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

Plagiarism API needs to use the context/component/area/itemid pattern



    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.8.1
    • Fix Version/s: None
    • Component/s: Plagiarism
    • Labels:
    • Affected Branches:


      Currently the plagiarism API has a call to plagiarism_get_links()

       * displays the similarity score and provides a link to the full report if allowed.
       * @param object  $linkarray contains all relevant information for the plugin to generate a link                                    
       * @return string - url to allow login/viewing of a similarity report
      function plagiarism_get_links($linkarray)

      This does not describe what is expected in the linkarray. This means that the plugins adding plagiarism support, each pass different custom data, and the plagiarism plugins each get custom coded to work with specific modules only.

      Current known abuses are "mod/assign/submission/onlinetext/locallib.php" passing the entire "assignment" record, and mod_forum passing the entire forum record.

      We should deprecate the passing of these module specific data structures, and insist on the magic 4 "context/component/area/itemid" passing through this API always (as well as "content" or "file" params).

      This is an API change - so master only at first and we can consider backporting just some phpdocs to say not to use this wrong data.


          Issue Links



              • Votes:
                1 Vote for this issue
                5 Start watching this issue


                • Created: