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_configtext('grade_report_studentsperpage', get_string('studentsperpage', 'grades'),
14 get_string('configstudentsperpage', 'grades'), 20));
16 $settings->add(new admin_setting_configcheckbox('grade_report_quickgrading', get_string('quickgrading', 'grades'),
17 get_string('configquickgrading', 'grades'), 1));
19 $settings->add(new admin_setting_configcheckbox('grade_report_quickfeedback', get_string('quickfeedback', 'grades'),
20 get_string('configquickfeedback', 'grades'), 1));
22 $settings->add(new admin_setting_configselect('grade_report_decimalpoints', get_string('decimalpoints', 'grades'),
23 get_string('configdecimalpoints', 'grades'), 2,
31 $settings->add(new admin_setting_configselect('grade_report_aggregationposition', get_string('aggregationposition', 'grades'),
32 get_string('configaggregationposition', 'grades'), false,
33 array(GRADE_REPORT_AGGREGATION_POSITION_LEFT
=> get_string('left', 'grades'),
34 GRADE_REPORT_AGGREGATION_POSITION_RIGHT
=> get_string('right', 'grades'))));
36 $settings->add(new admin_setting_configselect('grade_report_aggregationview', get_string('aggregationview', 'grades'),
37 get_string('configaggregationview', 'grades'), false,
38 array(GRADE_REPORT_AGGREGATION_VIEW_FULL
=> get_string('full', 'grades'),
39 GRADE_REPORT_AGGREGATION_VIEW_AGGREGATES_ONLY
=> get_string('aggregatesonly', 'grades'),
40 GRADE_REPORT_AGGREGATION_VIEW_GRADES_ONLY
=> get_string('gradesonly', 'grades'))));
42 $settings->add(new admin_setting_configselect('grade_report_gradedisplaytype', get_string('gradedisplaytype', 'grades'),
43 get_string('configgradedisplaytype', 'grades'), false,
44 array(GRADE_REPORT_GRADE_DISPLAY_TYPE_REAL
=> $strreal,
45 GRADE_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE
=> $strpercentage,
46 GRADE_REPORT_GRADE_DISPLAY_TYPE_LETTER
=> $strletter)));
48 $settings->add(new admin_setting_configselect('grade_report_meanselection', get_string('meanselection', 'grades'),
49 get_string('configmeanselection', 'grades'), false,
50 array(GRADE_AGGREGATE_MEAN_ALL
=> get_string('meanall', 'grades'),
51 GRADE_AGGREGATE_MEAN_GRADED
=> get_string('meangraded', 'grades'))));
53 $settings->add(new admin_setting_configcheckbox('grade_report_enableajax', get_string('enableajax', 'grades'),
54 get_string('configenableajax', 'grades'), 0));
56 $settings->add(new admin_setting_configcheckbox('grade_report_showcalculations', get_string('showcalculations', 'grades'),
57 get_string('configshowcalculations', 'grades'), 0));
59 $settings->add(new admin_setting_configcheckbox('grade_report_showeyecons', get_string('showeyecons', 'grades'),
60 get_string('configshoweyecons', 'grades'), 0));
62 $settings->add(new admin_setting_configcheckbox('grade_report_showaverages', get_string('showaverages', 'grades'),
63 get_string('configshowaverages', 'grades'), 0));
65 $settings->add(new admin_setting_configcheckbox('grade_report_showgroups', get_string('showgroups', 'grades'),
66 get_string('configshowgroups', 'grades'), 0));
68 $settings->add(new admin_setting_configcheckbox('grade_report_showlocks', get_string('showlocks', 'grades'),
69 get_string('configshowlocks', 'grades'), 0));
71 $settings->add(new admin_setting_configcheckbox('grade_report_showranges', get_string('showranges', 'grades'),
72 get_string('configshowranges', 'grades'), 0));
74 $settings->add(new admin_setting_configcheckbox('grade_report_showuserimage', get_string('showuserimage', 'grades'),
75 get_string('configshowuserimage', 'grades'), 1));
77 $settings->add(new admin_setting_configcheckbox('grade_report_showactivityicons', get_string('showactivityicons', 'grades'),
78 get_string('configshowactivityicons', 'grades'), 1));
80 $settings->add(new admin_setting_configselect('grade_report_averagesdisplaytype', get_string('averagesdisplaytype', 'grades'),
81 get_string('configaveragesdisplaytype', 'grades'), false,
82 array(GRADE_REPORT_PREFERENCE_INHERIT
=> $strinherit,
83 GRADE_REPORT_GRADE_DISPLAY_TYPE_REAL
=> $strreal,
84 GRADE_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE
=> $strpercentage,
85 GRADE_REPORT_GRADE_DISPLAY_TYPE_LETTER
=> $strletter)));
87 $settings->add(new admin_setting_configselect('grade_report_rangesdisplaytype', get_string('rangesdisplaytype', 'grades'),
88 get_string('configrangesdisplaytype', 'grades'), false,
89 array(GRADE_REPORT_PREFERENCE_INHERIT
=> $strinherit,
90 GRADE_REPORT_GRADE_DISPLAY_TYPE_REAL
=> $strreal,
91 GRADE_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE
=> $strpercentage,
92 GRADE_REPORT_GRADE_DISPLAY_TYPE_LETTER
=> $strletter)));
94 $settings->add(new admin_setting_configselect('grade_report_averagesdecimalpoints', get_string('averagesdecimalpoints', 'grades'),
95 get_string('configaveragesdecimalpoints', 'grades'), 2,
96 array(GRADE_REPORT_PREFERENCE_INHERIT
=> $strinherit,
103 $settings->add(new admin_setting_configselect('grade_report_rangesdecimalpoints', get_string('rangesdecimalpoints', 'grades'),
104 get_string('configrangesdecimalpoints', 'grades'), 2,
105 array(GRADE_REPORT_PREFERENCE_INHERIT
=> $strinherit,
113 $percentages = array(GRADE_REPORT_PREFERENCE_UNUSED
=> get_string('unused', 'grades'));
114 for ($i=100; $i > -1; $i--) {
115 $percentages[$i] = "$i%";
118 for ($i = 1; $i <= 10; $i++
) {
119 $default = abs(($i-10)*10);
120 $settings->add(new admin_setting_configselect('grade_report_gradeboundary'.$i, $strgradeboundary . " $i",
121 $strconfiggradeboundary, $default, $percentages));
123 $settings->add(new admin_setting_configtext('grade_report_gradeletter'.$i, $strgradeletter . " $i",
124 $strconfiggradeletter, ''));