mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
gradebook MDL-21596 fixed a problem that prevented edits appearing in the UI
This commit is contained in:
parent
be3df7fb70
commit
5e212c334c
@ -227,6 +227,11 @@ if ($current_view != '') {
|
||||
|
||||
print_grade_page_head($courseid, 'edittree', $current_view, get_string('categoriesedit', 'grades') . ': ' . $current_view_str);
|
||||
|
||||
//if we go straight to the db to update an element we need to recreate the tree as
|
||||
// $grade_edit_tree has already been constructed.
|
||||
//Ideally we could do the updates through $grade_edit_tree to avoid recreating it
|
||||
$recreatetree = false;
|
||||
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
// Perform bulk actions first
|
||||
if (!empty($data->bulkmove)) {
|
||||
@ -258,6 +263,8 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||
$grade_category->update();
|
||||
grade_regrade_final_grades($courseid);
|
||||
|
||||
$recreatetree = true;
|
||||
|
||||
// Grade item text inputs
|
||||
} elseif (preg_match('/^(grademax|aggregationcoef|multfactor|plusfactor)_([0-9]+)$/', $key, $matches)) {
|
||||
$param = $matches[1];
|
||||
@ -277,6 +284,8 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||
$grade_item->update();
|
||||
grade_regrade_final_grades($courseid);
|
||||
|
||||
$recreatetree = true;
|
||||
|
||||
// Grade item checkbox inputs
|
||||
} elseif (preg_match('/^extracredit_([0-9]+)$/', $key, $matches)) { // Sum extra credit checkbox
|
||||
$aid = $matches[1];
|
||||
@ -288,6 +297,8 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||
$grade_item->update();
|
||||
grade_regrade_final_grades($courseid);
|
||||
|
||||
$recreatetree = true;
|
||||
|
||||
// Grade category checkbox inputs
|
||||
} elseif (preg_match('/^aggregate(onlygraded|subcats|outcomes)_([0-9]+)$/', $key, $matches)) {
|
||||
$param = 'aggregate'.$matches[1];
|
||||
@ -299,6 +310,8 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
||||
|
||||
$grade_category->update();
|
||||
grade_regrade_final_grades($courseid);
|
||||
|
||||
$recreatetree = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -310,6 +323,11 @@ echo '<form id="gradetreeform" method="post" action="'.$returnurl.'">';
|
||||
echo '<div>';
|
||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||
|
||||
//did we update something in the db and thus invalidate $grade_edit_tree?
|
||||
if ($recreatetree) {
|
||||
$grade_edit_tree = new grade_edit_tree($gtree, $movingeid, $gpr);
|
||||
}
|
||||
|
||||
echo html_writer::table($grade_edit_tree->table);
|
||||
|
||||
echo '<div id="gradetreesubmit">';
|
||||
|
Loading…
x
Reference in New Issue
Block a user