2 require_once($CFG->libdir
.'/gradelib.php');
3 $strgradeboundary = get_string('gradeboundary', 'grades');
4 $strconfiggradeboundary = get_string('configgradeboundary', 'grades');
5 $strgradeletter = get_string('gradeletter', 'grades');
6 $strconfiggradeletter = get_string('configgradeletter', 'grades');
7 $strinherit = get_string('inherit', 'grades');
8 $strpercentage = get_string('percentage', 'grades');
9 $strreal = get_string('real', 'grades');
10 $strletter = get_string('letter', 'grades');
12 /// Add settings for this module to the $settings object (it's already defined)
13 $settings->add(new admin_setting_configselect('grade_report_aggregationposition', get_string('aggregationposition', 'grades'),
14 get_string('configaggregationposition', 'grades'), false,
15 array(GRADE_REPORT_AGGREGATION_POSITION_LEFT
=> get_string('left', 'grades'),
16 GRADE_REPORT_AGGREGATION_POSITION_RIGHT
=> get_string('right', 'grades'))));
18 $settings->add(new admin_setting_configselect('grade_report_aggregationview', get_string('aggregationview', 'grades'),
19 get_string('configaggregationview', 'grades'), false,
20 array(GRADE_REPORT_AGGREGATION_VIEW_FULL
=> get_string('full', 'grades'),
21 GRADE_REPORT_AGGREGATION_VIEW_COMPACT
=> get_string('compact', 'grades'))));
23 $settings->add(new admin_setting_configcheckbox('grade_report_bulkcheckboxes', get_string('bulkcheckboxes', 'grades'),
24 get_string('configbulkcheckboxes', 'grades'), 0));
26 $settings->add(new admin_setting_configcheckbox('grade_report_enableajax', get_string('enableajax', 'grades'),
27 get_string('configenableajax', 'grades'), 0));
29 $settings->add(new admin_setting_configselect('grade_report_gradedisplaytype', get_string('gradedisplaytype', 'grades'),
30 get_string('configgradedisplaytype', 'grades'), false,
31 array(GRADE_REPORT_GRADE_DISPLAY_TYPE_REAL
=> $strreal,
32 GRADE_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE
=> $strpercentage,
33 GRADE_REPORT_GRADE_DISPLAY_TYPE_LETTER
=> $strletter)));
35 $settings->add(new admin_setting_configselect('grade_report_rangesdisplaytype', get_string('rangesdisplaytype', 'grades'),
36 get_string('configrangesdisplaytype', 'grades'), false,
37 array(GRADE_REPORT_PREFERENCE_INHERIT
=> $strinherit,
38 GRADE_REPORT_GRADE_DISPLAY_TYPE_REAL
=> $strreal,
39 GRADE_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE
=> $strpercentage,
40 GRADE_REPORT_GRADE_DISPLAY_TYPE_LETTER
=> $strletter)));
42 $settings->add(new admin_setting_configselect('grade_report_averagesdisplaytype', get_string('averagesdisplaytype', 'grades'),
43 get_string('configaveragesdisplaytype', 'grades'), false,
44 array(GRADE_REPORT_PREFERENCE_INHERIT
=> $strinherit,
45 GRADE_REPORT_GRADE_DISPLAY_TYPE_REAL
=> $strreal,
46 GRADE_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE
=> $strpercentage,
47 GRADE_REPORT_GRADE_DISPLAY_TYPE_LETTER
=> $strletter)));
49 $settings->add(new admin_setting_configselect('grade_report_meanselection', get_string('meanselection', 'grades'),
50 get_string('configmeanselection', 'grades'), false,
51 array(GRADE_AGGREGATE_MEAN_ALL
=> get_string('meanall', 'grades'),
52 GRADE_AGGREGATE_MEAN_GRADED
=> get_string('meangraded', 'grades'))));
54 $settings->add(new admin_setting_configcheckbox('grade_report_showcalculations', get_string('showcalculations', 'grades'),
55 get_string('configshowcalculations', 'grades'), 0));
57 $settings->add(new admin_setting_configcheckbox('grade_report_showeyecons', get_string('showeyecons', 'grades'),
58 get_string('configshoweyecons', 'grades'), 0));
60 $settings->add(new admin_setting_configcheckbox('grade_report_showgroups', get_string('showgroups', 'grades'),
61 get_string('configshowgroups', 'grades'), 0));
63 $settings->add(new admin_setting_configcheckbox('grade_report_showaverages', get_string('showaverages', 'grades'),
64 get_string('configshowaverages', 'grades'), 0));
66 $settings->add(new admin_setting_configcheckbox('grade_report_showlocks', get_string('showlocks', 'grades'),
67 get_string('configshowlocks', 'grades'), 0));
69 $settings->add(new admin_setting_configcheckbox('grade_report_showranges', get_string('showranges', 'grades'),
70 get_string('configshowranges', 'grades'), 0));
72 $settings->add(new admin_setting_configcheckbox('grade_report_quickgrading', get_string('quickgrading', 'grades'),
73 get_string('configquickgrading', 'grades'), 1));
75 $settings->add(new admin_setting_configcheckbox('grade_report_quickfeedback', get_string('quickfeedback', 'grades'),
76 get_string('configquickfeedback', 'grades'), 1));
78 $settings->add(new admin_setting_configcheckbox('grade_report_showuserimage', get_string('showuserimage', 'grades'),
79 get_string('configshowuserimage', 'grades'), 1));
81 $settings->add(new admin_setting_configtext('grade_report_studentsperpage', get_string('studentsperpage', 'grades'),
82 get_string('configstudentsperpage', 'grades'), 20));
84 $settings->add(new admin_setting_configselect('grade_report_decimalpoints', get_string('decimalpoints', 'grades'),
85 get_string('configdecimalpoints', 'grades'), 2,
92 $settings->add(new admin_setting_configselect('grade_report_averagesdecimalpoints', get_string('averagesdecimalpoints', 'grades'),
93 get_string('configaveragesdecimalpoints', 'grades'), 2,
94 array(GRADE_REPORT_PREFERENCE_INHERIT
=> $strinherit,
101 $settings->add(new admin_setting_configselect('grade_report_rangesdecimalpoints', get_string('rangesdecimalpoints', 'grades'),
102 get_string('configrangesdecimalpoints', 'grades'), 2,
103 array(GRADE_REPORT_PREFERENCE_INHERIT
=> $strinherit,
111 $percentages = array(GRADE_REPORT_PREFERENCE_UNUSED
=> get_string('unused', 'grades'));
112 for ($i=100; $i > -1; $i--) {
113 $percentages[$i] = "$i%";
116 for ($i = 1; $i <= 10; $i++
) {
117 $default = abs(($i-10)*10);
118 $settings->add(new admin_setting_configselect('grade_report_gradeboundary'.$i, $strgradeboundary . " $i",
119 $strconfiggradeboundary, $default, $percentages));
121 $settings->add(new admin_setting_configtext('grade_report_gradeletter'.$i, $strgradeletter . " $i",
122 $strconfiggradeletter, ''));