// the data about student interaction with the questions. The functions to do
// that are included with the following library
require_once("$CFG->dirroot/question/backuplib.php");
-
+
/*
* Insert necessary category ids to backup_ids table. Called during backup_check.html.
* This backs up ids for quiz module. It backs up :
function quiz_insert_category_and_question_ids($course, $backup_unique_code, $instances = null) {
global $CFG;
$status = true;
-
+
// Create missing categories and reasign orphaned questions.
quiz_fix_orphaned_questions($course);
$coursecontext = get_context_instance(CONTEXT_COURSE, $course);
$status = $status && question_insert_c_and_q_ids_for_course($coursecontext, $backup_unique_code);
-
+
// then, all categories and questions from this course's modules' contexts.
$status = $status && question_insert_c_and_q_ids_for_module($backup_unique_code, $course, 'quiz', $instances);
}
return $status;
}
-
+
/**
* Helper function adding the id of all the subcategories of a category to an array.
*/
require_login($course, true, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
-
+
require_capability('mod/quiz:grade', $context);
// Load question
}
$question->maxgrade = get_field('quiz_question_instances', 'grade', 'quiz', $quiz->id, 'question', $question->id);
// Some of the questions code is optimised to work with several questions
- // at once so it wants the question to be in an array.
+ // at once so it wants the question to be in an array.
$key = $question->id;
$questions[$key] = &$question;
// Add additional questiontype specific information to the question objects.
print_header();
print_heading(format_string($question->name));
-
+
//add_to_log($course->id, 'quiz', 'review', "review.php?id=$cm->id&attempt=$attempt->id", "$quiz->id", "$cm->id");
if ($data = data_submitted() and confirm_sesskey()) {
notify(get_string('changessaved'));
echo '<div class="boxaligncenter"><input type="button" onclick="window.opener.location.reload(1); self.close();return false;" value="' .
- get_string('closewindow') . "\" /></div>";
-
+ get_string('closewindow') . "\" /></div>";
+
print_footer();
exit;
}
<td>
<input name="timelimitenable" type="checkbox" value="1" alt="<?php print_string('timelimit', 'quiz') ?>" onclick="return lockoptions('form', 'timelimitenable', timelimititems)" <?php if ($form->timelimit) echo 'checked="checked"' ?> />
<input type="text" name="timelimit" size="3" value="<?php p($form->timelimit ? $form->timelimit : '') ?>" />
- <?php
+ <?php
print_string('minutes');
helpbutton("timelimit", get_string("quiztimer","quiz"), "quiz");
?>
</td>
<td align="center">
<input type="hidden" name="fix_delay2" value="0" />
- <input type="checkbox" name="fix_delay2" value="1" <?php echo $CFG->quiz_fix_delay2 ? 'checked="checked"' : ''; ?> />
+ <input type="checkbox" name="fix_delay2" value="1" <?php echo $CFG->quiz_fix_delay2 ? 'checked="checked"' : ''; ?> />
</td>
</tr>
</form>
<script type="text/javascript">
-<?php
+<?php
if (!$form->timelimit) echo "lockoptions('form','timelimitenable', timelimititems);";
?>
</script>
'admin' => CAP_ALLOW
)
),
-
+
'mod/quiz:ignoretimelimits' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
print_string('reordertool', 'quiz');
echo ' ';
helpbutton('reorderingtool', get_string('reordertool', 'quiz'), 'quiz');
-
+
echo '<div class="quizquestionlistcontrols"><input type="submit" name="repaginate" value="'. get_string('go') .'" /></div>';
echo '</fieldset>';
echo '</form>';
$this->activityname = 'quiz';
parent::init_quick($data);
}
-
+
function get_type() {
return PAGE_QUIZ_VIEW;
}
$question->maxgrade = get_field('quiz_question_instances', 'grade', 'quiz', $quiz->id, 'question', $question->id);
// Some of the questions code is optimised to work with several questions
- // at once so it wants the question to be in an array.
+ // at once so it wants the question to be in an array.
$key = $question->id;
$questions[$key] = &$question;
// Add additional questiontype specific information to the question objects.