MDL-14204 "Content for Quiz Statistics report table - Random_guess_score" added method random_guess_score to question type objects and a new function in questionlib that calls the question type method.

This commit is contained in:
jamiesensei 2008-06-16 13:29:00 +00:00
parent ed48af75b4
commit 6f51ed72be
12 changed files with 201 additions and 96 deletions

View file

@ -425,6 +425,16 @@ class question_match_qtype extends default_questiontype {
// This should almost certainly be overridden
return substr(implode(', ', $this->get_actual_response($question, $state)), 0, $length);
}
/**
* @param object $question
* @return integer a score out of 1 that the average random guess by a
* student might give.
*/
function get_random_guess_score($question) {
return 1 / count($question->options->subquestions);
}
/// BACKUP FUNCTIONS ////////////////////////////