mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merged from stable
This commit is contained in:
parent
cb998489a2
commit
fc44ee0de8
17 changed files with 307 additions and 414 deletions
|
@ -216,13 +216,13 @@
|
|||
// list of questions needed by page
|
||||
$pagelist = quiz_questions_on_page($attempt->layout, $page);
|
||||
|
||||
// add all questions that are on the submitted form
|
||||
if ($newattempt) {
|
||||
$questionlist = $attempt->layout;
|
||||
$questionlist = quiz_questions_in_quiz($attempt->layout);
|
||||
} else {
|
||||
$questionlist = $pagelist;
|
||||
}
|
||||
|
||||
// add all questions that are on the submitted form
|
||||
if ($questionids) {
|
||||
$questionlist .= ','.$questionids;
|
||||
}
|
||||
|
@ -253,6 +253,13 @@
|
|||
error('Could not restore question sessions');
|
||||
}
|
||||
|
||||
// Save all the newly created states
|
||||
if ($newattempt) {
|
||||
foreach ($questions as $i => $question) {
|
||||
quiz_save_question_session($questions[$i], $states[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Process form data /////////////////////////////////////////////////
|
||||
|
||||
|
@ -370,13 +377,16 @@
|
|||
|
||||
/// Print the attempt number or preview heading
|
||||
if ($isteacher) {
|
||||
print_heading(get_string('previewquiz', 'quiz'));
|
||||
print_heading(get_string('previewquiz', 'quiz', format_string($quiz->name)));
|
||||
unset($buttonoptions);
|
||||
$buttonoptions['q'] = $quiz->id;
|
||||
$buttonoptions['forcenew'] = true;
|
||||
echo '<center>';
|
||||
print_single_button($CFG->wwwroot.'/mod/quiz/attempt.php', $buttonoptions, get_string('startagain', 'quiz'));
|
||||
echo '</center>';
|
||||
if ($quiz->popup) {
|
||||
notify(get_string('popupnotice', 'quiz'));
|
||||
}
|
||||
} else {
|
||||
print_heading($strattemptnum);
|
||||
}
|
||||
|
@ -434,14 +444,6 @@
|
|||
quiz_save_question_session($questions[$i], $states[$i]);
|
||||
$number += $questions[$i]->length;
|
||||
}
|
||||
if ($newattempt) {
|
||||
$questionlist = explode(',', $attempt->layout);
|
||||
foreach ($questionlist as $i) {
|
||||
if ($i != 0) {
|
||||
quiz_save_question_session($questions[$i], $states[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Print the submit buttons
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue