From: tjhunt Date: Wed, 31 Oct 2007 17:08:47 +0000 (+0000) Subject: MDL-10284 - wrong language string used on the quiz view page to inform students of... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8289cdf33ad3f7bca865d185ce02db01dc664a54;p=moodle.git 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. --- diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php index 0ec0677999..a55b720b2c 100644 --- a/mod/quiz/locallib.php +++ b/mod/quiz/locallib.php @@ -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 ''; - if ($quiz->timeopen) { - echo ''; - echo ' '; - } - if ($quiz->timeclose) { - echo ''; - echo ' '; - } - echo '
'.get_string("quizopen", "quiz").':'.userdate($quiz->timeopen).'
'.get_string("quizclose", "quiz").':'.userdate($quiz->timeclose).'
'; - print_simple_box_end(); -} - /** * Parse field names used for the replace options on question edit forms */ diff --git a/mod/quiz/mod_form.php b/mod/quiz/mod_form.php index fdccacd218..4b5c0fc715 100644 --- a/mod/quiz/mod_form.php +++ b/mod/quiz/mod_form.php @@ -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(); diff --git a/mod/quiz/view.php b/mod/quiz/view.php index e77ad5552b..2f4e098436 100644 --- a/mod/quiz/view.php +++ b/mod/quiz/view.php @@ -112,7 +112,12 @@ if ($quiz->timelimit) { echo "

".get_string("quiztimelimit","quiz", format_time($quiz->timelimit * 60))."

"; } - quiz_view_dates($quiz); + if ($quiz->timeopen) { + echo '

', get_string('quizopens', 'quiz'), ': ', userdate($quiz->timeopen), '

'; + } + if ($quiz->timeclose) { + echo '

', get_string('quizcloses', 'quiz'), ': ', userdate($quiz->timeclose), '

'; + } } else if ($timenow < $quiz->timeopen) { echo "

".get_string("quiznotavailable", "quiz", userdate($quiz->timeopen))."

"; } else {