]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10676 Added linking activity icons to grader report headers, based on user prefer...
authornicolasconnault <nicolasconnault>
Wed, 1 Aug 2007 14:52:14 +0000 (14:52 +0000)
committernicolasconnault <nicolasconnault>
Wed, 1 Aug 2007 14:52:14 +0000 (14:52 +0000)
grade/report/grader/preferences_form.php
grade/report/grader/settings.php
grade/report/grader/version.php
grade/report/lib.php
lang/en_utf8/grades.php
version.php

index 3f449ee631c190166c7681a556c9d319e759769e..5e7fc53912a60ed28a8d2f2b9f9219f0e083cbc1 100644 (file)
@@ -5,7 +5,6 @@ require_once($CFG->libdir.'/formslib.php');
 /**
  * First implementation of the preferences in the form of a moodleform.
  * TODO add "reset to site defaults" button
- * TODO show site defaults near each setting
  */
 class grader_report_preferences_form extends moodleform {
 
@@ -37,32 +36,33 @@ class grader_report_preferences_form extends moodleform {
 //--------------------------------------------------------------------------------
         $preferences = array();
         $preferences['prefgeneral'] = array(
-                      'studentsperpage'        => 'text',
-                      'quickgrading'           => $checkbox_default,
-                      'quickfeedback'          => $checkbox_default,
-                      'decimalpoints'          => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default', 0, 1, 2, 3, 4, 5),
-                      'aggregationposition'    => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default',
-                                                        GRADE_REPORT_AGGREGATION_POSITION_LEFT => get_string('left', 'grades'),
-                                                        GRADE_REPORT_AGGREGATION_POSITION_RIGHT => get_string('right', 'grades')),
-                      'aggregationview'        => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default',
-                                                        GRADE_REPORT_AGGREGATION_VIEW_FULL => get_string('full', 'grades'),
-                                                        GRADE_REPORT_AGGREGATION_VIEW_COMPACT => get_string('compact', 'grades')),
-                      'gradedisplaytype'       => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default',
-                                                        GRADE_REPORT_GRADE_DISPLAY_TYPE_REAL => get_string('real', 'grades'),
-                                                        GRADE_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE => get_string('percentage', 'grades'),
-                                                        GRADE_REPORT_GRADE_DISPLAY_TYPE_LETTER => get_string('letter', 'grades')),
-                      'meanselection'          => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default',
-                                                        GRADE_AGGREGATE_MEAN_ALL => get_string('meanall', 'grades'),
-                                                        GRADE_AGGREGATE_MEAN_GRADED => get_string('meangraded', 'grades')),
-                      'enableajax'             => $checkbox_default);
-
-        $preferences['prefshow'] = array('showcalculations'       => $checkbox_default,
-                                         'showeyecons'            => $checkbox_default,
-                                         'showaverages'           => $checkbox_default,
-                                         'showgroups'             => $checkbox_default,
-                                         'showlocks'              => $checkbox_default,
-                                         'showranges'             => $checkbox_default,
-                                         'showuserimage'          => $checkbox_default,);
+                      'studentsperpage'     => 'text',
+                      'quickgrading'        => $checkbox_default,
+                      'quickfeedback'       => $checkbox_default,
+                      'decimalpoints'       => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default', 0, 1, 2, 3, 4, 5),
+                      'aggregationposition' => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default',
+                                                     GRADE_REPORT_AGGREGATION_POSITION_LEFT => get_string('left', 'grades'),
+                                                     GRADE_REPORT_AGGREGATION_POSITION_RIGHT => get_string('right', 'grades')),
+                      'aggregationview'     => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default',
+                                                     GRADE_REPORT_AGGREGATION_VIEW_FULL => get_string('full', 'grades'),
+                                                     GRADE_REPORT_AGGREGATION_VIEW_COMPACT => get_string('compact', 'grades')),
+                      'gradedisplaytype'    => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default',
+                                                     GRADE_REPORT_GRADE_DISPLAY_TYPE_REAL => get_string('real', 'grades'),
+                                                     GRADE_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE => get_string('percentage', 'grades'),
+                                                     GRADE_REPORT_GRADE_DISPLAY_TYPE_LETTER => get_string('letter', 'grades')),
+                      'meanselection'       => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default',
+                                                     GRADE_AGGREGATE_MEAN_ALL => get_string('meanall', 'grades'),
+                                                     GRADE_AGGREGATE_MEAN_GRADED => get_string('meangraded', 'grades')),
+                      'enableajax'          => $checkbox_default);
+
+        $preferences['prefshow'] = array('showcalculations'  => $checkbox_default,
+                                         'showeyecons'       => $checkbox_default,
+                                         'showaverages'      => $checkbox_default,
+                                         'showgroups'        => $checkbox_default,
+                                         'showlocks'         => $checkbox_default,
+                                         'showranges'        => $checkbox_default,
+                                         'showuserimage'     => $checkbox_default,
+                                         'showactivityicons' => $checkbox_default);
 
         $preferences['prefrows'] = array(
                     'averagesdisplaytype'    => array(GRADE_REPORT_PREFERENCE_DEFAULT => 'default',
index 118199ef28cae3e6ad670f70abe6062d5a8b6f80..659c7f76ce9bc2634b9df84eb73f1218317ed5b4 100644 (file)
@@ -73,6 +73,9 @@ $settings->add(new admin_setting_configcheckbox('grade_report_showranges', get_s
 $settings->add(new admin_setting_configcheckbox('grade_report_showuserimage', get_string('showuserimage', 'grades'),
                                             get_string('configshowuserimage', 'grades'), 1));
 
+$settings->add(new admin_setting_configcheckbox('grade_report_showactivityicons', get_string('showactivityicons', 'grades'),
+                                            get_string('configshowactivityicons', 'grades'), 1));
+
 $settings->add(new admin_setting_configselect('grade_report_averagesdisplaytype', get_string('averagesdisplaytype', 'grades'),
                                           get_string('configaveragesdisplaytype', 'grades'), false,
                                           array(GRADE_REPORT_PREFERENCE_INHERIT => $strinherit,
index 55d7451372e087ddba71095d31fdce8947ce89f5..f31dd22dbacdf2e93fc23ee32bd2f5596dc943d6 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-$plugin->version  = 2007072500;
-$plugin->requires = 2007072402;
+$plugin->version  = 2007080103;
+$plugin->requires = 2007080103;
 
 ?>
index c457af4dfce1417698a79de2ea3ca7faead1cf75..bcfcdf81a6a969f28ca0cdafcb388200766c4272 100755 (executable)
@@ -370,6 +370,12 @@ class grade_report {
 
         $link = null;
         if (!is_null($itemmodule) AND !is_null($iteminstance)) {
+            // Add module icon if toggle is enabled
+            if ($this->get_pref('showactivityicons')) {
+                $modulename = '<img src="' . $CFG->modpixpath . '/' . $itemmodule
+                            . '/icon.gif" class="icon activity" alt="' . $modulename . '" />' . $modulename;
+            }
+
             $coursemodule = get_coursemodule_from_instance($itemmodule, $iteminstance, $COURSE->id);
 
             $dir = $CFG->dirroot . "/mod/$itemmodule/";
index c7940cae392f645f59dcbd3d0233f2da69b818e7..cd053cbc3b4e28954548a5934684b5a294ba17b4 100644 (file)
@@ -69,6 +69,7 @@ $string['configrangesdecimalpoints'] = 'The number of decimal points to display
 $string['configrangesdisplaytype'] = 'Specifies how to display the range for each column in the grader report. The default and recommended value is Inherit, which first checks the display type of each column, and if such is not set explicitly, defaults to the more general Grade Display Type. If other display types are selected, they ignore the individual settings for each column, and use exclusively the selected type.';
 $string['configshowcalculations'] = 'Whether to show calculator icons near each grade item and category, tooltips over calculated items and a visual indicator that a column is calculated.';
 $string['configshoweyecons'] = 'Whether to show a show/hide icon near each grade (controlling its visibility to the user).';
+$string['configshowactivityicons'] = 'Show an activity icon next to each grade item linked to an activity, in the grader report.';
 $string['configshowaverages'] = 'Show column averages in the grader report.';
 $string['configshowgroups'] = 'Show group averages and means in the grader report.';
 $string['configshowlocks'] = 'Whether to show a lock/unlock icon near each grade.';
@@ -292,6 +293,7 @@ $string['setting'] = 'Setting';
 $string['settings'] = 'Settings';
 $string['setweights'] = 'Set Weights';
 $string['showallstudents'] = 'Show All Students';
+$string['showactivityicons'] = 'Show activity icons';
 $string['showaverages'] = 'Show column averages';
 $string['showcalculations'] = 'Show calculations';
 $string['showeyecons'] = 'Show show/hide icons';
index 66bb6f77adf7673976e12d051cc9be35839b849c..43ee93180ff9003c5afb997cd7cf559b48c1aa72 100644 (file)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-    $version = 2007080102;  // YYYYMMDD = date
+    $version = 2007080103;  // YYYYMMDD = date
                             //       XY = increments within a single day
 
     $release = '1.9 dev';   // Human-friendly version name