Repository navigation
48479 - Accepting a further answer in the answer statistic does not rescore participants - #12186
Merged
kergomard merged 1 commit intoOct 9, 2026
Conversation
addAnswer() passed $question_index - the sub-question index, for a cloze question the gap - to recalculateSolutions(), which expects a question id. Until 10.11 the filter in TestScoring was an OR whose first operand was true for any non-zero value, so everything was recalculated anyway. With the equality check introduced in 10.12 nothing matches and no participant is rescored.
Contributor
|
Thank you very much for the PR and the explanation @lorenzgith ! I'm actually glad that we get these knots sorted out. Merged and picked to ILIAS 11 and trunk. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://mantis.ilias.de/view.php?id=48479
In "Korrektur der Punkte" → "Antwortstatistik" a teacher accepts a further answer as correct and gives it points. The answer is stored on the question, the screen reports success — but no participant is rescored. The points only appear after re-saving the whole question on the "Frage" tab.
addAnswer()passes the wrong value:$question_indexis the sub-question index — for a cloze question the gap number — not a question id. Both values are in the modal:ilAnswerFrequencyStatisticTableGUI::buildAddAnswerAction()setsquestion_idandquestion_index, andilAddAnswerFormBuilderdeclares both as hidden inputs.question_idis simply never read.This was already wrong before, but invisible. The filter in
TestScoring::recalculatePass()used to be:An
ORwhose first operand is true for every non-zero value, so every question of the pass was recalculated and the points landed anyway. 10.12 replaced it with a proper equality check — correct in itself, but it exposes the caller: a gap index never equals a question id,$question_idis notnull, so no branch matches and nothing is recalculated.Passing the question id fixes it;
$questionis already in scope two statements above.Worth noting for triage: this is silent. The teacher gets a success message, the answer really is saved, and only the learners' scores stay behind — in our case noticed after an exam, by comparing results before and after re-saving the question.
Present in
release_10andtrunkalike.