mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Fixing OU report issues
This commit is contained in:
parent
f22bc9dbcb
commit
d32100a522
3 changed files with 13 additions and 2 deletions
|
@ -806,6 +806,8 @@ class grade_report_grader extends grade_report {
|
||||||
$meanselection = $this->get_pref('meanselection');
|
$meanselection = $this->get_pref('meanselection');
|
||||||
$shownumberofgrades = $this->get_pref('shownumberofgrades');
|
$shownumberofgrades = $this->get_pref('shownumberofgrades');
|
||||||
|
|
||||||
|
$canviewhidden = has_capability('moodle/grade:viewhidden', get_context_instance(CONTEXT_COURSE, $this->course->id));
|
||||||
|
|
||||||
$avghtml = '';
|
$avghtml = '';
|
||||||
$avgcssclass = 'avg';
|
$avgcssclass = 'avg';
|
||||||
|
|
||||||
|
@ -857,6 +859,12 @@ class grade_report_grader extends grade_report {
|
||||||
|
|
||||||
$columncount=1;
|
$columncount=1;
|
||||||
foreach ($this->items as $item) {
|
foreach ($this->items as $item) {
|
||||||
|
// If the user shouldn't see this grade_item, hide the average as well
|
||||||
|
if ($item->is_hidden() && !$canviewhidden) {
|
||||||
|
$avghtml .= '<td class="cell c' . $columncount++.'"> - </td>';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($sum_array[$item->id])) {
|
if (empty($sum_array[$item->id])) {
|
||||||
$sum_array[$item->id] = 0;
|
$sum_array[$item->id] = 0;
|
||||||
}
|
}
|
||||||
|
@ -992,6 +1000,9 @@ class grade_report_grader extends grade_report {
|
||||||
$decimalpoints = $rangesdecimalpoints;
|
$decimalpoints = $rangesdecimalpoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$grademin = 0;
|
||||||
|
$grademax = 100;
|
||||||
|
|
||||||
if ($displaytype == GRADE_DISPLAY_TYPE_REAL) {
|
if ($displaytype == GRADE_DISPLAY_TYPE_REAL) {
|
||||||
$grademin = format_float($item->grademin, $decimalpoints);
|
$grademin = format_float($item->grademin, $decimalpoints);
|
||||||
$grademax = format_float($item->grademax, $decimalpoints);
|
$grademax = format_float($item->grademax, $decimalpoints);
|
||||||
|
|
|
@ -117,7 +117,7 @@ class grader_report_preferences_form extends moodleform {
|
||||||
$help_string = get_string("config$lang_string", 'grades');
|
$help_string = get_string("config$lang_string", 'grades');
|
||||||
|
|
||||||
// Replace the 'default' value with the site default language string
|
// Replace the 'default' value with the site default language string
|
||||||
if (!is_null($options) AND $options[GRADE_REPORT_PREFERENCE_DEFAULT] == 'default') {
|
if (!is_null($options) AND isset($options[GRADE_REPORT_PREFERENCE_DEFAULT]) && $options[GRADE_REPORT_PREFERENCE_DEFAULT] == 'default') {
|
||||||
$options[GRADE_REPORT_PREFERENCE_DEFAULT] = get_string('sitedefault', 'grades', $default);
|
$options[GRADE_REPORT_PREFERENCE_DEFAULT] = get_string('sitedefault', 'grades', $default);
|
||||||
} elseif ($type == 'text') {
|
} elseif ($type == 'text') {
|
||||||
$help_string = get_string("config{$lang_string}default", 'grades', $default);
|
$help_string = get_string("config{$lang_string}default", 'grades', $default);
|
||||||
|
|
|
@ -533,7 +533,7 @@ class grade_item extends grade_object {
|
||||||
* Returns the hidden state of this grade_item
|
* Returns the hidden state of this grade_item
|
||||||
* @return boolean hidden state
|
* @return boolean hidden state
|
||||||
*/
|
*/
|
||||||
function is_hidden($userid=NULL) {
|
function is_hidden() {
|
||||||
return ($this->hidden == 1 or ($this->hidden != 0 and $this->hidden > time()));
|
return ($this->hidden == 1 or ($this->hidden != 0 and $this->hidden > time()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue