Fix edit all evaluation results - refs BT#12585

remotes/angel/1.11.x
Angel Fernando Quiroz Campos 8 years ago
parent 0bb6093971
commit 2078b88abf
  1. 17
      main/gradebook/gradebook_edit_result.php

@ -28,13 +28,18 @@ $edit_result_form = new EvalForm(
if ($edit_result_form->validate()) {
$values = $edit_result_form->exportValues();
$scores = $values['score'];
foreach ($scores as $row) {
$resultedit = Result:: load(key($scores));
$row_value = $row;
if ($row_value != '') {
$resultedit[0]->set_score(api_number_format($row_value, api_get_setting('gradebook_number_decimals')));
$resultedit[0]->save();
foreach ($scores as $userId => $score) {
/** @var array $resultedit */
$resultedit = Result::load($userId);
/** @var Result $result */
$result = $resultedit[0];
if ('' == $score) {
continue;
}
$result->set_score(api_number_format($score, api_get_setting('gradebook_number_decimals')));
$result->save();
}
Display::addFlash(Display::return_message(get_lang('AllResultsEdited')));
header('Location: gradebook_view_result.php?selecteval='.$select_eval.'&'.api_get_cidreq());

Loading…
Cancel
Save