diff --git a/CHANGELOG.md b/CHANGELOG.md index 00814e4..82e8cb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +### Date: 2021-June-01 +### Release: v2021060101 + +#### :zap: What's new + +--- + +#### Support for Moodle 3.11 + +You can now confidently use Turnitin with Moodle 3.11. + +#### Retain assignment settings and submissions after a course restore in a new environment + +Turnitin already supports Moodle’s backup and store functionality, this change gives the same functionality when restoring to a different environment from the original backup. + +#### :wrench: Fixes and enhancements + +--- + +#### New CSS class name prefix + +To help conform to Moodle guidelines, all classes within the plugin are now prefixed with ‘turnitinsim_’. This change will help avoid any potential styling conflicts. + +#### Draft submissions will not stick in pending status + +A bug had caused some draft submissions to stick in ‘pending’ status and not generate a Similarity Report. This bug has now been fixed and draft submissions will generate Similarity Reports if enabled. + +#### Accept the Turnitin EULA after forum posts have been made + +If an Instructor had not previously accepted the Turnitin EULA, but students had already started to post to a Moodle Forum, the instructor wouldn’t be given another chance to accept it. We will now show the EULA acceptance option to any users who haven’t previously accepted it. + +#### Change the default activity tracking moodle setting + +A bug had prevented users from being able to alter the default activity tracking setting within Moodle when Turnitin was also enabled. This bug has now been fixed, and you can use this feature alongside Turnitin without error. + +--- + ### Date: 2021-March-09 ### Release: v2021030901 diff --git a/amd/build/cv_launch.min.js b/amd/build/cv_launch.min.js index fb3b5e8..bfe7931 100644 --- a/amd/build/cv_launch.min.js +++ b/amd/build/cv_launch.min.js @@ -1,2 +1,2 @@ -define ("plagiarism_turnitinsim/cv_launch",["jquery"],function(a){return{openCv:function openCv(){a(document).on("click",".or_score",function(){var b=a(this).parent().attr("class").split(/\s+/),c=0;a(b).each(function(a){if(b[a].match("^submission_")){c=b[a].split("_")[1]}});var d=M.cfg.wwwroot+"/plagiarism/turnitinsim/pix/tiiLogo.svg",e=window.open();e.document.write("");e.document.write("");a(e.document.body).html("
");a.ajax({type:"GET",url:M.cfg.wwwroot+"/plagiarism/turnitinsim/ajax/cv.php",dataType:"json",data:{action:"request_cv_launch",submissionid:c,sesskey:M.cfg.sesskey},success:function success(a){e.location=a.viewer_url;this.checkDVClosed(e)},checkDVClosed:function checkDVClosed(a){var b=this;if(a.closed){window.location=window.location+""}else{setTimeout(function(){b.checkDVClosed(a)},500)}}})})}}}); +define ("plagiarism_turnitinsim/cv_launch",["jquery"],function(a){return{openCv:function openCv(){a(document).on("click",".turnitinsim_or_score",function(){var b=a(this).parent().attr("class").split(/\s+/),c=0;a(b).each(function(a){if(b[a].match("^submission_")){c=b[a].split("_")[1]}});var d=M.cfg.wwwroot+"/plagiarism/turnitinsim/pix/turnitin-logo.png",e=window.open();e.document.write("");e.document.write("");a(e.document.body).html("
");a.ajax({type:"GET",url:M.cfg.wwwroot+"/plagiarism/turnitinsim/ajax/cv.php",dataType:"json",data:{action:"request_cv_launch",submissionid:c,sesskey:M.cfg.sesskey},success:function success(a){e.location=a.viewer_url;this.checkDVClosed(e)},checkDVClosed:function checkDVClosed(a){var b=this;if(a.closed){window.location=window.location+""}else{setTimeout(function(){b.checkDVClosed(a)},500)}}})})}}}); //# sourceMappingURL=cv_launch.min.js.map diff --git a/amd/build/cv_launch.min.js.map b/amd/build/cv_launch.min.js.map index 9e10d1a..48095d2 100644 --- a/amd/build/cv_launch.min.js.map +++ b/amd/build/cv_launch.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/cv_launch.js"],"names":["define","$","openCv","document","on","classList","parent","attr","split","submissionid","each","index","match","icon","M","cfg","wwwroot","cvWindow","window","open","write","body","html","ajax","type","url","dataType","data","action","sesskey","success","location","viewer_url","checkDVClosed","that","closed","setTimeout"],"mappings":"AA4BAA,OAAM,oCAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAC3B,MAAO,CACHC,MAAM,CAAE,iBAAW,CACfD,CAAC,CAACE,QAAD,CAAD,CAAYC,EAAZ,CAAe,OAAf,CAAwB,WAAxB,CAAqC,UAAW,IAGxCC,CAAAA,CAAS,CAAGJ,CAAC,CAAC,IAAD,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B,CAC9B,GAAIiB,CAAAA,CAAI,CAAG,IAAX,CACA,GAAIjB,CAAQ,CAACkB,MAAb,CAAqB,CACjBjB,MAAM,CAACa,QAAP,CAAkBb,MAAM,CAACa,QAAP,CAAkB,EACvC,CAFD,IAEO,CACHK,UAAU,CAAC,UAAW,CAClBF,CAAI,CAACD,aAAL,CAAmBhB,CAAnB,CACH,CAFS,CAEP,GAFO,CAGb,CACJ,CAvBE,CAAP,CAyBH,CAxDD,CAyDH,CA3DE,CA6DV,CA9DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for the Turnitin Cloud Viewer launch.\n *\n * @package plagiarism_turnitinsim\n * @copyright 2017 Turnitin\n * @author John McGettrick \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * @module plagiarism_turnitinsim/cv_launch\n */\n\ndefine(['jquery'], function($) {\n return {\n openCv: function() {\n $(document).on('click', '.or_score', function() {\n\n // Moodle forums strip ids from elements so we have to use classes.\n var classList = $(this).parent().attr('class').split(/\\s+/);\n var submissionid = 0;\n $(classList).each(function(index) {\n if (classList[index].match(\"^submission_\")) {\n submissionid = classList[index].split(\"_\")[1];\n }\n });\n\n // Launch the Cloud Viewer in a new window.\n var icon = M.cfg.wwwroot + '/plagiarism/turnitinsim/pix/tiiLogo.svg';\n var cvWindow = window.open();\n\n cvWindow.document.write('');\n cvWindow.document.write('');\n\n var loading = '
' +\n '
' +\n '' +\n '
' +\n '
' +\n '' +\n '' +\n '' +\n '
' +\n '
';\n $(cvWindow.document.body).html(loading);\n\n $.ajax({\n type: \"GET\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitinsim/ajax/cv.php\",\n dataType: \"json\",\n data: {\n action: 'request_cv_launch',\n submissionid: submissionid,\n sesskey: M.cfg.sesskey\n },\n success: function(data) {\n // Redirect opened window to returned URL.\n cvWindow.location = data.viewer_url;\n this.checkDVClosed(cvWindow);\n },\n checkDVClosed: function(cvWindow) {\n var that = this;\n if (cvWindow.closed) {\n window.location = window.location + '';\n } else {\n setTimeout(function() {\n that.checkDVClosed(cvWindow);\n }, 500);\n }\n }\n });\n });\n }\n };\n});"],"file":"cv_launch.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/cv_launch.js"],"names":["define","$","openCv","document","on","classList","parent","attr","split","submissionid","each","index","match","icon","M","cfg","wwwroot","cvWindow","window","open","write","body","html","ajax","type","url","dataType","data","action","sesskey","success","location","viewer_url","checkDVClosed","that","closed","setTimeout"],"mappings":"AA4BAA,OAAM,oCAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAC3B,MAAO,CACHC,MAAM,CAAE,iBAAW,CACfD,CAAC,CAACE,QAAD,CAAD,CAAYC,EAAZ,CAAe,OAAf,CAAwB,uBAAxB,CAAiD,UAAW,IAGpDC,CAAAA,CAAS,CAAGJ,CAAC,CAAC,IAAD,CAAD,CAAQK,MAAR,GAAiBC,IAAjB,CAAsB,OAAtB,EAA+BC,KAA/B,CAAqC,KAArC,CAHwC,CAIpDC,CAAY,CAAG,CAJqC,CAKxDR,CAAC,CAACI,CAAD,CAAD,CAAaK,IAAb,CAAkB,SAASC,CAAT,CAAgB,CAC9B,GAAIN,CAAS,CAACM,CAAD,CAAT,CAAiBC,KAAjB,CAAuB,cAAvB,CAAJ,CAA4C,CACxCH,CAAY,CAAGJ,CAAS,CAACM,CAAD,CAAT,CAAiBH,KAAjB,CAAuB,GAAvB,EAA4B,CAA5B,CAClB,CACJ,CAJD,EALwD,GAYpDK,CAAAA,CAAI,CAAGC,CAAC,CAACC,GAAF,CAAMC,OAAN,CAAgB,+CAZ6B,CAapDC,CAAQ,CAAGC,MAAM,CAACC,IAAP,EAbyC,CAexDF,CAAQ,CAACd,QAAT,CAAkBiB,KAAlB,CAAwB,iEACKN,CAAC,CAACC,GAAF,CAAMC,OADX,qDAAxB,EAEAC,CAAQ,CAACd,QAAT,CAAkBiB,KAAlB,CAAwB,gBAAxB,EAYAnB,CAAC,CAACgB,CAAQ,CAACd,QAAT,CAAkBkB,IAAnB,CAAD,CAA0BC,IAA1B,CAVc,wFAE6CT,CAF7C,+NAUd,EAEAZ,CAAC,CAACsB,IAAF,CAAO,CACHC,IAAI,CAAE,KADH,CAEHC,GAAG,CAAEX,CAAC,CAACC,GAAF,CAAMC,OAAN,CAAgB,qCAFlB,CAGHU,QAAQ,CAAE,MAHP,CAIHC,IAAI,CAAE,CACFC,MAAM,CAAE,mBADN,CAEFnB,YAAY,CAAEA,CAFZ,CAGFoB,OAAO,CAAEf,CAAC,CAACC,GAAF,CAAMc,OAHb,CAJH,CASHC,OAAO,CAAE,iBAASH,CAAT,CAAe,CAEpBV,CAAQ,CAACc,QAAT,CAAoBJ,CAAI,CAACK,UAAzB,CACA,KAAKC,aAAL,CAAmBhB,CAAnB,CACH,CAbE,CAcHgB,aAAa,CAAE,uBAAShB,CAAT,CAAmB,CAC9B,GAAIiB,CAAAA,CAAI,CAAG,IAAX,CACA,GAAIjB,CAAQ,CAACkB,MAAb,CAAqB,CACjBjB,MAAM,CAACa,QAAP,CAAkBb,MAAM,CAACa,QAAP,CAAkB,EACvC,CAFD,IAEO,CACHK,UAAU,CAAC,UAAW,CAClBF,CAAI,CAACD,aAAL,CAAmBhB,CAAnB,CACH,CAFS,CAEP,GAFO,CAGb,CACJ,CAvBE,CAAP,CAyBH,CAxDD,CAyDH,CA3DE,CA6DV,CA9DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for the Turnitin Cloud Viewer launch.\n *\n * @package plagiarism_turnitinsim\n * @copyright 2017 Turnitin\n * @author John McGettrick \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * @module plagiarism_turnitinsim/cv_launch\n */\n\ndefine(['jquery'], function($) {\n return {\n openCv: function() {\n $(document).on('click', '.turnitinsim_or_score', function() {\n\n // Moodle forums strip ids from elements so we have to use classes.\n var classList = $(this).parent().attr('class').split(/\\s+/);\n var submissionid = 0;\n $(classList).each(function(index) {\n if (classList[index].match(\"^submission_\")) {\n submissionid = classList[index].split(\"_\")[1];\n }\n });\n\n // Launch the Cloud Viewer in a new window.\n var icon = M.cfg.wwwroot + '/plagiarism/turnitinsim/pix/turnitin-logo.png';\n var cvWindow = window.open();\n\n cvWindow.document.write('');\n cvWindow.document.write('');\n\n var loading = '
' +\n '
' +\n '' +\n '
' +\n '
' +\n '' +\n '' +\n '' +\n '
' +\n '
';\n $(cvWindow.document.body).html(loading);\n\n $.ajax({\n type: \"GET\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitinsim/ajax/cv.php\",\n dataType: \"json\",\n data: {\n action: 'request_cv_launch',\n submissionid: submissionid,\n sesskey: M.cfg.sesskey\n },\n success: function(data) {\n // Redirect opened window to returned URL.\n cvWindow.location = data.viewer_url;\n this.checkDVClosed(cvWindow);\n },\n checkDVClosed: function(cvWindow) {\n var that = this;\n if (cvWindow.closed) {\n window.location = window.location + '';\n } else {\n setTimeout(function() {\n that.checkDVClosed(cvWindow);\n }, 500);\n }\n }\n });\n });\n }\n };\n});"],"file":"cv_launch.min.js"} \ No newline at end of file diff --git a/amd/build/eula_response.min.js b/amd/build/eula_response.min.js index f1342c4..1a43ea2 100644 --- a/amd/build/eula_response.min.js +++ b/amd/build/eula_response.min.js @@ -1,2 +1,2 @@ -define ("plagiarism_turnitinsim/eula_response",["jquery","core/str"],function(a,b){return{eulaResponse:function eulaResponse(){a(document).ready(function(){if(a("#turnitinsim_eulacontainer").length){a("input[name=submitbutton]").prop("disabled","disabled")}});a(document).on("click","#pp-eula-accept",function(){a("input[name=submitbutton]").prop("disabled","");a.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitinsim/ajax/eula_response.php",dataType:"text",data:{action:"accept_eula",sesskey:M.cfg.sesskey},success:function success(){b.get_string("eulaaccepted","plagiarism_turnitinsim").done(function(c){a(".turnitinsim_eulacontainer").hide().html(c).fadeIn();b.get_string("submissiondisplaystatus:queued","plagiarism_turnitinsim").done(function(b){a(".tii_status_text").html(b)})})}})});a(document).on("click","#pp-eula-decline",function(){b.get_string("euladeclined","plagiarism_turnitinsim").done(function(b){a(".turnitinsim_eulacontainer").hide().html(b).fadeIn()});a("input[name=submitbutton]").prop("disabled","")})}}}); +define ("plagiarism_turnitinsim/eula_response",["jquery","core/str"],function(a,b){return{eulaResponse:function eulaResponse(){a(document).ready(function(){if(a("#turnitinsim_eulacontainer").length){a("input[name=submitbutton]").prop("disabled","disabled")}});a(document).on("click","#turnitinsim_eula_accept",function(){a("input[name=submitbutton]").prop("disabled","");a.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitinsim/ajax/eula_response.php",dataType:"text",data:{action:"accept_eula",sesskey:M.cfg.sesskey},success:function success(){b.get_string("eulaaccepted","plagiarism_turnitinsim").done(function(c){a(".turnitinsim_eulacontainer").hide().html(c).fadeIn();b.get_string("submissiondisplaystatus:queued","plagiarism_turnitinsim").done(function(b){a(".tii_status_text").html(b)})})}})});a(document).on("click","#turnitinsim_eula_decline",function(){b.get_string("euladeclined","plagiarism_turnitinsim").done(function(b){a(".turnitinsim_eulacontainer").hide().html(b).fadeIn()});a("input[name=submitbutton]").prop("disabled","")})}}}); //# sourceMappingURL=eula_response.min.js.map diff --git a/amd/build/eula_response.min.js.map b/amd/build/eula_response.min.js.map index a820c02..b95491c 100644 --- a/amd/build/eula_response.min.js.map +++ b/amd/build/eula_response.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/eula_response.js"],"names":["define","$","str","eulaResponse","document","ready","length","prop","on","ajax","type","url","M","cfg","wwwroot","dataType","data","action","sesskey","success","get_string","done","text","hide","html","fadeIn"],"mappings":"AA4BAA,OAAM,wCAAC,CAAC,QAAD,CAAW,UAAX,CAAD,CAAyB,SAASC,CAAT,CAAYC,CAAZ,CAAiB,CAC5C,MAAO,CACHC,YAAY,CAAE,uBAAW,CACrBF,CAAC,CAACG,QAAD,CAAD,CAAYC,KAAZ,CAAkB,UAAW,CACzB,GAAIJ,CAAC,CAAC,4BAAD,CAAD,CAAgCK,MAApC,CAA4C,CACxCL,CAAC,CAAC,0BAAD,CAAD,CAA8BM,IAA9B,CAAmC,UAAnC,CAA+C,UAA/C,CACH,CACJ,CAJD,EAMAN,CAAC,CAACG,QAAD,CAAD,CAAYI,EAAZ,CAAe,OAAf,CAAwB,iBAAxB,CAA2C,UAAW,CAClDP,CAAC,CAAC,0BAAD,CAAD,CAA8BM,IAA9B,CAAmC,UAAnC,CAA+C,EAA/C,EAGAN,CAAC,CAACQ,IAAF,CAAO,CACHC,IAAI,CAAE,MADH,CAEHC,GAAG,CAAEC,CAAC,CAACC,GAAF,CAAMC,OAAN,CAAgB,gDAFlB,CAGHC,QAAQ,CAAE,MAHP,CAIHC,IAAI,CAAE,CAACC,MAAM,CAAE,aAAT,CAAwBC,OAAO,CAAEN,CAAC,CAACC,GAAF,CAAMK,OAAvC,CAJH,CAKHC,OAAO,CAAE,kBAAW,CAChBjB,CAAG,CAACkB,UAAJ,CAAe,cAAf,CAA+B,wBAA/B,EAAyDC,IAAzD,CAA8D,SAASC,CAAT,CAAe,CACzErB,CAAC,CAAC,4BAAD,CAAD,CAAgCsB,IAAhC,GAAuCC,IAAvC,CAA4CF,CAA5C,EAAkDG,MAAlD,GAEAvB,CAAG,CAACkB,UAAJ,CAAe,gCAAf,CAAiD,wBAAjD,EAA2EC,IAA3E,CAAgF,SAASC,CAAT,CAAe,CAC3FrB,CAAC,CAAC,kBAAD,CAAD,CAAsBuB,IAAtB,CAA2BF,CAA3B,CACH,CAFD,CAGH,CAND,CAOH,CAbE,CAAP,CAeH,CAnBD,EAqBArB,CAAC,CAACG,QAAD,CAAD,CAAYI,EAAZ,CAAe,OAAf,CAAwB,kBAAxB,CAA4C,UAAW,CACnDN,CAAG,CAACkB,UAAJ,CAAe,cAAf,CAA+B,wBAA/B,EAAyDC,IAAzD,CAA8D,SAASC,CAAT,CAAe,CACzErB,CAAC,CAAC,4BAAD,CAAD,CAAgCsB,IAAhC,GAAuCC,IAAvC,CAA4CF,CAA5C,EAAkDG,MAAlD,EACH,CAFD,EAIAxB,CAAC,CAAC,0BAAD,CAAD,CAA8BM,IAA9B,CAAmC,UAAnC,CAA+C,EAA/C,CACH,CAND,CAOH,CApCE,CAsCV,CAvCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for handling the EULA response.\n *\n * @package plagiarism_turnitinsim\n * @copyright 2018 Turnitin\n * @author John McGettrick \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * @module plagiarism_turnitinsim/handleEulaResponse\n */\n\ndefine(['jquery', 'core/str'], function($, str) {\n return {\n eulaResponse: function() {\n $(document).ready(function() {\n if ($(\"#turnitinsim_eulacontainer\").length) {\n $('input[name=submitbutton]').prop('disabled', 'disabled');\n }\n });\n\n $(document).on('click', '#pp-eula-accept', function() {\n $('input[name=submitbutton]').prop('disabled', '');\n\n // Hide the EULA link.\n $.ajax({\n type: \"POST\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitinsim/ajax/eula_response.php\",\n dataType: \"text\",\n data: {action: \"accept_eula\", sesskey: M.cfg.sesskey},\n success: function() {\n str.get_string('eulaaccepted', 'plagiarism_turnitinsim').done(function(text) {\n $('.turnitinsim_eulacontainer').hide().html(text).fadeIn();\n\n str.get_string('submissiondisplaystatus:queued', 'plagiarism_turnitinsim').done(function(text) {\n $('.tii_status_text').html(text);\n });\n });\n }\n });\n });\n\n $(document).on('click', '#pp-eula-decline', function() {\n str.get_string('euladeclined', 'plagiarism_turnitinsim').done(function(text) {\n $('.turnitinsim_eulacontainer').hide().html(text).fadeIn();\n });\n\n $('input[name=submitbutton]').prop('disabled', '');\n });\n }\n };\n});"],"file":"eula_response.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/eula_response.js"],"names":["define","$","str","eulaResponse","document","ready","length","prop","on","ajax","type","url","M","cfg","wwwroot","dataType","data","action","sesskey","success","get_string","done","text","hide","html","fadeIn"],"mappings":"AA4BAA,OAAM,wCAAC,CAAC,QAAD,CAAW,UAAX,CAAD,CAAyB,SAASC,CAAT,CAAYC,CAAZ,CAAiB,CAC5C,MAAO,CACHC,YAAY,CAAE,uBAAW,CACrBF,CAAC,CAACG,QAAD,CAAD,CAAYC,KAAZ,CAAkB,UAAW,CACzB,GAAIJ,CAAC,CAAC,4BAAD,CAAD,CAAgCK,MAApC,CAA4C,CACxCL,CAAC,CAAC,0BAAD,CAAD,CAA8BM,IAA9B,CAAmC,UAAnC,CAA+C,UAA/C,CACH,CACJ,CAJD,EAMAN,CAAC,CAACG,QAAD,CAAD,CAAYI,EAAZ,CAA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file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for handling the EULA response.\n *\n * @package plagiarism_turnitinsim\n * @copyright 2018 Turnitin\n * @author John McGettrick \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * @module plagiarism_turnitinsim/handleEulaResponse\n */\n\ndefine(['jquery', 'core/str'], function($, str) {\n return {\n eulaResponse: function() {\n $(document).ready(function() {\n if ($(\"#turnitinsim_eulacontainer\").length) {\n $('input[name=submitbutton]').prop('disabled', 'disabled');\n }\n });\n\n $(document).on('click', '#turnitinsim_eula_accept', function() {\n $('input[name=submitbutton]').prop('disabled', '');\n\n // Hide the EULA link.\n $.ajax({\n type: \"POST\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitinsim/ajax/eula_response.php\",\n dataType: \"text\",\n data: {action: \"accept_eula\", sesskey: M.cfg.sesskey},\n success: function() {\n str.get_string('eulaaccepted', 'plagiarism_turnitinsim').done(function(text) {\n $('.turnitinsim_eulacontainer').hide().html(text).fadeIn();\n\n str.get_string('submissiondisplaystatus:queued', 'plagiarism_turnitinsim').done(function(text) {\n $('.tii_status_text').html(text);\n });\n });\n }\n });\n });\n\n $(document).on('click', '#turnitinsim_eula_decline', function() {\n str.get_string('euladeclined', 'plagiarism_turnitinsim').done(function(text) {\n $('.turnitinsim_eulacontainer').hide().html(text).fadeIn();\n });\n\n $('input[name=submitbutton]').prop('disabled', '');\n });\n }\n };\n});"],"file":"eula_response.min.js"} \ No newline at end of file diff --git a/amd/build/resend_submission.min.js b/amd/build/resend_submission.min.js index 576f9cc..f6af439 100644 --- a/amd/build/resend_submission.min.js +++ b/amd/build/resend_submission.min.js @@ -1,2 +1,2 @@ -define ("plagiarism_turnitinsim/resend_submission",["jquery","core/str"],function(a,b){return{resendSubmission:function resendSubmission(){a(document).on("click",".pp_resubmit_link",function(){a(this).hide();a(this).siblings(".pp_resubmitting").removeClass("hidden");var c=a(this),d=a(this).attr("class").split(/\s+/),e=0;a(d).each(function(a){if(d[a].match("^pp_resubmit_id_")){e=d[a].split("_")[3]}});a.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitinsim/ajax/resend_submission.php",dataType:"text",data:{action:"resubmit_event",submissionid:e,sesskey:M.cfg.sesskey},success:function success(){c.siblings(".turnitinsim_status").removeClass("hidden");b.get_string("submissiondisplaystatus:queued","plagiarism_turnitinsim").done(function(a){c.siblings(".tii_status_text").html(a)});c.siblings(".pp_resubmitting").addClass("hidden")},error:function error(){c.show();c.siblings(".pp_resubmitting").addClass("hidden")}})})}}}); +define ("plagiarism_turnitinsim/resend_submission",["jquery","core/str"],function(a,b){return{resendSubmission:function resendSubmission(){a(document).on("click",".turnitinsim_resubmit_link",function(){a(this).hide();a(this).siblings(".pp_resubmitting").removeClass("hidden");var c=a(this),d=a(this).attr("class").split(/\s+/),e=0;a(d).each(function(a){if(d[a].match("^pp_resubmit_id_")){e=d[a].split("_")[3]}});a.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitinsim/ajax/resend_submission.php",dataType:"text",data:{action:"resubmit_event",submissionid:e,sesskey:M.cfg.sesskey},success:function success(){c.siblings(".turnitinsim_status").removeClass("hidden");b.get_string("submissiondisplaystatus:queued","plagiarism_turnitinsim").done(function(a){c.siblings(".tii_status_text").html(a)});c.siblings(".pp_resubmitting").addClass("hidden")},error:function error(){c.show();c.siblings(".pp_resubmitting").addClass("hidden")}})})}}}); //# sourceMappingURL=resend_submission.min.js.map diff --git a/amd/build/resend_submission.min.js.map b/amd/build/resend_submission.min.js.map index 9404f1d..fb17afa 100644 --- a/amd/build/resend_submission.min.js.map +++ b/amd/build/resend_submission.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/resend_submission.js"],"names":["define","$","str","resendSubmission","document","on","hide","siblings","removeClass","that","classList","attr","split","submissionid","each","index","match","ajax","type","url","M","cfg","wwwroot","dataType","data","action","sesskey","success","get_string","done","text","html","addClass","error","show"],"mappings":"AA4BAA,OAAM,4CAAC,CAAC,QAAD,CAAW,UAAX,CAAD,CAAyB,SAASC,CAAT,CAAYC,CAAZ,CAAiB,CAC5C,MAAO,CACHC,gBAAgB,CAAE,2BAAW,CACzBF,CAAC,CAACG,QAAD,CAAD,CAAYC,EAAZ,CAAe,OAAf,CAAwB,mBAAxB,CAA6C,UAAW,CACpDJ,CAAC,CAAC,IAAD,CAAD,CAAQK,IAAR,GACAL,CAAC,CAAC,IAAD,CAAD,CAAQM,QAAR,CAAiB,kBAAjB,EAAqCC,WAArC,CAAiD,QAAjD,EAFoD,GAGhDC,CAAAA,CAAI,CAAGR,CAAC,CAAC,IAAD,CAHwC,CAMhDS,CAAS,CAAGT,CAAC,CAAC,IAAD,CAAD,CAAQU,IAAR,CAAa,OAAb,EAAsBC,KAAtB,CAA4B,KAA5B,CANoC,CAOhDC,CAAY,CAAG,CAPiC,CAQpDZ,CAAC,CAACS,CAAD,CAAD,CAAaI,IAAb,CAAkB,SAASC,CAAT,CAAgB,CAC9B,GAAIL,CAAS,CAACK,CAAD,CAAT,CAAiBC,KAAjB,CAAuB,kBAAvB,CAAJ,CAAgD,CAC5CH,CAAY,CAAGH,CAAS,CAACK,CAAD,CAAT,CAAiBH,KAAjB,CAAuB,GAAvB,EAA4B,CAA5B,CAClB,CACJ,CAJD,EAMAX,CAAC,CAACgB,IAAF,CAAO,CACHC,IAAI,CAAE,MADH,CAEHC,GAAG,CAAEC,CAAC,CAACC,GAAF,CAAMC,OAAN,CAAgB,oDAFlB,CAGHC,QAAQ,CAAE,MAHP,CAIHC,IAAI,CAAE,CAACC,MAAM,CAAE,gBAAT,CAA2BZ,YAAY,CAAEA,CAAzC,CAAuDa,OAAO,CAAEN,CAAC,CAACC,GAAF,CAAMK,OAAtE,CAJH,CAKHC,OAAO,CAAE,kBAAW,CAChBlB,CAAI,CAACF,QAAL,CAAc,qBAAd,EAAqCC,WAArC,CAAiD,QAAjD,EAEAN,CAAG,CAAC0B,UAAJ,CAAe,gCAAf,CAAiD,wBAAjD,EAA2EC,IAA3E,CAAgF,SAASC,CAAT,CAAe,CAC3FrB,CAAI,CAACF,QAAL,CAAc,kBAAd,EAAkCwB,IAAlC,CAAuCD,CAAvC,CACH,CAFD,EAIArB,CAAI,CAACF,QAAL,CAAc,kBAAd,EAAkCyB,QAAlC,CAA2C,QAA3C,CACH,CAbE,CAcHC,KAAK,CAAE,gBAAW,CACdxB,CAAI,CAACyB,IAAL,GACAzB,CAAI,CAACF,QAAL,CAAc,kBAAd,EAAkCyB,QAAlC,CAA2C,QAA3C,CACH,CAjBE,CAAP,CAmBH,CAjCD,CAkCH,CApCE,CAsCV,CAvCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for Requeueing submissions.\n *\n * @package plagiarism_turnitinsim\n * @copyright 2018 Turnitin\n * @author David Winn \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * @module plagiarism_turnitinsim/resendSubmission\n */\n\ndefine(['jquery', 'core/str'], function($, str) {\n return {\n resendSubmission: function() {\n $(document).on('click', '.pp_resubmit_link', function() {\n $(this).hide();\n $(this).siblings('.pp_resubmitting').removeClass('hidden');\n var that = $(this);\n\n // Moodle forums strip ids from elements so we have to use classes.\n var classList = $(this).attr('class').split(/\\s+/);\n var submissionid = 0;\n $(classList).each(function(index) {\n if (classList[index].match(\"^pp_resubmit_id_\")) {\n submissionid = classList[index].split(\"_\")[3];\n }\n });\n\n $.ajax({\n type: \"POST\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitinsim/ajax/resend_submission.php\",\n dataType: \"text\",\n data: {action: \"resubmit_event\", submissionid: submissionid, sesskey: M.cfg.sesskey},\n success: function() {\n that.siblings('.turnitinsim_status').removeClass('hidden');\n\n str.get_string('submissiondisplaystatus:queued', 'plagiarism_turnitinsim').done(function(text) {\n that.siblings('.tii_status_text').html(text);\n });\n\n that.siblings('.pp_resubmitting').addClass('hidden');\n },\n error: function() {\n that.show();\n that.siblings('.pp_resubmitting').addClass('hidden');\n }\n });\n });\n }\n };\n});"],"file":"resend_submission.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/resend_submission.js"],"names":["define","$","str","resendSubmission","document","on","hide","siblings","removeClass","that","classList","attr","split","submissionid","each","index","match","ajax","type","url","M","cfg","wwwroot","dataType","data","action","sesskey","success","get_string","done","text","html","addClass","error","show"],"mappings":"AA4BAA,OAAM,4CAAC,CAAC,QAAD,CAAW,UAAX,CAAD,CAAyB,SAASC,CAAT,CAAYC,CAAZ,CAAiB,CAC5C,MAAO,CACHC,gBAAgB,CAAE,2BAAW,CACzBF,CAAC,CAACG,QAAD,CAAD,CAAYC,EAAZ,CAAe,OAAf,CAAwB,4BAAxB,CAAsD,UAAW,CAC7DJ,CAAC,CAAC,IAAD,CAAD,CAAQK,IAAR,GACAL,CAAC,CAAC,IAAD,CAAD,CAAQM,QAAR,CAAiB,kBAAjB,EAAqCC,WAArC,CAAiD,QAAjD,EAF6D,GAGzDC,CAAAA,CAAI,CAAGR,CAAC,CAAC,IAAD,CAHiD,CAMzDS,CAAS,CAAGT,CAAC,CAAC,IAAD,CAAD,CA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free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for Requeueing submissions.\n *\n * @package plagiarism_turnitinsim\n * @copyright 2018 Turnitin\n * @author David Winn \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * @module plagiarism_turnitinsim/resendSubmission\n */\n\ndefine(['jquery', 'core/str'], function($, str) {\n return {\n resendSubmission: function() {\n $(document).on('click', '.turnitinsim_resubmit_link', function() {\n $(this).hide();\n $(this).siblings('.pp_resubmitting').removeClass('hidden');\n var that = $(this);\n\n // Moodle forums strip ids from elements so we have to use classes.\n var classList = $(this).attr('class').split(/\\s+/);\n var submissionid = 0;\n $(classList).each(function(index) {\n if (classList[index].match(\"^pp_resubmit_id_\")) {\n submissionid = classList[index].split(\"_\")[3];\n }\n });\n\n $.ajax({\n type: \"POST\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitinsim/ajax/resend_submission.php\",\n dataType: \"text\",\n data: {action: \"resubmit_event\", submissionid: submissionid, sesskey: M.cfg.sesskey},\n success: function() {\n that.siblings('.turnitinsim_status').removeClass('hidden');\n\n str.get_string('submissiondisplaystatus:queued', 'plagiarism_turnitinsim').done(function(text) {\n that.siblings('.tii_status_text').html(text);\n });\n\n that.siblings('.pp_resubmitting').addClass('hidden');\n },\n error: function() {\n that.show();\n that.siblings('.pp_resubmitting').addClass('hidden');\n }\n });\n });\n }\n };\n});"],"file":"resend_submission.min.js"} \ No newline at end of file diff --git a/amd/src/cv_launch.js b/amd/src/cv_launch.js index f4341a5..522e9fc 100644 --- a/amd/src/cv_launch.js +++ b/amd/src/cv_launch.js @@ -29,7 +29,7 @@ define(['jquery'], function($) { return { openCv: function() { - $(document).on('click', '.or_score', function() { + $(document).on('click', '.turnitinsim_or_score', function() { // Moodle forums strip ids from elements so we have to use classes. var classList = $(this).parent().attr('class').split(/\s+/); @@ -41,7 +41,7 @@ define(['jquery'], function($) { }); // Launch the Cloud Viewer in a new window. - var icon = M.cfg.wwwroot + '/plagiarism/turnitinsim/pix/tiiLogo.svg'; + var icon = M.cfg.wwwroot + '/plagiarism/turnitinsim/pix/turnitin-logo.png'; var cvWindow = window.open(); cvWindow.document.write(''); var loading = '
' + - ''; $(cvWindow.document.body).html(loading); diff --git a/amd/src/eula_response.js b/amd/src/eula_response.js index 745004c..318df68 100644 --- a/amd/src/eula_response.js +++ b/amd/src/eula_response.js @@ -35,7 +35,7 @@ define(['jquery', 'core/str'], function($, str) { } }); - $(document).on('click', '#pp-eula-accept', function() { + $(document).on('click', '#turnitinsim_eula_accept', function() { $('input[name=submitbutton]').prop('disabled', ''); // Hide the EULA link. @@ -56,7 +56,7 @@ define(['jquery', 'core/str'], function($, str) { }); }); - $(document).on('click', '#pp-eula-decline', function() { + $(document).on('click', '#turnitinsim_eula_decline', function() { str.get_string('euladeclined', 'plagiarism_turnitinsim').done(function(text) { $('.turnitinsim_eulacontainer').hide().html(text).fadeIn(); }); diff --git a/amd/src/resend_submission.js b/amd/src/resend_submission.js index 3f8698c..d581058 100644 --- a/amd/src/resend_submission.js +++ b/amd/src/resend_submission.js @@ -29,7 +29,7 @@ define(['jquery', 'core/str'], function($, str) { return { resendSubmission: function() { - $(document).on('click', '.pp_resubmit_link', function() { + $(document).on('click', '.turnitinsim_resubmit_link', function() { $(this).hide(); $(this).siblings('.pp_resubmitting').removeClass('hidden'); var that = $(this); diff --git a/backup/moodle2/restore_plagiarism_turnitinsim_plugin.class.php b/backup/moodle2/restore_plagiarism_turnitinsim_plugin.class.php index 4756466..03d01d8 100644 --- a/backup/moodle2/restore_plagiarism_turnitinsim_plugin.class.php +++ b/backup/moodle2/restore_plagiarism_turnitinsim_plugin.class.php @@ -44,7 +44,6 @@ protected function define_module_plugin_structure() { /** * Restore the Turnitin settings for this module. - * This will only be done if the module is from the same site from where it was backed up. * * @param object $data object The data we are restoring. * @throws dml_exception @@ -52,13 +51,10 @@ protected function define_module_plugin_structure() { public function process_turnitinsim_mods($data) { global $DB; - if ($this->task->is_samesite()) { - - $data = (object)$data; - $data->cm = $this->task->get_moduleid(); + $data = (object)$data; + $data->cm = $this->task->get_moduleid(); - $DB->insert_record('plagiarism_turnitinsim_mod', $data); - } + $DB->insert_record('plagiarism_turnitinsim_mod', $data); } /** diff --git a/classes/eula.class.php b/classes/eula.class.php index 8d033b7..95ca146 100644 --- a/classes/eula.class.php +++ b/classes/eula.class.php @@ -123,15 +123,16 @@ public function accept_eula() { * * @param int $cmid - course module id * @param string $submissiontype - The type of submission - file or content. + * @param string $submissionuserid - The userid the submission is against. * @return array The HTML elements for a EULA NOT ACCEPTED status. * @throws coding_exception * @throws dml_exception */ - public function get_eula_status($cmid, $submissiontype) { - global $OUTPUT; + public function get_eula_status($cmid, $submissiontype, $submissionuserid) { + global $OUTPUT, $USER; $eulaconfirm = ''; - if (!has_capability('plagiarism/turnitinsim:viewfullreport', context_module::instance($cmid))) { + if ($USER->id == $submissionuserid) { $plagiarismpluginturnitinsim = new plagiarism_plugin_turnitinsim(); $eulaconfirm = $plagiarismpluginturnitinsim->print_disclosure($cmid, $submissiontype); } diff --git a/lib.php b/lib.php index be9c88b..83957a2 100644 --- a/lib.php +++ b/lib.php @@ -84,8 +84,18 @@ public function get_form_elements_module($mform, $context, $modulename = "") { // Course ID is only passed in on new module - if updating then get it from module id. $courseid = optional_param('course', 0, PARAM_INT); + $id = optional_param('id', 0, PARAM_INT); + if (empty($courseid)) { - $courseid = get_coursemodule_from_id('', $cmid)->course; + $checkcourse = (!empty($cmid)) ? $cmid : $id; + $course = get_coursemodule_from_id('', $checkcourse); + + // If it is still empty, return to avoid an error. + if (empty($course)) { + return; + } + + $courseid = $course->course; } // Exit if this user does not have permissions to configure the plugin. @@ -293,13 +303,13 @@ public function get_links($linkarray) { case TURNITINSIM_SUBMISSION_STATUS_COMPLETE: $score = $submission->getoverallscore() . '%'; $submissionid = $submission->getid(); - $orcolour = ' or_score_colour_' . round($submission->getoverallscore(), -1); - $status = html_writer::tag('div', $score, array('class' => 'or_score' . $orcolour)); + $orcolour = ' turnitinsim_or_score_colour_' . round($submission->getoverallscore(), -1); + $status = html_writer::tag('div', $score, array('class' => 'turnitinsim_or_score' . $orcolour)); break; case TURNITINSIM_SUBMISSION_STATUS_EULA_NOT_ACCEPTED: $eula = new plagiarism_turnitinsim_eula(); - $statusset = $eula->get_eula_status($cm->id, $submission->gettype()); + $statusset = $eula->get_eula_status($cm->id, $submission->gettype(), $submission->getuserid()); $status = $statusset['eula-status']; $eulaconfirm = $statusset['eula-confirm']; $showresubmitlink = false; @@ -365,7 +375,7 @@ public function get_links($linkarray) { if ($plagiarismfile->status === TURNITINSIM_SUBMISSION_STATUS_EULA_NOT_ACCEPTED) { $eula = new plagiarism_turnitinsim_eula(); - $statusset = $eula->get_eula_status($cm->id, $plagiarismfile->type); + $statusset = $eula->get_eula_status($cm->id, $plagiarismfile->type, $plagiarismfile->userid); $status = $statusset['eula-status']; $eulaconfirm = $statusset['eula-confirm']; } else { @@ -375,7 +385,7 @@ public function get_links($linkarray) { } // Render a Turnitin logo. - $turnitinicon = $OUTPUT->pix_icon('tiiIcon', '', 'plagiarism_turnitinsim', array('class' => 'tii_icon')); + $turnitinicon = $OUTPUT->pix_icon('turnitin-icon', '', 'plagiarism_turnitinsim', array('class' => 'tii_icon')); // Render a resubmit link for instructors if necessary. $resubmitlink = ($instructor && $showresubmitlink) ? $this->render_resubmit_link($submission->getid()) : ''; @@ -443,7 +453,7 @@ public function render_resubmit_link($submissionid) { $resubmiticon . $resubmittext, array( 'title' => $resubmittext, - 'class' => 'turnitinsim_error_icon clear pp_resubmit_link pp_resubmit_id_' . $submissionid + 'class' => 'turnitinsim_error_icon clear turnitinsim_resubmit_link pp_resubmit_id_' . $submissionid ) ); @@ -526,13 +536,13 @@ public function print_disclosure($cmid, $submissiontype = 'file') { // Button to allow the user to accept the Turnitin EULA. $eulaacceptbtn = html_writer::tag('span', get_string('eulaaccept', 'plagiarism_turnitinsim'), - array('class' => 'btn btn-primary', 'id' => 'pp-eula-accept') + array('class' => 'btn btn-primary', 'id' => 'turnitinsim_eula_accept') ); // Button to allow the user to decline the Turnitin EULA. $euladeclinebtn = html_writer::tag('span', get_string('euladecline', 'plagiarism_turnitinsim'), - array('class' => 'btn btn-secondary', 'id' => 'pp-eula-decline') + array('class' => 'btn btn-secondary', 'id' => 'turnitinsim_eula_decline') ); // Output EULA container. @@ -656,6 +666,7 @@ public function submission_handler($eventdata) { $tssubmission->calculate_generation_time($generated); $tssubmission->setstatus($status); + $tssubmission->settogenerate(1); $tssubmission->update(); } @@ -698,9 +709,11 @@ public function submission_handler($eventdata) { $tssubmission->setid($submission->id); } - // If the submitter has not accepted the EULA then flag accordingly. + // If the submitter has not accepted the EULA AND the eula is required then flag accordingly. $authoruser = new plagiarism_turnitinsim_user($author); - if ($authoruser->get_lasteulaaccepted() < get_config('plagiarism_turnitinsim', 'turnitin_eula_version')) { + if ((bool)$features->tenant->require_eula && $authoruser->get_lasteulaaccepted() < + get_config('plagiarism_turnitinsim', 'turnitin_eula_version')) { + $tssubmission->setstatus(TURNITINSIM_SUBMISSION_STATUS_EULA_NOT_ACCEPTED); $tssubmission->update(); return true; diff --git a/pix/icon.png b/pix/icon.png deleted file mode 100755 index eeba0d0..0000000 Binary files a/pix/icon.png and /dev/null differ diff --git a/pix/tiiIcon.svg b/pix/tiiIcon.svg deleted file mode 100755 index de249de..0000000 --- a/pix/tiiIcon.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/pix/tiiLogo.svg b/pix/tiiLogo.svg deleted file mode 100644 index 22da669..0000000 --- a/pix/tiiLogo.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pix/turnitin-icon.png b/pix/turnitin-icon.png new file mode 100644 index 0000000..8ac44f1 Binary files /dev/null and b/pix/turnitin-icon.png differ diff --git a/pix/turnitin-logo.png b/pix/turnitin-logo.png new file mode 100644 index 0000000..21af4be Binary files /dev/null and b/pix/turnitin-logo.png differ diff --git a/styles.css b/styles.css index 7d2cc32..2aebb9a 100644 --- a/styles.css +++ b/styles.css @@ -46,7 +46,7 @@ .turnitinsim_eulacontainer, #turnitinsim_eulaaccepted, #turnitinsim_eulanotrequired, -#pp-eula-accept { +#turnitinsim_eula_accept { margin-right: 5px; } @@ -63,7 +63,7 @@ top: 3px; } -.turnitinsim_links .turnitinsim_status .or_score { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score { min-width: 32px; font-size: 12px; display: inline-block; @@ -76,59 +76,58 @@ clear: both; } -.turnitinsim_links .pp_resubmit_link, -.turnitinsim_links .turnitinsim_status_text_eula, -.turnitinsim_links .eula-row-launch { +.turnitinsim_links .turnitinsim_resubmit_link, +.turnitinsim_links .turnitinsim_status_text_eula { cursor: pointer; } /* Define OR score colours */ -.turnitinsim_links .turnitinsim_status .or_score_colour_0 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_0 { background: #3552b7; color: #fff; } -.turnitinsim_links .turnitinsim_status .or_score_colour_10 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_10 { background: #617b8d; color: #fff; } -.turnitinsim_links .turnitinsim_status .or_score_colour_20 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_20 { background: #a1b556; } -.turnitinsim_links .turnitinsim_status .or_score_colour_30 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_30 { background: #dae235; } -.turnitinsim_links .turnitinsim_status .or_score_colour_40 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_40 { background: #edac28; } -.turnitinsim_links .turnitinsim_status .or_score_colour_50 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_50 { background: #edd42f; } -.turnitinsim_links .turnitinsim_status .or_score_colour_60 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_60 { background: #ecad28; } -.turnitinsim_links .turnitinsim_status .or_score_colour_70 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_70 { background: #e15a21; color: #fff; } -.turnitinsim_links .turnitinsim_status .or_score_colour_80 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_80 { background: #e05a21; color: #fff; } -.turnitinsim_links .turnitinsim_status .or_score_colour_90 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_90 { background: #dc4321; color: #fff; } -.turnitinsim_links .turnitinsim_status .or_score_colour_100 { +.turnitinsim_links .turnitinsim_status .turnitinsim_or_score_colour_100 { background: #db4221; color: #fff; } @@ -139,7 +138,6 @@ .turnitinsim_loadingLogo { width: 250px; - height: 72px; display: inline-block; } @@ -167,7 +165,7 @@ .turnitinsim_Loading_Circle-2, .turnitinsim_Loading_Circle-3 { background-color: #BAD8EE; - animation-name: three-bubbles; + animation-name: turnitinsim_three-bubbles; animation-duration: 2s; animation-iteration-count: infinite; border-radius: 100%; @@ -192,7 +190,7 @@ margin-bottom: 3px; } -@keyframes three-bubbles { +@keyframes turnitinsim_three-bubbles { 0%, 80%, 100% { transform: scale(0); } diff --git a/tests/classes/callback.class_test.php b/tests/classes/callback.class_test.php index b2f2740..607a3cd 100644 --- a/tests/classes/callback.class_test.php +++ b/tests/classes/callback.class_test.php @@ -380,6 +380,6 @@ public function test_expected_callback_signature_generates_hash() { $tscallback = new plagiarism_turnitinsim_callback( new plagiarism_turnitinsim_request() ); $hash = $tscallback->expected_callback_signature('{"any": "string","but": "usually", "raw": "json"}'); - $this->assertRegExp( "/[0-9a-f]{64}/i", $hash); + handle_deprecation::assertregex($this, "/[0-9a-f]{64}/i", $hash); } } \ No newline at end of file diff --git a/tests/classes/eula.class_test.php b/tests/classes/eula.class_test.php index c85773b..5a79019 100644 --- a/tests/classes/eula.class_test.php +++ b/tests/classes/eula.class_test.php @@ -226,7 +226,7 @@ public function test_get_eula_status_for_student() { $cm = get_coursemodule_from_instance('assign', $module->id); $tseula = new plagiarism_turnitinsim_eula(); - $result = $tseula->get_eula_status($cm->id, 'file'); + $result = $tseula->get_eula_status($cm->id, 'file', $this->student->id); handle_deprecation::assertcontains($this, get_string('eulalink', 'plagiarism_turnitinsim', '?lang=en-US'), $result['eula-confirm']); @@ -288,9 +288,10 @@ public function test_get_eula_status_for_instructor() { $cm = get_coursemodule_from_instance('assign', $module->id); $tseula = new plagiarism_turnitinsim_eula(); - $result = $tseula->get_eula_status($cm->id, 'file'); + $result = $tseula->get_eula_status($cm->id, 'file', $this->instructor->id); - $this->assertEmpty($result['eula-confirm']); + handle_deprecation::assertcontains($this, + get_string('eulalink', 'plagiarism_turnitinsim', '?lang=en-US'), $result['eula-confirm']); handle_deprecation::assertcontains($this, get_string('submissiondisplayerror:eulanotaccepted_help', 'plagiarism_turnitinsim'), $result['eula-status']); } diff --git a/tests/classes/group.class_test.php b/tests/classes/group.class_test.php index ecac43d..703b5c0 100644 --- a/tests/classes/group.class_test.php +++ b/tests/classes/group.class_test.php @@ -57,7 +57,7 @@ public function test_constructor_creates_turnitinid() { // Turnitinid should match reg ex. $format = "/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i"; $turnitinid = $tsgroup->get_turnitinid(); - $this->assertRegExp($format, $turnitinid); + handle_deprecation::assertregex($this, $format, $turnitinid); } } \ No newline at end of file diff --git a/tests/classes/user_class_test.php b/tests/classes/user_class_test.php index fc380f1..6fe208b 100644 --- a/tests/classes/user_class_test.php +++ b/tests/classes/user_class_test.php @@ -48,7 +48,7 @@ public function test_constructor_creates_turnitinid() { // Turnitinid should match reg ex. $format = "/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i"; $turnitinid = $tsuser->get_turnitinid(); - $this->assertRegExp($format, $turnitinid); + handle_deprecation::assertregex($this, $format, $turnitinid); } } \ No newline at end of file diff --git a/tests/lib_test.php b/tests/lib_test.php index 54c35e5..41bdf67 100644 --- a/tests/lib_test.php +++ b/tests/lib_test.php @@ -366,7 +366,7 @@ public function test_get_links_with_submission() { $tssubmission->update(); handle_deprecation::assertcontains($this, $score.'%', $plagiarismturnitinsim->get_links($linkarray)); handle_deprecation::assertcontains($this, - 'or_score_colour_' . round($score, -1), $plagiarismturnitinsim->get_links($linkarray)); + 'turnitinsim_or_score_colour_' . round($score, -1), $plagiarismturnitinsim->get_links($linkarray)); } /** diff --git a/utilities/handle_deprecation.php b/utilities/handle_deprecation.php index b10a039..71da9e6 100644 --- a/utilities/handle_deprecation.php +++ b/utilities/handle_deprecation.php @@ -159,4 +159,20 @@ public static function assertinternaltypeint($object, $value) { $CFG->branch >= 37 ? $object->assertIsInt($value) : $object->assertInternalType("int", $value); } + + /** + * In Moodle 3.11, Moodle switched to use PHPUnit 9.5 which contains deprecations for some assertions. + * assertRegExp was deprecated in favour of newer methods such as assertMatchesRegularExpression. (PHPUnit 7.5) + * This method handles our support for Moodle versions that use PHPUnit versions below 9.1. (Moodle 3.10 and below) + * + * @param object $object The test class object. + * @param string $pattern The regex pattern we are looking for. + * @param string $string The string we are searching within. + */ + public static function assertregex($object, $pattern, $string) { + global $CFG; + + $CFG->branch >= 311 ? $object->assertMatchesRegularExpression($pattern, $string) : + $object->assertRegExp("int", $pattern, $string); + } } \ No newline at end of file diff --git a/version.php b/version.php index 3892d1f..365cb19 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2021030901; +$plugin->version = 2021060101; $plugin->release = "v1.2"; $plugin->requires = 2017051500; $plugin->component = 'plagiarism_turnitinsim';