Moodle  2.2.1
http://www.collinsharper.com
qformat_gift Class Reference
Inheritance diagram for qformat_gift:
Collaboration diagram for qformat_gift:

Public Member Functions

 provide_import ()
 provide_export ()
 export_file_extension ()
 readquestion ($lines)
 write_name ($name)
 write_questiontext ($text, $format, $defaultformat=FORMAT_MOODLE)
 writequestion ($question)

Protected Member Functions

 answerweightparser (&$answer)
 commentparser ($answer, $defaultformat)
 split_truefalse_comment ($answer, $defaultformat)
 escapedchar_pre ($string)
 escapedchar_post ($string)
 check_answer_count ($min, $answers, $text)
 parse_text_with_format ($text, $defaultformat=FORMAT_MOODLE)
 add_blank_combined_feedback ($question)
 repchar ($text, $notused=0)
 format_const_to_name ($format)
 format_name_to_const ($format)

Detailed Description

The GIFT import filter was designed as an easy to use method for teachers writing questions as a text file. It supports most question types and the missing word format.

Multiple Choice / Missing Word Who's buried in Grant's tomb?{~Grant ~Jefferson =no one} Grant is {~buried =entombed ~living} in Grant's tomb. True-False: Grant is buried in Grant's tomb.{FALSE} Short-Answer. Who's buried in Grant's tomb?{=no one =nobody} Numerical When was Ulysses S. Grant born?{#1822:5} Matching Match the following countries with their corresponding capitals.{=Canada->Ottawa =Italy->Rome =Japan->Tokyo}

Comment lines start with a double backslash (//). Optional question names are enclosed in double colon(::). Answer feedback is indicated with hash mark (#). Percentage answer weights immediately follow the tilde (for multiple choice) or equal sign (for short answer and numerical), and are enclosed in percent signs (% %). See docs and examples.txt for more.

This filter was written through the collaboration of numerous members of the Moodle community. It was originally based on the missingword format, which included code from Thomas Robb and others. Paul Tsuchido Shew wrote this filter in December 2003.

Definition at line 63 of file format.php.


Member Function Documentation

add_blank_combined_feedback ( question) [protected]

Definition at line 540 of file format.php.

Here is the caller graph for this function:

answerweightparser ( &$  answer) [protected]

Definition at line 77 of file format.php.

Here is the caller graph for this function:

check_answer_count ( min,
answers,
text 
) [protected]

Definition at line 133 of file format.php.

Here is the call graph for this function:

Here is the caller graph for this function:

commentparser ( answer,
defaultformat 
) [protected]

Definition at line 86 of file format.php.

Here is the call graph for this function:

Here is the caller graph for this function:

escapedchar_post ( string) [protected]

Definition at line 125 of file format.php.

Here is the caller graph for this function:

escapedchar_pre ( string) [protected]

Definition at line 113 of file format.php.

Here is the caller graph for this function:

Returns:
string the file extension (including .) that is normally used for files handled by this plugin.

Reimplemented from qformat_default.

Definition at line 73 of file format.php.

format_const_to_name ( format) [protected]
Parameters:
int$formatone of the FORMAT_ constants.
Returns:
string the corresponding name.

Definition at line 567 of file format.php.

Here is the caller graph for this function:

format_name_to_const ( format) [protected]
Parameters:
int$formatone of the FORMAT_ constants.
Returns:
string the corresponding name.

Definition at line 585 of file format.php.

Here is the caller graph for this function:

parse_text_with_format ( text,
defaultformat = FORMAT_MOODLE 
) [protected]

Definition at line 143 of file format.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
bool whether this plugin provides export functionality.

Reimplemented from qformat_default.

Definition at line 69 of file format.php.

Reimplemented from qformat_default.

Definition at line 65 of file format.php.

readquestion ( lines)

Reimplemented from qformat_default.

Definition at line 162 of file format.php.

Here is the call graph for this function:

repchar ( text,
notused = 0 
) [protected]

Definition at line 553 of file format.php.

Here is the caller graph for this function:

split_truefalse_comment ( answer,
defaultformat 
) [protected]

Definition at line 97 of file format.php.

Here is the call graph for this function:

Here is the caller graph for this function:

write_name ( name)

Definition at line 599 of file format.php.

Here is the call graph for this function:

Here is the caller graph for this function:

write_questiontext ( text,
format,
defaultformat = FORMAT_MOODLE 
)

Definition at line 603 of file format.php.

Here is the call graph for this function:

Here is the caller graph for this function:

writequestion ( question)

convert a single question object into text output in the given format. This must be overriden

Parameters:
objectquestion question object
Returns:
mixed question export text or null if not implemented

Reimplemented from qformat_default.

Definition at line 612 of file format.php.

Here is the call graph for this function:


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations