mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
Fix for bug 3288.
This commit is contained in:
parent
6ea5ebd43e
commit
356d829527
@ -119,6 +119,16 @@ class quiz_random_qtype extends quiz_default_questiontype {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We need to set responses[''] to whatever was saved in the most recent
|
||||
// state of the wrapped question.
|
||||
if(!$wrappedstates = get_records_select('quiz_states',
|
||||
"question = $wrappedquestion->id AND attempt = $state->attempt",
|
||||
'seq_number DESC')) {
|
||||
return false;
|
||||
}
|
||||
$wrappedstates = array_values($wrappedstates);
|
||||
$state->responses = array('' => $wrappedstates[0]->answer);
|
||||
|
||||
if (!$QUIZ_QTYPES[$wrappedquestion->qtype]
|
||||
->restore_session_and_responses($wrappedquestion, $state)) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user