Skip to content

Commit

Permalink
MDL-10676 Added linking activity icons to grader report headers, base…
Browse files Browse the repository at this point in the history
…d on user preference /config setting.
  • Loading branch information
nicolasconnault committed Aug 1, 2007
1 parent c738c61 commit 1815b45
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 30 deletions.
54 changes: 27 additions & 27 deletions grade/report/grader/preferences_form.php
Expand Up @@ -5,7 +5,6 @@
/**
* 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 {

Expand Down Expand Up @@ -37,32 +36,33 @@ function definition() {
//--------------------------------------------------------------------------------
$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',
Expand Down
3 changes: 3 additions & 0 deletions grade/report/grader/settings.php
Expand Up @@ -73,6 +73,9 @@
$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,
Expand Down
4 changes: 2 additions & 2 deletions grade/report/grader/version.php
@@ -1,6 +1,6 @@
<?PHP // $Id$

$plugin->version = 2007072500;
$plugin->requires = 2007072402;
$plugin->version = 2007080103;
$plugin->requires = 2007080103;

?>
6 changes: 6 additions & 0 deletions grade/report/lib.php
Expand Up @@ -370,6 +370,12 @@ function get_module_link($modulename, $itemmodule=null, $iteminstance=null) {

$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/";
Expand Down
2 changes: 2 additions & 0 deletions lang/en_utf8/grades.php
Expand Up @@ -69,6 +69,7 @@
$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.';
Expand Down Expand Up @@ -292,6 +293,7 @@
$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';
Expand Down
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -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
Expand Down

0 comments on commit 1815b45

Please sign in to comment.