From 1815b45c1b4ad74868d6e38ccfd32d24e91e6e7e Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Wed, 1 Aug 2007 14:52:14 +0000 Subject: [PATCH] MDL-10676 Added linking activity icons to grader report headers, based on user preference /config setting. --- grade/report/grader/preferences_form.php | 52 ++++++++++++------------ grade/report/grader/settings.php | 3 ++ grade/report/grader/version.php | 4 +- grade/report/lib.php | 6 +++ lang/en_utf8/grades.php | 2 + version.php | 2 +- 6 files changed, 40 insertions(+), 29 deletions(-) diff --git a/grade/report/grader/preferences_form.php b/grade/report/grader/preferences_form.php index 3f449ee631c..5e7fc53912a 100644 --- a/grade/report/grader/preferences_form.php +++ b/grade/report/grader/preferences_form.php @@ -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); + '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,); + $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', diff --git a/grade/report/grader/settings.php b/grade/report/grader/settings.php index 118199ef28c..659c7f76ce9 100644 --- a/grade/report/grader/settings.php +++ b/grade/report/grader/settings.php @@ -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, diff --git a/grade/report/grader/version.php b/grade/report/grader/version.php index 55d7451372e..f31dd22dbac 100644 --- a/grade/report/grader/version.php +++ b/grade/report/grader/version.php @@ -1,6 +1,6 @@ version = 2007072500; -$plugin->requires = 2007072402; +$plugin->version = 2007080103; +$plugin->requires = 2007080103; ?> diff --git a/grade/report/lib.php b/grade/report/lib.php index c457af4dfce..bcfcdf81a6a 100755 --- a/grade/report/lib.php +++ b/grade/report/lib.php @@ -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 = '' . $modulename . '' . $modulename; + } + $coursemodule = get_coursemodule_from_instance($itemmodule, $iteminstance, $COURSE->id); $dir = $CFG->dirroot . "/mod/$itemmodule/"; diff --git a/lang/en_utf8/grades.php b/lang/en_utf8/grades.php index c7940cae392..cd053cbc3b4 100644 --- a/lang/en_utf8/grades.php +++ b/lang/en_utf8/grades.php @@ -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'; diff --git a/version.php b/version.php index 66bb6f77adf..43ee93180ff 100644 --- a/version.php +++ b/version.php @@ -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