Skip to content

Commit 929b3a6

Browse files
committed
[FIX] LTI: Fix LTI 1.3 learning progress via outcomes service
This fixes learning progress updates for LTI 1.3 by correctly using the outcomes service and preserving the required authentication context during the consumer flow. As a result, outcome requests are resolved consistently and progress can be reported as expected.
1 parent 9c378df commit 929b3a6

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

components/ILIAS/LTIProvider/classes/class.ilLTIAppEventListener.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,28 @@ protected function tryOutcomeService(int $resource, string $ext_account, int $a_
180180

181181
$this->logger->info('Sending score: ' . (string) $score);
182182

183-
$outcome = new Outcome((string) $score);
183+
$pointsPossible = 1;
184+
185+
if ($a_status == ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM) {
186+
$activityProgress = 'Initialized';
187+
$gradingProgress = 'NotReady';
188+
} elseif ($a_status == ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) {
189+
$activityProgress = 'InProgress';
190+
$gradingProgress = 'Pending';
191+
} elseif ($a_status == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
192+
$activityProgress = 'Completed';
193+
$gradingProgress = 'FullyGraded';
194+
} elseif ($a_status == ilLPStatus::LP_STATUS_FAILED_NUM) {
195+
$activityProgress = 'Completed';
196+
$gradingProgress = 'Failed';
197+
} else {
198+
$activityProgress = 'InProgress';
199+
$gradingProgress = 'Pending';
200+
}
201+
202+
$this->logger->info("Sending score: $score, Points possible: $pointsPossible, Activity progress: $activityProgress, Grading progress: $gradingProgress");
203+
204+
$outcome = new Outcome($score, $pointsPossible, $activityProgress, $gradingProgress);
184205

185206
$status = $resource_link->doOutcomesService(
186207
ServiceAction::Write,

0 commit comments

Comments
 (0)