MDL-29920 Grader report does not need to cache grade.php existence flags any more

This caching is now performed by the underlying methods.
This commit is contained in:
David Mudrak 2011-11-03 13:50:34 +01:00
parent eff314b06a
commit f17bb885e9

View File

@ -802,11 +802,9 @@ class grade_report_grader extends grade_report {
$rows = $this->get_right_icons_row($rows);
// Preload scale objects for items with a scaleid, initialize tab indices and prepare the list
// of all activity modules that have the file grade.php present if showanalysisicon is enabled
// Preload scale objects for items with a scaleid and initialize tab indices
$scaleslist = array();
$tabindices = array();
$modgrades = array();
foreach ($this->gtree->get_items() as $itemid=>$item) {
$scale = null;
@ -819,16 +817,6 @@ class grade_report_grader extends grade_report {
$tabindices[$item->id]['grade'] = $gradetabindex;
$tabindices[$item->id]['feedback'] = $gradetabindex + $numusers;
$gradetabindex += $numusers * 2;
if ($this->get_pref('showanalysisicon')) {
if ($item->itemtype == 'mod' and !array_key_exists($item->itemmodule, $modgrades)) {
if (file_exists($CFG->dirroot . '/mod/' . $item->itemmodule . '/grade.php')) {
$modgrades[$item->itemmodule] = true;
} else {
$modgrades[$item->itemmodule] = false;
}
}
}
}
$scalesarray = array();
@ -1020,9 +1008,7 @@ class grade_report_grader extends grade_report {
$itemcell->text .= html_writer::tag('span', get_string('error'), array('class'=>"gradingerror$hidden$gradepass"));
} else {
if ($this->get_pref('showanalysisicon') and !is_null($gradeval)) {
if ($item->itemtype == 'mod' and !empty($modgrades[$item->itemmodule])) {
$itemcell->text .= $this->gtree->get_grade_analysis_icon($grade);
}
$itemcell->text .= $this->gtree->get_grade_analysis_icon($grade);
}
$itemcell->text .= html_writer::tag('span', grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null), array('class'=>"gradevalue$hidden$gradepass"));
}