kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Replace the most recent attempt when a learner has several for an item

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 progress tracking API's replace option looks up the learner's attempt for an item with .get(), which assumes there is only one. Exercises that repeat an item, and the same quiz attempted on two devices then synced, both leave several attempts, and replace then returns a 500.

Complexity: Low Target branch: develop

Context

  • On develop at fe298f5449, two PUT /api/logger/trackprogress/<id>/ requests with an interaction for the same item without replace, then one with "replace": true, raise MultipleObjectsReturned at progress_tracking.py#L819. The anonymous path at #L827 does the same.

The Change

  • replace should update the most recent attempt for the item when there is more than one.

Acceptance Criteria

  • [ ] The sequence under Context returns 200 and updates the most recent attempt.
  • [ ] replace with a single attempt behaves as before.
  • [ ] Tests cover replace with two attempts for a learner and for an anonymous session.

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

/assign

Shruti2110-coder avatar Nov 16 '26 18:11 Shruti2110-coder

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 18:11 learning-equality-bot

I have read the contributing guidelines.

Shruti2110-coder avatar Nov 16 '26 18:11 Shruti2110-coder