Merged from stable

This commit is contained in:
gustav_delius 2005-06-05 20:51:15 +00:00
parent cb998489a2
commit fc44ee0de8
17 changed files with 307 additions and 414 deletions

View file

@ -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