mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-32490 Offline assignment: do not display lateness information
This commit is contained in:
parent
ead4f180a0
commit
2159c1eaed
3 changed files with 16 additions and 4 deletions
|
@ -415,6 +415,12 @@ class assignment_base {
|
||||||
return $submitted;
|
return $submitted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Whether this assignment type supports lateness information - true by default
|
||||||
|
*/
|
||||||
|
function supports_lateness() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo Document this function
|
* @todo Document this function
|
||||||
|
@ -1445,8 +1451,8 @@ class assignment_base {
|
||||||
if ($auser->timemodified > 0) {
|
if ($auser->timemodified > 0) {
|
||||||
$studentmodifiedcontent = $this->print_student_answer($auser->id)
|
$studentmodifiedcontent = $this->print_student_answer($auser->id)
|
||||||
. userdate($auser->timemodified);
|
. userdate($auser->timemodified);
|
||||||
if ($assignment->timedue && $auser->timemodified > $assignment->timedue) {
|
if ($assignment->timedue && $auser->timemodified > $assignment->timedue && $this->supports_lateness()) {
|
||||||
$studentmodifiedcontent .= assignment_display_lateness($auser->timemodified, $assignment->timedue);
|
$studentmodifiedcontent .= $this->display_lateness($auser->timemodified);
|
||||||
$rowclass = 'late';
|
$rowclass = 'late';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -55,8 +55,10 @@ class mod_assignment_mod_form extends moodleform_mod {
|
||||||
|
|
||||||
$ynoptions = array( 0 => get_string('no'), 1 => get_string('yes'));
|
$ynoptions = array( 0 => get_string('no'), 1 => get_string('yes'));
|
||||||
|
|
||||||
$mform->addElement('select', 'preventlate', get_string('preventlate', 'assignment'), $ynoptions);
|
if ($assignmentinstance->supports_lateness()) {
|
||||||
$mform->setDefault('preventlate', 0);
|
$mform->addElement('select', 'preventlate', get_string('preventlate', 'assignment'), $ynoptions);
|
||||||
|
$mform->setDefault('preventlate', 0);
|
||||||
|
}
|
||||||
|
|
||||||
// hack to support pluggable assignment type titles
|
// hack to support pluggable assignment type titles
|
||||||
if (get_string_manager()->string_exists('type'.$type, 'assignment')) {
|
if (get_string_manager()->string_exists('type'.$type, 'assignment')) {
|
||||||
|
|
|
@ -11,6 +11,10 @@ class assignment_offline extends assignment_base {
|
||||||
$this->type = 'offline';
|
$this->type = 'offline';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function supports_lateness() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
function display_lateness($timesubmitted) {
|
function display_lateness($timesubmitted) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue