Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"New session" deck stats not always working #819

Closed
schu opened this issue Apr 18, 2024 · 0 comments
Closed

"New session" deck stats not always working #819

schu opened this issue Apr 18, 2024 · 0 comments
Assignees
Labels
bug Something isn't working p1

Comments

@schu
Copy link
Member

schu commented Apr 18, 2024

The "New session" page shows stats (number of correct answers, number of incorrect answers, etc.) if a user has answered some of the questions of the selected module. In at least one OMC installation the stats component doesn't show the expected stats because the following reactive declerations do not re-run upon a change of validAnswerChoices:

$: numCorrectAnsweredQuestions = validAnswerChoices.filter(a => a.is_correct === 1 && a.help_used === 0).length;
$: numCorrectWithHelpAnsweredQuestions = validAnswerChoices.filter(a => a.is_correct === 1 && a.help_used === 1).length;
$: numIncorrectAnsweredQuestions = validAnswerChoices.filter(a => a.is_correct === 0).length

My understanding is that the declarations should be updated whenever validAnswerChoices gets updated, as the compiler should be able to determine that for example numCorrectAnsweredQuestions depends on the value of validAnswerChoices.

Am I missing something?

We currently use Svelte 4.2.9. So far I wasn't able to reproduce the issue locally, despite being on the same commit.

@schu schu added bug Something isn't working p1 labels Apr 18, 2024
@schu schu removed the needs triage label Apr 18, 2024
@schu schu self-assigned this May 1, 2024
@schu schu closed this as completed in ebe4ec3 May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p1
Projects
None yet
Development

No branches or pull requests

1 participant