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

Undefined variable error when onlinetext assignment submission deleted

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MDL-73215-undef-plagiarismlinks-311
    • MDL-73215-undef-plagiarismlinks-400
    • MDL-73215-undef-plagiarismlinks
    • Hide
      1. Change debug level to DEVELOPER.
        Easier on mdk: Run "mdk run mindev"
      2. Create a course.
      3. Enrol a student.
      4. Add an assignment activity with Submission types: Online text.
      5. As the student go to the assignment, click Add submission, type some text in the editor and click Save changes.
      6. As an admin:
        1. go to the assignment;
        2. click View all submissions;
        3. select the checkbox for the above student;
        4. for With selected... select Remove submission;
        5. click Go.
      7. As the admin click the magnifying glass icon for the student's submission.

      Expected results

      The submission page appears without the student's submitted text. No errors are shown.

      Note: With the default Boost theme errors may be hidden behind the bar at the top of the page. You may need to reduce the width of the browser window (on my computer to approximately 900 pixels wide) to see any errors. Alternatively, check the PHP error log to confirm no error has been logged.

      Show
      Change debug level to DEVELOPER. Easier on mdk: Run " mdk run mindev " Create a course. Enrol a student. Add an assignment activity with Submission types : Online text . As the student go to the assignment, click Add submission , type some text in the editor and click Save changes . As an admin: go to the assignment; click View all submissions ; select the checkbox for the above student; for With selected... select Remove submission ; click Go . As the admin click the magnifying glass icon for the student's submission. Expected results The submission page appears without the student's submitted text. No errors are shown. Note: With the default Boost theme errors may be hidden behind the bar at the top of the page. You may need to reduce the width of the browser window (on my computer to approximately 900 pixels wide) to see any errors. Alternatively, check the PHP error log to confirm no error has been logged.

    Description

      If a learner submits an assignsubmission_onlinetext assignment submission, and the submission data is deleted by the admin the empty submission can be viewed but with the error:

      Undefined variable: plagiarismlinks in /var/www/moodle/mod/assign/submission/onlinetext/locallib.php on line 483

      Steps to reproduce issue:

      1. Change debug level to DEVELOPER.
      2. Create a course.
      3. Enrol a student.
      4. Add an assignment activity with Submission types: Online text.
      5. As the student go to the assignment, click Add submission, enter some text and click Save changes.
      6. As an admin go to the assigment, click View all submissions, select the checkbox for the above student, for With selected... select Remove submission and click Go.
      7. Click the magnifying glass icon for the student's submission.

      Expected results

      The submission page with no data. No errors are shown.

      Actual results

      At the top of the page (possibly hidden under the navbar at the top) is the error "Notice: Undefined variable: plagiarismlinks in /var/www/moodle/mod/assign/submission/onlinetext/locallib.php on line 483". This also appears in the PHP error log.

      Attachments

        1. MDL-73215_311.patch
          0.1 kB
        2. TestOk_311.jpg
          TestOk_311.jpg
          72 kB
        3. TestOk_400_master.jpg
          TestOk_400_master.jpg
          47 kB
        4. TestOk_400.jpg
          TestOk_400.jpg
          44 kB

        Activity

          People

            leonstr Leon Stringer
            leonstr Leon Stringer
            Sujith Haridasan Sujith Haridasan
            Simey Lameze Simey Lameze
            Raquel Ortega Raquel Ortega
            Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              22/Aug/22

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 3 minutes
                3h 3m