This started with some of the user's students being shown/taking and completing quizzes that are no longer associated with a course.
In the reporting for the quizzes the user tried to go in and delete the old/dissociated quizzes but this does not work and can be recreated on the staging site
When tracking down the quizzes they are still associated with the course they were removed from, however when you open the course or lesson in the builder the new correct quiz is associated with the lesson.
The Algebra 1 Quiz ID 5053 for example is associated with the AHSA Home Study High School Completion Program course, but in the course itself under Introduction to Mathematics lesson the correct quiz. (note there are two Algebra 1 quizzes that are both associated with the home study course and both are wrong).
The user says she has cloned the course before but the users are only ever enrolled in the original course.
When you try to open a new lesson to see the detached quiz to reattach it or do anything with that quiz you're only offered a cloning option.
If you delete the correct quiz (in staging) from the Introduction to Mathematics lesson you can still only clone the Algebra 1 Quiz
Expected Behavior
Users see the correct quiz (most seem to)
You can delete the dissociated quiz that is no longer in use
Actual Behavior
The delete quiz function isn't working
Quizzes that should have been dissociated from the course are still linked to it
Some students occasionally get shown the wrong quiz.
Error Messages / Logs
Include any relevant error messages or log files
Error Details
=============
An error of type E_ERROR was caused in line 78 of the file /nas/content/live/americanhsa/wp-content/plugins/lifterlms/includes/models/model.llms.quiz.php. Error message: Uncaught Error: Call to undefined method LLMS_Question::get_course() in /nas/content/live/americanhsa/wp-content/plugins/lifterlms/includes/models/model.llms.quiz.php:78
Stack trace:
#0 /nas/content/live/americanhsa/wp-content/plugins/lifterlms/includes/llms.functions.core.php(870): LLMS_Quiz->get_course()
#1 /nas/content/live/americanhsa/wp-content/plugins/lifterlms/includes/models/model.llms.instructor.php(298): llms_get_post_parent_course(Object(LLMS_Quiz))
#2 /nas/content/live/americanhsa/wp-content/plugins/lifterlms/includes/class.llms.user.permissions.php(126): LLMS_Instructor->is_instructor(7380)
#3 /nas/content/live/americanhsa/wp-content/plugins/lifterlms/includes/class.llms.user.permissions.php(248): LLMS_User_Permissions->edit_others_lms_content(Array, Array, Array)
#4 /nas/content/live/americanhsa/wp-includes/class-wp-hook.php(294): LLMS_User_Permissions->handle_caps(Array, Array, Array)
#5 /nas/content/live/americanhsa/wp-includes/plugin.php(212): WP_Hook->apply_filters(Array, Array)
#6 /nas/cont
### System and Environment Information
<details>
<summary>System Report</summary>
<!-- Paste your System Report between the three backticks below this line -->
Website: americanhighschoolacademy.com
Possible Issues:
The following may be contributing to your issue or causing errors on your site:
Your theme, Beaver Builder Child Theme, does not declare support for LifterLMS. If you're encountering issues with how LifterLMS content looks on your site, consider asking your theme developers to add LifterLMS support to your theme. See our theme compatibility tutorials for more information.
System Report:
Wordpress
Home Url: [removed]
Site Url: [removed]
Login Url: [removed]/wp-login.php
Version: 5.7.2
Debug Mode: No
Debug Log: No
Debug Display: Yes
Locale: en_US
Multisite: No
Page For Posts: Blog (#1928) [[removed]/blog]
Page On Front: Get Your High School Diploma (#629) [[removed]/]
Permalink Structure: /%postname%
Show On Front: page
Wp Cron: Yes
Settings
Version: 5.0.1
Db Version: 5.0.1
Course Catalog: Course Catalog (#2453) [[removed]/courses]
Membership Catalog: Membership Catalog (#2454) [[removed]/memberships]
Student Dashboard: Dashboard (#2456) [[removed]/dashboard]
Checkout Page: Adult High School Completion Program: Home Study Application (#7549) [[removed]/adult-high-school-completion-program/home-online-based-study-application]
Course Catalog Per Page: 1
Course Catalog Sorting: menu_order,ASC
Membership Catalog Per Page: 9
Membership Catalog Sorting: menu_order
Site Membership: Not Set
Courses Endpoint: my-courses
Edit Endpoint: edit-account
Lost Password Endpoint: lost-password
Vouchers Endpoint: student-enrollment
Autogenerate Username: yes
Password Strength Meter: yes
Minimum Password Strength: strong
Terms Required: yes
Terms Page: Enrollment Policies, Terms and Conditions (#2786) [[removed]/enrollment-policies-terms-and-conditions]
Checkout Names: required
Checkout Address: required
Checkout Phone: required
Checkout Email Confirmation: yes
Open Registration: yes
Registration Names: required
Registration Address: required
Registration Phone: required
Registration Voucher: required
Registration Email Confirmation: yes
Account Names: required
Account Address: required
Account Phone: required
Account Email Confirmation: yes
Confirmation Endpoint: confirm-enrollment
Force Ssl Checkout: yes
Country: US
Currency: USD
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Decimals: 2
Trim Zero Decimals: no
Recurring Payments: yes
Email From Address: [removed]
Email From Name: [removed]
Email Footer Text: AMERICAN HIGH SCHOOL ACADEMY
10300 SW 72nd St #427, Miami, FL 33173, USA
Tel: (305) 270-1440Fax: (305) 598-8003
Email Header Image: 1463
Cert Bg Width: 500
Cert Bg Height:
Cert Legacy Compat: no
Advanced Excerpt: 4.3.9
Beaver Builder Plugin (Pro Version): 2.4.2.4
Beaver Themer: 1.3.3.1
Cloudflare: 4.5.1
Code Snippets: 2.14.1
Fast User Switching: 1.4.9
Gravity Forms: 2.5.6
Gravity Forms Mailchimp Add-On: 4.9
Gravity Forms PayPal Payments Pro Add-On: 2.7
Gravity Forms PayPal Standard Add-On: 3.5
Gravity Forms User Registration Add-On: 4.8
Gravity PDF: 6.0.2
Imagify: 1.9.14
LifterLMS: 5.0.1
LifterLMS Advanced Quizzes: 1.1.1
LifterLMS Assignments: 1.1.13
LifterLMS Gravity Forms: 2.1.2
LifterLMS Helper: 3.3.0
LifterLMS MailChimp Add-on: 3.2.0
LifterLMS Private Areas: 1.1.4
PowerPack for Beaver Builder: 2.16.4
Rank Math SEO: 1.0.67
Simply Schedule Appointments: 3.4.6.3
Ultimate Addons for Beaver Builder: 1.31.1
Wordfence Security: 7.5.4
WP File Manager: 7.1.1
WPFront Notification Bar: 1.9.1.04012
Integrations
BbPress: No
BuddyPress: No
LifterLMS Gravity Forms: Yes
LifterLMS MailChimp: Yes
LifterLMS Private Areas: Yes
Template Overrides
</details>
This issue has be recreated:
+ [ ] Locally
+ [X] On a staging site
+ [X] On a production website
+ [X] With only LifterLMS and a default theme
### Browser, Device, and Operating System Information
+ Browser name and version
+ Operating System name and version
+ Device name and version (if applicable)
I can't investigate the claims that "The user is being served the wrong quiz" because the staging site appears to have already removed all instances of these quiz attempts. I ran through as a student and I was served the intended quiz (the quiz that is currently attached to the lesson). As far as I can tell this is working correctly.
The duplicate copies of the quiz should be able to be deleted. There's a bug here. We fixed something similar to this a while ago (see #1039). In this issue we were also unable to identify how the quizzes in question became "detached" but still had association with the lesson so they were kind of orphans. The deep check adds another check to ensure that the lesson's quiz attribute matches the quiz in question. In this case there's 3 quizzes referencing the lesson but the lesson only references one quiz (the correct one). When deleting the quiz we make sure it's an orphan so that "live" quizzes can't accidentally be deleted. Because we're not doing a "deep* check on the deletion validation it's not working right. Incoming PR to address this.
Reproduction Steps
Expected Behavior
Actual Behavior
Error Messages / Logs
Website: americanhighschoolacademy.com
Possible Issues: The following may be contributing to your issue or causing errors on your site:
Your theme, Beaver Builder Child Theme, does not declare support for LifterLMS. If you're encountering issues with how LifterLMS content looks on your site, consider asking your theme developers to add LifterLMS support to your theme. See our theme compatibility tutorials for more information. System Report: Wordpress
Home Url: [removed] Site Url: [removed] Login Url: [removed]/wp-login.php Version: 5.7.2 Debug Mode: No Debug Log: No Debug Display: Yes Locale: en_US Multisite: No Page For Posts: Blog (#1928) [[removed]/blog] Page On Front: Get Your High School Diploma (#629) [[removed]/] Permalink Structure: /%postname% Show On Front: page Wp Cron: Yes
Settings
Version: 5.0.1 Db Version: 5.0.1 Course Catalog: Course Catalog (#2453) [[removed]/courses] Membership Catalog: Membership Catalog (#2454) [[removed]/memberships] Student Dashboard: Dashboard (#2456) [[removed]/dashboard] Checkout Page: Adult High School Completion Program: Home Study Application (#7549) [[removed]/adult-high-school-completion-program/home-online-based-study-application] Course Catalog Per Page: 1 Course Catalog Sorting: menu_order,ASC Membership Catalog Per Page: 9 Membership Catalog Sorting: menu_order Site Membership: Not Set Courses Endpoint: my-courses Edit Endpoint: edit-account Lost Password Endpoint: lost-password Vouchers Endpoint: student-enrollment Autogenerate Username: yes Password Strength Meter: yes Minimum Password Strength: strong Terms Required: yes Terms Page: Enrollment Policies, Terms and Conditions (#2786) [[removed]/enrollment-policies-terms-and-conditions] Checkout Names: required Checkout Address: required Checkout Phone: required Checkout Email Confirmation: yes Open Registration: yes Registration Names: required Registration Address: required Registration Phone: required Registration Voucher: required Registration Email Confirmation: yes Account Names: required Account Address: required Account Phone: required Account Email Confirmation: yes Confirmation Endpoint: confirm-enrollment Force Ssl Checkout: yes Country: US Currency: USD Currency Position: left Thousand Separator: , Decimal Separator: . Decimals: 2 Trim Zero Decimals: no Recurring Payments: yes Email From Address: [removed] Email From Name: [removed] Email Footer Text: AMERICAN HIGH SCHOOL ACADEMY 10300 SW 72nd St #427, Miami, FL 33173, USA Tel: (305) 270-1440Fax: (305) 598-8003 Email Header Image: 1463 Cert Bg Width: 500 Cert Bg Height: Cert Legacy Compat: no
Constants
LLMS_REMOVE_ALL_DATA: undefined LLMS_REST_DISABLE: undefined LLMS_SITE_FEATURE_RECURRING_PAYMENTS: undefined LLMS_SITE_IS_CLONE: undefined
Gateways
Manual: Enabled Manual Logging: no Manual Order: 1
Server
Mysql Version: 5.7.34 Php Curl: Yes Php Default Timezone: UTC Php Fsockopen: Yes Php Max Input Vars: 10000 Php Max Upload Size: 50 MB Php Memory Limit: 1024M Php Post Max Size: 100M Php Soap: Yes Php Suhosin: No Php Time Limt: 3600 Php Version: 7.4.18 Software: Apache Wp Memory Limit: 512M
Browser
HTTP USER AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
Theme
Name: Beaver Builder Child Theme Version: 1.0 Themeuri: http://www.wpbeaverbuilder.com Authoruri: http://www.fastlinemedia.com Template: bb-theme Child Theme: Yes Llms Support: No
Plugins
Advanced Excerpt: 4.3.9 Beaver Builder Plugin (Pro Version): 2.4.2.4 Beaver Themer: 1.3.3.1 Cloudflare: 4.5.1 Code Snippets: 2.14.1 Fast User Switching: 1.4.9 Gravity Forms: 2.5.6 Gravity Forms Mailchimp Add-On: 4.9 Gravity Forms PayPal Payments Pro Add-On: 2.7 Gravity Forms PayPal Standard Add-On: 3.5 Gravity Forms User Registration Add-On: 4.8 Gravity PDF: 6.0.2 Imagify: 1.9.14 LifterLMS: 5.0.1 LifterLMS Advanced Quizzes: 1.1.1 LifterLMS Assignments: 1.1.13 LifterLMS Gravity Forms: 2.1.2 LifterLMS Helper: 3.3.0 LifterLMS MailChimp Add-on: 3.2.0 LifterLMS Private Areas: 1.1.4 PowerPack for Beaver Builder: 2.16.4 Rank Math SEO: 1.0.67 Simply Schedule Appointments: 3.4.6.3 Ultimate Addons for Beaver Builder: 1.31.1 Wordfence Security: 7.5.4 WP File Manager: 7.1.1 WPFront Notification Bar: 1.9.1.04012
Integrations
BbPress: No BuddyPress: No LifterLMS Gravity Forms: Yes LifterLMS MailChimp: Yes LifterLMS Private Areas: Yes
Template Overrides