From 1ff8b4281e6420dbceb4ba9a4867019d6c52b428 Mon Sep 17 00:00:00 2001 From: Isaac Xiong Date: Mon, 4 Dec 2023 16:16:39 -0600 Subject: [PATCH 1/4] prevent truncated average score of multiple submissions --- lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.php b/lib.php index f97ccefe..c91e5fbf 100755 --- a/lib.php +++ b/lib.php @@ -1488,7 +1488,7 @@ private function update_grade($cm, $submission, $userid) { $gradescounted += 1; } } - $grade->grade = (!is_null($averagegrade) && $gradescounted > 0) ? (int)($averagegrade / $gradescounted) : null; + $grade->grade = (!is_null($averagegrade) && $gradescounted > 0) ? (int)round(($averagegrade / $gradescounted)) : null; } else { $grade->grade = $submission->getGrade(); } From c81215b75c1f17a40ccdddf0cebbd5c6d9fd9100 Mon Sep 17 00:00:00 2001 From: ixiongtii <113456240+ixiongtii@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:43:36 -0600 Subject: [PATCH 2/4] Fix: Use proper Modal Dialogue for eula modal (#682) * use new modal creator for Moodle 4.3 * use proper modal dialogue * add new modal dialogue js * use correct js path for eula * adding build js files to gitignore * revert gitignore --- .gitignore | 1 + amd/build/eula.min.js | 3 +- amd/build/eula.min.js.map | 2 +- amd/build/modal_eula_launch.min.js | 3 +- amd/build/modal_eula_launch.min.js.map | 2 +- amd/build/new_eula_modal.min.js | 2 + amd/build/new_eula_modal.min.js.map | 1 + amd/build/peermark.min.js | 3 +- amd/build/peermark.min.js.map | 2 +- amd/build/quickmark.min.js | 3 +- amd/build/quickmark.min.js.map | 2 +- amd/build/rubric.min.js | 3 +- amd/build/rubric.min.js.map | 2 +- amd/src/modal_eula_launch.js | 1 + amd/src/new_eula_modal.js | 55 ++++++++++++++++++++++++++ amd/src/peermark.js | 6 +-- amd/src/quickmark.js | 6 +-- amd/src/rubric.js | 6 +-- lib.php | 12 +++++- 19 files changed, 89 insertions(+), 26 deletions(-) create mode 100644 amd/build/new_eula_modal.min.js create mode 100644 amd/build/new_eula_modal.min.js.map create mode 100644 amd/src/new_eula_modal.js diff --git a/.gitignore b/.gitignore index 1c2d52b6..c3da2901 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea/* + diff --git a/amd/build/eula.min.js b/amd/build/eula.min.js index 3af3528e..1cc53a15 100644 --- a/amd/build/eula.min.js +++ b/amd/build/eula.min.js @@ -1,3 +1,2 @@ -define("plagiarism_turnitin/eula",["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_eula_launch"],(function($,Templates,ModalFactory,ModalEvents,ModalEulaLaunch){return{eulaLaunch:function(){var turnitinEulaClass=$(".pp_turnitin_eula");turnitinEulaClass.show(),$(document).on("mod_forum-post-created",".forum-post-container",(function(event,newid){$("#post-content-"+newid+" .pp_turnitin_eula").show()})),$(document).on("click",".pp_turnitin_eula_link",(function(){ModalFactory.create({type:ModalEulaLaunch.TYPE,templateContext:{cmid:$('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:!0}).then((function(modal){modal.show(),modal.getRoot().find(".modal").addClass("tii_pp_modal_eula"),modal.getRoot().find(".modal-content").addClass("tii_pp_modal_eula_content")}))})),$(".pp_turnitin_eula_ignored").length>0&&($(".editsubmissionform").length>0&&$(".editsubmissionform").hide(),turnitinEulaClass.siblings(".mform").length>0&&turnitinEulaClass.siblings(".mform").hide())}}})); - +define("plagiarism_turnitin/eulaLaunch",["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_eula_launch"],function($,Templates,ModalFactory,ModalEvents,ModalEulaLaunch){return{eulaLaunch:function(){var turnitinEulaClass=$(".pp_turnitin_eula");turnitinEulaClass.show();$(document).on("mod_forum-post-created",".forum-post-container",function(event,newid){var turnitinEulaClass=$("#post-content-"+newid+" .pp_turnitin_eula");turnitinEulaClass.show()});$(document).on("click",".pp_turnitin_eula_link",function(){ModalFactory.create({type:ModalEulaLaunch.TYPE,templateContext:{cmid:$('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:true}).then(function(modal){modal.show();modal.getRoot().find(".modal").addClass("tii_pp_modal_eula");modal.getRoot().find(".modal-content").addClass("tii_pp_modal_eula_content")})});if($(".pp_turnitin_eula_ignored").length>0){if($(".editsubmissionform").length>0){$(".editsubmissionform").hide()}if(turnitinEulaClass.siblings(".mform").length>0){turnitinEulaClass.siblings(".mform").hide()}}}}}); //# sourceMappingURL=eula.min.js.map \ No newline at end of file diff --git a/amd/build/eula.min.js.map b/amd/build/eula.min.js.map index db585234..a7dd02d1 100644 --- a/amd/build/eula.min.js.map +++ b/amd/build/eula.min.js.map @@ -1 +1 @@ -{"version":3,"file":"eula.min.js","sources":["../src/eula.js"],"sourcesContent":["/**\n * Javascript controller for launching the EULA modal.\n *\n * @copyright Turnitin\n * @author 2019 David Winn \n * @module plagiarism_turnitin/eulaLaunch\n */\n\ndefine(['jquery',\n 'core/templates',\n 'core/modal_factory',\n 'core/modal_events',\n 'plagiarism_turnitin/modal_eula_launch'\n ],\n function($, Templates, ModalFactory, ModalEvents, ModalEulaLaunch) {\n return {\n eulaLaunch: function() {\n var turnitinEulaClass = $(\".pp_turnitin_eula\");\n turnitinEulaClass.show();\n\n // Show the 'accept EULA' prompt for new in-page forum replies.\n $(document).on('mod_forum-post-created', '.forum-post-container', function (event, newid) {\n var turnitinEulaClass = $(\"#post-content-\" + newid + \" .pp_turnitin_eula\");\n turnitinEulaClass.show();\n });\n\n $(document).on('click', '.pp_turnitin_eula_link', function() {\n ModalFactory.create({\n type: ModalEulaLaunch.TYPE,\n templateContext: {\n cmid: $('input[name=\"coursemodule\"]').val(),\n wwwroot: M.cfg.wwwroot\n },\n large: true\n })\n .then(function (modal) {\n modal.show();\n modal.getRoot().find('.modal').addClass('tii_pp_modal_eula');\n modal.getRoot().find('.modal-content').addClass('tii_pp_modal_eula_content');\n });\n });\n\n // Hide the submission form if the user has never accepted or declined the Turnitin EULA.\n if ($(\".pp_turnitin_eula_ignored\").length > 0) {\n if ($('.editsubmissionform').length > 0) {\n $('.editsubmissionform').hide();\n }\n if (turnitinEulaClass.siblings('.mform').length > 0) {\n turnitinEulaClass.siblings('.mform').hide();\n }\n }\n }\n };\n });"],"names":["define","$","Templates","ModalFactory","ModalEvents","ModalEulaLaunch","eulaLaunch","turnitinEulaClass","show","document","on","event","newid","create","type","TYPE","templateContext","cmid","val","wwwroot","M","cfg","large","then","modal","getRoot","find","addClass","length","hide","siblings"],"mappings":"AAQAA,kCAAO,CAAC,SACA,iBACA,qBACA,oBACA,0CAEJ,SAASC,EAAGC,UAAWC,aAAcC,YAAaC,uBACvC,CACHC,WAAY,eACJC,kBAAoBN,EAAE,qBAC1BM,kBAAkBC,OAGlBP,EAAEQ,UAAUC,GAAG,yBAA0B,yBAAyB,SAAUC,MAAOC,OACvDX,EAAE,iBAAmBW,MAAQ,sBACnCJ,UAGtBP,EAAEQ,UAAUC,GAAG,QAAS,0BAA0B,WAC9CP,aAAaU,OAAO,CAChBC,KAAMT,gBAAgBU,KACtBC,gBAAiB,CACbC,KAAMhB,EAAE,8BAA8BiB,MACtCC,QAASC,EAAEC,IAAIF,SAEnBG,OAAO,IAENC,MAAK,SAAUC,OACZA,MAAMhB,OACNgB,MAAMC,UAAUC,KAAK,UAAUC,SAAS,qBACxCH,MAAMC,UAAUC,KAAK,kBAAkBC,SAAS,mCAKxD1B,EAAE,6BAA6B2B,OAAS,IACpC3B,EAAE,uBAAuB2B,OAAS,GAClC3B,EAAE,uBAAuB4B,OAEzBtB,kBAAkBuB,SAAS,UAAUF,OAAS,GAC9CrB,kBAAkBuB,SAAS,UAAUD"} \ No newline at end of file +{"version":3,"sources":["src/eula.js"],"names":["define","$","Templates","ModalFactory","ModalEvents","ModalEulaLaunch","eulaLaunch","turnitinEulaClass","show","document","on","event","newid","create","type","TYPE","templateContext","cmid","val","wwwroot","M","cfg","large","then","modal","getRoot","find","addClass","length","hide","siblings"],"mappings":"AAQAA,OAAO,CAAC,SACA,iBACA,qBACA,oBACA,yCAEJ,SAASC,EAAGC,UAAWC,aAAcC,YAAaC,iBAC9C,MAAO,CACHC,WAAY,WACR,IAAIC,kBAAoBN,EAAE,mBAAmB,EAC7CM,kBAAkBC,KAAK,EAGvBP,EAAEQ,QAAQ,EAAEC,GAAG,yBAA0B,wBAAyB,SAAUC,MAAOC,OAC/E,IAAIL,kBAAoBN,EAAE,iBAAmBW,MAAQ,oBAAoB,EACzEL,kBAAkBC,KAAK,CAC3B,CAAC,EAEDP,EAAEQ,QAAQ,EAAEC,GAAG,QAAS,yBAA0B,WAC9CP,aAAaU,OAAO,CAChBC,KAAMT,gBAAgBU,KACtBC,gBAAiB,CACbC,KAAMhB,EAAE,4BAA4B,EAAEiB,IAAI,EAC1CC,QAASC,EAAEC,IAAIF,OACnB,EACAG,MAAO,IACX,CAAC,EACIC,KAAK,SAAUC,OACZA,MAAMhB,KAAK,EACXgB,MAAMC,QAAQ,EAAEC,KAAK,QAAQ,EAAEC,SAAS,mBAAmB,EAC3DH,MAAMC,QAAQ,EAAEC,KAAK,gBAAgB,EAAEC,SAAS,2BAA2B,CAC/E,CAAC,CACT,CAAC,EAGD,GAAI1B,EAAE,2BAA2B,EAAE2B,OAAS,EAAG,CAC3C,GAAI3B,EAAE,qBAAqB,EAAE2B,OAAS,EAAG,CACrC3B,EAAE,qBAAqB,EAAE4B,KAAK,CAClC,CACA,GAAItB,kBAAkBuB,SAAS,QAAQ,EAAEF,OAAS,EAAG,CACjDrB,kBAAkBuB,SAAS,QAAQ,EAAED,KAAK,CAC9C,CACJ,CACJ,CACJ,CACJ,CAAC"} \ No newline at end of file diff --git a/amd/build/modal_eula_launch.min.js b/amd/build/modal_eula_launch.min.js index 98f04173..d5b799b5 100644 --- a/amd/build/modal_eula_launch.min.js +++ b/amd/build/modal_eula_launch.min.js @@ -1,3 +1,2 @@ -define("plagiarism_turnitin/modal_eula_launch",["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],(function($,Ajax,Notification,CustomEvents,Modal,ModalRegistry,ModalEvents){var registered=!1,SELECTORS_HIDE_BUTTON='[data-action="hide"]',ModalEulaLaunch=function(root){Modal.call(this,root)};return ModalEulaLaunch.TYPE="plagiarism_turnitin-modal_eula_launch",(ModalEulaLaunch.prototype=Object.create(Modal.prototype)).constructor=ModalEulaLaunch,ModalEulaLaunch.prototype.registerEventListeners=function(){Modal.prototype.registerEventListeners.call(this),$(window).on("message",(function(ev){var message=void 0===ev.data?ev.originalEvent.data:ev.data;"turnitin_eula_declined"!==message&&"turnitin_eula_accepted"!==message||$.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"actionuseragreement",message:message,sesskey:M.cfg.sesskey},success:function(){window.location.reload()},error:function(){window.location.reload()}})})),this.getModal().on(CustomEvents.events.activate,SELECTORS_HIDE_BUTTON,function(e,data){var cancelEvent=$.Event(ModalEvents.cancel);this.getRoot().trigger(cancelEvent,this),cancelEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this))},registered||(ModalRegistry.register(ModalEulaLaunch.TYPE,ModalEulaLaunch,"plagiarism_turnitin/modal_eula_launch"),registered=!0),ModalEulaLaunch})); - +define("plagiarism_turnitin/modal_eula_launch",["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function($,Ajax,Notification,CustomEvents,Modal,ModalRegistry,ModalEvents){var registered=false;var SELECTORS={HIDE_BUTTON:'[data-action="hide"]',MODAL:'[data-region="modal"]'};var ModalEulaLaunch=function(root){Modal.call(this,root)};ModalEulaLaunch.TYPE="plagiarism_turnitin-modal_eula_launch";ModalEulaLaunch.TEMPLATE="plagiarism_turnitin/modal_eula_launch";ModalEulaLaunch.prototype=Object.create(Modal.prototype);ModalEulaLaunch.prototype.constructor=ModalEulaLaunch;ModalEulaLaunch.prototype.registerEventListeners=function(){Modal.prototype.registerEventListeners.call(this);processEula();this.getModal().on(CustomEvents.events.activate,SELECTORS.HIDE_BUTTON,function(e,data){var cancelEvent=$.Event(ModalEvents.cancel);this.getRoot().trigger(cancelEvent,this);if(!cancelEvent.isDefaultPrevented()){this.hide();data.originalEvent.preventDefault()}}.bind(this))};function processEula(){$(window).on("message",function(ev){var message=typeof ev.data==="undefined"?ev.originalEvent.data:ev.data;if(message==="turnitin_eula_declined"||message==="turnitin_eula_accepted"){$.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"actionuseragreement",message:message,sesskey:M.cfg.sesskey},success:function(){window.location.reload()},error:function(){window.location.reload()}})}})}if(!registered){ModalRegistry.register(ModalEulaLaunch.TYPE,ModalEulaLaunch,"plagiarism_turnitin/modal_eula_launch");registered=true}return ModalEulaLaunch}); //# sourceMappingURL=modal_eula_launch.min.js.map \ No newline at end of file diff --git a/amd/build/modal_eula_launch.min.js.map b/amd/build/modal_eula_launch.min.js.map index aa571592..48e4f88c 100644 --- a/amd/build/modal_eula_launch.min.js.map +++ b/amd/build/modal_eula_launch.min.js.map @@ -1 +1 @@ -{"version":3,"file":"modal_eula_launch.min.js","sources":["../src/modal_eula_launch.js"],"sourcesContent":["/**\n * Javascript controller for Eula launcher\n *\n * @copyright Turnitin\n * @author 2019 David Winn \n * @module plagiarism_turnitin/modal_eula_launch\n */\n\ndefine(\n [\n 'jquery',\n 'core/ajax',\n 'core/notification',\n 'core/custom_interaction_events',\n 'core/modal',\n 'core/modal_registry',\n 'core/modal_events'\n ],\n function($, Ajax, Notification, CustomEvents, Modal, ModalRegistry, ModalEvents) {\n\n var registered = false;\n var SELECTORS = {\n HIDE_BUTTON: '[data-action=\"hide\"]',\n MODAL: '[data-region=\"modal\"]'\n };\n\n /**\n * Constructor for the Modal.\n *\n * @param {object} root The root jQuery element for the modal\n */\n var ModalEulaLaunch = function(root) {\n Modal.call(this, root);\n };\n\n ModalEulaLaunch.TYPE = 'plagiarism_turnitin-modal_eula_launch';\n ModalEulaLaunch.prototype = Object.create(Modal.prototype);\n ModalEulaLaunch.prototype.constructor = ModalEulaLaunch;\n\n /**\n * Set up all of the event handling for the modal.\n *\n * @method registerEventListeners\n */\n ModalEulaLaunch.prototype.registerEventListeners = function() {\n // Apply parent event listeners.\n Modal.prototype.registerEventListeners.call(this);\n\n processEula();\n\n // On clicking the X, then hide the modal.\n this.getModal().on(CustomEvents.events.activate, SELECTORS.HIDE_BUTTON, function(e, data) {\n var cancelEvent = $.Event(ModalEvents.cancel);\n this.getRoot().trigger(cancelEvent, this);\n\n if (!cancelEvent.isDefaultPrevented()) {\n this.hide();\n data.originalEvent.preventDefault();\n }\n }.bind(this));\n };\n\n // Get the rubrics belonging to a user from Turnitin and refresh menu accordingly.\n /**\n * Method for processing the EULA.\n */\n function processEula() {\n $(window).on(\"message\", function(ev) {\n var message = typeof ev.data === 'undefined' ? ev.originalEvent.data : ev.data;\n\n // Only make ajax request if message is one of the expected responses.\n if (message === 'turnitin_eula_declined' || message === 'turnitin_eula_accepted') {\n $.ajax({\n type: \"POST\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitin/ajax.php\",\n dataType: \"json\",\n data: {\n action: \"actionuseragreement\",\n message: message,\n sesskey: M.cfg.sesskey\n },\n success: function() {\n window.location.reload();\n },\n error: function() {\n window.location.reload();\n }\n });\n }\n });\n }\n\n // Automatically register with the modal registry the first time this module is imported so that\n // you can create modals of this type using the modal factory.\n if (!registered) {\n ModalRegistry.register(ModalEulaLaunch.TYPE, ModalEulaLaunch, 'plagiarism_turnitin/modal_eula_launch');\n registered = true;\n }\n\n return ModalEulaLaunch;\n }\n);"],"names":["define","$","Ajax","Notification","CustomEvents","Modal","ModalRegistry","ModalEvents","registered","SELECTORS","ModalEulaLaunch","root","call","this","TYPE","prototype","Object","create","constructor","registerEventListeners","window","on","ev","message","data","originalEvent","ajax","type","url","M","cfg","wwwroot","dataType","action","sesskey","success","location","reload","error","getModal","events","activate","e","cancelEvent","Event","cancel","getRoot","trigger","isDefaultPrevented","hide","preventDefault","bind","register"],"mappings":"AAQAA,+CACI,CACI,SACA,YACA,oBACA,iCACA,aACA,sBACA,sBAEJ,SAASC,EAAGC,KAAMC,aAAcC,aAAcC,MAAOC,cAAeC,iBAE5DC,YAAa,EACbC,sBACa,uBASbC,gBAAkB,SAASC,MAC3BN,MAAMO,KAAKC,KAAMF,cAGrBD,gBAAgBI,KAAO,yCACvBJ,gBAAgBK,UAAYC,OAAOC,OAAOZ,MAAMU,YACtBG,YAAcR,gBAOxCA,gBAAgBK,UAAUI,uBAAyB,WAE/Cd,MAAMU,UAAUI,uBAAuBP,KAAKC,MAqB5CZ,EAAEmB,QAAQC,GAAG,WAAW,SAASC,QACzBC,aAA6B,IAAZD,GAAGE,KAAuBF,GAAGG,cAAcD,KAAOF,GAAGE,KAG1D,2BAAZD,SAAoD,2BAAZA,SACxCtB,EAAEyB,KAAK,CACHC,KAAM,OACNC,IAAKC,EAAEC,IAAIC,QAAU,gCACrBC,SAAU,OACVR,KAAM,CACFS,OAAQ,sBACRV,QAASA,QACTW,QAASL,EAAEC,IAAII,SAEnBC,QAAS,WACLf,OAAOgB,SAASC,UAEpBC,MAAO,WACHlB,OAAOgB,SAASC,oBAlC3BE,WAAWlB,GAAGjB,aAAaoC,OAAOC,SAAUhC,sBAAuB,SAASiC,EAAGlB,UAC5EmB,YAAc1C,EAAE2C,MAAMrC,YAAYsC,aACjCC,UAAUC,QAAQJ,YAAa9B,MAE/B8B,YAAYK,4BACRC,OACLzB,KAAKC,cAAcyB,mBAEzBC,KAAKtC,QAmCNL,aACDF,cAAc8C,SAAS1C,gBAAgBI,KAAMJ,gBAAiB,yCAC9DF,YAAa,GAGVE"} \ No newline at end of file +{"version":3,"sources":["src/modal_eula_launch.js"],"names":["define","$","Ajax","Notification","CustomEvents","Modal","ModalRegistry","ModalEvents","registered","SELECTORS","HIDE_BUTTON","MODAL","ModalEulaLaunch","root","call","this","TYPE","TEMPLATE","prototype","Object","create","constructor","registerEventListeners","processEula","getModal","on","events","activate","e","data","cancelEvent","Event","cancel","getRoot","trigger","isDefaultPrevented","hide","originalEvent","preventDefault","bind","window","ev","message","ajax","type","url","M","cfg","wwwroot","dataType","action","sesskey","success","location","reload","error","register"],"mappings":"AAQAA,OACI,CACI,SACA,YACA,oBACA,iCACA,aACA,sBACA,qBAEJ,SAASC,EAAGC,KAAMC,aAAcC,aAAcC,MAAOC,cAAeC,aAEhE,IAAIC,WAAa,MACjB,IAAIC,UAAY,CACZC,YAAa,uBACbC,MAAO,uBACX,EAOA,IAAIC,gBAAkB,SAASC,MAC3BR,MAAMS,KAAKC,KAAMF,IAAI,CACzB,EAEAD,gBAAgBI,KAAO,wCACvBJ,gBAAgBK,SAAW,wCAC3BL,gBAAgBM,UAAYC,OAAOC,OAAOf,MAAMa,SAAS,EACzDN,gBAAgBM,UAAUG,YAAcT,gBAOxCA,gBAAgBM,UAAUI,uBAAyB,WAE/CjB,MAAMa,UAAUI,uBAAuBR,KAAKC,IAAI,EAEhDQ,YAAY,EAGZR,KAAKS,SAAS,EAAEC,GAAGrB,aAAasB,OAAOC,SAAUlB,UAAUC,YAAa,SAASkB,EAAGC,MAChF,IAAIC,YAAc7B,EAAE8B,MAAMxB,YAAYyB,MAAM,EAC5CjB,KAAKkB,QAAQ,EAAEC,QAAQJ,YAAaf,IAAI,EAExC,GAAI,CAACe,YAAYK,mBAAmB,EAAG,CACnCpB,KAAKqB,KAAK,EACVP,KAAKQ,cAAcC,eAAe,CACtC,CACJ,EAAEC,KAAKxB,IAAI,CAAC,CAChB,EAMA,SAASQ,cACLtB,EAAEuC,MAAM,EAAEf,GAAG,UAAW,SAASgB,IAC7B,IAAIC,QAAU,OAAOD,GAAGZ,OAAS,YAAcY,GAAGJ,cAAcR,KAAOY,GAAGZ,KAG1E,GAAIa,UAAY,0BAA4BA,UAAY,yBAA0B,CAC9EzC,EAAE0C,KAAK,CACHC,KAAM,OACNC,IAAKC,EAAEC,IAAIC,QAAU,gCACrBC,SAAU,OACVpB,KAAM,CACFqB,OAAQ,sBACRR,QAASA,QACTS,QAASL,EAAEC,IAAII,OACnB,EACAC,QAAS,WACLZ,OAAOa,SAASC,OAAO,CAC3B,EACAC,MAAO,WACHf,OAAOa,SAASC,OAAO,CAC3B,CACJ,CAAC,CACL,CACJ,CAAC,CACL,CAIA,GAAI,CAAC9C,WAAY,CACbF,cAAckD,SAAS5C,gBAAgBI,KAAMJ,gBAAiB,uCAAuC,EACrGJ,WAAa,IACjB,CAEA,OAAOI,eACX,CACJ"} \ No newline at end of file diff --git a/amd/build/new_eula_modal.min.js b/amd/build/new_eula_modal.min.js new file mode 100644 index 00000000..e73253cd --- /dev/null +++ b/amd/build/new_eula_modal.min.js @@ -0,0 +1,2 @@ +define("plagiarism_turnitin/newEulaLaunch",["jquery","core/templates","core/modal","core/modal_events","plagiarism_turnitin/modal_eula_launch"],function($,Templates,Modal,ModalEvents,ModalEulaLaunch){return{newEulaLaunch:function(){var turnitinEulaClass=$(".pp_turnitin_eula");turnitinEulaClass.show();$(document).on("mod_forum-post-created",".forum-post-container",function(event,newid){var turnitinEulaClass=$("#post-content-"+newid+" .pp_turnitin_eula");turnitinEulaClass.show()});$(document).on("click",".pp_turnitin_eula_link",function(){Modal.create({type:ModalEulaLaunch.TYPE,template:ModalEulaLaunch.TEMPLATE,templateContext:{cmid:$('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:true}).then(function(modal){modal.show();modal.getRoot().find(".modal").addClass("tii_pp_modal_eula");modal.getRoot().find(".modal-content").addClass("tii_pp_modal_eula_content")})});if($(".pp_turnitin_eula_ignored").length>0){if($(".editsubmissionform").length>0){$(".editsubmissionform").hide()}if(turnitinEulaClass.siblings(".mform").length>0){turnitinEulaClass.siblings(".mform").hide()}}}}}); +//# sourceMappingURL=new_eula_modal.min.js.map \ No newline at end of file diff --git a/amd/build/new_eula_modal.min.js.map b/amd/build/new_eula_modal.min.js.map new file mode 100644 index 00000000..50fa72e7 --- /dev/null +++ b/amd/build/new_eula_modal.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["src/new_eula_modal.js"],"names":["define","$","Templates","Modal","ModalEvents","ModalEulaLaunch","newEulaLaunch","turnitinEulaClass","show","document","on","event","newid","create","type","TYPE","template","TEMPLATE","templateContext","cmid","val","wwwroot","M","cfg","large","then","modal","getRoot","find","addClass","length","hide","siblings"],"mappings":"AAQAA,OAAO,CAAC,SACA,iBACA,aACA,oBACA,yCAEJ,SAASC,EAAGC,UAAWC,MAAOC,YAAaC,iBACvC,MAAO,CACHC,cAAe,WACX,IAAIC,kBAAoBN,EAAE,mBAAmB,EAC7CM,kBAAkBC,KAAK,EAGvBP,EAAEQ,QAAQ,EAAEC,GAAG,yBAA0B,wBAAyB,SAAUC,MAAOC,OAC/E,IAAIL,kBAAoBN,EAAE,iBAAmBW,MAAQ,oBAAoB,EACzEL,kBAAkBC,KAAK,CAC3B,CAAC,EAEDP,EAAEQ,QAAQ,EAAEC,GAAG,QAAS,yBAA0B,WAC9CP,MAAMU,OAAO,CACTC,KAAMT,gBAAgBU,KACtBC,SAAUX,gBAAgBY,SAC1BC,gBAAiB,CACbC,KAAMlB,EAAE,4BAA4B,EAAEmB,IAAI,EAC1CC,QAASC,EAAEC,IAAIF,OACnB,EACAG,MAAO,IACX,CAAC,EACIC,KAAK,SAAUC,OACZA,MAAMlB,KAAK,EACXkB,MAAMC,QAAQ,EAAEC,KAAK,QAAQ,EAAEC,SAAS,mBAAmB,EAC3DH,MAAMC,QAAQ,EAAEC,KAAK,gBAAgB,EAAEC,SAAS,2BAA2B,CAC/E,CAAC,CACT,CAAC,EAGD,GAAI5B,EAAE,2BAA2B,EAAE6B,OAAS,EAAG,CAC3C,GAAI7B,EAAE,qBAAqB,EAAE6B,OAAS,EAAG,CACrC7B,EAAE,qBAAqB,EAAE8B,KAAK,CAClC,CACA,GAAIxB,kBAAkByB,SAAS,QAAQ,EAAEF,OAAS,EAAG,CACjDvB,kBAAkByB,SAAS,QAAQ,EAAED,KAAK,CAC9C,CACJ,CACJ,CACJ,CACJ,CAAC"} \ No newline at end of file diff --git a/amd/build/peermark.min.js b/amd/build/peermark.min.js index 5bc3c340..dd46aba4 100644 --- a/amd/build/peermark.min.js +++ b/amd/build/peermark.min.js @@ -1,3 +1,2 @@ -define("plagiarism_turnitin/peermark",["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_peermark_manager_launch","plagiarism_turnitin/modal_peermark_reviews_launch"],(function($,Templates,ModalFactory,ModalEvents,ModalPeermarkManagerLaunch,ModalPeermarkReviewsLaunch){return{peermarkLaunch:function(){var that=this;$(".peermark_manager_launch").on("click",(function(event){event.preventDefault(),that.peermarkCreateModal(ModalPeermarkManagerLaunch.TYPE)})),$(document).on("click",".peermark_reviews_pp_launch",(function(){that.peermarkCreateModal(ModalPeermarkReviewsLaunch.TYPE)}))},peermarkCreateModal:function(modalType){if($('input[name="coursemodule"]').val())var cmid=$('input[name="coursemodule"]').val();else cmid=new URLSearchParams(window.location.search).get("id");ModalFactory.create({type:modalType,templateContext:{cmid:cmid,wwwroot:M.cfg.wwwroot},large:!0}).then((function(modal){modal.show()}))}}})); - +define(["jquery","core/templates","core/modal","core/modal_events","plagiarism_turnitin/modal_peermark_manager_launch","plagiarism_turnitin/modal_peermark_reviews_launch"],function($,Templates,Modal,ModalEvents,ModalPeermarkManagerLaunch,ModalPeermarkReviewsLaunch){return{peermarkLaunch:function(){var that=this;$(".peermark_manager_launch").on("click",function(event){event.preventDefault();that.peermarkCreateModal(ModalPeermarkManagerLaunch.TYPE)});$(document).on("click",".peermark_reviews_pp_launch",function(){that.peermarkCreateModal(ModalPeermarkReviewsLaunch.TYPE)})},peermarkCreateModal:function(modalType){if($('input[name="coursemodule"]').val()){var cmid=$('input[name="coursemodule"]').val()}else{var urlParams=new URLSearchParams(window.location.search);var cmid=urlParams.get("id")}Modal.create({type:modalType,templateContext:{cmid:cmid,wwwroot:M.cfg.wwwroot},large:true}).then(function(modal){modal.show()})}}}); //# sourceMappingURL=peermark.min.js.map \ No newline at end of file diff --git a/amd/build/peermark.min.js.map b/amd/build/peermark.min.js.map index 19cd1cf1..44d7459f 100644 --- a/amd/build/peermark.min.js.map +++ b/amd/build/peermark.min.js.map @@ -1 +1 @@ -{"version":3,"file":"peermark.min.js","sources":["../src/peermark.js"],"sourcesContent":["/**\n * Javascript controller for launching a Peermark modal.\n *\n * @copyright Turnitin\n * @author 2019 David Winn \n * @module plagiarism_turnitin/peermarkLaunch\n */\n\ndefine(['jquery',\n 'core/templates',\n 'core/modal_factory',\n 'core/modal_events',\n 'plagiarism_turnitin/modal_peermark_manager_launch',\n 'plagiarism_turnitin/modal_peermark_reviews_launch'\n ],\n function($, Templates, ModalFactory, ModalEvents, ModalPeermarkManagerLaunch, ModalPeermarkReviewsLaunch) {\n return {\n peermarkLaunch: function() {\n var that = this;\n $('.peermark_manager_launch').on('click', function(event) {\n event.preventDefault();\n that.peermarkCreateModal(ModalPeermarkManagerLaunch.TYPE);\n });\n\n $(document).on('click', '.peermark_reviews_pp_launch', function() {\n that.peermarkCreateModal(ModalPeermarkReviewsLaunch.TYPE);\n });\n },\n peermarkCreateModal: function(modalType) {\n\n if ($('input[name=\"coursemodule\"]').val()) {\n var cmid = $('input[name=\"coursemodule\"]').val();\n } else {\n var urlParams = new URLSearchParams(window.location.search);\n var cmid = urlParams.get('id');\n }\n ModalFactory.create({\n type: modalType,\n templateContext: {\n cmid: cmid,\n wwwroot: M.cfg.wwwroot\n },\n large: true\n })\n .then(function (modal) {\n modal.show();\n });\n }\n };\n });"],"names":["define","$","Templates","ModalFactory","ModalEvents","ModalPeermarkManagerLaunch","ModalPeermarkReviewsLaunch","peermarkLaunch","that","this","on","event","preventDefault","peermarkCreateModal","TYPE","document","modalType","val","cmid","URLSearchParams","window","location","search","get","create","type","templateContext","wwwroot","M","cfg","large","then","modal","show"],"mappings":"AAQAA,sCAAO,CAAC,SACA,iBACA,qBACA,oBACA,oDACA,sDAEJ,SAASC,EAAGC,UAAWC,aAAcC,YAAaC,2BAA4BC,kCACnE,CACHC,eAAgB,eACRC,KAAOC,KACXR,EAAE,4BAA4BS,GAAG,SAAS,SAASC,OAC/CA,MAAMC,iBACNJ,KAAKK,oBAAoBR,2BAA2BS,SAGxDb,EAAEc,UAAUL,GAAG,QAAS,+BAA+B,WACnDF,KAAKK,oBAAoBP,2BAA2BQ,UAG5DD,oBAAqB,SAASG,cAEtBf,EAAE,8BAA8BgB,UAC5BC,KAAOjB,EAAE,8BAA8BgB,WAGvCC,KADY,IAAIC,gBAAgBC,OAAOC,SAASC,QAC/BC,IAAI,MAE7BpB,aAAaqB,OAAO,CAChBC,KAAMT,UACNU,gBAAiB,CACbR,KAAMA,KACNS,QAASC,EAAEC,IAAIF,SAEnBG,OAAO,IAENC,MAAK,SAAUC,OACZA,MAAMC"} \ No newline at end of file +{"version":3,"sources":["../src/peermark.js"],"names":["define","$","Templates","Modal","ModalEvents","ModalPeermarkManagerLaunch","ModalPeermarkReviewsLaunch","peermarkLaunch","that","this","on","event","preventDefault","peermarkCreateModal","TYPE","document","modalType","val","cmid","urlParams","URLSearchParams","window","location","search","get","create","type","templateContext","wwwroot","M","cfg","large","then","modal","show"],"mappings":"AAQAA,OAAO,CAAC,SACA,iBACA,aACA,oBACA,oDACA,qDAEJ,SAASC,EAAGC,UAAWC,MAAOC,YAAaC,2BAA4BC,4BACnE,MAAO,CACHC,eAAgB,WACZ,IAAIC,KAAOC,KACXR,EAAE,0BAA0B,EAAES,GAAG,QAAS,SAASC,OAC/CA,MAAMC,eAAe,EACrBJ,KAAKK,oBAAoBR,2BAA2BS,IAAI,CAC5D,CAAC,EAEDb,EAAEc,QAAQ,EAAEL,GAAG,QAAS,8BAA+B,WACnDF,KAAKK,oBAAoBP,2BAA2BQ,IAAI,CAC5D,CAAC,CACL,EACAD,oBAAqB,SAASG,WAE1B,GAAIf,EAAE,4BAA4B,EAAEgB,IAAI,EAAG,CACvC,IAAIC,KAAOjB,EAAE,4BAA4B,EAAEgB,IAAI,CACnD,KAAO,CACH,IAAIE,UAAY,IAAIC,gBAAgBC,OAAOC,SAASC,MAAM,EAC1D,IAAIL,KAAOC,UAAUK,IAAI,IAAI,CACjC,CACArB,MAAMsB,OAAO,CACTC,KAAMV,UACNW,gBAAiB,CACbT,KAAMA,KACNU,QAASC,EAAEC,IAAIF,OACnB,EACAG,MAAO,IACX,CAAC,EACIC,KAAK,SAAUC,OACZA,MAAMC,KAAK,CACf,CAAC,CACT,CACJ,CACJ,CAAC"} \ No newline at end of file diff --git a/amd/build/quickmark.min.js b/amd/build/quickmark.min.js index 7e5f06a1..9a28d1c5 100644 --- a/amd/build/quickmark.min.js +++ b/amd/build/quickmark.min.js @@ -1,3 +1,2 @@ -define("plagiarism_turnitin/quickmark",["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_quickmark_launch"],(function($,Templates,ModalFactory,ModalEvents,ModalQuickmarkLaunch){return{quickmarkLaunch:function(){$(".plagiarism_turnitin_quickmark_manager_launch").on("click",(function(event){event.preventDefault(),ModalFactory.create({type:ModalQuickmarkLaunch.TYPE,templateContext:{cmid:$('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:!0}).then((function(modal){modal.show()}))}))}}})); - +define(["jquery","core/templates","core/modal","core/modal_events","plagiarism_turnitin/modal_quickmark_launch"],function($,Templates,Modal,ModalEvents,ModalQuickmarkLaunch){return{quickmarkLaunch:function(){$(".plagiarism_turnitin_quickmark_manager_launch").on("click",function(event){event.preventDefault();Modal.create({type:ModalQuickmarkLaunch.TYPE,templateContext:{cmid:$('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:true}).then(function(modal){modal.show()})})}}}); //# sourceMappingURL=quickmark.min.js.map \ No newline at end of file diff --git a/amd/build/quickmark.min.js.map b/amd/build/quickmark.min.js.map index d41fe0a9..ffa51f0f 100644 --- a/amd/build/quickmark.min.js.map +++ b/amd/build/quickmark.min.js.map @@ -1 +1 @@ -{"version":3,"file":"quickmark.min.js","sources":["../src/quickmark.js"],"sourcesContent":["/**\n * Javascript controller for launching a Quickmark modal.\n *\n * @copyright Turnitin\n * @author 2019 David Winn \n * @module plagiarism_turnitin/quickmarkLaunch\n */\n\ndefine(['jquery',\n 'core/templates',\n 'core/modal_factory',\n 'core/modal_events',\n 'plagiarism_turnitin/modal_quickmark_launch'\n ],\n function($, Templates, ModalFactory, ModalEvents, ModalQuickmarkLaunch) {\n return {\n quickmarkLaunch: function() {\n $('.plagiarism_turnitin_quickmark_manager_launch').on('click', function (event) {\n event.preventDefault();\n ModalFactory.create({\n type: ModalQuickmarkLaunch.TYPE,\n templateContext: {\n cmid: $('input[name=\"coursemodule\"]').val(),\n wwwroot: M.cfg.wwwroot\n },\n large: true\n })\n .then(function (modal) {\n modal.show();\n });\n });\n }\n };\n });"],"names":["define","$","Templates","ModalFactory","ModalEvents","ModalQuickmarkLaunch","quickmarkLaunch","on","event","preventDefault","create","type","TYPE","templateContext","cmid","val","wwwroot","M","cfg","large","then","modal","show"],"mappings":"AAQAA,uCAAO,CAAC,SACA,iBACA,qBACA,oBACA,+CAEJ,SAASC,EAAGC,UAAWC,aAAcC,YAAaC,4BACvC,CACHC,gBAAiB,WACbL,EAAE,iDAAiDM,GAAG,SAAS,SAAUC,OACrEA,MAAMC,iBACNN,aAAaO,OAAO,CAChBC,KAAMN,qBAAqBO,KAC3BC,gBAAiB,CACbC,KAAMb,EAAE,8BAA8Bc,MACtCC,QAASC,EAAEC,IAAIF,SAEnBG,OAAO,IAENC,MAAK,SAAUC,OACZA,MAAMC"} \ No newline at end of file +{"version":3,"sources":["../src/quickmark.js"],"names":["define","$","Templates","Modal","ModalEvents","ModalQuickmarkLaunch","quickmarkLaunch","on","event","preventDefault","create","type","TYPE","templateContext","cmid","val","wwwroot","M","cfg","large","then","modal","show"],"mappings":"AAQAA,OAAO,CAAC,SACA,iBACA,aACA,oBACA,8CAEJ,SAASC,EAAGC,UAAWC,MAAOC,YAAaC,sBACvC,MAAO,CACHC,gBAAiB,WACbL,EAAE,+CAA+C,EAAEM,GAAG,QAAS,SAAUC,OACrEA,MAAMC,eAAe,EACrBN,MAAMO,OAAO,CACTC,KAAMN,qBAAqBO,KAC3BC,gBAAiB,CACbC,KAAMb,EAAE,4BAA4B,EAAEc,IAAI,EAC1CC,QAASC,EAAEC,IAAIF,OACnB,EACAG,MAAO,IACX,CAAC,EACIC,KAAK,SAAUC,OACZA,MAAMC,KAAK,CACf,CAAC,CACT,CAAC,CACL,CACJ,CACJ,CAAC"} \ No newline at end of file diff --git a/amd/build/rubric.min.js b/amd/build/rubric.min.js index 5cede269..45aaeb30 100644 --- a/amd/build/rubric.min.js +++ b/amd/build/rubric.min.js @@ -1,3 +1,2 @@ -define("plagiarism_turnitin/rubric",["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_rubric_manager_launch","plagiarism_turnitin/modal_rubric_view_launch"],(function($,Templates,ModalFactory,ModalEvents,ModalRubricManagerLaunch,ModalRubricViewLaunch){return{rubric:function(){var that=this;$(".rubric_manager_launch").on("click",(function(){var courseid=$(this).data("courseid"),cmid=$(this).data("cmid");that.rubricCreateModal(ModalRubricManagerLaunch.TYPE,courseid,cmid)})),$(document).on("click",".rubric_view",(function(){var courseid=$(this).data("courseid"),cmid=$(this).data("cmid");that.rubricCreateModal(ModalRubricViewLaunch.TYPE,courseid,cmid)})),$("#id_plagiarism_rubric").mousedown((function(){""!=$('input[name="instance"]').val()&&"Y"!=$('input[name="rubric_warning_seen"]').val()&&confirm(M.str.plagiarism_turnitin.changerubricwarning)&&$('input[name="rubric_warning_seen"]').val("Y")}))},rubricCreateModal:function(modalType,courseid,cmid){ModalFactory.create({type:modalType,templateContext:{courseid:courseid,cmid:cmid,wwwroot:M.cfg.wwwroot},large:!0}).then((function(modal){modal.show(),modal.getRoot().find(".modal").addClass("tii_pp_modal_rubric"),modal.getRoot().find(".modal-dialog").addClass("tii_pp_modal_rubric_content")}))}}})); - +define(["jquery","core/templates","core/modal","core/modal_events","plagiarism_turnitin/modal_rubric_manager_launch","plagiarism_turnitin/modal_rubric_view_launch"],function($,Templates,Modal,ModalEvents,ModalRubricManagerLaunch,ModalRubricViewLaunch){return{rubric:function(){var that=this;$(".rubric_manager_launch").on("click",function(){var courseid=$(this).data("courseid");var cmid=$(this).data("cmid");that.rubricCreateModal(ModalRubricManagerLaunch.TYPE,courseid,cmid)});$(document).on("click",".rubric_view",function(){var courseid=$(this).data("courseid");var cmid=$(this).data("cmid");that.rubricCreateModal(ModalRubricViewLaunch.TYPE,courseid,cmid)});$("#id_plagiarism_rubric").mousedown(function(){if($('input[name="instance"]').val()!=""&&$('input[name="rubric_warning_seen"]').val()!="Y"){if(confirm(M.str.plagiarism_turnitin.changerubricwarning)){$('input[name="rubric_warning_seen"]').val("Y")}}})},rubricCreateModal:function(modalType,courseid,cmid){Modal.create({type:modalType,templateContext:{courseid:courseid,cmid:cmid,wwwroot:M.cfg.wwwroot},large:true}).then(function(modal){modal.show();modal.getRoot().find(".modal").addClass("tii_pp_modal_rubric");modal.getRoot().find(".modal-content").addClass("tii_pp_modal_rubric_content")})}}}); //# sourceMappingURL=rubric.min.js.map \ No newline at end of file diff --git a/amd/build/rubric.min.js.map b/amd/build/rubric.min.js.map index 0d080d64..96ca162f 100644 --- a/amd/build/rubric.min.js.map +++ b/amd/build/rubric.min.js.map @@ -1 +1 @@ -{"version":3,"file":"rubric.min.js","sources":["../src/rubric.js"],"sourcesContent":["/**\n * Javascript controller for handling rubrics.\n *\n * @copyright Turnitin\n * @author 2019 David Winn \n * @module plagiarism_turnitin/rubric\n */\n\ndefine(['jquery',\n 'core/templates',\n 'core/modal_factory',\n 'core/modal_events',\n 'plagiarism_turnitin/modal_rubric_manager_launch',\n 'plagiarism_turnitin/modal_rubric_view_launch'\n ],\n function($, Templates, ModalFactory, ModalEvents, ModalRubricManagerLaunch, ModalRubricViewLaunch) {\n return {\n rubric: function() {\n var that = this;\n $('.rubric_manager_launch').on('click', function() {\n var courseid = $(this).data('courseid');\n var cmid = $(this).data('cmid');\n that.rubricCreateModal(ModalRubricManagerLaunch.TYPE, courseid, cmid);\n });\n\n $(document).on('click', '.rubric_view', function() {\n var courseid = $(this).data('courseid');\n var cmid = $(this).data('cmid');\n that.rubricCreateModal(ModalRubricViewLaunch.TYPE, courseid, cmid);\n });\n\n // Show warning when changing the rubric linked to an assignment.\n $('#id_plagiarism_rubric').mousedown(function () {\n if ($('input[name=\"instance\"]').val() != '' && $('input[name=\"rubric_warning_seen\"]').val() != 'Y') {\n if (confirm(M.str.plagiarism_turnitin.changerubricwarning)) {\n $('input[name=\"rubric_warning_seen\"]').val('Y');\n }\n }\n });\n },\n rubricCreateModal: function(modalType, courseid, cmid) {\n ModalFactory.create({\n type: modalType,\n templateContext: {\n courseid: courseid,\n cmid: cmid,\n wwwroot: M.cfg.wwwroot\n },\n large: true\n })\n .then(function (modal) {\n modal.show();\n modal.getRoot().find('.modal').addClass('tii_pp_modal_rubric');\n modal.getRoot().find('.modal-dialog').addClass('tii_pp_modal_rubric_content');\n });\n }\n };\n });\n"],"names":["define","$","Templates","ModalFactory","ModalEvents","ModalRubricManagerLaunch","ModalRubricViewLaunch","rubric","that","this","on","courseid","data","cmid","rubricCreateModal","TYPE","document","mousedown","val","confirm","M","str","plagiarism_turnitin","changerubricwarning","modalType","create","type","templateContext","wwwroot","cfg","large","then","modal","show","getRoot","find","addClass"],"mappings":"AAQAA,oCAAO,CAAC,SACA,iBACA,qBACA,oBACA,kDACA,iDAEJ,SAASC,EAAGC,UAAWC,aAAcC,YAAaC,yBAA0BC,6BACjE,CACHC,OAAQ,eACAC,KAAOC,KACXR,EAAE,0BAA0BS,GAAG,SAAS,eAChCC,SAAWV,EAAEQ,MAAMG,KAAK,YACxBC,KAAOZ,EAAEQ,MAAMG,KAAK,QACxBJ,KAAKM,kBAAkBT,yBAAyBU,KAAMJ,SAAUE,SAGpEZ,EAAEe,UAAUN,GAAG,QAAS,gBAAgB,eAChCC,SAAWV,EAAEQ,MAAMG,KAAK,YACxBC,KAAOZ,EAAEQ,MAAMG,KAAK,QACxBJ,KAAKM,kBAAkBR,sBAAsBS,KAAMJ,SAAUE,SAIjEZ,EAAE,yBAAyBgB,WAAU,WACQ,IAArChB,EAAE,0BAA0BiB,OAA+D,KAAhDjB,EAAE,qCAAqCiB,OAC9EC,QAAQC,EAAEC,IAAIC,oBAAoBC,sBAClCtB,EAAE,qCAAqCiB,IAAI,SAK3DJ,kBAAmB,SAASU,UAAWb,SAAUE,MAC7CV,aAAasB,OAAO,CAChBC,KAAMF,UACNG,gBAAiB,CACbhB,SAAUA,SACVE,KAAMA,KACNe,QAASR,EAAES,IAAID,SAEnBE,OAAO,IAENC,MAAK,SAAUC,OACZA,MAAMC,OACND,MAAME,UAAUC,KAAK,UAAUC,SAAS,uBACxCJ,MAAME,UAAUC,KAAK,iBAAiBC,SAAS"} \ No newline at end of file +{"version":3,"sources":["../src/rubric.js"],"names":["define","$","Templates","Modal","ModalEvents","ModalRubricManagerLaunch","ModalRubricViewLaunch","rubric","that","this","on","courseid","data","cmid","rubricCreateModal","TYPE","document","mousedown","val","confirm","M","str","plagiarism_turnitin","changerubricwarning","modalType","create","type","templateContext","wwwroot","cfg","large","then","modal","show","getRoot","find","addClass"],"mappings":"AAQAA,OAAO,CAAC,SACA,iBACA,aACA,oBACA,kDACA,gDAEJ,SAASC,EAAGC,UAAWC,MAAOC,YAAaC,yBAA0BC,uBACjE,MAAO,CACHC,OAAQ,WACJ,IAAIC,KAAOC,KACXR,EAAE,wBAAwB,EAAES,GAAG,QAAS,WACpC,IAAIC,SAAWV,EAAEQ,IAAI,EAAEG,KAAK,UAAU,EACtC,IAAIC,KAAOZ,EAAEQ,IAAI,EAAEG,KAAK,MAAM,EAC9BJ,KAAKM,kBAAkBT,yBAAyBU,KAAMJ,SAAUE,IAAI,CACxE,CAAC,EAEDZ,EAAEe,QAAQ,EAAEN,GAAG,QAAS,eAAgB,WACpC,IAAIC,SAAWV,EAAEQ,IAAI,EAAEG,KAAK,UAAU,EACtC,IAAIC,KAAOZ,EAAEQ,IAAI,EAAEG,KAAK,MAAM,EAC9BJ,KAAKM,kBAAkBR,sBAAsBS,KAAMJ,SAAUE,IAAI,CACrE,CAAC,EAGDZ,EAAE,uBAAuB,EAAEgB,UAAU,WACjC,GAAIhB,EAAE,wBAAwB,EAAEiB,IAAI,GAAK,IAAMjB,EAAE,mCAAmC,EAAEiB,IAAI,GAAK,IAAK,CAChG,GAAIC,QAAQC,EAAEC,IAAIC,oBAAoBC,mBAAmB,EAAG,CACxDtB,EAAE,mCAAmC,EAAEiB,IAAI,GAAG,CAClD,CACJ,CACJ,CAAC,CACL,EACAJ,kBAAmB,SAASU,UAAWb,SAAUE,MAC7CV,MAAMsB,OAAO,CACTC,KAAMF,UACNG,gBAAiB,CACbhB,SAAUA,SACVE,KAAMA,KACNe,QAASR,EAAES,IAAID,OACnB,EACAE,MAAO,IACX,CAAC,EACIC,KAAK,SAAUC,OACZA,MAAMC,KAAK,EACXD,MAAME,QAAQ,EAAEC,KAAK,QAAQ,EAAEC,SAAS,qBAAqB,EAC7DJ,MAAME,QAAQ,EAAEC,KAAK,gBAAgB,EAAEC,SAAS,6BAA6B,CACjF,CAAC,CACT,CACJ,CACJ,CAAC"} \ No newline at end of file diff --git a/amd/src/modal_eula_launch.js b/amd/src/modal_eula_launch.js index 6a0977a8..e96b5173 100644 --- a/amd/src/modal_eula_launch.js +++ b/amd/src/modal_eula_launch.js @@ -34,6 +34,7 @@ define( }; ModalEulaLaunch.TYPE = 'plagiarism_turnitin-modal_eula_launch'; + ModalEulaLaunch.TEMPLATE = 'plagiarism_turnitin/modal_eula_launch'; ModalEulaLaunch.prototype = Object.create(Modal.prototype); ModalEulaLaunch.prototype.constructor = ModalEulaLaunch; diff --git a/amd/src/new_eula_modal.js b/amd/src/new_eula_modal.js new file mode 100644 index 00000000..d9942bb7 --- /dev/null +++ b/amd/src/new_eula_modal.js @@ -0,0 +1,55 @@ +/** + * Javascript controller for launching the EULA modal. + * + * @copyright Turnitin + * @author 2023 Isaac Xiong + * @module plagiarism_turnitin/newEulaLaunch + */ + +define(['jquery', + 'core/templates', + 'core/modal', + 'core/modal_events', + 'plagiarism_turnitin/modal_eula_launch', + ], + function($, Templates, Modal, ModalEvents, ModalEulaLaunch) { + return { + newEulaLaunch: function() { + var turnitinEulaClass = $(".pp_turnitin_eula"); + turnitinEulaClass.show(); + + // Show the 'accept EULA' prompt for new in-page forum replies. + $(document).on('mod_forum-post-created', '.forum-post-container', function (event, newid) { + var turnitinEulaClass = $("#post-content-" + newid + " .pp_turnitin_eula"); + turnitinEulaClass.show(); + }); + + $(document).on('click', '.pp_turnitin_eula_link', function() { + Modal.create({ + type: ModalEulaLaunch.TYPE, + template: ModalEulaLaunch.TEMPLATE, + templateContext: { + cmid: $('input[name="coursemodule"]').val(), + wwwroot: M.cfg.wwwroot + }, + large: true, + }) + .then(function (modal) { + modal.show(); + modal.getRoot().find('.modal').addClass('tii_pp_modal_eula'); + modal.getRoot().find('.modal-content').addClass('tii_pp_modal_eula_content'); + }); + }); + + // Hide the submission form if the user has never accepted or declined the Turnitin EULA. + if ($(".pp_turnitin_eula_ignored").length > 0) { + if ($('.editsubmissionform').length > 0) { + $('.editsubmissionform').hide(); + } + if (turnitinEulaClass.siblings('.mform').length > 0) { + turnitinEulaClass.siblings('.mform').hide(); + } + } + } + }; + }); \ No newline at end of file diff --git a/amd/src/peermark.js b/amd/src/peermark.js index df8f2d71..8455fd6a 100644 --- a/amd/src/peermark.js +++ b/amd/src/peermark.js @@ -8,12 +8,12 @@ define(['jquery', 'core/templates', - 'core/modal_factory', + 'core/modal', 'core/modal_events', 'plagiarism_turnitin/modal_peermark_manager_launch', 'plagiarism_turnitin/modal_peermark_reviews_launch' ], - function($, Templates, ModalFactory, ModalEvents, ModalPeermarkManagerLaunch, ModalPeermarkReviewsLaunch) { + function($, Templates, Modal, ModalEvents, ModalPeermarkManagerLaunch, ModalPeermarkReviewsLaunch) { return { peermarkLaunch: function() { var that = this; @@ -34,7 +34,7 @@ define(['jquery', var urlParams = new URLSearchParams(window.location.search); var cmid = urlParams.get('id'); } - ModalFactory.create({ + Modal.create({ type: modalType, templateContext: { cmid: cmid, diff --git a/amd/src/quickmark.js b/amd/src/quickmark.js index 5a3a94ba..720c0cd4 100644 --- a/amd/src/quickmark.js +++ b/amd/src/quickmark.js @@ -8,16 +8,16 @@ define(['jquery', 'core/templates', - 'core/modal_factory', + 'core/modal', 'core/modal_events', 'plagiarism_turnitin/modal_quickmark_launch' ], - function($, Templates, ModalFactory, ModalEvents, ModalQuickmarkLaunch) { + function($, Templates, Modal, ModalEvents, ModalQuickmarkLaunch) { return { quickmarkLaunch: function() { $('.plagiarism_turnitin_quickmark_manager_launch').on('click', function (event) { event.preventDefault(); - ModalFactory.create({ + Modal.create({ type: ModalQuickmarkLaunch.TYPE, templateContext: { cmid: $('input[name="coursemodule"]').val(), diff --git a/amd/src/rubric.js b/amd/src/rubric.js index a4ab429c..79a3dbb8 100644 --- a/amd/src/rubric.js +++ b/amd/src/rubric.js @@ -8,12 +8,12 @@ define(['jquery', 'core/templates', - 'core/modal_factory', + 'core/modal', 'core/modal_events', 'plagiarism_turnitin/modal_rubric_manager_launch', 'plagiarism_turnitin/modal_rubric_view_launch' ], - function($, Templates, ModalFactory, ModalEvents, ModalRubricManagerLaunch, ModalRubricViewLaunch) { + function($, Templates, Modal, ModalEvents, ModalRubricManagerLaunch, ModalRubricViewLaunch) { return { rubric: function() { var that = this; @@ -39,7 +39,7 @@ define(['jquery', }); }, rubricCreateModal: function(modalType, courseid, cmid) { - ModalFactory.create({ + Modal.create({ type: modalType, templateContext: { courseid: courseid, diff --git a/lib.php b/lib.php index c91e5fbf..58f49336 100755 --- a/lib.php +++ b/lib.php @@ -583,7 +583,7 @@ public function print_disclosure($cmid) { * Load JS needed by the page. */ public function load_page_components() { - global $PAGE; + global $PAGE, $CFG; // The function from js files by using js_call_amd will be loaded only once. if (static::$amdcomponentsloaded) { return; @@ -593,7 +593,15 @@ public function load_page_components() { $PAGE->requires->js_call_amd('plagiarism_turnitin/peermark', 'peermarkLaunch'); $PAGE->requires->js_call_amd('plagiarism_turnitin/rubric', 'rubric'); - $PAGE->requires->js_call_amd('plagiarism_turnitin/eula', 'eulaLaunch'); + + // Moodle 4.3 uses a new Modal dialog that is not compatible with older versions of Moodle. Depending on the user's + // version of Moodle, we will use the supported versin of Modal dialog + if ($CFG->version >= 2023100900) { + $PAGE->requires->js_call_amd('plagiarism_turnitin/newEulaLaunch', 'newEulaLaunch'); + } else { + $PAGE->requires->js_call_amd('plagiarism_turnitin/eulaLaunch', 'eulaLaunch'); + } + $PAGE->requires->js_call_amd('plagiarism_turnitin/resend_submission', 'resendSubmission'); $PAGE->requires->string_for_js('closebutton', 'plagiarism_turnitin'); From 6b93bb9300d25003eb9827e2cd05f3604aa4b738 Mon Sep 17 00:00:00 2001 From: ixiongtii <113456240+ixiongtii@users.noreply.github.com> Date: Tue, 19 Dec 2023 15:32:52 -0600 Subject: [PATCH 3/4] move deprecated external methods as internal methods (#689) --- lib.php | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/lib.php b/lib.php index 58f49336..05463278 100755 --- a/lib.php +++ b/lib.php @@ -220,13 +220,10 @@ public function is_plugin_configured() { /** * Save the form data associated with the plugin * - * TODO: This code needs to be moved for 4.3 as the method will be completely removed from core. - * See https://tracker.moodle.org/browse/MDL-67526 - * * @global type $DB * @param object $data the form data to save */ - public function save_form_elements($data) { + public function save_form_data($data) { global $DB; $moduletiienabled = $this->get_config_settings('mod_'.$data->modulename); @@ -264,24 +261,13 @@ public function save_form_elements($data) { /** * Add the Turnitin settings form to an add/edit activity page * - * TODO: This code needs to be moved for 4.3 as the method will be completely removed from core. - * See https://tracker.moodle.org/browse/MDL-67526 - * * @param object $mform * @param object $context * @return type */ - public function get_form_elements_module($mform, $context, $modulename = "") { + public function add_settings_form_to_activity_page($mform, $context, $modulename = "") { global $DB, $PAGE, $COURSE; - // This is a bit of a hack and untidy way to ensure the form elements aren't displayed - // twice. This won't be needed once this method goes away. - // TODO: Remove once this method goes away. - static $settingsdisplayed; - if ($settingsdisplayed) { - return; - } - if (has_capability('plagiarism/turnitin:enable', $context)) { // Get Course module id and values. $cmid = optional_param('update', null, PARAM_INT); @@ -2914,7 +2900,7 @@ function plagiarism_turnitin_coursemodule_standard_elements($formwrapper, $mform $context = context_course::instance($formwrapper->get_course()->id); - $pluginturnitin->get_form_elements_module( + $pluginturnitin->add_settings_form_to_activity_page( $mform, $context, isset($formwrapper->get_current()->modulename) ? 'mod_'.$formwrapper->get_current()->modulename : ''); @@ -2929,7 +2915,7 @@ function plagiarism_turnitin_coursemodule_standard_elements($formwrapper, $mform function plagiarism_turnitin_coursemodule_edit_post_actions($data, $course) { $pluginturnitin = new plagiarism_plugin_turnitin(); - $pluginturnitin->save_form_elements($data); + $pluginturnitin->save_form_data($data); return $data; } From c5a9610fd1ea52fc3b860be9e672dedb6d643dce Mon Sep 17 00:00:00 2001 From: ixiongtii <113456240+ixiongtii@users.noreply.github.com> Date: Tue, 19 Dec 2023 16:11:43 -0600 Subject: [PATCH 4/4] release_2023121901 (#690) --- CHANGELOG.md | 9 +++++++++ version.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b329206f..a8c3b6e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +### Date: 2023-December-19 +### Release: v2023121901 + +#### New students can now access the EULA +Previously there was an issue with students accepting the EULA in Moodle 4.3. This has now been resolved and students presented with the EULA should be able to successfully accept it. + +#### Correct rounding of grade average +Previously when multiple submissions were made to an assignment the final grade was averaged by rounding down rather than up. This release now fixes this issue and the grade average should now round up. + ### Date: 2023-August-22 ### Release: v2023082201 diff --git a/version.php b/version.php index 17abdef5..2137ac2d 100644 --- a/version.php +++ b/version.php @@ -19,7 +19,7 @@ * @copyright 2012 iParadigms LLC */ -$plugin->version = 2023082201; +$plugin->version = 2023121901; $plugin->release = "3.5+"; $plugin->requires = 2018051700;