kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

List each lesson once for learners assigned it twice

Open rtibbles opened this issue 2 weeks ago โ€ข 4 comments

๐Ÿ™‚ Looking for an issue? Welcome! This issue is open for contribution. If this is the first time youโ€™re requesting an issue, please:

  • Read Contributing guidelines carefully. Pay extra attention to Using generative AI. Pull requests and comments that donโ€™t follow the guidelines wonโ€™t be answered.
  • Confirm that youโ€™ve read the guidelines in your comment.

Overview

The learner lesson list returns a lesson twice when it is assigned both to the learner's class and to a group the learner is in. The query joins through assignments and memberships without .distinct().

Complexity: Low Target branch: develop

Context

  • On develop at fe298f5449, GET /learn/api/learnerlesson/ returns the same lesson id twice for a learner in that situation (learner). learn/viewsets/lesson.py#L117.
  • The learner course and classroom viewsets in the same plugin already use .distinct().

The Change

  • The list query should collapse lessons reached through more than one assignment.

Acceptance Criteria

  • [ ] The list returns each lesson once for a learner assigned it through both their class and a group.
  • [ ] A test covers that case.

AI usage

I had Claude Code sweep Kolibri for crashes and wrong results caused by data that sync, soft deletion or concurrent writes can create, and reproduce each one. I chose the grouping. Claude Code drafted the issue.

rtibbles avatar Nov 15 '26 20:11 rtibbles

Hi! ๐Ÿ‘‹

This issue is available for contribution and supports self-assignment. Here's how to get started:

  • Comment /assign to assign yourself to this issue
  • You can have up to 2 issues assigned at a time across all community repos
  • Dropping an issue has a 7-day cooldown before the slot opens up
  • Link your pull request to this issue when you submit it

๐Ÿ“– Read the Contributing guidelines before starting.

Are you preparing for Google Summer of Code? See our GSoC guidelines.

learning-equality-bot avatar Nov 15 '26 21:11 learning-equality-bot

Hi! ๐Ÿ‘‹

This issue is available for contribution and supports self-assignment. Here's how to get started:

  • Comment /assign to assign yourself to this issue
  • You can have up to 2 issues assigned at a time across all community repos
  • Dropping an issue has a 7-day cooldown before the slot opens up
  • Link your pull request to this issue when you submit it

๐Ÿ“– Read the Contributing guidelines before starting.

Are you preparing for Google Summer of Code? See our GSoC guidelines.

learning-equality-bot avatar Nov 15 '26 21:11 learning-equality-bot

/assign

hrishikeshpathak1009 avatar Nov 16 '26 03:11 hrishikeshpathak1009

Hi! ๐Ÿ‘‹

You've been assigned to this issue. Here's what to do next:

  • Read the issue description carefully and make sure you understand the requirements
  • Link your pull request to this issue when you submit it
  • If you can no longer work on this, unassign yourself so others can pick it up

Good luck! ๐Ÿ˜Š

Are you preparing for Google Summer of Code? See our GSoC guidelines.

learning-equality-bot avatar Nov 16 '26 03:11 learning-equality-bot