-
Notifications
You must be signed in to change notification settings - Fork 198
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
Fix timed quiz still working for students even after time ends #7675
Fix timed quiz still working for students even after time ends #7675
Conversation
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #7675 +/- ##
============================================
+ Coverage 51.92% 52.37% +0.44%
- Complexity 11449 11463 +14
============================================
Files 651 653 +2
Lines 48659 48761 +102
Branches 468 480 +12
============================================
+ Hits 25268 25537 +269
+ Misses 23012 22835 -177
- Partials 379 389 +10 see 9 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
assets/css/frontend.scss
Outdated
@@ -403,6 +403,10 @@ a.sensei-certificate-link { | |||
} | |||
} | |||
|
|||
.sensei-item-no-display { |
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 should be following the BEM standards here and use a modifier to indicate the state change instead of adding a new class (i.e. --hidden
). Hopefully we can put this CSS in a file that only loads for quizzes instead of adding it to this catch-all file.
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.
Thanks for the suggestion @donnapep ! I've implemented the changes here f920701 .
Initially I used a more generic class and placed it in a catch-all file because I was envisioning it a bit like bootstrap
or tailwind
's general purpose class to hide an element. To avoid having display: none
for many different classes in many files. But I've changed it now.
An additional note is that we didn't have any specific stylesheet that loads only for single Quizzes. So I've added one, and adding this style only there. Styles for quizzes used to go into some catch-all files. I haven't moved those quiz specific styles in this PR to avoid risk of breaking and also that'd be out of scope for this PR. But moving the quiz specific styles from general stylesheet to this new quiz specific stylesheet will probably be a good idea once we are done with bugs and important enhancements. Should I create an issue for that?
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.
Should I create an issue for that?
Sure!
@Imran92 Can you please address the feedback in this one? 🙇🏻♀️ |
Test the previous changes of this PR with WordPress Playground. |
WordPress Dependencies ReportThe
This comment was automatically generated by the |
Test the previous changes of this PR with WordPress Playground. |
This reverts commit 7c1a484.
This reverts commit 7c1a484.
…tps://github.com/Automattic/sensei into fix/timed-quiz-input-not-stopping-when-time-ends
Test the previous changes of this PR with WordPress Playground. |
Thanks Donna! I've updated it here #7675 (comment) |
Test the previous changes of this PR with WordPress Playground. |
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.
Looks good to me and works as described!
I think having the quiz CSS in a separate file is a good idea so 👍. Thanks for the tests as well!
Resolves https://github.com/Automattic/sensei-pro/issues/2606
Proposed Changes
In timed quizzes, when time is up, the frontend code clicks the completion button to submit the quiz. But in the cases where the quiz was paginated, completion button only got rendered on the last page. So if the student was not on the last page, the quiz didn't get submitted, and the student was still able to answer.
To fix that, we're rendering the button even in the middle pages so that the completion function still works, but keeping it hidden in those cases so that UI doesn't break or change from before.
Testing Instructions
Multi Page
and setper page
value to 1 or a small number to generate many pagesQuiz Timer
option, set a small timePre-Merge Checklist