MDL-10676 Added linking activity icons to grader report headers, based on user preference /config setting.

This commit is contained in:
nicolasconnault 2007-08-01 14:52:14 +00:00
parent c738c61c44
commit 1815b45c1b
6 changed files with 40 additions and 29 deletions

View 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);
'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',

View 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,

View File

@ -1,6 +1,6 @@
<?PHP // $Id$
$plugin->version = 2007072500;
$plugin->requires = 2007072402;
$plugin->version = 2007080103;
$plugin->requires = 2007080103;
?>

View File

@ -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/";

View 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';

View 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