]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-9628 When a timestamp is selected for locktime or hiddenuntil, the grader report...
authornicolasconnault <nicolasconnault>
Wed, 8 Aug 2007 15:48:20 +0000 (15:48 +0000)
committernicolasconnault <nicolasconnault>
Wed, 8 Aug 2007 15:48:20 +0000 (15:48 +0000)
grade/lib.php
grade/report/grader/lib.php
pix/t/hiddenuntil.gif [new file with mode: 0644]
theme/standard/styles_layout.css

index 9ecbbddbb11ddf39b3aebf72098d028ff36eab70..b03b9627447c84f8db2333920f273d24bf7d3261 100644 (file)
@@ -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.'&amp;action=show&amp;sesskey='.sesskey().'&amp;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.'&amp;action=show&amp;sesskey='.sesskey()
+                     . '&amp;eid='.$element['eid'];
             $url     = $gpr->add_url_params($url);
-            $action  = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/show.gif" class="iconsmall" alt="'.$strshow.'" title="'.$strshow.'"/></a>';
+            $action  = '<a href="'.$url.'"><img title="' . $tooltip . '" src="'.$CFG->pixpath.'/t/' . $icon . '.gif" class="iconsmall" alt="'
+                     . $strshow.'" title="'.$strshow.'"/></a>';
 
         } else {
-            $url     = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&amp;action=hide&amp;sesskey='.sesskey().'&amp;eid='.$element['eid'];
+            $url     = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&amp;action=hide&amp;sesskey='.sesskey()
+                     . '&amp;eid='.$element['eid'];
             $url     = $gpr->add_url_params($url);
             $action  = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/hide.gif" class="iconsmall" alt="'.$strhide.'" title="'.$strhide.'"/></a>';
         }
@@ -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.'&amp;action=unlock&amp;sesskey='.sesskey().'&amp;eid='.$element['eid'];
+            $url     = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&amp;action=unlock&amp;sesskey='.sesskey()
+                     . '&amp;eid='.$element['eid'];
             $url     = $gpr->add_url_params($url);
-            $action  = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/unlock.gif" class="iconsmall" alt="'.$strunlock.'" title="'.$strunlock.'"/></a>';
+            $action  = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/' . $icon . '.gif" title="' . $tooltip
+                     . '" class="iconsmall" alt="'.$strunlock
+                     . '" title="'.$strunlock.'"/></a>';
 
         } 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.'&amp;action=lock&amp;sesskey='.sesskey().'&amp;eid='.$element['eid'];
+            $url     = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&amp;action=lock&amp;sesskey='.sesskey()
+                     . '&amp;eid='.$element['eid'];
             $url     = $gpr->add_url_params($url);
-            $action  = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/lock.gif" class="iconsmall" alt="'.$strlock.'" title="'.$strlock.'"/></a>';
+            $action  = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/lock.gif" class="iconsmall" alt="'.$strlock.'" title="'
+                     . $strlock.'"/></a>';
         }
         return $action;
     }
index 710d0f53cfc7799bdcbbc07c2aaa5f458f643292..8b17e22f958ab736ab39f0360c836e32e0c4d004 100644 (file)
@@ -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 .= '<input type="hidden" name="oldgrade_'.$userid.'_'
                                           .$item->id.'" value="'.$oldval.'"/>';
diff --git a/pix/t/hiddenuntil.gif b/pix/t/hiddenuntil.gif
new file mode 100644 (file)
index 0000000..ae86129
Binary files /dev/null and b/pix/t/hiddenuntil.gif differ
index 858e846555efb70ea266b437f70ba5c6166486b8..35300dcee38c7789cb13a036cb75f092653333cb 100644 (file)
@@ -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 {