Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-58227

New feedback attempts create new entries in feedback_completed (instead resetting the last attempt)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.1.6, 3.2.3
    • Component/s: Feedback
    • Labels:
    • Testing Instructions:
      Hide
      1. Before applying the patch create a feedback with at least one question configured to enable multiple attempts
      2. With the same user complete the feedback a couple of times
      3. Check in the DB that the feedback_completed table have two rows with the same userid, feedback and courseid
      4. Apply the patch and run the upgrade
      5. Check in the DB that the first duplicatd row has been deleted
      6. With the same user again complete the feedback
      7. Check in the DB that no new rows are created in feedback_completed, instead the timestamp has been updated
      8. Now open the feedback_value table, filtering by rows related to the last completed feedback (filter by the completed field)
      9. With the same user again complete the feedback using different response values
      10. Check that in the feeedback_value table the responses values are updated and no new records are created
      Show
      Before applying the patch create a feedback with at least one question configured to enable multiple attempts With the same user complete the feedback a couple of times Check in the DB that the feedback_completed table have two rows with the same userid, feedback and courseid Apply the patch and run the upgrade Check in the DB that the first duplicatd row has been deleted With the same user again complete the feedback Check in the DB that no new rows are created in feedback_completed, instead the timestamp has been updated Now open the feedback_value table, filtering by rows related to the last completed feedback (filter by the completed field) With the same user again complete the feedback using different response values Check that in the feeedback_value table the responses values are updated and no new records are created
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-58227-master

      Description

      I think that this was introduced by MDL-53638, this line is incorrect:

      https://github.com/moodle/moodle/blob/master/mod/feedback/classes/completion.php#L520

      It should be: if (!isloggedin() || isguestuser()) {

      This is causing that in every new attempt, a new entry in the feedback_completed table is created, this is not expected behaviour because as you can see some lines bellow, it is expected to have just one entry per feedback in that table.

      I think this is causing unexpected behaviours like the one reported in MDL-58011

      The fix for this is not trivial because it will require an upgrade step to remove the extra entries in the feedback table.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/May/17