Skip to content

Commit c240e8c

Browse files
authored
Merge pull request #11334 from surlabs/trunk_LTI_lpfixes
[FIX] LTI: Fix LTI 1.3 learning progress via outcomes service
2 parents 9c378df + 929b3a6 commit c240e8c

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)