-
Notifications
You must be signed in to change notification settings - Fork 199
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
Create quiz progress on quiz answers submit #7136
Conversation
Codecov Report
@@ Coverage Diff @@
## trunk #7136 +/- ##
============================================
+ Coverage 49.36% 49.50% +0.13%
- Complexity 10546 10582 +36
============================================
Files 575 578 +3
Lines 44537 44629 +92
Branches 402 402
============================================
+ Hits 21987 22092 +105
+ Misses 22223 22210 -13
Partials 327 327
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
@@ -13,6 +13,9 @@ | |||
<directory name="widgets" /> | |||
</ignoreFiles> | |||
</projectFiles> | |||
<stubs> | |||
<file name="sensei-lms.php" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had lots of errors like Undefined function Sensei()
. I encountered it in this PR as well.
It looks like Psalm for some reason can't discover some entities via reflection. In these cases, I found a recommendation, put files containing those entities into <stubs>
.
Another approach might be to create config/psalm/psalm-stubs.php
and define functions like Sensei()
there (without implementation) and include these stubs in config like I did with above.
Hm, I wasn't able to reproduce this. I've tried to create a fresh course with a lesson and a quiz. After taking the course and the quiz, it didn't create a quiz progress entry. Did I do something wrong? QUZkUE.mp4 |
Thanks, I see the quiz progress but it is added even if the lesson doesn't have a quiz. Is that expected? iHLs69.mp4 |
Thanks @m1r0. |
Nice! Now it creates the quiz progress only when there is a quiz for that lesson. Related to that, does it make more sense to create the quiz progress when you open the quiz itself, similar to how the progress works for lessons? On a side note, psalm and the linter are failing. |
Makes sense for me. Updated here: fc2bad4 I removed creation of the quiz progress from the lesson starting function as it leads to a conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 💯
Resolves #7050
We create the quiz progress when start the lesson. When the user submits their answers we implicitly start the lesson.
Here we make sure we have a quiz progress or try to create one.
We don't check the feature flag as it is safe to create quiz progress for comments-based version: it is the same lesson progress there.
Proposed Changes
Testing Instructions
tables_based_progress
.in-progress
status expected, on the quiz answers submit depends on quiz settings: could be ungraded, passed, failed, graded.Pre-Merge Checklist