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

Use student progress models on the frontend #7185

Merged
merged 22 commits into from
Oct 10, 2023

Conversation

merkushin
Copy link
Member

@merkushin merkushin commented Sep 26, 2023

Resolves part of #7150

  • Here I also changed logic for table reading quiz progress repository, to create lesson progress if it doesn't exist yet (creating a quiz progress leads to an error).
  • In student progress migration, I added handling for the failed status. It is not very efficient as it performs a query in the loop. Any ideas on how it improve?
  • When table reading is enabled, tests fail: we need to update code for quiz submission, then tests themselves to make them green.

Proposed Changes

  • Add a find method for progress repositories to get multiple progress entries.
  • Adjust client code on the frontend to use new progress storage instead of activity comments.
  • Adjust client code to use separated lesson/quiz progress behavior.

Testing Instructions

  1. Create a course with a few lessons with quizzes.
  2. Create a few students.
  3. Without enabling the feature, complete a course. Make sure frontend looks good (correctly displays the progress), you can see submissions and try to grade them.
  4. Enable the tables-based progress feature, complete a course. Make sure frontend looks good (correctly displays the progress), you can see submissions and try to grade them.
  5. Run migration.
  6. Enable reading from tables. Make sure frontend looks good (correctly displays the progress), you can see submissions and try to grade them.
  7. Reset progress. Make sure you don't see progress on the frontend.

New/Updated Hooks

Deprecated Code

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.17.1 milestone Sep 26, 2023
@merkushin merkushin requested a review from m1r0 September 26, 2023 03:43
@merkushin merkushin self-assigned this Sep 26, 2023
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #7185 (ac5e9a4) into trunk (a8ad8a8) will increase coverage by 0.24%.
Report is 1 commits behind head on trunk.
The diff coverage is 69.15%.

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #7185      +/-   ##
============================================
+ Coverage     50.06%   50.31%   +0.24%     
- Complexity    10720    10860     +140     
============================================
  Files           601      601              
  Lines         45231    45673     +442     
  Branches        402      402              
============================================
+ Hits          22647    22980     +333     
- Misses        22257    22366     +109     
  Partials        327      327              
Files Coverage Δ
.../course-theme/class-sensei-course-theme-lesson.php 94.56% <100.00%> (+0.09%) ⬆️
...t-reading-aggregate-course-progress-repository.php 100.00% <100.00%> (ø)
...ories/class-course-progress-repository-factory.php 100.00% <100.00%> (ø)
...e-reading-aggregate-course-progress-repository.php 95.12% <100.00%> (+0.25%) ⬆️
...progress/models/class-lesson-progress-abstract.php 86.84% <100.00%> (+0.35%) ⬆️
...t-reading-aggregate-lesson-progress-repository.php 100.00% <100.00%> (ø)
...ories/class-lesson-progress-repository-factory.php 100.00% <100.00%> (ø)
...z-progress/models/class-quiz-progress-abstract.php 77.77% <100.00%> (+0.50%) ⬆️
...ent-reading-aggregate-quiz-progress-repository.php 100.00% <100.00%> (ø)
...itories/class-quiz-progress-repository-factory.php 100.00% <100.00%> (ø)
... and 25 more

... and 1 file 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 a560b3e...ac5e9a4. Read the comment docs.

@merkushin merkushin force-pushed the update/use-student-progress-models branch from 657271d to 7da2cab Compare September 29, 2023 06:59
@merkushin merkushin changed the title WIP: Use student progress models Use student progress models Oct 1, 2023
@merkushin merkushin changed the title Use student progress models Use student progress models on the frontend Oct 1, 2023
@merkushin merkushin marked this pull request as ready for review October 1, 2023 21:45
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.

While testing I wasn't able to find any bugs, which is amazing for such a big change! 💯 I did find just a few small things.

For the record, it's totally possible that I've missed something... 😅

includes/class-sensei-grading.php Outdated Show resolved Hide resolved
includes/class-sensei-lesson.php Outdated Show resolved Hide resolved
includes/class-sensei-quiz.php Outdated Show resolved Hide resolved
includes/class-sensei-quiz.php Outdated Show resolved Hide resolved
includes/class-sensei-utils.php Show resolved Hide resolved
includes/template-functions.php Outdated Show resolved Hide resolved
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! I've tested the base flow and didn't find any issues.

@merkushin merkushin merged commit 7a5caf4 into trunk Oct 10, 2023
23 checks passed
@merkushin merkushin deleted the update/use-student-progress-models branch October 10, 2023 18:53
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.

2 participants