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

Public Member Functions

 requires_qtypes ()
 is_usable_by_random ()
 get_question_options ($question)
 save_question_options ($question)
 delete_question ($questionid, $contextid)
 create_session_and_responses (&$question, &$state, $cmoptions, $attempt)
 restore_session_and_responses (&$question, &$state)
 get_sa_candidates ($categorylist, $questionsinuse=0)
 get_random_guess_score ($question)

Data Fields

const MAX_SUBQUESTIONS = 10

Detailed Description

The randomsamatch question type class.

TODO: Make sure short answer questions chosen by a randomsamatch question can not also be used by a random question

Definition at line 39 of file questiontype.php.


Member Function Documentation

create_session_and_responses ( &$  question,
&$  state,
cmoptions,
attempt 
)

Definition at line 92 of file questiontype.php.

Here is the call graph for this function:

delete_question ( questionid,
contextid 
)

Deletes the question-type specific data when a question is deleted.

Parameters:
int$questionthe question being deleted.
int$contextidthe context this quesiotn belongs to.

Reimplemented from question_type.

Definition at line 85 of file questiontype.php.

get_question_options ( question)

Loads the question type specific options for the question.

This function loads any question type specific options for the question from the database into the question object. This information is placed in the $question->options field. A question type is free, however, to decide on a internal structure of the options field.

Returns:
bool Indicates success or failure.
Parameters:
object$questionThe question object for the question. This object should be updated to include the question type specific information (it is passed by reference).

Reimplemented from question_type.

Definition at line 50 of file questiontype.php.

Here is the caller graph for this function:

get_random_guess_score ( question)
Parameters:
object$question
Returns:
mixed either a integer score out of 1 that the average random guess by a student might give or an empty string which means will not calculate.

Reimplemented from question_type.

Definition at line 251 of file questiontype.php.

get_sa_candidates ( categorylist,
questionsinuse = 0 
)

Definition at line 231 of file questiontype.php.

Here is the caller graph for this function:

Returns:
bool true if this question type can be used by the random question type.

Reimplemented from question_type.

Definition at line 46 of file questiontype.php.

Definition at line 42 of file questiontype.php.

restore_session_and_responses ( &$  question,
&$  state 
)

Definition at line 170 of file questiontype.php.

Here is the call graph for this function:

save_question_options ( question)

Saves question-type specific options

This is called by save_question() to save the question-type specific data

Returns:
object $result->error or $result->noticeyesno or $result->notice
Parameters:
object$questionThis holds the information from the editing form, it is not a standard question object.

Reimplemented from question_type.

Definition at line 63 of file questiontype.php.


Field Documentation

const MAX_SUBQUESTIONS = 10

Definition at line 40 of file questiontype.php.


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