mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
MDL-15750 - After the close date, the teacher cannot preview a quiz becuase the timer thinks the time is already up. Also, move the timer in to the new navigation block.
This commit is contained in:
parent
5bbf20b48d
commit
5533791abc
5 changed files with 24 additions and 55 deletions
|
@ -498,6 +498,14 @@ class open_close_date_access_rule extends quiz_access_rule_base {
|
|||
return $this->_quiz->timeclose && $this->_timenow > $this->_quiz->timeclose;
|
||||
}
|
||||
public function time_left($attempt, $timenow) {
|
||||
// If this is a teacher preview after the close date, do not show
|
||||
// the time.
|
||||
if ($attempt->preview && $timenow > $this->_quiz->timeclose) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Otherwise, return to the time left until the close date, providing
|
||||
// that is less than QUIZ_SHOW_TIME_BEFORE_DEADLINE
|
||||
if ($this->_quiz->timeclose) {
|
||||
$timeleft = $this->_quiz->timeclose - $timenow;
|
||||
if ($timeleft < QUIZ_SHOW_TIME_BEFORE_DEADLINE) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue