MDL-10284 - wrong language string used on the quiz view page to inform students of the quiz deadline. I took the opportunity to strip out an unnecessary HTML table, and reviewing uses of the string /quiz(open|close)s?/ found one other inconsistency on the quiz editing form. Merged from MOODLE_18_STABLE.

This commit is contained in:
tjhunt 2007-10-31 17:08:47 +00:00
parent 8de9f89a56
commit 8289cdf33a
3 changed files with 10 additions and 29 deletions

View File

@ -571,30 +571,6 @@ function quiz_get_grading_option_name($option) {
/// Other quiz functions ////////////////////////////////////////////////////
/**
* Print a box with quiz start and due dates
*
* @param object $quiz
*/
function quiz_view_dates($quiz) {
if (!$quiz->timeopen && !$quiz->timeclose) {
return;
}
print_simple_box_start('center', '', '', '', 'generalbox', 'dates');
echo '<table>';
if ($quiz->timeopen) {
echo '<tr><td class="c0">'.get_string("quizopen", "quiz").':</td>';
echo ' <td class="c1">'.userdate($quiz->timeopen).'</td></tr>';
}
if ($quiz->timeclose) {
echo '<tr><td class="c0">'.get_string("quizclose", "quiz").':</td>';
echo ' <td class="c1">'.userdate($quiz->timeclose).'</td></tr>';
}
echo '</table>';
print_simple_box_end();
}
/**
* Parse field names used for the replace options on question edit forms
*/

View File

@ -24,11 +24,11 @@ class mod_quiz_mod_form extends moodleform_mod {
//-------------------------------------------------------------------------------
$mform->addElement('header', 'timinghdr', get_string('timing', 'form'));
$mform->addElement('date_time_selector', 'timeopen', get_string("quizopen", "quiz"), array('optional'=>true));
$mform->setHelpButton('timeopen', array('timeopen', get_string('quizopens', 'quiz'), 'quiz'));
$mform->addElement('date_time_selector', 'timeopen', get_string('quizopen', 'quiz'), array('optional'=>true));
$mform->setHelpButton('timeopen', array('timeopen', get_string('quizopen', 'quiz'), 'quiz'));
$mform->addElement('date_time_selector', 'timeclose', get_string("quizcloses", "quiz"), array('optional'=>true));
$mform->setHelpButton('timeclose', array('timeopen', get_string('quizcloses', 'quiz'), 'quiz'));
$mform->addElement('date_time_selector', 'timeclose', get_string('quizclose', 'quiz'), array('optional'=>true));
$mform->setHelpButton('timeclose', array('timeopen', get_string('quizclose', 'quiz'), 'quiz'));
$timelimitgrp=array();

View File

@ -112,7 +112,12 @@
if ($quiz->timelimit) {
echo "<p>".get_string("quiztimelimit","quiz", format_time($quiz->timelimit * 60))."</p>";
}
quiz_view_dates($quiz);
if ($quiz->timeopen) {
echo '<p>', get_string('quizopens', 'quiz'), ': ', userdate($quiz->timeopen), '</p>';
}
if ($quiz->timeclose) {
echo '<p>', get_string('quizcloses', 'quiz'), ': ', userdate($quiz->timeclose), '</p>';
}
} else if ($timenow < $quiz->timeopen) {
echo "<p>".get_string("quiznotavailable", "quiz", userdate($quiz->timeopen))."</p>";
} else {