Skip to content

Commit

Permalink
Test: Show Participants in Manual Scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kergomard committed Feb 19, 2025
1 parent 73114ae commit 5682fec
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions Modules/Test/classes/class.ilObjTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4834,33 +4834,8 @@ public function getTestParticipantsForManualScoring($filter = null): array
$participants = &$this->getTestParticipants();
$filtered_participants = [];
foreach ($participants as $active_id => $participant) {
$qstType_IN_manScoreableQstTypes = $this->db->in('qpl_questions.question_type_fi', $scoring, false, 'integer');

$queryString = "
SELECT tst_test_result.manual
FROM tst_test_result
INNER JOIN qpl_questions
ON tst_test_result.question_fi = qpl_questions.question_id
WHERE tst_test_result.active_fi = %s
AND $qstType_IN_manScoreableQstTypes
";

$result = $this->db->queryF(
$queryString,
["integer"],
[$active_id]
);

$count = $result->numRows();

if ($count > 0) {
if ($participant['tries'] > 0) {
switch ($filter) {
case 3: // all users
$filtered_participants[$active_id] = $participant;
break;
case 4:
if ($this->testManScoringDoneHelper->isDone((int) $active_id)) {
$filtered_participants[$active_id] = $participant;
Expand All @@ -4871,21 +4846,8 @@ public function getTestParticipantsForManualScoring($filter = null): array
$filtered_participants[$active_id] = $participant;
}
break;
case 6:
// partially scored participants
$found = 0;
while ($row = $this->db->fetchAssoc($result)) {
if ($row["manual"]) {
$found++;
}
}
if (($found > 0) && ($found < $count)) {
$filtered_participants[$active_id] = $participant;
}
break;
default:
$filtered_participants[$active_id] = $participant;
break;
}
}
}
Expand Down

0 comments on commit 5682fec

Please sign in to comment.