Skip to content

Commit

Permalink
Test: Fix Filter in Scoring By Question Table
Browse files Browse the repository at this point in the history
  • Loading branch information
kergomard committed Oct 9, 2024
1 parent cdd6fca commit 19af549
Showing 1 changed file with 21 additions and 26 deletions.
47 changes: 21 additions & 26 deletions Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

class ilTestScoringByQuestionsGUI extends ilTestScoringGUI
{
public const ONLY_FINALIZED = 1;
public const EXCEPT_FINALIZED = 2;
public const EXCEPT_FINALIZED = 1;
public const ONLY_FINALIZED = 2;

public function __construct(ilObjTest $a_object)
{
Expand Down Expand Up @@ -105,31 +105,26 @@ protected function showManScoringByQuestionParticipantsTable(array $manPointsPos
$feedback = $complete_feedback[$active_id][$passNr - 1][$qst_id];
}

$check_filter =
($finalized_filter !== self::ONLY_FINALIZED || $finalized_evaluation) &&
($finalized_filter !== self::EXCEPT_FINALIZED || !$finalized_evaluation);

$check_answered = $answered_filter == false || $is_answered;

if (
isset($questionData['qid']) &&
$questionData['qid'] == $selected_questionData['question_id'] &&
$check_filter &&
$check_answered
) {
$table_data[] = [
'pass_id' => $passNr - 1,
'active_id' => $active_id,
'qst_id' => $questionData['qid'],
'reached_points' => assQuestion::_getReachedPoints(
$active_id,
(int) $questionData['qid'],
$passNr - 1
),
'maximum_points' => $this->questioninfo->getMaximumPoints((int) $questionData['qid']),
'name' => $participant->getName()
] + $feedback;
if (!isset($questionData['qid'])
|| $questionData['qid'] !== $selected_questionData['question_id']
|| $finalized_filter === self::ONLY_FINALIZED && !$finalized_evaluation
|| $finalized_filter === self::EXCEPT_FINALIZED && $finalized_evaluation
|| $answered_filter === true && !$is_answered) {
continue;
}

$table_data[] = [
'pass_id' => $passNr - 1,
'active_id' => $active_id,
'qst_id' => $questionData['qid'],
'reached_points' => assQuestion::_getReachedPoints(
$active_id,
(int) $questionData['qid'],
$passNr - 1
),
'maximum_points' => $this->questioninfo->getMaximumPoints((int) $questionData['qid']),
'name' => $participant->getName()
] + $feedback;
}
}
} else {
Expand Down

0 comments on commit 19af549

Please sign in to comment.