$action->responses = $closestates[$key]->responses;
$action->timestamp = $closestates[$key]->timestamp;
question_process_responses($question, $closestates[$key], $action, $quiz, $attempt);
- save_question_session($question, $closestates[$key]);
+ save_question_session($question, $closestates[$key]);
}
}
add_to_log($course->id, 'quiz', 'close attempt',
function create_session_and_responses(&$question, &$state, $cmoptions, $attempt) {
if (!$state->options->subquestions = get_records('question_match_sub',
- 'question', $question->id)) {
- notify('Error: Missing subquestions!');
- return false;
+ 'question', $question->id)) {
+ notify('Error: Missing subquestions!');
+ return false;
}
foreach ($state->options->subquestions as $key => $subquestion) {
$answer->answer = $subquestion->answertext;
$answer->fraction = 1.0;
$state->options->subquestions[$key]->options
- ->answers[$subquestion->code] = clone($answer);
+ ->answers[$subquestion->code] = clone($answer);
$state->responses[$key] = '';
}