Moodle
  1. Moodle
  2. MDL-29368

htmllize_tree() :: undefined function get_plagiarism_links()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.5, 2.1.2, 2.2
    • Fix Version/s: 2.0.6, 2.1.3
    • Labels:
      None
    • Environment:
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      This requires two users a teacher and a student

      1. As a teacher Create an Assignment using the Advanced uploading of files type.
      2. As a student upload a file to the newly created assignment.
      3. As the teacher view the submitted assignments
      4. Next as the teacher click on the name of the student who uploaded the file.
      5. In the navigation block browse to Coursename -> Participants -> StudentName -> Activity Reports -> complete report

      Verify that the student submission is shown

      Show
      This requires two users a teacher and a student 1. As a teacher Create an Assignment using the Advanced uploading of files type. 2. As a student upload a file to the newly created assignment. 3. As the teacher view the submitted assignments 4. Next as the teacher click on the name of the student who uploaded the file. 5. In the navigation block browse to Coursename -> Participants -> StudentName -> Activity Reports -> complete report Verify that the student submission is shown
    • Workaround:
      Hide

      A temporary fix is to require the plagiarismlib on line 53 of the /mod/assignment/renderer.php file:

      require_once($CFG->libdir.'plagiarismlib.php');

      Show
      A temporary fix is to require the plagiarismlib on line 53 of the /mod/assignment/renderer.php file: require_once($CFG->libdir.'plagiarismlib.php');
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Rank:
      18891

      Description

      Background: We have recently upgraded from 1.9 to 2.1.

      Issue:
      When viewing a course participant report (/course/user.php?userid=xxxx&id=yyy&mode=complete), page rendering fails at line 69 of mod_assignment_renderer (/assignment/renderer/renderer.php).

      The offending line:

      $plagiarsmlinks = plagiarism_get_links(array('userid'=>$file->get_userid(), 'file'=>$file, 'cmid'=>$tree->cm->id, 'course'=>$tree->course));

      This will only happen if there are user-submitted files for the assignment.

      A temporary fix is to require the plagiarismlib on line 53 of this file:

      require_once($CFG->libdir.'plagiarismlib.php');

      I imagine that this could happen at other locations, as there are multiple instances of htmllize_tree() and get_plagiarism_links() in other modules.

      I have enabled plagiarism in the system config, to no avail (and I don't see logic dictating to include the plagiarismlib based on it)

      I'm new to Moodle, just can't quite follow the path or find how classes are (auto?)loaded...I may just be missing a configuration param.

        Issue Links

          Activity

          Hide
          Stephen Bourget added a comment -

          I ran into the same problem. I've attached the fix that I've been using.

          Show
          Stephen Bourget added a comment - I ran into the same problem. I've attached the fix that I've been using.
          Hide
          Stephen Bourget added a comment -

          Dan,

          It looks like you wrote most of the code for the Plagiarism api. Can you peer review this fix? It's similar to the fix from MDL-29564.

          Thanks

          Show
          Stephen Bourget added a comment - Dan, It looks like you wrote most of the code for the Plagiarism api. Can you peer review this fix? It's similar to the fix from MDL-29564 . Thanks
          Hide
          Blair Patterson added a comment -

          Thanks Stephen - we just had to re-patch after an upgrade, so this is great news!

          Any idea which update this patch will be included in?

          Show
          Blair Patterson added a comment - Thanks Stephen - we just had to re-patch after an upgrade, so this is great news! Any idea which update this patch will be included in?
          Hide
          Stephen Bourget added a comment -

          Hopefully in one of the 2.1.2+ releases but that depends on how long it takes to get through both the peer and integration review process. See: http://docs.moodle.org/dev/Process

          Show
          Stephen Bourget added a comment - Hopefully in one of the 2.1.2+ releases but that depends on how long it takes to get through both the peer and integration review process. See: http://docs.moodle.org/dev/Process
          Hide
          Dan Marsden added a comment -

          I was sure that I'd dealt with this one - must have forgotten as it was re-assigned - assigning back to me - will get this applied sometime this week - thanks for the report!

          Dan

          Show
          Dan Marsden added a comment - I was sure that I'd dealt with this one - must have forgotten as it was re-assigned - assigning back to me - will get this applied sometime this week - thanks for the report! Dan
          Hide
          Stephen Bourget added a comment -

          Dan,

          It's a similar issue to MDL-29564, but not the same. MDL-29564 was missing the include in mod/assignment/lib.php and appeared with the upload single assignment type. This bug affects mod/assignment/renderer.php and affects the advanced upload assignment type. Both issues appeared on the course overview report.

          -Steve

          Show
          Stephen Bourget added a comment - Dan, It's a similar issue to MDL-29564 , but not the same. MDL-29564 was missing the include in mod/assignment/lib.php and appeared with the upload single assignment type. This bug affects mod/assignment/renderer.php and affects the advanced upload assignment type. Both issues appeared on the course overview report. -Steve
          Hide
          Dan Marsden added a comment -

          Thanks Stephen - passing this through now!

          NOTE TO INTEGRATOR:
          This needs to be applied to master, 21Stable and 20Stable branches - The patch from Steven above:
          e444aec9e17fa320eaccfe07f884e76937dd4e02

          Applies cleanly to all branches

          thanks!

          Show
          Dan Marsden added a comment - Thanks Stephen - passing this through now! NOTE TO INTEGRATOR: This needs to be applied to master, 21Stable and 20Stable branches - The patch from Steven above: e444aec9e17fa320eaccfe07f884e76937dd4e02 Applies cleanly to all branches thanks!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Done, applied to 20, 21 and master. Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Done, applied to 20, 21 and master. Thanks!
          Hide
          Sam Hemelryk added a comment -

          Passed thanks guys

          Show
          Sam Hemelryk added a comment - Passed thanks guys
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Done, your delicious hacks have been sent upstream, many thanks!

          Closing as fixed, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Done, your delicious hacks have been sent upstream, many thanks! Closing as fixed, ciao

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: