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

Properly determine a submitted quiz #7278

Merged
merged 4 commits into from Nov 9, 2023
Merged

Conversation

merkushin
Copy link
Member

Resolves #7276

Proposed Changes

  • Add a method to the quiz progress to determine if the quiz has been submitted.
  • Fix legacy check of the status.
  • Fix pagination not showing in an edge case (when a lesson was completed, but then a quiz was added, we visit the quiz on the frontend —it is not submitted yet— and see all the questions on one page).

Testing Instructions

  1. Publish a lesson.
  2. Complete the lesson as a student.
  3. Add a quiz with a few questions and pagination to that lesson and update it.
  4. As a student, go to the quiz.
  5. You should see proper placement of buttons in the footer (quiz template) and paginated output of questions (for example, you see only one question per page if you set it that way, so you don't see all questions on one page).

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@merkushin merkushin added this to the 4.19.2 milestone Nov 8, 2023
@merkushin merkushin requested a review from a team November 8, 2023 20:54
@merkushin merkushin self-assigned this Nov 8, 2023
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

Merging #7278 (852b4a2) into trunk (8e68ffa) will increase coverage by 0.27%.
Report is 7 commits behind head on trunk.
The diff coverage is 77.94%.

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #7278      +/-   ##
============================================
+ Coverage     50.59%   50.86%   +0.27%     
- Complexity    10975    11022      +47     
============================================
  Files           608      610       +2     
  Lines         46286    46552     +266     
  Branches        402      402              
============================================
+ Hits          23417    23678     +261     
- Misses        22542    22547       +5     
  Partials        327      327              
Files Coverage Δ
includes/class-sensei-lesson.php 36.20% <100.00%> (ø)
includes/class-sensei-quiz.php 69.48% <100.00%> (ø)
...es/course-theme/class-sensei-course-theme-quiz.php 44.00% <100.00%> (+44.00%) ⬆️
...urse-theme/class-sensei-course-theme-templates.php 14.04% <100.00%> (+3.40%) ⬆️
...z-progress/models/class-quiz-progress-abstract.php 86.79% <100.00%> (+9.01%) ⬆️
...-progress/models/class-quiz-progress-interface.php 50.00% <ø> (ø)
...i/class-sensei-rest-api-question-helpers-trait.php 92.78% <100.00%> (+0.80%) ⬆️
includes/class-sensei-cli.php 0.00% <0.00%> (ø)
...des/cli/class-sensei-validate-progress-command.php 0.00% <0.00%> (ø)
.../class-sensei-validate-quiz-submission-command.php 0.00% <0.00%> (ø)
... and 1 more

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7a8423...852b4a2. Read the comment docs.

@merkushin merkushin marked this pull request as ready for review November 9, 2023 00:59
Copy link
Member

@m1r0 m1r0 left a 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.

@merkushin merkushin merged commit ce1b256 into trunk Nov 9, 2023
24 checks passed
@merkushin merkushin deleted the fix/quiz-complete-status branch November 9, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use proper student progress when determine the template for a quiz
2 participants