Skip to content

Commit

Permalink
Merge pull request #4057 from iszmais/bugfix/doubled-log-of-manual-sc…
Browse files Browse the repository at this point in the history
…oring-trunk

Fix loggin for manual scoring and break on invalid form
  • Loading branch information
mbecker-databay authored Mar 2, 2022
2 parents f9b0e68 + 11a2cbe commit 6767b4e
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ protected function saveManScoringByQuestion($ajax = false)
$pass = key($_POST['scoring']);
$activeData = current($_POST['scoring']);
$participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
$oneExceededMaxPoints = false;
$manPointsPost = [];
$skipParticipant = [];
$maxPointsByQuestionId = [];
Expand All @@ -217,8 +216,6 @@ protected function saveManScoringByQuestion($ajax = false)
}

foreach ((array) $questions as $qst_id => $reached_points) {
$this->saveFeedback($active_id, $qst_id, $pass, $ajax);

if (false == isset($manPointsPost[$pass])) {
$manPointsPost[$pass] = [];
}
Expand All @@ -228,17 +225,13 @@ protected function saveManScoringByQuestion($ajax = false)
$maxPointsByQuestionId[$qst_id] = assQuestion::_getMaximumPoints($qst_id);
$manPointsPost[$pass][$active_id][$qst_id] = $reached_points;
if ($reached_points > $maxPointsByQuestionId[$qst_id]) {
$oneExceededMaxPoints = true;
ilUtil::sendFailure(sprintf($this->lng->txt('tst_save_manscoring_failed'), $pass + 1));
$this->showManScoringByQuestionParticipantsTable($manPointsPost);
return;
}
}
}

if ($oneExceededMaxPoints) {
$this->tpl->setOnScreenMessage('failure', sprintf($this->lng->txt('tst_save_manscoring_failed'), $pass + 1));
$this->showManScoringByQuestionParticipantsTable($manPointsPost);
return;
}


$changed_one = false;
$lastAndHopefullyCurrentQuestionId = null;

Expand Down

0 comments on commit 6767b4e

Please sign in to comment.