|
|
|
@ -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()); |
|
|
|
|