Jump to content

הרחבה:חידון

From mediawiki.org
This page is a translated version of the page Extension:Quiz and the translation is 72% complete.
מדריך להרחבות מדיה-ויקי
Quiz
סטטוס שחרור: גרסה יציבה
יישום Tag , Hook
Description מספק כלי חידון
Author(s) Lrbabeשיחה
Latest version 1.2.0 (2015-12-08)
MediaWiki 1.25+
License GNU General Public License 2.0 or later
Download
Example and format documentation: v:Help:Quiz
Translate the Quiz extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

התוסף Quiz הוא כלי בניית החידונים שאומץ בויקיברסיטה. הרחבה זו שואפת להיות:

  • פשוטה בתחביר ובשימוש בה; עוצמתית באפשרויותיה.
  • פתוחה להצעות ושיפורים (על ידי הקלת הוספת סוגי שאלות חדשים).

שימוש

דפי עזרה אחרים מתארחים בויקיברסיטה על מנת לאפשר דוגמאות מעשיות.

התקנה

  • Download and move the extracted Quiz folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Quiz
    
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'Quiz' );
    
  • Yes בוצע – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

פיתוח

הוספת סוג שאלה חדשה

החידון נוצר כדי להקל על הוספת סוגי שאלות חדשים. אם הסוגים הבסיסיים (שאלות רב-ברירה עם תשובה אחת/מרובה) אינם מספיקים לכם, יש לכם אפשרות ליצור ולשלב בקלות את סוג השאלות שאתם צריכים. לשם כך עליך להיות בעל ידע מסוים ב-PHP.

  1. הדבר הראשון שעליכם לעשות הוא לבחור תחביר (הפשוט ביותר האפשרי) עבור סוג השאלה שלכם. ההגבלות הן:
    • התחביר של כותרת השאלה קבוע. יש למקם את השאלה בין סוגריים מסולסלים - כלומר { ו- } .
    • לשם עקביות, מומלץ להשתמש ב-|| כדי לסמן את תחילת קטע המשוב ("תיקון").
  2. Choose a new code name for your question type (example: "questionTypeName") as well as a symbol (currently the symbol () is used for single response multiple choice because it looks like a radio button, and the symbol [] is used for multiple response multiple choice because it looks like a checkbox).
  3. Add a "case" at the beginning of the parseParameters's "switch", as follows:
    case 'symbol':
    	$this->mType = "questionTypeName";
    	break;
    
  4. Add a parser function to Quiz.php
    This function must convert a question object from quiz syntax to HTML and set a state to the question (right, wrong, error, NA or unmarked), according to syntax errors and eventually posted answers. Name the function "questionTypeNameParseObject" and implement as follows :
    /**
     * Convert a basic type object from quiz syntax to HTML.
     * 
     * @param  $input				A question object in quiz syntax
     * 
     * @return $output				A question object in HTML.
     */
    function questionTypeNameParseObject($input) {
    	// your code here.
    	$this->setState(""); // Set the state if needed.
    	return $output;
    }
    
  5. רשמו את מפרטי התחביר שלכם אשר יתווספו לעזרה. אנא קראו תחילה את העזרה הקיימת.
  6. לאחר שכל זה ייעשה, צרו איתי קשר כדי לכלול באופן רשמי את סוג השאלה שלכם בתוך ההרחבה.

ראו גם