From: nicolasconnault Date: Wed, 8 Aug 2007 15:48:20 +0000 (+0000) Subject: MDL-9628 When a timestamp is selected for locktime or hiddenuntil, the grader report... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d4795a07926a124b6b8838a1dba15c9b6da70f9e;p=moodle.git MDL-9628 When a timestamp is selected for locktime or hiddenuntil, the grader report now shows a new icon (lock or eye in front of a calendar), with a tooltip showing the selected date. Very useful :-) --- diff --git a/grade/lib.php b/grade/lib.php index 9ecbbddbb1..b03b962744 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -429,7 +429,7 @@ function grade_build_nav($path, $pagename=null, $id=null) { $navigation = build_navigation($navlinks); return $navigation; - } +} /** * This class represents a complete tree of categories, grade_items and final grades, @@ -547,7 +547,7 @@ class grade_tree { and $element['children'][$sortorder]['object']->is_outcome_item()) { unset($element['children'][$sortorder]); - } else if ($element['children'][$sortorder]['type'] == 'category') { + } else if ($element['children'][$sortorder]['type'] == 'category') { grade_tree::no_outcomes($element['children'][$sortorder]); } } @@ -822,12 +822,23 @@ class grade_tree { } if ($element['object']->is_hidden()) { - $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=show&sesskey='.sesskey().'&eid='.$element['eid']; + $icon = 'show'; + $tooltip = ''; + + if ($element['object']->hidden > 1) { // Change the icon and add a tooltip showing the date + $icon = 'hiddenuntil'; + $tooltip = userdate($element['object']->hidden); + } + + $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=show&sesskey='.sesskey() + . '&eid='.$element['eid']; $url = $gpr->add_url_params($url); - $action = ''.$strshow.''; + $action = ''
+                     . $strshow.''; } else { - $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=hide&sesskey='.sesskey().'&eid='.$element['eid']; + $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=hide&sesskey='.sesskey() + . '&eid='.$element['eid']; $url = $gpr->add_url_params($url); $action = ''.$strhide.''; } @@ -850,20 +861,33 @@ class grade_tree { } if ($element['object']->is_locked()) { + $icon = 'unlock'; + $tooltip = ''; + + if ($element['object']->locktime > 1) { // Change the icon and add a tooltip showing the date + $icon = 'locktime'; + $tooltip = userdate($element['object']->locktime); + } + if (!has_capability('moodle/grade:manage', $this->context) and !has_capability('moodle/grade:unlock', $this->context)) { return ''; } - $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=unlock&sesskey='.sesskey().'&eid='.$element['eid']; + $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=unlock&sesskey='.sesskey() + . '&eid='.$element['eid']; $url = $gpr->add_url_params($url); - $action = ''.$strunlock.''; + $action = ''.$strunlock
+                     . ''; } else { if (!has_capability('moodle/grade:manage', $this->context) and !has_capability('moodle/grade:lock', $this->context)) { return ''; } - $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=lock&sesskey='.sesskey().'&eid='.$element['eid']; + $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=lock&sesskey='.sesskey() + . '&eid='.$element['eid']; $url = $gpr->add_url_params($url); - $action = ''.$strlock.''; + $action = ''.$strlock.''; } return $action; } diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index 710d0f53cf..8b17e22f95 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -352,7 +352,7 @@ class grade_report_grader extends grade_report { 'calculations' => 't/calc.gif', 'locks' => 't/lock.gif', 'averages' => 't/sigma.gif', - 'nooutcomes' => 'i/outcomes.gif'); + 'nooutcomes' => 't/outcomes.gif'); $pref_name = 'grade_report_show' . $type; @@ -634,9 +634,9 @@ class grade_report_grader extends grade_report { if ($this->get_pref('quickgrading') and $grade->is_editable()) { $oldval = empty($gradeval) ? -1 : $gradeval; if (empty($item->outcomeid)) { - $nogradestr = $this->get_lang_string('nograde'); + $nogradestr = $this->get_lang_string('nograde'); } else { - $nogradestr = $this->get_lang_string('nooutcome', 'grades'); + $nogradestr = $this->get_lang_string('nooutcome', 'grades'); } $studentshtml .= ''; diff --git a/pix/t/hiddenuntil.gif b/pix/t/hiddenuntil.gif new file mode 100644 index 0000000000..ae8612976e Binary files /dev/null and b/pix/t/hiddenuntil.gif differ diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 858e846555..35300dcee3 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -2150,6 +2150,11 @@ body#doc-contents ul { .grade-report-grader .quickfeedback { border: #000000 1px dashed; } + +.popupfeedback { + background-color: #FFFFFF; + border: #000000 1px dashed; +} /* scales edit */ .grade-edit-scale .buttons {