[FIX] LTI: Provide outcome status lists for LP collections#11641
Conversation
| $usr_ids = array(); | ||
| $query = 'SELECT DISTINCT usr_id FROM ut_lp_marks' | ||
| . ' WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') | ||
| . ' AND status = ' . $ilDB->quote($a_status, 'integer'); | ||
|
|
||
| $res = $ilDB->query($query); | ||
| while ($row = $ilDB->fetchAssoc($res)) { | ||
| $usr_ids[] = (int) $row['usr_id']; | ||
| } | ||
|
|
||
| return $usr_ids; |
There was a problem hiding this comment.
Hi @Saaweel ,
I just stumbled across these changes and am not sure whether the overridden methods have been implemented as intended. From my understanding _getInProgress, _getCompleted, _getFailed and _getNotAttempeted are expected to return lists of user IDs for the respective status based on the underlying learning progress data, rather than on the aggregated status values stored in ut_lp_marks.
Let's assume that \ilLPStatusWrapper::_refreshStatus() is invoked for the consuming object. This eventually calls \ilLPStatus::refreshStatus(), which in turn invokes the methods overridden here.
The returned user ID lists are then used to persist the corresponding learning progress status in ut_lp_marks.
Kind regards,
Michael
Certain missing and/or inherited functions have been added to ensure that learning progress is correctly transferred to the parent object in all cases.
Mantis ticket: https://mantis.ilias.de/view.php?id=41919