Skip to content
Permalink
Browse files

get_actual_response() method for cloze question type contributed by J…

  • Loading branch information...
gustav_delius
gustav_delius committed Feb 11, 2006
1 parent eaa5a1c commit 6f51aa2e5bd78998260077772305b78e2362093d
Showing with 15 additions and 0 deletions.
  1. +15 −0 mod/quiz/questiontypes/multianswer/questiontype.php
@@ -357,6 +357,21 @@ function grade_responses(&$question, &$state, $cmoptions) {
return true;
}
function get_actual_response($question, $state) {
global $QUIZ_QTYPES;
$teststate = clone($state);
foreach($question->options->questions as $key => $wrapped) {
$state->responses[$key] = html_entity_decode($state->responses[$key]);
$teststate->responses = array('' => $state->responses[$key]);
$correct = $QUIZ_QTYPES[$wrapped->qtype]
->get_actual_response($wrapped, $teststate);
// change separator here if you want
$responsesseparator = ',';
$responses[$key] = implode($responsesseparator, $correct);
}
return $responses;
}
}
//// END OF CLASS ////

0 comments on commit 6f51aa2

Please sign in to comment.
You can’t perform that action at this time.