mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
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:
parent
99b119c166
commit
8c037a917b
@ -722,7 +722,6 @@ class grade_report_grader extends grade_report {
|
|||||||
$arrows = $this->get_sort_arrows();
|
$arrows = $this->get_sort_arrows();
|
||||||
|
|
||||||
$jsarguments = array(
|
$jsarguments = array(
|
||||||
'id' => '#fixed_column',
|
|
||||||
'cfg' => array('ajaxenabled'=>false),
|
'cfg' => array('ajaxenabled'=>false),
|
||||||
'items' => array(),
|
'items' => array(),
|
||||||
'users' => array(),
|
'users' => array(),
|
||||||
@ -1117,36 +1116,21 @@ class grade_report_grader extends grade_report {
|
|||||||
*/
|
*/
|
||||||
public function get_grade_table($displayaverages = false) {
|
public function get_grade_table($displayaverages = false) {
|
||||||
global $OUTPUT;
|
global $OUTPUT;
|
||||||
$fixedstudents = $this->is_fixed_students();
|
|
||||||
|
|
||||||
$leftrows = $this->get_left_rows($displayaverages);
|
$leftrows = $this->get_left_rows($displayaverages);
|
||||||
$rightrows = $this->get_right_rows($displayaverages);
|
$rightrows = $this->get_right_rows($displayaverages);
|
||||||
|
|
||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
if ($fixedstudents) {
|
$fulltable = new html_table();
|
||||||
$fixedcolumntable = new html_table();
|
$fulltable->attributes['class'] = 'table table-bordered table-striped table-condensed';
|
||||||
$fixedcolumntable->id = 'fixed_column';
|
$fulltable->id = 'user-grades';
|
||||||
$fixedcolumntable->data = $leftrows;
|
|
||||||
$html .= $OUTPUT->container(html_writer::table($fixedcolumntable), 'left_scroller');
|
|
||||||
|
|
||||||
$righttable = new html_table();
|
// Extract rows from each side (left and right) and collate them into one row each
|
||||||
$righttable->id = 'user-grades';
|
foreach ($leftrows as $key => $row) {
|
||||||
$righttable->data = $rightrows;
|
$row->cells = array_merge($row->cells, $rightrows[$key]->cells);
|
||||||
|
$fulltable->data[] = $row;
|
||||||
$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);
|
|
||||||
}
|
}
|
||||||
|
$html .= html_writer::table($fulltable);
|
||||||
return $OUTPUT->container($html, 'gradeparent');
|
return $OUTPUT->container($html, 'gradeparent');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1742,18 +1726,6 @@ class grade_report_grader extends grade_report {
|
|||||||
return true;
|
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.
|
* Refactored function for generating HTML of sorting links with matching arrows.
|
||||||
* Returns an array with 'studentname' and 'idnumber' as keys, with HTML ready
|
* Returns an array with 'studentname' and 'idnumber' as keys, with HTML ready
|
||||||
|
@ -44,9 +44,6 @@ if ($ADMIN->fulltree) {
|
|||||||
$settings->add(new admin_setting_configcheckbox('grade_report_showquickfeedback', get_string('quickfeedback', 'grades'),
|
$settings->add(new admin_setting_configcheckbox('grade_report_showquickfeedback', get_string('quickfeedback', 'grades'),
|
||||||
get_string('showquickfeedback_help', 'grades'), 0));
|
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'),
|
$settings->add(new admin_setting_configselect('grade_report_meanselection', get_string('meanselection', 'grades'),
|
||||||
get_string('meanselection_help', 'grades'), GRADE_REPORT_MEAN_GRADED,
|
get_string('meanselection_help', 'grades'), GRADE_REPORT_MEAN_GRADED,
|
||||||
array(GRADE_REPORT_MEAN_ALL => get_string('meanall', 'grades'),
|
array(GRADE_REPORT_MEAN_ALL => get_string('meanall', 'grades'),
|
||||||
|
@ -212,8 +212,6 @@ $string['feedbacksaved'] = 'Feedback saved';
|
|||||||
$string['feedbackview'] = 'View feedback';
|
$string['feedbackview'] = 'View feedback';
|
||||||
$string['finalgrade'] = 'Final grade';
|
$string['finalgrade'] = 'Final grade';
|
||||||
$string['finalgrade_help'] = 'If the overridden checkbox is ticked, a grade may be added or amended.';
|
$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['forceoff'] = 'Force: Off';
|
||||||
$string['forceon'] = 'Force: On';
|
$string['forceon'] = 'Force: On';
|
||||||
$string['forelementtypes'] = 'for the selected {$a}';
|
$string['forelementtypes'] = 'for the selected {$a}';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user