mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-18229 gradebook: Fixes for bulk insert and checkboxes.
This commit is contained in:
parent
57fac09a40
commit
1b2c1ccb4c
@ -25,6 +25,8 @@
|
||||
namespace gradereport_singleview\local\screen;
|
||||
|
||||
use gradereport_singleview\local\ui\range;
|
||||
use gradereport_singleview\local\ui\bulk_insert;
|
||||
use grade_grade;
|
||||
use grade_item;
|
||||
use moodle_url;
|
||||
use pix_icon;
|
||||
|
@ -263,14 +263,21 @@ abstract class screen {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!in_array($matches[1], $fields)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$gradeitem = grade_item::fetch(array(
|
||||
'id' => $itemid, 'courseid' => $this->courseid
|
||||
));
|
||||
|
||||
if (preg_match('/^old[oe]{1}/', $varname)) {
|
||||
$elementname = preg_replace('/^old/', '', $varname);
|
||||
if (!isset($data->$elementname)) {
|
||||
$data->$elementname = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!in_array($matches[1], $fields)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$gradeitem) {
|
||||
continue;
|
||||
}
|
||||
|
@ -293,7 +293,6 @@ class user extends tablelike implements selectable_items {
|
||||
// Appropriately massage data that may not exist.
|
||||
|
||||
$userid = $this->item->id;
|
||||
|
||||
foreach ($this->items as $gradeitemid => $gradeitem) {
|
||||
$null = $gradeitem->gradetype == GRADE_TYPE_SCALE ? -1 : '';
|
||||
$field = "finalgrade_{$gradeitem->id}_{$gradeitemid}";
|
||||
|
@ -85,12 +85,6 @@ class checkbox_attribute extends element {
|
||||
$attributes['disabled'] = 'DISABLED';
|
||||
}
|
||||
|
||||
$alt = array(
|
||||
'type' => 'hidden',
|
||||
'name' => $this->name,
|
||||
'value' => 0
|
||||
);
|
||||
|
||||
$hidden = array(
|
||||
'type' => 'hidden',
|
||||
'name' => 'old' . $this->name
|
||||
@ -111,7 +105,6 @@ class checkbox_attribute extends element {
|
||||
}
|
||||
|
||||
return (
|
||||
html_writer::empty_tag('input', $alt) .
|
||||
html_writer::tag('label',
|
||||
get_string($type . 'for', 'gradereport_singleview', $this->label),
|
||||
array('for' => $this->name, 'class' => 'accesshide')) .
|
||||
|
Loading…
x
Reference in New Issue
Block a user