kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Add score in practice quiz

Open thesujai opened this issue 1 year ago • 8 comments

Summary

Now the ContentNodeProgressViewSet return num_attempts, num_correct_attempts and total_questions. Some frontend work remains

References

Fixes #8643

Reviewer guidance

How do I calculate the score and no of question in the frontend


Testing checklist

  • [x] Contributor has fully tested the PR manually
  • [ ] If there are any front-end changes, before/after screenshots are included
  • [ ] Critical user journeys are covered by Gherkin stories
  • [ ] Critical and brittle code paths are covered by unit tests

PR process

  • [ ] PR has the correct target branch and milestone
  • [x] PR has 'needs review' or 'work-in-progress' label
  • [ ] If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • [ ] If this is an important user-facing change, PR or related issue has a 'changelog' label
  • [ ] If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

thesujai avatar Aug 15 '24 17:08 thesujai

Hey @thesujai, thanks! Regarding frontend parts,

How do I calculate the score and no of question in the frontend

Was this a question for us? If so, we have some score calculations here

https://github.com/learningequality/kolibri/blob/develop/kolibri/plugins/learn/assets/src/views/cards/QuizCard/index.vue#L59-L87

That said, I'm not entirely sure what cards exactly you will need work on. Please send me a link to the card component that's used for a practice quiz.

MisRob avatar Aug 19 '24 13:08 MisRob

Also there's some guidance in comments from @rtibbles in the issue's comments https://github.com/learningequality/kolibri/issues/8643, and some touch on frontend parts as well.

MisRob avatar Aug 19 '24 13:08 MisRob

HI @MisRob The issue was that we could keep attempting a practice quiz even after all questions were complete(Not a bug). But this means that a new attempt_log will be created for every new attempt. So a point can be reached where num_correct_attempts>num_questions. We cannot calculate score in this case. I discussed this with @nucleogenesis and he suggested fetching all of the attemptlogs which are correct, but unique by AttemptLog.item. So I am working on that approach

thesujai avatar Aug 20 '24 08:08 thesujai

Okay, it sounds you've got all you need then

MisRob avatar Aug 20 '24 09:08 MisRob

Concern: When a quiz has more questions than the minimum required to complete it (e.g., a quiz has 20 questions, but only 6 need to be correct to mark it as complete), the progress shows as 1 (100%) after answering the required number of questions. However, if the score is calculated using the total number of questions (num_correct_attempts/num_questions), it may appear low even when the quiz is marked as complete, which could be confusing.

One approach could be to calculate num_questions and num_correct_attempts based on the criteria for completing the quiz. For instance, if a quiz is marked complete after 6 correct answers, then:

  • num_questions would be set to 6 (the number required for completion).
  • num_correct_attempts would be calculated up to that point, ensuring the score reflects only those necessary attempts.

This way, the score and progress would be more aligned, avoiding confusion when the progress is 1 but the score seems low.

thesujai avatar Aug 21 '24 07:08 thesujai

@thesujai I am looping in @nucleogenesis here, since you mentioned you've already had some discussions regarding this together

MisRob avatar Aug 21 '24 08:08 MisRob

@thesujai after a quick chat w/ Richard I think I see the misunderstanding on my end.

A "Practice Quiz" will not allow multiple attempts at the same question within the same "Quiz Attempt" -- that is to say, when you take a "Practice Quiz" it is treated like a "Quiz" in that you're going straight through it.

Which means:

  • Mastery model can be ignored
  • % is a calculation of num_correct_attempts / total_questions because the user is expected to have attempted all of the questions exactly one time

So if you only get the data for the last "AttemptLog" for the practice quiz, then you should have the correct data there.

I'll give the code another look through w/ this in mind

nucleogenesis avatar Aug 29 '24 17:08 nucleogenesis

I understand why the linting failed here, but not why locally it passed

thesujai avatar Sep 05 '24 09:09 thesujai

Codewise, this is good to go - this just needs QA sign off to merge.

rtibbles avatar Sep 24 '24 00:09 rtibbles

Hi @rtibbles and @thesujai besides the issue already noted in https://github.com/learningequality/kolibri/issues/12663 I was able to identify only one more which is that the 'Score N%' text is not translated in the other supported languages:

score

pcenov avatar Sep 25 '24 11:09 pcenov

As this is new string here, I think this is to be expected!

rtibbles avatar Sep 25 '24 14:09 rtibbles