MDL-46663 gradereport_grader: Remove fixed column support

This issue is a part of the MDL-46658 Task.
This issue is a part of the MDL-25544 Epic.
This commit is contained in:
Andrew Nicols 2014-08-19 08:14:40 +08:00
parent 99b119c166
commit 8c037a917b
3 changed files with 8 additions and 41 deletions

View File

@ -722,7 +722,6 @@ class grade_report_grader extends grade_report {
$arrows = $this->get_sort_arrows();
$jsarguments = array(
'id' => '#fixed_column',
'cfg' => array('ajaxenabled'=>false),
'items' => array(),
'users' => array(),
@ -1117,36 +1116,21 @@ class grade_report_grader extends grade_report {
*/
public function get_grade_table($displayaverages = false) {
global $OUTPUT;
$fixedstudents = $this->is_fixed_students();
$leftrows = $this->get_left_rows($displayaverages);
$rightrows = $this->get_right_rows($displayaverages);
$html = '';
if ($fixedstudents) {
$fixedcolumntable = new html_table();
$fixedcolumntable->id = 'fixed_column';
$fixedcolumntable->data = $leftrows;
$html .= $OUTPUT->container(html_writer::table($fixedcolumntable), 'left_scroller');
$fulltable = new html_table();
$fulltable->attributes['class'] = 'table table-bordered table-striped table-condensed';
$fulltable->id = 'user-grades';
$righttable = new html_table();
$righttable->id = 'user-grades';
$righttable->data = $rightrows;
$html .= $OUTPUT->container(html_writer::table($righttable), 'right_scroller');
} else {
$fulltable = new html_table();
$fulltable->attributes['class'] = 'table table-bordered table-striped table-condensed';
$fulltable->id = 'user-grades';
// Extract rows from each side (left and right) and collate them into one row each
foreach ($leftrows as $key => $row) {
$row->cells = array_merge($row->cells, $rightrows[$key]->cells);
$fulltable->data[] = $row;
}
$html .= html_writer::table($fulltable);
// Extract rows from each side (left and right) and collate them into one row each
foreach ($leftrows as $key => $row) {
$row->cells = array_merge($row->cells, $rightrows[$key]->cells);
$fulltable->data[] = $row;
}
$html .= html_writer::table($fulltable);
return $OUTPUT->container($html, 'gradeparent');
}
@ -1742,18 +1726,6 @@ class grade_report_grader extends grade_report {
return true;
}
/**
* Returns whether or not to display fixed students column.
* Includes a browser check, because IE6 doesn't support the scrollbar.
*
* @return bool
*/
public function is_fixed_students() {
global $CFG;
return $CFG->grade_report_fixedstudents;
}
/**
* Refactored function for generating HTML of sorting links with matching arrows.
* Returns an array with 'studentname' and 'idnumber' as keys, with HTML ready

View File

@ -44,9 +44,6 @@ if ($ADMIN->fulltree) {
$settings->add(new admin_setting_configcheckbox('grade_report_showquickfeedback', get_string('quickfeedback', 'grades'),
get_string('showquickfeedback_help', 'grades'), 0));
$settings->add(new admin_setting_configcheckbox('grade_report_fixedstudents', get_string('fixedstudents', 'grades'),
get_string('fixedstudents_help', 'grades'), 0));
$settings->add(new admin_setting_configselect('grade_report_meanselection', get_string('meanselection', 'grades'),
get_string('meanselection_help', 'grades'), GRADE_REPORT_MEAN_GRADED,
array(GRADE_REPORT_MEAN_ALL => get_string('meanall', 'grades'),

View File

@ -212,8 +212,6 @@ $string['feedbacksaved'] = 'Feedback saved';
$string['feedbackview'] = 'View feedback';
$string['finalgrade'] = 'Final grade';
$string['finalgrade_help'] = 'If the overridden checkbox is ticked, a grade may be added or amended.';
$string['fixedstudents'] = 'Static students column';
$string['fixedstudents_help'] = 'Allows grades to scroll horizontally without losing sight of the students column, by making it static.';
$string['forceoff'] = 'Force: Off';
$string['forceon'] = 'Force: On';
$string['forelementtypes'] = 'for the selected {$a}';