gocodebox / lifterlms

LifterLMS, a WordPress LMS Solution: Easily create, sell, and protect engaging online courses.
https://lifterlms.com
GNU General Public License v3.0
185 stars 135 forks source link

Detached Quizzes Still Attached to Courses/Not Deletable #1694

Closed nrherron92 closed 3 years ago

nrherron92 commented 3 years ago

Reproduction Steps

Expected Behavior

Actual Behavior

Error Messages / Logs


### 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:

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



</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)
nrherron92 commented 3 years ago

bump?

thomasplevy commented 3 years ago

@nrherron92 I lost track of this one, I'll have a look today

thomasplevy commented 3 years ago
  1. 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.
  2. 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.