From: nicolasconnault Date: Thu, 13 Sep 2007 15:11:16 +0000 (+0000) Subject: Issue: X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=aae94377b771465cab62265247e089e207e9063b;p=moodle.git Issue: Only students should appear in the tutor report, however sorting by Surname results in the tutor being included, which we don't want. Solution: Confirmed as a bug and filed in tracker: http://tracker.moodle.org/browse/MDL-11233 Issue: Clicking on Hide Groups reveals the results for all students and all tutors and course staff appear. A tutor should only be able to see the results for their tutor group Solution: Prevent tutors from ever seeing student grades from other groups: use existing capabilities moodle/site:accessallgroups = off AND moodle/grade:viewall = on Issue: Preferences tab should not be available to users without gradereport/grader:manage capability Solution: Hide the tab completely Issue: Apply different style to average cells Solution: Add css classes to the different average cells, and write a default style in css file. Issue: The Average under group average might be better labelled Course average. Solution: Rename to "Complete average" --- diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index cae568727f..a081f632ee 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -348,7 +348,13 @@ class grade_report_grader extends grade_report { } $html .= $this->print_toggle('averages', true); - $html .= $this->print_toggle('groups', true); + + if (has_capability('moodle/grade:viewall', $this->context) + and has_capability('moodle/site:accessallgroups', $this->context) + and $course_has_groups = true) { // TODO replace that last condition with proper check + $html .= $this->print_toggle('groups', true); + } + $html .= $this->print_toggle('ranges', true); if (!empty($CFG->enableoutcomes)) { $html .= $this->print_toggle('nooutcomes', true); @@ -787,14 +793,16 @@ class grade_report_grader extends grade_report { $averagesdecimalpoints = $this->get_pref('averagesdecimalpoints'); $meanselection = $this->get_pref('meanselection'); $avghtml = ''; + $avgcssclass = 'avg'; if ($grouponly) { $straverage = get_string('groupavg', 'grades'); $showaverages = $this->currentgroup && $this->get_pref('showgroups'); $groupsql = $this->groupsql; $groupwheresql = $this->groupwheresql; + $avgcssclass = 'groupavg'; } else { - $straverage = get_string('average', 'grades'); + $straverage = get_string('completeaverage', 'grades'); $showaverages = $this->get_pref('showaverages'); $groupsql = null; $groupwheresql = null; @@ -827,7 +835,7 @@ class grade_report_grader extends grade_report { } } - $avghtml = ''.$straverage.''; + $avghtml = ''.$straverage.''; $columncount=1; foreach ($this->items as $item) { diff --git a/grade/report/grader/tabs.php b/grade/report/grader/tabs.php index 84e349bb84..f1a4d3572c 100644 --- a/grade/report/grader/tabs.php +++ b/grade/report/grader/tabs.php @@ -1,12 +1,14 @@ wwwroot.'/grade/report/grader/index.php?id='.$courseid, get_string('modulename', 'gradereport_grader')); - - $row[] = new tabobject('preferences', - $CFG->wwwroot.'/grade/report/grader/preferences.php?id='.$courseid, - get_string('preferences')); + if (has_capability('moodle/grade:manage', get_context_instance(CONTEXT_COURSE, $COURSE->id))) { + $row[] = new tabobject('preferences', + $CFG->wwwroot.'/grade/report/grader/preferences.php?id='.$courseid, + get_string('preferences')); + } $tabs[] = $row; echo '
'; diff --git a/lang/en_utf8/grades.php b/lang/en_utf8/grades.php index f164af6220..37a5b2a4aa 100644 --- a/lang/en_utf8/grades.php +++ b/lang/en_utf8/grades.php @@ -57,6 +57,7 @@ $string['categorytotal'] = 'Category total'; $string['changesitedefaults'] = 'Change site defaults'; $string['choosecategory'] = 'Select Category'; $string['compact'] = 'Compact'; +$string['completeaverage'] = 'Complete average'; $string['configaggregationposition'] = 'The position of the aggregation column in the grader report table, in reference to the real grades.'; $string['configaggregationview'] = 'Each category can be displayed in three ways: Full mode (aggregated column and grade item columns), the aggregated column only, or the grade items alone.'; $string['configaveragesdecimalpoints'] = 'The number of decimal points to display for each average (group or whole), below a column of grades. This can be overriden per grading item.'; diff --git a/theme/standard/styles_color.css b/theme/standard/styles_color.css index 7c510318f0..462dcea04b 100644 --- a/theme/standard/styles_color.css +++ b/theme/standard/styles_color.css @@ -721,6 +721,13 @@ body#grade-index .grades .r1 { background-color: #dddddd; } +.grade-report-grader .gradestable tr.avg td.cell { + background-color: #efefff; +} + +.grade-report-grader .gradestable tr.groupavg td.cell { + background-color: #efffef; +} /*** *** Login ***/ diff --git a/theme/standard/styles_fonts.css b/theme/standard/styles_fonts.css index 6b85bceefc..ed80910321 100644 --- a/theme/standard/styles_fonts.css +++ b/theme/standard/styles_fonts.css @@ -485,7 +485,16 @@ body#grade-index .grades .header { font-size: 0.7em; } +.grade-report-grader .gradestable tr.groupavg td.cell { + font-weight: bold; + color: #006400; +} +.grade-report-grader .gradestable tr.avg td.cell { + font-weight: bold; + color: #00008B; + +} /*** *** Login ***/