ModuleResultForm doesn't complete LP if passed

Created on 30 April 2025, about 1 month ago

Problem/Motivation

When manually scoring a Learning Path, the ModuleResultForm doesn't check and update the Learning Path status. This results in an odd state in which the module(s) are complete, but not the LP.

Steps to reproduce

  1. Create a new Learning Path with a single module, and a single file upload activity
  2. Require the activity to be manually scored
  3. Have a user complete the activity
  4. Manually score the user as passed
  5. The user will show a completed Module Status, but an incomplete Learning Path status

Proposed resolution

Modify the ::submitForm() to also check if the LP has passed.

Remaining tasks

Create patch.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

3.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States socketwench

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @socketwench
  • πŸ‡ΊπŸ‡ΈUnited States socketwench

    This patch adds a check to complete the Learning Path in the form. This works, but as I borrowed this from OpignoModuleController::userStatus(), I feel the problem is architectural. Either way, this works to correct the fault for manual scoring.

  • πŸ‡ΊπŸ‡ΈUnited States socketwench

    This updated patch corrects a fault where the step achievements also do not score correctly, resulting in an issue where the opigno_statistics.training route does not display the expected completion amount.

  • πŸ‡ΊπŸ‡ΈUnited States socketwench

    In https://www.drupal.org/project/opigno_learning_path/issues/3523674 πŸ› LpSteps::getCourseStep should include max score Active it was discovered that the completion logic still doesn't work as expected. This patch corrects the issue (hopefully for the last time) along with the referenced opigno_learning_path patch.

  • πŸ‡ΊπŸ‡ΈUnited States socketwench
  • πŸ‡ΊπŸ‡ΈUnited States socketwench

    In https://www.drupal.org/project/opigno_learning_path/issues/3524000 πŸ› LpSteps::getCourseStep should include attempts allowed Active we also found out that we need to compare the number of attempts compared to the maximum allowed attempts for each mandatory step to be sure the LP should be marked as "failed" rather than just "incomplete".

    This patch updates the logic to include the fix, but also requires the patch from the above issue in order to work.

Production build 0.71.5 2024