From ea109679f8b748d2076b648a8827bfa7f60dde07 Mon Sep 17 00:00:00 2001 From: Andrii Ilin Date: Mon, 13 May 2024 10:45:58 -0600 Subject: [PATCH 1/7] INT 20172 unattach event listener before attach, minify in bulk script --- amd/build/eula.min.js | 2 +- amd/build/eula.min.js.map | 2 +- amd/build/modal_eula_launch.min.js | 2 +- amd/build/modal_eula_launch.min.js.map | 2 +- .../modal_peermark_manager_launch.min.js | 4 +-- .../modal_peermark_manager_launch.min.js.map | 2 +- .../modal_peermark_reviews_launch.min.js | 2 +- .../modal_peermark_reviews_launch.min.js.map | 2 +- amd/build/modal_quickmark_launch.min.js | 2 +- amd/build/modal_quickmark_launch.min.js.map | 2 +- amd/build/modal_rubric_manager_launch.min.js | 2 +- .../modal_rubric_manager_launch.min.js.map | 2 +- amd/build/modal_rubric_view_launch.min.js | 2 +- amd/build/modal_rubric_view_launch.min.js.map | 2 +- amd/build/new_eula_modal.min.js | 2 +- amd/build/new_eula_modal.min.js.map | 2 +- amd/build/new_peermark.min.js | 2 +- amd/build/new_peermark.min.js.map | 2 +- amd/build/new_quickmark.min.js | 2 +- amd/build/new_quickmark.min.js.map | 2 +- amd/build/new_rubric.min.js | 2 +- amd/build/new_rubric.min.js.map | 2 +- amd/build/open_viewer.min.js | 3 +- amd/build/open_viewer.min.js.map | 2 +- amd/build/peermark.min.js | 2 +- amd/build/peermark.min.js.map | 2 +- amd/build/quickmark.min.js | 2 +- amd/build/quickmark.min.js.map | 2 +- amd/build/refresh_submissions.min.js | 3 +- amd/build/refresh_submissions.min.js.map | 2 +- amd/build/resend_submission.min.js | 3 +- amd/build/resend_submission.min.js.map | 2 +- amd/build/rubric.min.js | 2 +- amd/build/rubric.min.js.map | 2 +- amd/minify.sh | 28 +++++++++++++++++++ amd/src/open_viewer.js | 4 +-- 36 files changed, 65 insertions(+), 40 deletions(-) create mode 100755 amd/minify.sh diff --git a/amd/build/eula.min.js b/amd/build/eula.min.js index 1cc53a15..4f7ff30c 100644 --- a/amd/build/eula.min.js +++ b/amd/build/eula.min.js @@ -1,2 +1,2 @@ -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()}}}}}); +define(["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_eula_launch"],function(o,t,n,e,i){return{eulaLaunch:function(){var t=o(".pp_turnitin_eula");t.show(),o(document).on("mod_forum-post-created",".forum-post-container",function(t,n){o("#post-content-"+n+" .pp_turnitin_eula").show()}),o(document).on("click",".pp_turnitin_eula_link",function(){n.create({type:i.TYPE,templateContext:{cmid:o('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:!0}).then(function(t){t.show(),t.getRoot().find(".modal").addClass("tii_pp_modal_eula"),t.getRoot().find(".modal-content").addClass("tii_pp_modal_eula_content")})}),0");optgroup.attr("label",i);$.each(val,function(j,rubric){var option=$("");option.val(j);option.text(rubric);optgroup.append(option)});$("#id_plagiarism_rubric").append(optgroup)}else{$($("#id_plagiarism_rubric")).append($("")).attr("label",t),r.each(e,function(t,e){var i=r("");i.val(t),i.text(e),a.append(i)}),r("#id_plagiarism_rubric").append(a))}),r('#id_plagiarism_rubric option[value="'+e+'"]').attr("selected","selected")}})}return c.TYPE="plagiarism_turnitin-modal_rubric_manager_launch",c.TEMPLATE="plagiarism_turnitin/modal_rubric_manager_launch",((c.prototype=Object.create(a.prototype)).constructor=c).prototype.registerEventListeners=function(){a.prototype.registerEventListeners.call(this),this.getModal().on(i.events.activate,s,function(t,e){var i=r.Event(o.cancel);this.getRoot().trigger(i,this),i.isDefaultPrevented()||(this.hide(),e.originalEvent.preventDefault(),u())}.bind(this)),this.getRoot().click(function(t){r(t.target).closest(l).length||u()}.bind(this))},n.register(c.TYPE,c,"plagiarism_turnitin/modal_rubric_manager_launch"),c}); //# sourceMappingURL=modal_rubric_manager_launch.min.js.map \ No newline at end of file diff --git a/amd/build/modal_rubric_manager_launch.min.js.map b/amd/build/modal_rubric_manager_launch.min.js.map index 77d73da7..716c7013 100644 --- a/amd/build/modal_rubric_manager_launch.min.js.map +++ b/amd/build/modal_rubric_manager_launch.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["src/modal_rubric_manager_launch.js"],"names":["define","$","Ajax","Notification","CustomEvents","Modal","ModalRegistry","ModalEvents","registered","SELECTORS","HIDE_BUTTON","MODAL","ModalRubricManagerLaunch","root","call","this","TYPE","TEMPLATE","prototype","Object","create","constructor","registerEventListeners","getModal","on","events","activate","e","data","cancelEvent","Event","cancel","getRoot","trigger","isDefaultPrevented","hide","originalEvent","preventDefault","refreshRubricSelect","bind","click","target","closest","length","currentRubric","val","ajax","dataType","type","url","action","assignment","modulename","course","success","empty","options","each","i","isNumeric","optgroup","attr","j","rubric","option","text","append","value","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,yBAA2B,SAASC,MACpCR,MAAMS,KAAKC,KAAMF,IAAI,CACzB,EAEAD,yBAAyBI,KAAO,kDAChCJ,yBAAyBK,SAAW,kDACpCL,yBAAyBM,UAAYC,OAAOC,OAAOf,MAAMa,SAAS,EAClEN,yBAAyBM,UAAUG,YAAcT,yBAOjDA,yBAAyBM,UAAUI,uBAAyB,WAExDjB,MAAMa,UAAUI,uBAAuBR,KAAKC,IAAI,EAGhDA,KAAKQ,SAAS,EAAEC,GAAGpB,aAAaqB,OAAOC,SAAUjB,UAAUC,YAAa,SAASiB,EAAGC,MAChF,IAAIC,YAAc5B,EAAE6B,MAAMvB,YAAYwB,MAAM,EAC5ChB,KAAKiB,QAAQ,EAAEC,QAAQJ,YAAad,IAAI,EAExC,GAAI,CAACc,YAAYK,mBAAmB,EAAG,CACnCnB,KAAKoB,KAAK,EACVP,KAAKQ,cAAcC,eAAe,EAElCC,oBAAoB,CACxB,CACJ,EAAEC,KAAKxB,IAAI,CAAC,EAGZA,KAAKiB,QAAQ,EAAEQ,MAAM,SAASb,GAC1B,GAAI,CAAC1B,EAAE0B,EAAEc,MAAM,EAAEC,QAAQjC,UAAUE,KAAK,EAAEgC,OAAQ,CAC9CL,oBAAoB,CACxB,CACJ,EAAEC,KAAKxB,IAAI,CAAC,CAChB,EAKA,SAASuB,sBACL,IAAIM,cAAgB3C,EAAE,uBAAuB,EAAE4C,IAAI,EACnD5C,EAAE6C,KAAK,CACHC,SAAY,OACZC,KAAQ,OACRC,IAAO,kCACPrB,KAAQ,CACJsB,OAAQ,wBAAyBC,WAAYlD,EAAE,wBAAwB,EAAE4C,IAAI,EAC7EO,WAAYnD,EAAE,0BAA0B,EAAE4C,IAAI,EAAGQ,OAAQpD,EAAE,sBAAsB,EAAE4C,IAAI,CAC3F,EACAS,QAAS,SAAU1B,MACf3B,EAAEA,EAAE,uBAAuB,CAAC,EAAEsD,MAAM,EACpC,IAAIC,QAAU5B,KACd3B,EAAEwD,KAAKD,QAAS,SAAUE,EAAGb,KACzB,GAAI,CAAC5C,EAAE0D,UAAUD,CAAC,GAAKA,IAAM,GAAI,CAE7B,IAAIE,SAAW3D,EAAE,YAAY,EAC7B2D,SAASC,KAAK,QAASH,CAAC,EAExBzD,EAAEwD,KAAKZ,IAAK,SAAUiB,EAAGC,QACrB,IAAIC,OAAS/D,EAAE,mBAAmB,EAClC+D,OAAOnB,IAAIiB,CAAC,EACZE,OAAOC,KAAKF,MAAM,EAElBH,SAASM,OAAOF,MAAM,CAC1B,CAAC,EAED/D,EAAE,uBAAuB,EAAEiE,OAAON,QAAQ,CAE9C,KAAO,CACH3D,EAAEA,EAAE,uBAAuB,CAAC,EAAEiE,OAAOjE,EAAE,WAAY,CAC/CkE,MAAOT,EACPO,KAAMpB,GACV,CAAC,CAAC,CACN,CACJ,CAAC,EAED5C,EAAE,wBAA0B,kBAAoB2C,cAAgB,IAAI,EAAEiB,KAAK,WAAY,UAAU,CACrG,CACJ,CAAC,CACL,CAIA,GAAI,CAACrD,WAAY,CACbF,cAAc8D,SAASxD,yBAAyBI,KAC5CJ,yBACA,iDAAiD,EACrDJ,WAAa,IACjB,CAEA,OAAOI,wBACX,CACJ"} \ No newline at end of file +{"version":3,"file":"./build/modal_rubric_manager_launch.min.js.map","sources":["./src/modal_rubric_manager_launch.js"],"names":["define","$","Ajax","Notification","CustomEvents","Modal","ModalRegistry","ModalEvents","ModalRubricManagerLaunch","root","call","this","SELECTORS","refreshRubricSelect","currentRubric","val","ajax","dataType","type","url","data","action","assignment","modulename","course","success","empty","each","i","optgroup","isNumeric","append","value","text","attr","j","rubric","option","TYPE","TEMPLATE","prototype","Object","create","constructor","registerEventListeners","getModal","on","events","activate","e","cancelEvent","Event","cancel","getRoot","trigger","isDefaultPrevented","hide","originalEvent","preventDefault","bind","click","target","closest","length","register"],"mappings":"AAQAA,OACI,CACI,SACA,YACA,oBACA,iCACA,aACA,sBACA,qBAEJ,SAASC,EAAGC,EAAMC,EAAcC,EAAcC,EAAOC,EAAeC,GAajC,SAA3BC,EAAoCC,GACpCJ,EAAMK,KAAKC,KAAMF,CAAI,CACzB,CAbA,IACIG,EACa,uBADbA,EAEO,wBAkDX,SAASC,IACL,IAAIC,EAAgBb,EAAE,uBAAuB,EAAEc,IAAI,EACnDd,EAAEe,KAAK,CACHC,SAAY,OACZC,KAAQ,OACRC,IAAO,kCACPC,KAAQ,CACJC,OAAQ,wBAAyBC,WAAYrB,EAAE,wBAAwB,EAAEc,IAAI,EAC7EQ,WAAYtB,EAAE,0BAA0B,EAAEc,IAAI,EAAGS,OAAQvB,EAAE,sBAAsB,EAAEc,IAAI,CAC3F,EACAU,QAAS,SAAUL,GACfnB,EAAEA,EAAE,uBAAuB,CAAC,EAAEyB,MAAM,EAEpCzB,EAAE0B,KADYP,EACE,SAAUQ,EAAGb,GACzB,IAEQc,EAFH5B,EAAE6B,UAAUF,CAAC,GAAW,KAANA,EAgBnB3B,EAAEA,EAAE,uBAAuB,CAAC,EAAE8B,OAAO9B,EAAE,WAAY,CAC/C+B,MAAOJ,EACPK,KAAMlB,CACV,CAAC,CAAC,IAjBEc,EAAW5B,EAAE,YAAY,GACpBiC,KAAK,QAASN,CAAC,EAExB3B,EAAE0B,KAAKZ,EAAK,SAAUoB,EAAGC,GACrB,IAAIC,EAASpC,EAAE,mBAAmB,EAClCoC,EAAOtB,IAAIoB,CAAC,EACZE,EAAOJ,KAAKG,CAAM,EAElBP,EAASE,OAAOM,CAAM,CAC1B,CAAC,EAEDpC,EAAE,uBAAuB,EAAE8B,OAAOF,CAAQ,EAQlD,CAAC,EAED5B,EAAE,uCAA8Ca,EAAgB,IAAI,EAAEoB,KAAK,WAAY,UAAU,CACrG,CACJ,CAAC,CACL,CAWA,OAzFA1B,EAAyB8B,KAAO,kDAChC9B,EAAyB+B,SAAW,oDACpC/B,EAAyBgC,UAAYC,OAAOC,OAAOrC,EAAMmC,SAAS,GAC/BG,YAAcnC,GAOxBgC,UAAUI,uBAAyB,WAExDvC,EAAMmC,UAAUI,uBAAuBlC,KAAKC,IAAI,EAGhDA,KAAKkC,SAAS,EAAEC,GAAG1C,EAAa2C,OAAOC,SAAUpC,EAAuB,SAASqC,EAAG7B,GAChF,IAAI8B,EAAcjD,EAAEkD,MAAM5C,EAAY6C,MAAM,EAC5CzC,KAAK0C,QAAQ,EAAEC,QAAQJ,EAAavC,IAAI,EAEnCuC,EAAYK,mBAAmB,IAChC5C,KAAK6C,KAAK,EACVpC,EAAKqC,cAAcC,eAAe,EAElC7C,EAAoB,EAE5B,EAAE8C,KAAKhD,IAAI,CAAC,EAGZA,KAAK0C,QAAQ,EAAEO,MAAM,SAASX,GACrBhD,EAAEgD,EAAEY,MAAM,EAAEC,QAAQlD,CAAe,EAAEmD,QACtClD,EAAoB,CAE5B,EAAE8C,KAAKhD,IAAI,CAAC,CAChB,EAkDIL,EAAc0D,SAASxD,EAAyB8B,KAC5C9B,EACA,iDAAiD,EAIlDA,CACX,CACJ"} \ No newline at end of file diff --git a/amd/build/modal_rubric_view_launch.min.js b/amd/build/modal_rubric_view_launch.min.js index a80e6de3..8a0a3273 100644 --- a/amd/build/modal_rubric_view_launch.min.js +++ b/amd/build/modal_rubric_view_launch.min.js @@ -1,2 +1,2 @@ -define("plagiarism_turnitin/modal_rubric_view_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 ModalRubricViewLaunch=function(root){Modal.call(this,root)};ModalRubricViewLaunch.TYPE="plagiarism_turnitin-modal_rubric_view_launch";ModalRubricViewLaunch.TEMPLATE="plagiarism_turnitin/modal_rubric_view_launch";ModalRubricViewLaunch.prototype=Object.create(Modal.prototype);ModalRubricViewLaunch.prototype.constructor=ModalRubricViewLaunch;ModalRubricViewLaunch.prototype.registerEventListeners=function(){Modal.prototype.registerEventListeners.call(this);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))};if(!registered){ModalRegistry.register(ModalRubricViewLaunch.TYPE,ModalRubricViewLaunch,"plagiarism_turnitin/modal_rubric_view_launch");registered=true}return ModalRubricViewLaunch}); +define(["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function(r,t,e,i,n,o,a){function c(t){n.call(this,t)}var s='[data-action="hide"]';return c.TYPE="plagiarism_turnitin-modal_rubric_view_launch",c.TEMPLATE="plagiarism_turnitin/modal_rubric_view_launch",((c.prototype=Object.create(n.prototype)).constructor=c).prototype.registerEventListeners=function(){n.prototype.registerEventListeners.call(this),this.getModal().on(i.events.activate,s,function(t,e){var i=r.Event(a.cancel);this.getRoot().trigger(i,this),i.isDefaultPrevented()||(this.hide(),e.originalEvent.preventDefault())}.bind(this))},o.register(c.TYPE,c,"plagiarism_turnitin/modal_rubric_view_launch"),c}); //# sourceMappingURL=modal_rubric_view_launch.min.js.map \ No newline at end of file diff --git a/amd/build/modal_rubric_view_launch.min.js.map b/amd/build/modal_rubric_view_launch.min.js.map index ad65378f..57d27dd3 100644 --- a/amd/build/modal_rubric_view_launch.min.js.map +++ b/amd/build/modal_rubric_view_launch.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["src/modal_rubric_view_launch.js"],"names":["define","$","Ajax","Notification","CustomEvents","Modal","ModalRegistry","ModalEvents","registered","SELECTORS","HIDE_BUTTON","MODAL","ModalRubricViewLaunch","root","call","this","TYPE","TEMPLATE","prototype","Object","create","constructor","registerEventListeners","getModal","on","events","activate","e","data","cancelEvent","Event","cancel","getRoot","trigger","isDefaultPrevented","hide","originalEvent","preventDefault","bind","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,sBAAwB,SAASC,MACjCR,MAAMS,KAAKC,KAAMF,IAAI,CACzB,EAEAD,sBAAsBI,KAAO,+CAC7BJ,sBAAsBK,SAAW,+CACjCL,sBAAsBM,UAAYC,OAAOC,OAAOf,MAAMa,SAAS,EAC/DN,sBAAsBM,UAAUG,YAAcT,sBAO9CA,sBAAsBM,UAAUI,uBAAyB,WAErDjB,MAAMa,UAAUI,uBAAuBR,KAAKC,IAAI,EAGhDA,KAAKQ,SAAS,EAAEC,GAAGpB,aAAaqB,OAAOC,SAAUjB,UAAUC,YAAa,SAASiB,EAAGC,MAChF,IAAIC,YAAc5B,EAAE6B,MAAMvB,YAAYwB,MAAM,EAC5ChB,KAAKiB,QAAQ,EAAEC,QAAQJ,YAAad,IAAI,EAExC,GAAI,CAACc,YAAYK,mBAAmB,EAAG,CACnCnB,KAAKoB,KAAK,EACVP,KAAKQ,cAAcC,eAAe,CACtC,CACJ,EAAEC,KAAKvB,IAAI,CAAC,CAChB,EAIA,GAAI,CAACP,WAAY,CACbF,cAAciC,SAAS3B,sBAAsBI,KACzCJ,sBACA,8CAA8C,EAClDJ,WAAa,IACjB,CAEA,OAAOI,qBACX,CACJ"} \ No newline at end of file +{"version":3,"file":"./build/modal_rubric_view_launch.min.js.map","sources":["./src/modal_rubric_view_launch.js"],"names":["define","$","Ajax","Notification","CustomEvents","Modal","ModalRegistry","ModalEvents","ModalRubricViewLaunch","root","call","this","SELECTORS","TYPE","TEMPLATE","prototype","Object","create","constructor","registerEventListeners","getModal","on","events","activate","e","data","cancelEvent","Event","cancel","getRoot","trigger","isDefaultPrevented","hide","originalEvent","preventDefault","bind","register"],"mappings":"AAQAA,OACI,CACI,SACA,YACA,oBACA,iCACA,aACA,sBACA,qBAEJ,SAASC,EAAGC,EAAMC,EAAcC,EAAcC,EAAOC,EAAeC,GAapC,SAAxBC,EAAiCC,GACjCJ,EAAMK,KAAKC,KAAMF,CAAI,CACzB,CAbA,IACIG,EACa,uBAgDjB,OAnCAJ,EAAsBK,KAAO,+CAC7BL,EAAsBM,SAAW,iDACjCN,EAAsBO,UAAYC,OAAOC,OAAOZ,EAAMU,SAAS,GAC/BG,YAAcV,GAOxBO,UAAUI,uBAAyB,WAErDd,EAAMU,UAAUI,uBAAuBT,KAAKC,IAAI,EAGhDA,KAAKS,SAAS,EAAEC,GAAGjB,EAAakB,OAAOC,SAAUX,EAAuB,SAASY,EAAGC,GAChF,IAAIC,EAAczB,EAAE0B,MAAMpB,EAAYqB,MAAM,EAC5CjB,KAAKkB,QAAQ,EAAEC,QAAQJ,EAAaf,IAAI,EAEnCe,EAAYK,mBAAmB,IAChCpB,KAAKqB,KAAK,EACVP,EAAKQ,cAAcC,eAAe,EAE1C,EAAEC,KAAKxB,IAAI,CAAC,CAChB,EAKIL,EAAc8B,SAAS5B,EAAsBK,KACzCL,EACA,8CAA8C,EAI/CA,CACX,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 index e73253cd..ee1a3680 100644 --- a/amd/build/new_eula_modal.min.js +++ b/amd/build/new_eula_modal.min.js @@ -1,2 +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()}}}}}); +define(["jquery","core/templates","core/modal","core/modal_events","plagiarism_turnitin/modal_eula_launch"],function(e,t,n,o,i){return{newEulaLaunch:function(){var t=e(".pp_turnitin_eula");t.show(),e(document).on("mod_forum-post-created",".forum-post-container",function(t,n){e("#post-content-"+n+" .pp_turnitin_eula").show()}),e(document).on("click",".pp_turnitin_eula_link",function(){n.create({type:i.TYPE,template:i.TEMPLATE,templateContext:{cmid:e('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:!0}).then(function(t){t.show(),t.getRoot().find(".modal").addClass("tii_pp_modal_eula"),t.getRoot().find(".modal-content").addClass("tii_pp_modal_eula_content")})}),0';loading+='',loading+='

'+M.str.plagiarism_turnitin.loadingdv+"

",loading+="",$(dvWindow.document.body).html(loading),$.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"get_dv_html",submissionid:submissionid,dvtype:dvtype,cmid:coursemoduleid,sesskey:M.cfg.sesskey},success:function(data){$(dvWindow.document.body).html(loading+data),dvWindow.document.forms[0].submit(),dvWindow.document.close(),that.checkDVClosed(submissionid,coursemoduleid,dvWindow)}})},checkDVClosed:function(submissionid,coursemoduleid,dvWindow){var that=this;dvWindow.closed?that.refreshScores(submissionid,coursemoduleid):setTimeout((function(){that.checkDVClosed(submissionid,coursemoduleid,dvWindow)}),500)},refreshScores:function(submission_id,coursemoduleid){var refreshStartTime=(new Date).getTime();$.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"update_grade",submission:submission_id,cmid:coursemoduleid,sesskey:M.cfg.sesskey},success:function(){(new Date).getTime()-refreshStartTime<3e3||!$(".turnitin_score_refresh_alert").length?window.location=window.location+"":$(".turnitin_score_refresh_alert").show()}})}}})); - +define(["jquery"],function(s){return{origreport_open:function(){var n=this;s(document).off("click",".pp_origreport_open").on("click",".pp_origreport_open",function(){for(var e,t=s(this).attr("class").replace(/\s+/," ").split(" "),i=0;i',o=(o+='')+('

'+M.str.plagiarism_turnitin.loadingdv+"

")+"";s(r.document.body).html(o),s.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"get_dv_html",submissionid:t,dvtype:e,cmid:i,sesskey:M.cfg.sesskey},success:function(e){s(r.document.body).html(o+e),r.document.forms[0].submit(),r.document.close(),n.checkDVClosed(t,i,r)}})},checkDVClosed:function(e,t,i){var n=this;i.closed?n.refreshScores(e,t):setTimeout(function(){n.checkDVClosed(e,t,i)},500)},refreshScores:function(e,t){var i=(new Date).getTime();s.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"update_grade",submission:e,cmid:t,sesskey:M.cfg.sesskey},success:function(){(new Date).getTime()-i<3e3||!s(".turnitin_score_refresh_alert").length?window.location=window.location+"":s(".turnitin_score_refresh_alert").show()}})}}}); //# sourceMappingURL=open_viewer.min.js.map \ No newline at end of file diff --git a/amd/build/open_viewer.min.js.map b/amd/build/open_viewer.min.js.map index 068dcb41..a5c29a4a 100644 --- a/amd/build/open_viewer.min.js.map +++ b/amd/build/open_viewer.min.js.map @@ -1 +1 @@ -{"version":3,"file":"open_viewer.min.js","sources":["../src/open_viewer.js"],"sourcesContent":["/**\n * Javascript controller for opening the originality report viewreport\n\n * @copyright 2019 Turnitin\n * @author Charlotte Spinks \n * @module plagiarism_turnitin/open_viewer\n */\n\ndefine(['jquery'], function($) {\n return {\n origreport_open: function() {\n var that = this;\n $(document).on('click', '.pp_origreport_open', function() {\n var classList = $(this).attr('class').replace(/\\s+/,' ').split(' ');\n\n for (var i = 0; i < classList.length; i++) {\n if (classList[i].indexOf('origreport_') !== -1 && classList[i] != 'pp_origreport_open') {\n var classStr = classList[i].split(\"_\");\n that.openDV(\"origreport\", classStr[1], classStr[2]);\n }\n }\n });\n },\n\n grademark_open: function() {\n var that = this;\n $(document).on('click', '.pp_grademark_open', function() {\n var classList = $(this).attr('class').replace(/\\s+/,' ').split(' ');\n\n for (var i = 0; i < classList.length; i++) {\n if (classList[i].indexOf('grademark_') !== -1 && classList[i] != 'pp_grademark_open') {\n var classStr = classList[i].split(\"_\");\n that.openDV(\"grademark\", classStr[1], classStr[2]);\n }\n }\n });\n },\n\n // Open the DV in a new window in such a way as to not be blocked by popups.\n openDV: function(dvtype, submissionid, coursemoduleid) {\n var that = this;\n var dvWindow = window.open('', 'turnitin_viewer');\n\n var loading = '
';\n var icon = '/plagiarism/turnitin/pix/turnitin-icon.png';\n loading += '';\n loading += '

' + M.str.plagiarism_turnitin.loadingdv + '

';\n loading += '
';\n $(dvWindow.document.body).html(loading);\n\n // Get html to launch DV.\n $.ajax({\n type: \"POST\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitin/ajax.php\",\n dataType: \"json\",\n data: {\n action: \"get_dv_html\",\n submissionid: submissionid,\n dvtype: dvtype,\n cmid: coursemoduleid,\n sesskey: M.cfg.sesskey\n },\n success: function(data) {\n $(dvWindow.document.body).html(loading + data);\n dvWindow.document.forms[0].submit();\n dvWindow.document.close();\n\n that.checkDVClosed(submissionid, coursemoduleid, dvWindow);\n }\n });\n },\n\n checkDVClosed: function(submissionid, coursemoduleid, dvWindow) {\n var that = this;\n\n if (dvWindow.closed) {\n that.refreshScores(submissionid, coursemoduleid);\n } else {\n setTimeout( function(){\n that.checkDVClosed(submissionid, coursemoduleid, dvWindow);\n }, 500);\n }\n },\n\n refreshScores: function(submission_id, coursemoduleid) {\n var refreshStartTime = new Date().getTime();\n $.ajax({\n type: \"POST\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitin/ajax.php\",\n dataType: \"json\",\n data: {\n action: \"update_grade\",\n submission: submission_id,\n cmid: coursemoduleid,\n sesskey: M.cfg.sesskey\n },\n success: function() {\n var requestDuration = new Date().getTime() - refreshStartTime;\n if (requestDuration < 3000 || !$('.turnitin_score_refresh_alert').length) {\n window.location = window.location + '';\n } else {\n $('.turnitin_score_refresh_alert').show();\n }\n }\n });\n }\n };\n});\n"],"names":["define","$","origreport_open","that","this","document","on","classList","attr","replace","split","i","length","indexOf","classStr","openDV","grademark_open","dvtype","submissionid","coursemoduleid","dvWindow","window","open","loading","M","cfg","wwwroot","str","plagiarism_turnitin","loadingdv","body","html","ajax","type","url","dataType","data","action","cmid","sesskey","success","forms","submit","close","checkDVClosed","closed","refreshScores","setTimeout","submission_id","refreshStartTime","Date","getTime","submission","location","show"],"mappings":"AAQAA,yCAAO,CAAC,WAAW,SAASC,SACjB,CACHC,gBAAiB,eACTC,KAAOC,KACXH,EAAEI,UAAUC,GAAG,QAAS,uBAAuB,mBACvCC,UAAYN,EAAEG,MAAMI,KAAK,SAASC,QAAQ,MAAM,KAAKC,MAAM,KAEtDC,EAAI,EAAGA,EAAIJ,UAAUK,OAAQD,QACW,IAAzCJ,UAAUI,GAAGE,QAAQ,gBAAyC,sBAAhBN,UAAUI,GAA4B,KAChFG,SAAWP,UAAUI,GAAGD,MAAM,KAClCP,KAAKY,OAAO,aAAcD,SAAS,GAAIA,SAAS,SAMhEE,eAAgB,eACRb,KAAOC,KACXH,EAAEI,UAAUC,GAAG,QAAS,sBAAsB,mBACtCC,UAAYN,EAAEG,MAAMI,KAAK,SAASC,QAAQ,MAAM,KAAKC,MAAM,KAEtDC,EAAI,EAAGA,EAAIJ,UAAUK,OAAQD,QACU,IAAxCJ,UAAUI,GAAGE,QAAQ,eAAwC,qBAAhBN,UAAUI,GAA2B,KAC9EG,SAAWP,UAAUI,GAAGD,MAAM,KAClCP,KAAKY,OAAO,YAAaD,SAAS,GAAIA,SAAS,SAO/DC,OAAQ,SAASE,OAAQC,aAAcC,oBACjChB,KAAOC,KACPgB,SAAWC,OAAOC,KAAK,GAAI,mBAE3BC,QAAU,0DAEdA,SAAW,aAAeC,EAAEC,IAAIC,QAArB,kFACXH,SAAW,yDAA2DC,EAAEG,IAAIC,oBAAoBC,UAAY,OAC5GN,SAAW,SACXtB,EAAEmB,SAASf,SAASyB,MAAMC,KAAKR,SAG/BtB,EAAE+B,KAAK,CACHC,KAAM,OACNC,IAAKV,EAAEC,IAAIC,QAAU,gCACrBS,SAAU,OACVC,KAAM,CACFC,OAAQ,cACRnB,aAAcA,aACdD,OAAQA,OACRqB,KAAMnB,eACNoB,QAASf,EAAEC,IAAIc,SAEnBC,QAAS,SAASJ,MACdnC,EAAEmB,SAASf,SAASyB,MAAMC,KAAKR,QAAUa,MACzChB,SAASf,SAASoC,MAAM,GAAGC,SAC3BtB,SAASf,SAASsC,QAElBxC,KAAKyC,cAAc1B,aAAcC,eAAgBC,cAK3DwB,cAAe,SAAS1B,aAAcC,eAAgBC,cAC9CjB,KAAOC,KAEPgB,SAASyB,OACT1C,KAAK2C,cAAc5B,aAAcC,gBAEjC4B,YAAY,WACR5C,KAAKyC,cAAc1B,aAAcC,eAAgBC,YAClD,MAIX0B,cAAe,SAASE,cAAe7B,oBAC/B8B,kBAAmB,IAAIC,MAAOC,UAClClD,EAAE+B,KAAK,CACHC,KAAM,OACNC,IAAKV,EAAEC,IAAIC,QAAU,gCACrBS,SAAU,OACVC,KAAM,CACFC,OAAQ,eACRe,WAAYJ,cACZV,KAAMnB,eACNoB,QAASf,EAAEC,IAAIc,SAEnBC,QAAS,YACiB,IAAIU,MAAOC,UAAYF,iBACvB,MAAShD,EAAE,iCAAiCW,OAC9DS,OAAOgC,SAAWhC,OAAOgC,SAAW,GAEpCpD,EAAE,iCAAiCqD"} \ No newline at end of file +{"version":3,"file":"./build/open_viewer.min.js.map","sources":["./src/open_viewer.js"],"names":["define","$","origreport_open","that","this","document","off","on","classStr","classList","attr","replace","split","i","length","indexOf","openDV","grademark_open","dvtype","submissionid","coursemoduleid","dvWindow","window","open","loading","M","cfg","wwwroot","str","plagiarism_turnitin","loadingdv","body","html","ajax","type","url","dataType","data","action","cmid","sesskey","success","forms","submit","close","checkDVClosed","closed","refreshScores","setTimeout","submission_id","refreshStartTime","Date","getTime","submission","location","show"],"mappings":"AAQAA,OAAO,CAAC,UAAW,SAASC,GACxB,MAAO,CACHC,gBAAiB,WACb,IAAIC,EAAOC,KACXH,EAAEI,QAAQ,EAAEC,IAAI,QAAS,qBAAqB,EAAEC,GAAG,QAAS,sBAAuB,WAG/E,IAFA,IAIYC,EAJRC,EAAYR,EAAEG,IAAI,EAAEM,KAAK,OAAO,EAAEC,QAAQ,MAAM,GAAG,EAAEC,MAAM,GAAG,EAEzDC,EAAI,EAAGA,EAAIJ,EAAUK,OAAQD,CAAC,GACS,CAAC,IAAzCJ,EAAUI,GAAGE,QAAQ,aAAa,GAA4B,sBAAhBN,EAAUI,KACpDL,EAAWC,EAAUI,GAAGD,MAAM,GAAG,EACrCT,EAAKa,OAAO,aAAcR,EAAS,GAAIA,EAAS,EAAE,EAG7D,CAAC,CACN,EAEAS,eAAgB,WACZ,IAAId,EAAOC,KACXH,EAAEI,QAAQ,EAAEC,IAAI,QAAS,oBAAoB,EAAEC,GAAG,QAAS,qBAAsB,WAG7E,IAFA,IAIYC,EAJRC,EAAYR,EAAEG,IAAI,EAAEM,KAAK,OAAO,EAAEC,QAAQ,MAAM,GAAG,EAAEC,MAAM,GAAG,EAEzDC,EAAI,EAAGA,EAAIJ,EAAUK,OAAQD,CAAC,GACQ,CAAC,IAAxCJ,EAAUI,GAAGE,QAAQ,YAAY,GAA4B,qBAAhBN,EAAUI,KACnDL,EAAWC,EAAUI,GAAGD,MAAM,GAAG,EACrCT,EAAKa,OAAO,YAAaR,EAAS,GAAIA,EAAS,EAAE,EAG7D,CAAC,CACL,EAGAQ,OAAQ,SAASE,EAAQC,EAAcC,GACrC,IAAIjB,EAAOC,KACPiB,EAAWC,OAAOC,KAAK,GAAI,iBAAiB,EAE5CC,EAAU,0DAIdA,GAFAA,GAAW,aAAeC,EAAEC,IAAIC,QAAgB,oFACrC,yDAA2DF,EAAEG,IAAIC,oBAAoBC,UAAY,QACjG,SACX7B,EAAEoB,EAAShB,SAAS0B,IAAI,EAAEC,KAAKR,CAAO,EAGtCvB,EAAEgC,KAAK,CACHC,KAAM,OACNC,IAAKV,EAAEC,IAAIC,QAAU,gCACrBS,SAAU,OACVC,KAAM,CACFC,OAAQ,cACRnB,aAAcA,EACdD,OAAQA,EACRqB,KAAMnB,EACNoB,QAASf,EAAEC,IAAIc,OACnB,EACAC,QAAS,SAASJ,GACdpC,EAAEoB,EAAShB,SAAS0B,IAAI,EAAEC,KAAKR,EAAUa,CAAI,EAC7ChB,EAAShB,SAASqC,MAAM,GAAGC,OAAO,EAClCtB,EAAShB,SAASuC,MAAM,EAExBzC,EAAK0C,cAAc1B,EAAcC,EAAgBC,CAAQ,CAC7D,CACJ,CAAC,CACH,EAEAwB,cAAe,SAAS1B,EAAcC,EAAgBC,GAClD,IAAIlB,EAAOC,KAEPiB,EAASyB,OACT3C,EAAK4C,cAAc5B,EAAcC,CAAc,EAE/C4B,WAAY,WACR7C,EAAK0C,cAAc1B,EAAcC,EAAgBC,CAAQ,CAC7D,EAAG,GAAG,CAEd,EAEA0B,cAAe,SAASE,EAAe7B,GACnC,IAAI8B,GAAmB,IAAIC,MAAOC,QAAQ,EAC1CnD,EAAEgC,KAAK,CACHC,KAAM,OACNC,IAAKV,EAAEC,IAAIC,QAAU,gCACrBS,SAAU,OACVC,KAAM,CACFC,OAAQ,eACRe,WAAYJ,EACZV,KAAMnB,EACNoB,QAASf,EAAEC,IAAIc,OACnB,EACAC,QAAS,YACiB,IAAIU,MAAOC,QAAQ,EAAIF,EACvB,KAAQ,CAACjD,EAAE,+BAA+B,EAAEa,OAC9DQ,OAAOgC,SAAWhC,OAAOgC,SAAW,GAEpCrD,EAAE,+BAA+B,EAAEsD,KAAK,CAEhD,CACJ,CAAC,CACL,CACJ,CACJ,CAAC"} \ No newline at end of file diff --git a/amd/build/peermark.min.js b/amd/build/peermark.min.js index 80255ee3..cd902d0b 100644 --- a/amd/build/peermark.min.js +++ b/amd/build/peermark.min.js @@ -1,2 +1,2 @@ -define("plagiarism_turnitin/peermarkLaunch",["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)});$(document).on("click",".peermark_reviews_pp_launch",function(){that.peermarkCreateModal(ModalPeermarkReviewsLaunch)})},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")}ModalFactory.create({type:modalType.TYPE,templateContext:{cmid:cmid,wwwroot:M.cfg.wwwroot},large:true}).then(function(modal){modal.show()})}}}); +define(["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_peermark_manager_launch","plagiarism_turnitin/modal_peermark_reviews_launch"],function(r,e,n,a,t,o){return{peermarkLaunch:function(){var a=this;r(".peermark_manager_launch").on("click",function(e){e.preventDefault(),a.peermarkCreateModal(t)}),r(document).on("click",".peermark_reviews_pp_launch",function(){a.peermarkCreateModal(o)})},peermarkCreateModal:function(e){var a;a=r('input[name="coursemodule"]').val()?r('input[name="coursemodule"]').val():new URLSearchParams(window.location.search).get("id"),n.create({type:e.TYPE,templateContext:{cmid:a,wwwroot:M.cfg.wwwroot},large:!0}).then(function(e){e.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 b4dc35a3..b9ef62fc 100644 --- a/amd/build/peermark.min.js.map +++ b/amd/build/peermark.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["src/peermark.js"],"names":["define","$","Templates","ModalFactory","ModalEvents","ModalPeermarkManagerLaunch","ModalPeermarkReviewsLaunch","peermarkLaunch","that","this","on","event","preventDefault","peermarkCreateModal","document","modalType","val","cmid","urlParams","URLSearchParams","window","location","search","get","create","type","TYPE","templateContext","wwwroot","M","cfg","large","then","modal","show"],"mappings":"AAQAA,OAAO,CAAC,SACA,iBACA,qBACA,oBACA,oDACA,qDAEJ,SAASC,EAAGC,UAAWC,aAAcC,YAAaC,2BAA4BC,4BAC1E,MAAO,CACHC,eAAgB,WACZ,IAAIC,KAAOC,KACXR,EAAE,0BAA0B,EAAES,GAAG,QAAS,SAASC,OAC/CA,MAAMC,eAAe,EACrBJ,KAAKK,oBAAoBR,0BAA0B,CACvD,CAAC,EAEDJ,EAAEa,QAAQ,EAAEJ,GAAG,QAAS,8BAA+B,WACnDF,KAAKK,oBAAoBP,0BAA0B,CACvD,CAAC,CACL,EACAO,oBAAqB,SAASE,WAE1B,GAAId,EAAE,4BAA4B,EAAEe,IAAI,EAAG,CACvC,IAAIC,KAAOhB,EAAE,4BAA4B,EAAEe,IAAI,CACnD,KAAO,CACH,IAAIE,UAAY,IAAIC,gBAAgBC,OAAOC,SAASC,MAAM,EAC1D,IAAIL,KAAOC,UAAUK,IAAI,IAAI,CACjC,CACApB,aAAaqB,OAAO,CAChBC,KAAMV,UAAUW,KAChBC,gBAAiB,CACbV,KAAMA,KACNW,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 +{"version":3,"file":"./build/peermark.min.js.map","sources":["./src/peermark.js"],"names":["define","$","Templates","ModalFactory","ModalEvents","ModalPeermarkManagerLaunch","ModalPeermarkReviewsLaunch","peermarkLaunch","that","this","on","event","preventDefault","peermarkCreateModal","document","modalType","cmid","val","URLSearchParams","window","location","search","get","create","type","TYPE","templateContext","wwwroot","M","cfg","large","then","modal","show"],"mappings":"AAQAA,OAAO,CAAC,SACA,iBACA,qBACA,oBACA,oDACA,qDAEJ,SAASC,EAAGC,EAAWC,EAAcC,EAAaC,EAA4BC,GAC1E,MAAO,CACHC,eAAgB,WACZ,IAAIC,EAAOC,KACXR,EAAE,0BAA0B,EAAES,GAAG,QAAS,SAASC,GAC/CA,EAAMC,eAAe,EACrBJ,EAAKK,oBAAoBR,CAA0B,CACvD,CAAC,EAEDJ,EAAEa,QAAQ,EAAEJ,GAAG,QAAS,8BAA+B,WACnDF,EAAKK,oBAAoBP,CAA0B,CACvD,CAAC,CACL,EACAO,oBAAqB,SAASE,GAE1B,IAIQC,EAHAA,EADJf,EAAE,4BAA4B,EAAEgB,IAAI,EACzBhB,EAAE,4BAA4B,EAAEgB,IAAI,EAE/B,IAAIC,gBAAgBC,OAAOC,SAASC,MAAM,EACrCC,IAAI,IAAI,EAEjCnB,EAAaoB,OAAO,CAChBC,KAAMT,EAAUU,KAChBC,gBAAiB,CACbV,KAAMA,EACNW,QAASC,EAAEC,IAAIF,OACnB,EACAG,MAAO,CAAA,CACX,CAAC,EACIC,KAAK,SAAUC,GACZA,EAAMC,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 abc77766..c168e6ed 100644 --- a/amd/build/quickmark.min.js +++ b/amd/build/quickmark.min.js @@ -1,2 +1,2 @@ -define("plagiarism_turnitin/quickmarkLaunch",["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:true}).then(function(modal){modal.show()})})}}}); +define(["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_quickmark_launch"],function(n,e,t,a,r){return{quickmarkLaunch:function(){n(".plagiarism_turnitin_quickmark_manager_launch").on("click",function(e){e.preventDefault(),t.create({type:r.TYPE,templateContext:{cmid:n('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:!0}).then(function(e){e.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 053cb711..e75dca6a 100644 --- a/amd/build/quickmark.min.js.map +++ b/amd/build/quickmark.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["src/quickmark.js"],"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,OAAO,CAAC,SACA,iBACA,qBACA,oBACA,8CAEJ,SAASC,EAAGC,UAAWC,aAAcC,YAAaC,sBAC9C,MAAO,CACHC,gBAAiB,WACbL,EAAE,+CAA+C,EAAEM,GAAG,QAAS,SAAUC,OACrEA,MAAMC,eAAe,EACrBN,aAAaO,OAAO,CAChBC,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 +{"version":3,"file":"./build/quickmark.min.js.map","sources":["./src/quickmark.js"],"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,OAAO,CAAC,SACA,iBACA,qBACA,oBACA,8CAEJ,SAASC,EAAGC,EAAWC,EAAcC,EAAaC,GAC9C,MAAO,CACHC,gBAAiB,WACbL,EAAE,+CAA+C,EAAEM,GAAG,QAAS,SAAUC,GACrEA,EAAMC,eAAe,EACrBN,EAAaO,OAAO,CAChBC,KAAMN,EAAqBO,KAC3BC,gBAAiB,CACbC,KAAMb,EAAE,4BAA4B,EAAEc,IAAI,EAC1CC,QAASC,EAAEC,IAAIF,OACnB,EACAG,MAAO,CAAA,CACX,CAAC,EACIC,KAAK,SAAUC,GACZA,EAAMC,KAAK,CACf,CAAC,CACT,CAAC,CACL,CACJ,CACJ,CAAC"} \ No newline at end of file diff --git a/amd/build/refresh_submissions.min.js b/amd/build/refresh_submissions.min.js index d0beed22..fb707def 100644 --- a/amd/build/refresh_submissions.min.js +++ b/amd/build/refresh_submissions.min.js @@ -1,3 +1,2 @@ -define("plagiarism_turnitin/refresh_submissions",["jquery"],(function($){return{refreshSubmissions:function(){$(".plagiarism_turnitin_refresh_grades").on("click",(function(){$(".plagiarism_turnitin_refresh_grades").hide(),$(".plagiarism_turnitin_refreshing_grades").show(),$.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"update_grade",cmid:$('input[name="coursemodule"]').val(),sesskey:M.cfg.sesskey},success:function(){$(".plagiarism_turnitin_refresh_grades").show(),$(".plagiarism_turnitin_refreshing_grades").hide()}})}))}}})); - +define(["jquery"],function(i){return{refreshSubmissions:function(){i(".plagiarism_turnitin_refresh_grades").on("click",function(){i(".plagiarism_turnitin_refresh_grades").hide(),i(".plagiarism_turnitin_refreshing_grades").show(),i.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"update_grade",cmid:i('input[name="coursemodule"]').val(),sesskey:M.cfg.sesskey},success:function(){i(".plagiarism_turnitin_refresh_grades").show(),i(".plagiarism_turnitin_refreshing_grades").hide()}})})}}}); //# sourceMappingURL=refresh_submissions.min.js.map \ No newline at end of file diff --git a/amd/build/refresh_submissions.min.js.map b/amd/build/refresh_submissions.min.js.map index b457e4fb..90b24c24 100644 --- a/amd/build/refresh_submissions.min.js.map +++ b/amd/build/refresh_submissions.min.js.map @@ -1 +1 @@ -{"version":3,"file":"refresh_submissions.min.js","sources":["../src/refresh_submissions.js"],"sourcesContent":["/**\n * Javascript controller for refreshing the submissions.\n *\n * @copyright Turnitin\n * @author 2019 David Winn \n * @module plagiarism_turnitin/refreshSubmissions\n */\n\ndefine(['jquery'],\n function($) {\n return {\n refreshSubmissions: function() {\n $('.plagiarism_turnitin_refresh_grades').on('click', function() {\n $('.plagiarism_turnitin_refresh_grades').hide();\n $('.plagiarism_turnitin_refreshing_grades').show();\n\n $.ajax({\n type: \"POST\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitin/ajax.php\",\n dataType: \"json\",\n data: {\n action: \"update_grade\",\n cmid: $('input[name=\"coursemodule\"]').val(),\n sesskey: M.cfg.sesskey\n },\n success: function() {\n $('.plagiarism_turnitin_refresh_grades').show();\n $('.plagiarism_turnitin_refreshing_grades').hide();\n }\n });\n });\n }\n };\n });"],"names":["define","$","refreshSubmissions","on","hide","show","ajax","type","url","M","cfg","wwwroot","dataType","data","action","cmid","val","sesskey","success"],"mappings":"AAQAA,iDAAO,CAAC,WACJ,SAASC,SACE,CACHC,mBAAoB,WAChBD,EAAE,uCAAuCE,GAAG,SAAS,WACjDF,EAAE,uCAAuCG,OACzCH,EAAE,0CAA0CI,OAE5CJ,EAAEK,KAAK,CACHC,KAAM,OACNC,IAAKC,EAAEC,IAAIC,QAAU,gCACrBC,SAAU,OACVC,KAAM,CACFC,OAAQ,eACRC,KAAMd,EAAE,8BAA8Be,MACtCC,QAASR,EAAEC,IAAIO,SAEnBC,QAAS,WACLjB,EAAE,uCAAuCI,OACzCJ,EAAE,0CAA0CG"} \ No newline at end of file +{"version":3,"file":"./build/refresh_submissions.min.js.map","sources":["./src/refresh_submissions.js"],"names":["define","$","refreshSubmissions","on","hide","show","ajax","type","url","M","cfg","wwwroot","dataType","data","action","cmid","val","sesskey","success"],"mappings":"AAQAA,OAAO,CAAC,UACJ,SAASC,GACL,MAAO,CACHC,mBAAoB,WAChBD,EAAE,qCAAqC,EAAEE,GAAG,QAAS,WACjDF,EAAE,qCAAqC,EAAEG,KAAK,EAC9CH,EAAE,wCAAwC,EAAEI,KAAK,EAEjDJ,EAAEK,KAAK,CACHC,KAAM,OACNC,IAAKC,EAAEC,IAAIC,QAAU,gCACrBC,SAAU,OACVC,KAAM,CACFC,OAAQ,eACRC,KAAMd,EAAE,4BAA4B,EAAEe,IAAI,EAC1CC,QAASR,EAAEC,IAAIO,OACnB,EACAC,QAAS,WACLjB,EAAE,qCAAqC,EAAEI,KAAK,EAC9CJ,EAAE,wCAAwC,EAAEG,KAAK,CACrD,CACJ,CAAC,CACL,CAAC,CACL,CACJ,CACJ,CAAC"} \ No newline at end of file diff --git a/amd/build/resend_submission.min.js b/amd/build/resend_submission.min.js index 06ec88f2..af50287c 100644 --- a/amd/build/resend_submission.min.js +++ b/amd/build/resend_submission.min.js @@ -1,3 +1,2 @@ -define("plagiarism_turnitin/resend_submission",["jquery"],(function($){return{resendSubmission:function(){$(document).on("click",".plagiarism_turnitin_resubmit_link",(function(){$(this).hide(),$(this).siblings(".pp_resubmitting").removeClass("hidden");var that=$(this),submissionid=$(this).prop("id").split("_")[2],forumpost=$("#content_"+submissionid).html(),forumdata=$("#forumdata_"+submissionid).html();return $.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"resubmit_event",submissionid:submissionid,forumpost:forumpost,forumdata:forumdata,sesskey:M.cfg.sesskey},success:function(){that.siblings(".turnitin_status").removeClass("hidden"),that.siblings(".pp_resubmitting").addClass("hidden")},error:function(){that.show(),that.siblings(".pp_resubmitting").addClass("hidden")}}),!1}))}}})); - +define(["jquery"],function(e){return{resendSubmission:function(){e(document).on("click",".plagiarism_turnitin_resubmit_link",function(){e(this).hide(),e(this).siblings(".pp_resubmitting").removeClass("hidden");var i=e(this),s=e(this).prop("id").split("_")[2],t=e("#content_"+s).html(),n=e("#forumdata_"+s).html();return e.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"resubmit_event",submissionid:s,forumpost:t,forumdata:n,sesskey:M.cfg.sesskey},success:function(){i.siblings(".turnitin_status").removeClass("hidden"),i.siblings(".pp_resubmitting").addClass("hidden")},error:function(){i.show(),i.siblings(".pp_resubmitting").addClass("hidden")}}),!1})}}}); //# sourceMappingURL=resend_submission.min.js.map \ No newline at end of file diff --git a/amd/build/resend_submission.min.js.map b/amd/build/resend_submission.min.js.map index d9427d99..55d3ece9 100644 --- a/amd/build/resend_submission.min.js.map +++ b/amd/build/resend_submission.min.js.map @@ -1 +1 @@ -{"version":3,"file":"resend_submission.min.js","sources":["../src/resend_submission.js"],"sourcesContent":["/**\n * Javascript controller for resubmissions.\n *\n * @copyright Turnitin\n * @author 2019 David Winn \n * @module plagiarism_turnitin/resendSubmission\n */\n\ndefine(['jquery'], function($) {\n return {\n resendSubmission: function() {\n // Create new event for submission to be re-sent to Turnitin.\n $(document).on('click', '.plagiarism_turnitin_resubmit_link', function() {\n $(this).hide();\n $(this).siblings('.pp_resubmitting').removeClass('hidden');\n var that = $(this);\n\n var submissionid = $(this).prop('id').split(\"_\")[2];\n var forumpost = $('#content_' + submissionid).html();\n var forumdata = $('#forumdata_' + submissionid).html();\n\n $.ajax({\n type: \"POST\",\n url: M.cfg.wwwroot + \"/plagiarism/turnitin/ajax.php\",\n dataType: \"json\",\n data: {\n action: \"resubmit_event\",\n submissionid: submissionid,\n forumpost: forumpost,\n forumdata: forumdata,\n sesskey: M.cfg.sesskey\n },\n success: function() {\n that.siblings('.turnitin_status').removeClass('hidden');\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 return false;\n });\n }\n };\n});\n"],"names":["define","$","resendSubmission","document","on","this","hide","siblings","removeClass","that","submissionid","prop","split","forumpost","html","forumdata","ajax","type","url","M","cfg","wwwroot","dataType","data","action","sesskey","success","addClass","error","show"],"mappings":"AAQAA,+CAAO,CAAC,WAAW,SAASC,SACjB,CACHC,iBAAkB,WAEdD,EAAEE,UAAUC,GAAG,QAAS,sCAAsC,WAC1DH,EAAEI,MAAMC,OACRL,EAAEI,MAAME,SAAS,oBAAoBC,YAAY,cAC7CC,KAAOR,EAAEI,MAETK,aAAeT,EAAEI,MAAMM,KAAK,MAAMC,MAAM,KAAK,GAC7CC,UAAYZ,EAAE,YAAcS,cAAcI,OAC1CC,UAAYd,EAAE,cAAgBS,cAAcI,cAEhDb,EAAEe,KAAK,CACHC,KAAM,OACNC,IAAKC,EAAEC,IAAIC,QAAU,gCACrBC,SAAU,OACVC,KAAM,CACFC,OAAQ,iBACRd,aAAcA,aACdG,UAAWA,UACXE,UAAWA,UACXU,QAASN,EAAEC,IAAIK,SAEnBC,QAAS,WACLjB,KAAKF,SAAS,oBAAoBC,YAAY,UAC9CC,KAAKF,SAAS,oBAAoBoB,SAAS,WAE/CC,MAAO,WACHnB,KAAKoB,OACLpB,KAAKF,SAAS,oBAAoBoB,SAAS,cAI5C"} \ No newline at end of file +{"version":3,"file":"./build/resend_submission.min.js.map","sources":["./src/resend_submission.js"],"names":["define","$","resendSubmission","document","on","this","hide","siblings","removeClass","that","submissionid","prop","split","forumpost","html","forumdata","ajax","type","url","M","cfg","wwwroot","dataType","data","action","sesskey","success","addClass","error","show"],"mappings":"AAQAA,OAAO,CAAC,UAAW,SAASC,GACxB,MAAO,CACHC,iBAAkB,WAEdD,EAAEE,QAAQ,EAAEC,GAAG,QAAS,qCAAsC,WAC1DH,EAAEI,IAAI,EAAEC,KAAK,EACbL,EAAEI,IAAI,EAAEE,SAAS,kBAAkB,EAAEC,YAAY,QAAQ,EACzD,IAAIC,EAAOR,EAAEI,IAAI,EAEbK,EAAeT,EAAEI,IAAI,EAAEM,KAAK,IAAI,EAAEC,MAAM,GAAG,EAAE,GAC7CC,EAAYZ,EAAE,YAAcS,CAAY,EAAEI,KAAK,EAC/CC,EAAYd,EAAE,cAAgBS,CAAY,EAAEI,KAAK,EAuBrD,OArBAb,EAAEe,KAAK,CACHC,KAAM,OACNC,IAAKC,EAAEC,IAAIC,QAAU,gCACrBC,SAAU,OACVC,KAAM,CACFC,OAAQ,iBACRd,aAAcA,EACdG,UAAWA,EACXE,UAAWA,EACXU,QAASN,EAAEC,IAAIK,OACnB,EACAC,QAAS,WACLjB,EAAKF,SAAS,kBAAkB,EAAEC,YAAY,QAAQ,EACtDC,EAAKF,SAAS,kBAAkB,EAAEoB,SAAS,QAAQ,CACvD,EACAC,MAAO,WACHnB,EAAKoB,KAAK,EACVpB,EAAKF,SAAS,kBAAkB,EAAEoB,SAAS,QAAQ,CACvD,CACJ,CAAC,EAEM,CAAA,CACX,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 8496e178..46977e00 100644 --- a/amd/build/rubric.min.js +++ b/amd/build/rubric.min.js @@ -1,2 +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");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){ModalFactory.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")})}}}); +define(["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_rubric_manager_launch","plagiarism_turnitin/modal_rubric_view_launch"],function(n,i,t,r,e,c){return{rubric:function(){var a=this;n(".rubric_manager_launch").on("click",function(){var i=n(this).data("courseid"),r=n(this).data("cmid");a.rubricCreateModal(e.TYPE,i,r)}),n(document).on("click",".rubric_view",function(){var i=n(this).data("courseid"),r=n(this).data("cmid");a.rubricCreateModal(c.TYPE,i,r)}),n("#id_plagiarism_rubric").mousedown(function(){""!=n('input[name="instance"]').val()&&"Y"!=n('input[name="rubric_warning_seen"]').val()&&confirm(M.str.plagiarism_turnitin.changerubricwarning)&&n('input[name="rubric_warning_seen"]').val("Y")})},rubricCreateModal:function(i,r,a){t.create({type:i,templateContext:{courseid:r,cmid:a,wwwroot:M.cfg.wwwroot},large:!0}).then(function(i){i.show(),i.getRoot().find(".modal").addClass("tii_pp_modal_rubric"),i.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 375e6819..7eb854d6 100644 --- a/amd/build/rubric.min.js.map +++ b/amd/build/rubric.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["src/rubric.js"],"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,OAAO,CAAC,SACA,iBACA,qBACA,oBACA,kDACA,gDAEJ,SAASC,EAAGC,UAAWC,aAAcC,YAAaC,yBAA0BC,uBACxE,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,aAAasB,OAAO,CAChBC,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 +{"version":3,"file":"./build/rubric.min.js.map","sources":["./src/rubric.js"],"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,OAAO,CAAC,SACA,iBACA,qBACA,oBACA,kDACA,gDAEJ,SAASC,EAAGC,EAAWC,EAAcC,EAAaC,EAA0BC,GACxE,MAAO,CACHC,OAAQ,WACJ,IAAIC,EAAOC,KACXR,EAAE,wBAAwB,EAAES,GAAG,QAAS,WACpC,IAAIC,EAAWV,EAAEQ,IAAI,EAAEG,KAAK,UAAU,EAClCC,EAAOZ,EAAEQ,IAAI,EAAEG,KAAK,MAAM,EAC9BJ,EAAKM,kBAAkBT,EAAyBU,KAAMJ,EAAUE,CAAI,CACxE,CAAC,EAEDZ,EAAEe,QAAQ,EAAEN,GAAG,QAAS,eAAgB,WACpC,IAAIC,EAAWV,EAAEQ,IAAI,EAAEG,KAAK,UAAU,EAClCC,EAAOZ,EAAEQ,IAAI,EAAEG,KAAK,MAAM,EAC9BJ,EAAKM,kBAAkBR,EAAsBS,KAAMJ,EAAUE,CAAI,CACrE,CAAC,EAGDZ,EAAE,uBAAuB,EAAEgB,UAAU,WACQ,IAArChB,EAAE,wBAAwB,EAAEiB,IAAI,GAA2D,KAAhDjB,EAAE,mCAAmC,EAAEiB,IAAI,GAClFC,QAAQC,EAAEC,IAAIC,oBAAoBC,mBAAmB,GACrDtB,EAAE,mCAAmC,EAAEiB,IAAI,GAAG,CAG1D,CAAC,CACL,EACAJ,kBAAmB,SAASU,EAAWb,EAAUE,GAC7CV,EAAasB,OAAO,CAChBC,KAAMF,EACNG,gBAAiB,CACbhB,SAAUA,EACVE,KAAMA,EACNe,QAASR,EAAES,IAAID,OACnB,EACAE,MAAO,CAAA,CACX,CAAC,EACIC,KAAK,SAAUC,GACZA,EAAMC,KAAK,EACXD,EAAME,QAAQ,EAAEC,KAAK,QAAQ,EAAEC,SAAS,qBAAqB,EAC7DJ,EAAME,QAAQ,EAAEC,KAAK,gBAAgB,EAAEC,SAAS,6BAA6B,CACjF,CAAC,CACT,CACJ,CACJ,CAAC"} \ No newline at end of file diff --git a/amd/minify.sh b/amd/minify.sh new file mode 100755 index 00000000..010d75c8 --- /dev/null +++ b/amd/minify.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Check if UglifyJS is installed globally +if ! npm list -g uglify-js > /dev/null; then + echo "UglifyJS is not installed globally." + echo "Please run 'npm install -g uglify-js' to install it." + exit 1 +fi + +# Clear the /build directory +rm -rf ./build/* +echo "Cleared /build directory." + +# Ensure build directory exists +mkdir -p ./build + +# Minify each JavaScript file in the /src directory +for file in ./src/*.js; do + filename=$(basename -- "$file") + basename="${filename%.*}" + + # Uglify the file and create a source map + uglifyjs "$file" --compress --mangle --output "./build/${basename}.min.js" --source-map "url='${basename}.min.js.map',filename='./build/${basename}.min.js.map'" + + echo "Processed $file" +done + +echo "All files have been minified and moved to /build directory." diff --git a/amd/src/open_viewer.js b/amd/src/open_viewer.js index 8bb237d9..d9a14fd2 100644 --- a/amd/src/open_viewer.js +++ b/amd/src/open_viewer.js @@ -10,7 +10,7 @@ define(['jquery'], function($) { return { origreport_open: function() { var that = this; - $(document).on('click', '.pp_origreport_open', function() { + $(document).off('click', '.pp_origreport_open').on('click', '.pp_origreport_open', function() { var classList = $(this).attr('class').replace(/\s+/,' ').split(' '); for (var i = 0; i < classList.length; i++) { @@ -24,7 +24,7 @@ define(['jquery'], function($) { grademark_open: function() { var that = this; - $(document).on('click', '.pp_grademark_open', function() { + $(document).off('click', '.pp_grademark_open').on('click', '.pp_grademark_open', function() { var classList = $(this).attr('class').replace(/\s+/,' ').split(' '); for (var i = 0; i < classList.length; i++) { From b0c15b4b4ad01ddfa965feefe6be21214a6fc46f Mon Sep 17 00:00:00 2001 From: Andrii Ilin Date: Wed, 22 May 2024 17:08:52 -0600 Subject: [PATCH 2/7] Fix/rubrics select * fix initial options setup * fix update select after rubric creation --- amd/build/modal_rubric_manager_launch.min.js | 2 +- .../modal_rubric_manager_launch.min.js.map | 2 +- amd/build/new_rubric.min.js | 2 +- amd/build/new_rubric.min.js.map | 2 +- amd/src/modal_rubric_manager_launch.js | 2 ++ amd/src/new_eula_modal.js | 2 +- amd/src/new_peermark.js | 2 +- amd/src/new_quickmark.js | 2 +- amd/src/new_rubric.js | 19 ++++++++++++++----- classes/turnitin_view.class.php | 6 +++--- lib.php | 6 +++--- 11 files changed, 29 insertions(+), 18 deletions(-) diff --git a/amd/build/modal_rubric_manager_launch.min.js b/amd/build/modal_rubric_manager_launch.min.js index b4e651af..83222c7e 100644 --- a/amd/build/modal_rubric_manager_launch.min.js +++ b/amd/build/modal_rubric_manager_launch.min.js @@ -1,2 +1,2 @@ -define(["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function(r,t,e,i,a,n,o){function c(t){a.call(this,t)}var s='[data-action="hide"]',l='[data-region="modal"]';function u(){var e=r("#id_plagiarism_rubric").val();r.ajax({dataType:"json",type:"POST",url:"../plagiarism/turnitin/ajax.php",data:{action:"refresh_rubric_select",assignment:r('input[name="instance"]').val(),modulename:r('input[name="modulename"]').val(),course:r('input[name="course"]').val()},success:function(t){r(r("#id_plagiarism_rubric")).empty(),r.each(t,function(t,e){var a;r.isNumeric(t)||""===t?r(r("#id_plagiarism_rubric")).append(r("")).attr("label",t),r.each(e,function(t,e){var i=r("");i.val(t),i.text(e),a.append(i)}),r("#id_plagiarism_rubric").append(a))}),r('#id_plagiarism_rubric option[value="'+e+'"]').attr("selected","selected")}})}return c.TYPE="plagiarism_turnitin-modal_rubric_manager_launch",c.TEMPLATE="plagiarism_turnitin/modal_rubric_manager_launch",((c.prototype=Object.create(a.prototype)).constructor=c).prototype.registerEventListeners=function(){a.prototype.registerEventListeners.call(this),this.getModal().on(i.events.activate,s,function(t,e){var i=r.Event(o.cancel);this.getRoot().trigger(i,this),i.isDefaultPrevented()||(this.hide(),e.originalEvent.preventDefault(),u())}.bind(this)),this.getRoot().click(function(t){r(t.target).closest(l).length||u()}.bind(this))},n.register(c.TYPE,c,"plagiarism_turnitin/modal_rubric_manager_launch"),c}); +define(["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function(r,t,e,i,a,n,o){function c(t){a.call(this,t)}var s='[data-action="hide"]',l='[data-region="modal"]';function u(){var e=r("#id_plagiarism_rubric").val();r.ajax({dataType:"json",type:"POST",url:"../plagiarism/turnitin/ajax.php",data:{action:"refresh_rubric_select",assignment:r('input[name="instance"]').val(),modulename:r('input[name="modulename"]').val(),course:r('input[name="course"]').val()},success:function(t){r(r("#id_plagiarism_rubric")).empty(),r.each(t,function(t,e){var a;r.isNumeric(t)||""===t?r(r("#id_plagiarism_rubric")).append(r("")).attr("label",t),r.each(e,function(t,e){var i=r("");i.val(t),i.text(e),a.append(i)}),r("#id_plagiarism_rubric").append(a))}),r('#id_plagiarism_rubric option[value="'+e+'"]').attr("selected","selected")}})}return c.TYPE="plagiarism_turnitin-modal_rubric_manager_launch",c.TEMPLATE="plagiarism_turnitin/modal_rubric_manager_launch",((c.prototype=Object.create(a.prototype)).constructor=c).prototype.registerEventListeners=function(){a.prototype.registerEventListeners.call(this),this.getModal().on(i.events.activate,s,function(t,e){var i=r.Event(o.cancel);this.getRoot().trigger(i,this),i.isDefaultPrevented()||(this.hide(),e.originalEvent.preventDefault(),u())}.bind(this)),this.getRoot().click(function(t){r(t.target).closest(l).length||u()}.bind(this))},c.refreshRubricSelect=u,n.register(c.TYPE,c,"plagiarism_turnitin/modal_rubric_manager_launch"),c}); //# sourceMappingURL=modal_rubric_manager_launch.min.js.map \ No newline at end of file diff --git a/amd/build/modal_rubric_manager_launch.min.js.map b/amd/build/modal_rubric_manager_launch.min.js.map index 716c7013..e0cc7b1c 100644 --- a/amd/build/modal_rubric_manager_launch.min.js.map +++ b/amd/build/modal_rubric_manager_launch.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build/modal_rubric_manager_launch.min.js.map","sources":["./src/modal_rubric_manager_launch.js"],"names":["define","$","Ajax","Notification","CustomEvents","Modal","ModalRegistry","ModalEvents","ModalRubricManagerLaunch","root","call","this","SELECTORS","refreshRubricSelect","currentRubric","val","ajax","dataType","type","url","data","action","assignment","modulename","course","success","empty","each","i","optgroup","isNumeric","append","value","text","attr","j","rubric","option","TYPE","TEMPLATE","prototype","Object","create","constructor","registerEventListeners","getModal","on","events","activate","e","cancelEvent","Event","cancel","getRoot","trigger","isDefaultPrevented","hide","originalEvent","preventDefault","bind","click","target","closest","length","register"],"mappings":"AAQAA,OACI,CACI,SACA,YACA,oBACA,iCACA,aACA,sBACA,qBAEJ,SAASC,EAAGC,EAAMC,EAAcC,EAAcC,EAAOC,EAAeC,GAajC,SAA3BC,EAAoCC,GACpCJ,EAAMK,KAAKC,KAAMF,CAAI,CACzB,CAbA,IACIG,EACa,uBADbA,EAEO,wBAkDX,SAASC,IACL,IAAIC,EAAgBb,EAAE,uBAAuB,EAAEc,IAAI,EACnDd,EAAEe,KAAK,CACHC,SAAY,OACZC,KAAQ,OACRC,IAAO,kCACPC,KAAQ,CACJC,OAAQ,wBAAyBC,WAAYrB,EAAE,wBAAwB,EAAEc,IAAI,EAC7EQ,WAAYtB,EAAE,0BAA0B,EAAEc,IAAI,EAAGS,OAAQvB,EAAE,sBAAsB,EAAEc,IAAI,CAC3F,EACAU,QAAS,SAAUL,GACfnB,EAAEA,EAAE,uBAAuB,CAAC,EAAEyB,MAAM,EAEpCzB,EAAE0B,KADYP,EACE,SAAUQ,EAAGb,GACzB,IAEQc,EAFH5B,EAAE6B,UAAUF,CAAC,GAAW,KAANA,EAgBnB3B,EAAEA,EAAE,uBAAuB,CAAC,EAAE8B,OAAO9B,EAAE,WAAY,CAC/C+B,MAAOJ,EACPK,KAAMlB,CACV,CAAC,CAAC,IAjBEc,EAAW5B,EAAE,YAAY,GACpBiC,KAAK,QAASN,CAAC,EAExB3B,EAAE0B,KAAKZ,EAAK,SAAUoB,EAAGC,GACrB,IAAIC,EAASpC,EAAE,mBAAmB,EAClCoC,EAAOtB,IAAIoB,CAAC,EACZE,EAAOJ,KAAKG,CAAM,EAElBP,EAASE,OAAOM,CAAM,CAC1B,CAAC,EAEDpC,EAAE,uBAAuB,EAAE8B,OAAOF,CAAQ,EAQlD,CAAC,EAED5B,EAAE,uCAA8Ca,EAAgB,IAAI,EAAEoB,KAAK,WAAY,UAAU,CACrG,CACJ,CAAC,CACL,CAWA,OAzFA1B,EAAyB8B,KAAO,kDAChC9B,EAAyB+B,SAAW,oDACpC/B,EAAyBgC,UAAYC,OAAOC,OAAOrC,EAAMmC,SAAS,GAC/BG,YAAcnC,GAOxBgC,UAAUI,uBAAyB,WAExDvC,EAAMmC,UAAUI,uBAAuBlC,KAAKC,IAAI,EAGhDA,KAAKkC,SAAS,EAAEC,GAAG1C,EAAa2C,OAAOC,SAAUpC,EAAuB,SAASqC,EAAG7B,GAChF,IAAI8B,EAAcjD,EAAEkD,MAAM5C,EAAY6C,MAAM,EAC5CzC,KAAK0C,QAAQ,EAAEC,QAAQJ,EAAavC,IAAI,EAEnCuC,EAAYK,mBAAmB,IAChC5C,KAAK6C,KAAK,EACVpC,EAAKqC,cAAcC,eAAe,EAElC7C,EAAoB,EAE5B,EAAE8C,KAAKhD,IAAI,CAAC,EAGZA,KAAK0C,QAAQ,EAAEO,MAAM,SAASX,GACrBhD,EAAEgD,EAAEY,MAAM,EAAEC,QAAQlD,CAAe,EAAEmD,QACtClD,EAAoB,CAE5B,EAAE8C,KAAKhD,IAAI,CAAC,CAChB,EAkDIL,EAAc0D,SAASxD,EAAyB8B,KAC5C9B,EACA,iDAAiD,EAIlDA,CACX,CACJ"} \ No newline at end of file +{"version":3,"file":"./build/modal_rubric_manager_launch.min.js.map","sources":["./src/modal_rubric_manager_launch.js"],"names":["define","$","Ajax","Notification","CustomEvents","Modal","ModalRegistry","ModalEvents","ModalRubricManagerLaunch","root","call","this","SELECTORS","refreshRubricSelect","currentRubric","val","ajax","dataType","type","url","data","action","assignment","modulename","course","success","empty","each","i","optgroup","isNumeric","append","value","text","attr","j","rubric","option","TYPE","TEMPLATE","prototype","Object","create","constructor","registerEventListeners","getModal","on","events","activate","e","cancelEvent","Event","cancel","getRoot","trigger","isDefaultPrevented","hide","originalEvent","preventDefault","bind","click","target","closest","length","register"],"mappings":"AAQAA,OACI,CACI,SACA,YACA,oBACA,iCACA,aACA,sBACA,qBAEJ,SAASC,EAAGC,EAAMC,EAAcC,EAAcC,EAAOC,EAAeC,GAajC,SAA3BC,EAAoCC,GACpCJ,EAAMK,KAAKC,KAAMF,CAAI,CACzB,CAbA,IACIG,EACa,uBADbA,EAEO,wBAkDX,SAASC,IACL,IAAIC,EAAgBb,EAAE,uBAAuB,EAAEc,IAAI,EACnDd,EAAEe,KAAK,CACHC,SAAY,OACZC,KAAQ,OACRC,IAAO,kCACPC,KAAQ,CACJC,OAAQ,wBAAyBC,WAAYrB,EAAE,wBAAwB,EAAEc,IAAI,EAC7EQ,WAAYtB,EAAE,0BAA0B,EAAEc,IAAI,EAAGS,OAAQvB,EAAE,sBAAsB,EAAEc,IAAI,CAC3F,EACAU,QAAS,SAAUL,GACfnB,EAAEA,EAAE,uBAAuB,CAAC,EAAEyB,MAAM,EAEpCzB,EAAE0B,KADYP,EACE,SAAUQ,EAAGb,GACzB,IAEQc,EAFH5B,EAAE6B,UAAUF,CAAC,GAAW,KAANA,EAgBnB3B,EAAEA,EAAE,uBAAuB,CAAC,EAAE8B,OAAO9B,EAAE,WAAY,CAC/C+B,MAAOJ,EACPK,KAAMlB,CACV,CAAC,CAAC,IAjBEc,EAAW5B,EAAE,YAAY,GACpBiC,KAAK,QAASN,CAAC,EAExB3B,EAAE0B,KAAKZ,EAAK,SAAUoB,EAAGC,GACrB,IAAIC,EAASpC,EAAE,mBAAmB,EAClCoC,EAAOtB,IAAIoB,CAAC,EACZE,EAAOJ,KAAKG,CAAM,EAElBP,EAASE,OAAOM,CAAM,CAC1B,CAAC,EAEDpC,EAAE,uBAAuB,EAAE8B,OAAOF,CAAQ,EAQlD,CAAC,EAED5B,EAAE,uCAA8Ca,EAAgB,IAAI,EAAEoB,KAAK,WAAY,UAAU,CACrG,CACJ,CAAC,CACL,CAaA,OA3FA1B,EAAyB8B,KAAO,kDAChC9B,EAAyB+B,SAAW,oDACpC/B,EAAyBgC,UAAYC,OAAOC,OAAOrC,EAAMmC,SAAS,GAC/BG,YAAcnC,GAOxBgC,UAAUI,uBAAyB,WAExDvC,EAAMmC,UAAUI,uBAAuBlC,KAAKC,IAAI,EAGhDA,KAAKkC,SAAS,EAAEC,GAAG1C,EAAa2C,OAAOC,SAAUpC,EAAuB,SAASqC,EAAG7B,GAChF,IAAI8B,EAAcjD,EAAEkD,MAAM5C,EAAY6C,MAAM,EAC5CzC,KAAK0C,QAAQ,EAAEC,QAAQJ,EAAavC,IAAI,EAEnCuC,EAAYK,mBAAmB,IAChC5C,KAAK6C,KAAK,EACVpC,EAAKqC,cAAcC,eAAe,EAElC7C,EAAoB,EAE5B,EAAE8C,KAAKhD,IAAI,CAAC,EAGZA,KAAK0C,QAAQ,EAAEO,MAAM,SAASX,GACrBhD,EAAEgD,EAAEY,MAAM,EAAEC,QAAQlD,CAAe,EAAEmD,QACtClD,EAAoB,CAE5B,EAAE8C,KAAKhD,IAAI,CAAC,CAChB,EA+CAH,EAAyBK,oBAAsBA,EAK3CP,EAAc0D,SAASxD,EAAyB8B,KAC5C9B,EACA,iDAAiD,EAIlDA,CACX,CACJ"} \ No newline at end of file diff --git a/amd/build/new_rubric.min.js b/amd/build/new_rubric.min.js index ae964020..f1d3071f 100644 --- a/amd/build/new_rubric.min.js +++ b/amd/build/new_rubric.min.js @@ -1,2 +1,2 @@ -define(["jquery","core/templates","core/modal","core/modal_events","plagiarism_turnitin/modal_rubric_manager_launch","plagiarism_turnitin/modal_rubric_view_launch"],function(n,i,t,a,e,c){return{newRubric:function(){var r=this;n(".rubric_manager_launch").on("click",function(){var i=n(this).data("courseid"),a=n(this).data("cmid");r.rubricCreateModal(e,i,a)}),n(document).on("click",".rubric_view",function(){var i=n(this).data("courseid"),a=n(this).data("cmid");r.rubricCreateModal(c,i,a)}),n("#id_plagiarism_rubric").mousedown(function(){""!=n('input[name="instance"]').val()&&"Y"!=n('input[name="rubric_warning_seen"]').val()&&confirm(M.str.plagiarism_turnitin.changerubricwarning)&&n('input[name="rubric_warning_seen"]').val("Y")})},rubricCreateModal:function(i,a,r){t.create({type:i.TYPE,template:i.TEMPLATE,templateContext:{courseid:a,cmid:r,wwwroot:M.cfg.wwwroot},large:!0}).then(function(i){i.show(),i.getRoot().find(".modal").addClass("tii_pp_modal_rubric"),i.getRoot().find(".modal-content").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(t,i,e,a,c,o){return{newRubric:function(){var n=this;t(".rubric_manager_launch").on("click",function(){var i=t(this).data("courseid"),r=t(this).data("cmid");n.rubricCreateModal(c,i,r)}),t(document).on("click",".rubric_view",function(){var i=t(this).data("courseid"),r=t(this).data("cmid");n.rubricCreateModal(o,i,r)}),t("#id_plagiarism_rubric").mousedown(function(){""!=t('input[name="instance"]').val()&&"Y"!=t('input[name="rubric_warning_seen"]').val()&&confirm(M.str.plagiarism_turnitin.changerubricwarning)&&t('input[name="rubric_warning_seen"]').val("Y")}),c.refreshRubricSelect()},rubricCreateModal:function(i,r,n){e.create({type:i.TYPE,template:i.TEMPLATE,templateContext:{courseid:r,cmid:n,wwwroot:M.cfg.wwwroot},large:!0}).then(function(i){i.show(),i.getRoot().find(".modal").addClass("tii_pp_modal_rubric"),i.getRoot().find(".modal-content").addClass("tii_pp_modal_rubric_content"),i.getRoot().on(a.hidden,function(){setTimeout(function(){c.refreshRubricSelect()},1500)})})}}}); //# sourceMappingURL=new_rubric.min.js.map \ No newline at end of file diff --git a/amd/build/new_rubric.min.js.map b/amd/build/new_rubric.min.js.map index af6889df..1d65db52 100644 --- a/amd/build/new_rubric.min.js.map +++ b/amd/build/new_rubric.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build/new_rubric.min.js.map","sources":["./src/new_rubric.js"],"names":["define","$","Templates","Modal","ModalEvents","ModalRubricManagerLaunch","ModalRubricViewLaunch","newRubric","that","this","on","courseid","data","cmid","rubricCreateModal","document","mousedown","val","confirm","M","str","plagiarism_turnitin","changerubricwarning","modalType","create","type","TYPE","template","TEMPLATE","templateContext","wwwroot","cfg","large","then","modal","show","getRoot","find","addClass"],"mappings":"AAQAA,OAAO,CAAC,SACA,iBACA,aACA,oBACA,kDACA,gDAEJ,SAASC,EAAGC,EAAWC,EAAOC,EAAaC,EAA0BC,GACjE,MAAO,CACHC,UAAW,WACP,IAAIC,EAAOC,KACXR,EAAE,wBAAwB,EAAES,GAAG,QAAS,WACpC,IAAIC,EAAWV,EAAEQ,IAAI,EAAEG,KAAK,UAAU,EAClCC,EAAOZ,EAAEQ,IAAI,EAAEG,KAAK,MAAM,EAC9BJ,EAAKM,kBAAkBT,EAA0BM,EAAUE,CAAI,CACnE,CAAC,EAEDZ,EAAEc,QAAQ,EAAEL,GAAG,QAAS,eAAgB,WACpC,IAAIC,EAAWV,EAAEQ,IAAI,EAAEG,KAAK,UAAU,EAClCC,EAAOZ,EAAEQ,IAAI,EAAEG,KAAK,MAAM,EAC9BJ,EAAKM,kBAAkBR,EAAuBK,EAAUE,CAAI,CAChE,CAAC,EAGDZ,EAAE,uBAAuB,EAAEe,UAAU,WACQ,IAArCf,EAAE,wBAAwB,EAAEgB,IAAI,GAA2D,KAAhDhB,EAAE,mCAAmC,EAAEgB,IAAI,GAClFC,QAAQC,EAAEC,IAAIC,oBAAoBC,mBAAmB,GACrDrB,EAAE,mCAAmC,EAAEgB,IAAI,GAAG,CAG1D,CAAC,CACL,EACAH,kBAAmB,SAASS,EAAWZ,EAAUE,GAC7CV,EAAMqB,OAAO,CACTC,KAAMF,EAAUG,KAChBC,SAAUJ,EAAUK,SACpBC,gBAAiB,CACblB,SAAUA,EACVE,KAAMA,EACNiB,QAASX,EAAEY,IAAID,OACnB,EACAE,MAAO,CAAA,CACX,CAAC,EACIC,KAAK,SAAUC,GACZA,EAAMC,KAAK,EACXD,EAAME,QAAQ,EAAEC,KAAK,QAAQ,EAAEC,SAAS,qBAAqB,EAC7DJ,EAAME,QAAQ,EAAEC,KAAK,gBAAgB,EAAEC,SAAS,6BAA6B,CACjF,CAAC,CACT,CACJ,CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"./build/new_rubric.min.js.map","sources":["./src/new_rubric.js"],"names":["define","$","Templates","Modal","ModalEvents","ModalRubricManagerLaunch","ModalRubricViewLaunch","newRubric","that","this","on","courseid","data","cmid","rubricCreateModal","document","mousedown","val","confirm","M","str","plagiarism_turnitin","changerubricwarning","refreshRubricSelect","modalType","create","type","TYPE","template","TEMPLATE","templateContext","wwwroot","cfg","large","then","modal","show","getRoot","find","addClass","hidden","setTimeout"],"mappings":"AAQAA,OAAO,CAAC,SACA,iBACA,aACA,oBACA,kDACA,gDAEJ,SAASC,EAAGC,EAAWC,EAAOC,EAAaC,EAA0BC,GACjE,MAAO,CACHC,UAAW,WACP,IAAIC,EAAOC,KACXR,EAAE,wBAAwB,EAAES,GAAG,QAAS,WACpC,IAAIC,EAAWV,EAAEQ,IAAI,EAAEG,KAAK,UAAU,EAClCC,EAAOZ,EAAEQ,IAAI,EAAEG,KAAK,MAAM,EAC9BJ,EAAKM,kBAAkBT,EAA0BM,EAAUE,CAAI,CACnE,CAAC,EAEDZ,EAAEc,QAAQ,EAAEL,GAAG,QAAS,eAAgB,WACpC,IAAIC,EAAWV,EAAEQ,IAAI,EAAEG,KAAK,UAAU,EAClCC,EAAOZ,EAAEQ,IAAI,EAAEG,KAAK,MAAM,EAC9BJ,EAAKM,kBAAkBR,EAAuBK,EAAUE,CAAI,CAChE,CAAC,EAGDZ,EAAE,uBAAuB,EAAEe,UAAU,WACQ,IAArCf,EAAE,wBAAwB,EAAEgB,IAAI,GAA2D,KAAhDhB,EAAE,mCAAmC,EAAEgB,IAAI,GAClFC,QAAQC,EAAEC,IAAIC,oBAAoBC,mBAAmB,GACrDrB,EAAE,mCAAmC,EAAEgB,IAAI,GAAG,CAG1D,CAAC,EAEDZ,EAAyBkB,oBAAoB,CACjD,EACAT,kBAAmB,SAASU,EAAWb,EAAUE,GAC7CV,EAAMsB,OAAO,CACTC,KAAMF,EAAUG,KAChBC,SAAUJ,EAAUK,SACpBC,gBAAiB,CACbnB,SAAUA,EACVE,KAAMA,EACNkB,QAASZ,EAAEa,IAAID,OACnB,EACAE,MAAO,CAAA,CACX,CAAC,EACAC,KAAK,SAAUC,GACZA,EAAMC,KAAK,EACXD,EAAME,QAAQ,EAAEC,KAAK,QAAQ,EAAEC,SAAS,qBAAqB,EAC7DJ,EAAME,QAAQ,EAAEC,KAAK,gBAAgB,EAAEC,SAAS,6BAA6B,EAG7EJ,EAAME,QAAQ,EAAE3B,GAAGN,EAAYoC,OAAQ,WACnCC,WAAW,WACNpC,EAAyBkB,oBAAoB,CAClD,EAAG,IAAI,CACX,CAAC,CACL,CAAC,CACL,CACJ,CACJ,CAAC"} \ No newline at end of file diff --git a/amd/src/modal_rubric_manager_launch.js b/amd/src/modal_rubric_manager_launch.js index 2925e5a9..498c684a 100644 --- a/amd/src/modal_rubric_manager_launch.js +++ b/amd/src/modal_rubric_manager_launch.js @@ -113,6 +113,8 @@ define( }); } + ModalRubricManagerLaunch.refreshRubricSelect = refreshRubricSelect; + // Automatically register with the modal registry the first time this module is imported so that // you can create modals of this type using the modal factory. if (!registered) { diff --git a/amd/src/new_eula_modal.js b/amd/src/new_eula_modal.js index d9942bb7..5e4d422a 100644 --- a/amd/src/new_eula_modal.js +++ b/amd/src/new_eula_modal.js @@ -3,7 +3,7 @@ * * @copyright Turnitin * @author 2023 Isaac Xiong - * @module plagiarism_turnitin/newEulaLaunch + * @module plagiarism_turnitin/new_eula_modal */ define(['jquery', diff --git a/amd/src/new_peermark.js b/amd/src/new_peermark.js index 1613bf98..4bca8ec4 100644 --- a/amd/src/new_peermark.js +++ b/amd/src/new_peermark.js @@ -3,7 +3,7 @@ * * @copyright Turnitin * @author 2024 Isaac Xiong - * @module plagiarism_turnitin/newPeermarkLaunch + * @module plagiarism_turnitin/new_peermark */ define(['jquery', diff --git a/amd/src/new_quickmark.js b/amd/src/new_quickmark.js index 045508ce..674c923e 100644 --- a/amd/src/new_quickmark.js +++ b/amd/src/new_quickmark.js @@ -3,7 +3,7 @@ * * @copyright Turnitin * @author 2024 Isaac Xiong - * @module plagiarism_turnitin/newQuickmarkLaunch + * @module plagiarism_turnitin/new_quickmark */ define(['jquery', diff --git a/amd/src/new_rubric.js b/amd/src/new_rubric.js index 0a415948..0b3de53a 100644 --- a/amd/src/new_rubric.js +++ b/amd/src/new_rubric.js @@ -3,7 +3,7 @@ * * @copyright Turnitin * @author 2024 Isaac Xiong - * @module plagiarism_turnitin/newRubric + * @module plagiarism_turnitin/new_rubric */ define(['jquery', @@ -37,6 +37,8 @@ define(['jquery', } } }); + + ModalRubricManagerLaunch.refreshRubricSelect(); }, rubricCreateModal: function(modalType, courseid, cmid) { Modal.create({ @@ -49,11 +51,18 @@ define(['jquery', }, 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'); + .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'); + + // Attach the hidden event listener to the modal + modal.getRoot().on(ModalEvents.hidden, function() { + setTimeout(function() { + ModalRubricManagerLaunch.refreshRubricSelect(); + }, 1500); }); + }); } }; }); diff --git a/classes/turnitin_view.class.php b/classes/turnitin_view.class.php index 07d304a9..6efd2d82 100644 --- a/classes/turnitin_view.class.php +++ b/classes/turnitin_view.class.php @@ -139,9 +139,9 @@ public function add_elements_to_settings_form($mform, $course, $location = "acti $PAGE->requires->jquery_plugin('ui'); $PAGE->requires->js_call_amd('plagiarism_turnitin/refresh_submissions', 'refreshSubmissions'); if ($CFG->version >= 2023100900) { - $PAGE->requires->js_call_amd('plagiarism_turnitin/newPeermarkLaunch', 'newPeermarkLaunch'); - $PAGE->requires->js_call_amd('plagiarism_turnitin/newQuickmarkLaunch', 'newQuickmarkLaunch'); - $PAGE->requires->js_call_amd('plagiarism_turnitin/newRubric', 'newRubric'); + $PAGE->requires->js_call_amd('plagiarism_turnitin/new_peermark', 'newPeermarkLaunch'); + $PAGE->requires->js_call_amd('plagiarism_turnitin/new_quickmark', 'newQuickmarkLaunch'); + $PAGE->requires->js_call_amd('plagiarism_turnitin/new_rubric', 'newRubric'); } else { $PAGE->requires->js_call_amd('plagiarism_turnitin/peermarkLaunch', 'peermarkLaunch'); $PAGE->requires->js_call_amd('plagiarism_turnitin/quickmarkLaunch', 'quickmarkLaunch'); diff --git a/lib.php b/lib.php index dccfdee5..b247682b 100755 --- a/lib.php +++ b/lib.php @@ -580,9 +580,9 @@ public function load_page_components() { // 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'); - $PAGE->requires->js_call_amd('plagiarism_turnitin/newPeermarkLaunch', 'newPeermarkLaunch'); - $PAGE->requires->js_call_amd('plagiarism_turnitin/newRubric', 'newRubric'); + $PAGE->requires->js_call_amd('plagiarism_turnitin/new_eula_modal', 'newEulaLaunch'); + $PAGE->requires->js_call_amd('plagiarism_turnitin/new_peermark', 'newPeermarkLaunch'); + $PAGE->requires->js_call_amd('plagiarism_turnitin/new_rubric', 'newRubric'); } else { $PAGE->requires->js_call_amd('plagiarism_turnitin/eulaLaunch', 'eulaLaunch'); From 9b735a06df608029999e04a431753a4e78af56d3 Mon Sep 17 00:00:00 2001 From: Andrii Ilin Date: Thu, 30 May 2024 15:15:45 -0600 Subject: [PATCH 3/7] Fix/quickmarks peermarks launch * fix path to modules --- amd/src/peermark.js | 2 +- amd/src/quickmark.js | 2 +- classes/turnitin_view.class.php | 4 ++-- lib.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/amd/src/peermark.js b/amd/src/peermark.js index 7b64a907..e01e68df 100644 --- a/amd/src/peermark.js +++ b/amd/src/peermark.js @@ -3,7 +3,7 @@ * * @copyright Turnitin * @author 2019 David Winn - * @module plagiarism_turnitin/peermarkLaunch + * @module plagiarism_turnitin/peermark */ define(['jquery', diff --git a/amd/src/quickmark.js b/amd/src/quickmark.js index 5a3a94ba..053fd47a 100644 --- a/amd/src/quickmark.js +++ b/amd/src/quickmark.js @@ -3,7 +3,7 @@ * * @copyright Turnitin * @author 2019 David Winn - * @module plagiarism_turnitin/quickmarkLaunch + * @module plagiarism_turnitin/quickmark */ define(['jquery', diff --git a/classes/turnitin_view.class.php b/classes/turnitin_view.class.php index 6efd2d82..d2f12886 100644 --- a/classes/turnitin_view.class.php +++ b/classes/turnitin_view.class.php @@ -143,8 +143,8 @@ public function add_elements_to_settings_form($mform, $course, $location = "acti $PAGE->requires->js_call_amd('plagiarism_turnitin/new_quickmark', 'newQuickmarkLaunch'); $PAGE->requires->js_call_amd('plagiarism_turnitin/new_rubric', 'newRubric'); } else { - $PAGE->requires->js_call_amd('plagiarism_turnitin/peermarkLaunch', 'peermarkLaunch'); - $PAGE->requires->js_call_amd('plagiarism_turnitin/quickmarkLaunch', 'quickmarkLaunch'); + $PAGE->requires->js_call_amd('plagiarism_turnitin/peermark', 'peermarkLaunch'); + $PAGE->requires->js_call_amd('plagiarism_turnitin/quickmark', 'quickmarkLaunch'); $PAGE->requires->js_call_amd('plagiarism_turnitin/rubric', 'rubric'); } // Refresh Grades. diff --git a/lib.php b/lib.php index b247682b..84389f40 100755 --- a/lib.php +++ b/lib.php @@ -585,8 +585,8 @@ public function load_page_components() { $PAGE->requires->js_call_amd('plagiarism_turnitin/new_rubric', 'newRubric'); } else { - $PAGE->requires->js_call_amd('plagiarism_turnitin/eulaLaunch', 'eulaLaunch'); - $PAGE->requires->js_call_amd('plagiarism_turnitin/peermarkLaunch', 'peermarkLaunch'); + $PAGE->requires->js_call_amd('plagiarism_turnitin/eula', 'eulaLaunch'); + $PAGE->requires->js_call_amd('plagiarism_turnitin/peermark', 'peermarkLaunch'); $PAGE->requires->js_call_amd('plagiarism_turnitin/rubric', 'rubric'); } From 26e69f87e09ecf3304b6bd332c5fbbf3232cf06d Mon Sep 17 00:00:00 2001 From: Andrii Ilin Date: Mon, 3 Jun 2024 15:48:04 -0600 Subject: [PATCH 4/7] Fix/user_agreement launch * hide redundand user agreement button --- lib.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib.php b/lib.php index 84389f40..8fc62086 100755 --- a/lib.php +++ b/lib.php @@ -817,13 +817,14 @@ public function get_links($linkarray) { $eulaaccepted = ($user->useragreementaccepted == 0) ? $user->get_accepted_user_agreement() : $user->useragreementaccepted; $userid = $linkarray["userid"]; - if ($eulaaccepted != 1) { - $eulalink = html_writer::tag('span', - get_string('turnitinppulapost', 'plagiarism_turnitin'), - array('class' => 'pp_turnitin_eula_link tii_tooltip', 'id' => 'rubric_manager_form') - ); - $eula = html_writer::tag('div', $eulalink, array('class' => 'pp_turnitin_eula', 'data-userid' => $user->id)); - } + // Uncomment if ability to submit to Turnitin previously uploaded files will be implemented. + // if ($eulaaccepted != 1) { + // $eulalink = html_writer::tag('span', + // get_string('turnitinppulapost', 'plagiarism_turnitin'), + // array('class' => 'pp_turnitin_eula_link tii_tooltip', 'id' => 'rubric_manager_form') + // ); + // $eula = html_writer::tag('div', $eulalink, array('class' => 'pp_turnitin_eula', 'data-userid' => $user->id)); + // } // Show EULA launcher and form placeholder. if (!empty($eula)) { From 6d0a577461d41785f18717042906896092e1d3b7 Mon Sep 17 00:00:00 2001 From: Andrii Ilin Date: Thu, 6 Jun 2024 15:25:36 -0600 Subject: [PATCH 5/7] Fix: process declined user agreement * close agreement modal by accept or decline --- amd/build/eula_event_listener.min.js | 2 ++ amd/build/eula_event_listener.min.js.map | 1 + amd/build/modal_eula_launch.min.js | 2 +- 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 | 2 +- amd/build/new_rubric.min.js | 2 +- amd/build/new_rubric.min.js.map | 2 +- amd/src/eula_event_listener.js | 41 ++++++++++++++++++++++++ amd/src/modal_eula_launch.js | 29 +++-------------- amd/src/new_eula_modal.js | 5 ++- amd/src/new_rubric.js | 7 ++-- 12 files changed, 63 insertions(+), 34 deletions(-) create mode 100644 amd/build/eula_event_listener.min.js create mode 100644 amd/build/eula_event_listener.min.js.map create mode 100644 amd/src/eula_event_listener.js diff --git a/amd/build/eula_event_listener.min.js b/amd/build/eula_event_listener.min.js new file mode 100644 index 00000000..a0bc34ac --- /dev/null +++ b/amd/build/eula_event_listener.min.js @@ -0,0 +1,2 @@ +define(["jquery"],function(a){function n(n){n=(void 0===n.data?n.originalEvent:n).data;"turnitin_eula_declined"!==n&&"turnitin_eula_accepted"!==n||a.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"actionuseragreement",message:n,sesskey:M.cfg.sesskey},success:function(){window.location.reload()},error:function(){window.location.reload()}})}return{attach:function(){a(window).on("message",n)}}}); +//# sourceMappingURL=eula_event_listener.min.js.map \ No newline at end of file diff --git a/amd/build/eula_event_listener.min.js.map b/amd/build/eula_event_listener.min.js.map new file mode 100644 index 00000000..50af280e --- /dev/null +++ b/amd/build/eula_event_listener.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"./build/eula_event_listener.min.js.map","sources":["./src/eula_event_listener.js"],"names":["define","$","handleMessage","ev","message","data","originalEvent","ajax","type","url","M","cfg","wwwroot","dataType","action","sesskey","success","window","location","reload","error","attach","on"],"mappings":"AAQAA,OAAO,CAAC,UAAW,SAASC,GACxB,SAASC,EAAcC,GACfC,GAA6B,KAAA,IAAZD,EAAGE,KAAuBF,EAAGG,cAAqBH,GAAPE,KAGhD,2BAAZD,GAAoD,2BAAZA,GACxCH,EAAEM,KAAK,CACHC,KAAM,OACNC,IAAKC,EAAEC,IAAIC,QAAU,gCACrBC,SAAU,OACVR,KAAM,CACFS,OAAQ,sBACRV,QAASA,EACTW,QAASL,EAAEC,IAAII,OACnB,EACAC,QAAS,WACLC,OAAOC,SAASC,OAAO,CAC3B,EACAC,MAAO,WACHH,OAAOC,SAASC,OAAO,CAC3B,CACJ,CAAC,CAET,CAMA,MAAO,CACHE,OALJ,WACIpB,EAAEgB,MAAM,EAAEK,GAAG,UAAWpB,CAAa,CACzC,CAIA,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 d0b748ec..254bf3db 100644 --- a/amd/build/modal_eula_launch.min.js +++ b/amd/build/modal_eula_launch.min.js @@ -1,2 +1,2 @@ -define(["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function(n,t,e,i,a,o,r){function c(t){a.call(this,t)}var s='[data-action="hide"]';return c.TYPE="plagiarism_turnitin-modal_eula_launch",c.TEMPLATE="plagiarism_turnitin/modal_eula_launch",((c.prototype=Object.create(a.prototype)).constructor=c).prototype.registerEventListeners=function(){a.prototype.registerEventListeners.call(this),n(window).on("message",function(t){t=(void 0===t.data?t.originalEvent:t).data;"turnitin_eula_declined"!==t&&"turnitin_eula_accepted"!==t||n.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"actionuseragreement",message:t,sesskey:M.cfg.sesskey},success:function(){window.location.reload()},error:function(){window.location.reload()}})}),this.getModal().on(i.events.activate,s,function(t,e){var i=n.Event(r.cancel);this.getRoot().trigger(i,this),i.isDefaultPrevented()||(this.hide(),e.originalEvent.preventDefault())}.bind(this))},o.register(c.TYPE,c,"plagiarism_turnitin/modal_eula_launch"),c}); +define(["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events","plagiarism_turnitin/eula_event_listener"],function(n,t,e,i,r,a,o,c){function l(t){r.call(this,t)}var s='[data-action="hide"]';return l.TYPE="plagiarism_turnitin-modal_eula_launch",l.TEMPLATE="plagiarism_turnitin/modal_eula_launch",((l.prototype=Object.create(r.prototype)).constructor=l).prototype.registerEventListeners=function(){r.prototype.registerEventListeners.call(this),c.attach(),this.getModal().on(i.events.activate,s,function(t,e){var i=n.Event(o.cancel);this.getRoot().trigger(i,this),i.isDefaultPrevented()||(this.hide(),e.originalEvent.preventDefault())}.bind(this))},a.register(l.TYPE,l,"plagiarism_turnitin/modal_eula_launch"),l}); //# 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 217e0010..1764d9d9 100644 --- a/amd/build/modal_eula_launch.min.js.map +++ b/amd/build/modal_eula_launch.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build/modal_eula_launch.min.js.map","sources":["./src/modal_eula_launch.js"],"names":["define","$","Ajax","Notification","CustomEvents","Modal","ModalRegistry","ModalEvents","ModalEulaLaunch","root","call","this","SELECTORS","TYPE","TEMPLATE","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,OACI,CACI,SACA,YACA,oBACA,iCACA,aACA,sBACA,qBAEJ,SAASC,EAAGC,EAAMC,EAAcC,EAAcC,EAAOC,EAAeC,GAa1C,SAAlBC,EAA2BC,GAC3BJ,EAAMK,KAAKC,KAAMF,CAAI,CACzB,CAbA,IACIG,EACa,uBA8EjB,OAjEAJ,EAAgBK,KAAO,wCACvBL,EAAgBM,SAAW,0CAC3BN,EAAgBO,UAAYC,OAAOC,OAAOZ,EAAMU,SAAS,GAC/BG,YAAcV,GAOxBO,UAAUI,uBAAyB,WAE/Cd,EAAMU,UAAUI,uBAAuBT,KAAKC,IAAI,EAqBhDV,EAAEmB,MAAM,EAAEC,GAAG,UAAW,SAASC,GACzBC,GAA6B,KAAA,IAAZD,EAAGE,KAAuBF,EAAGG,cAAqBH,GAAPE,KAGhD,2BAAZD,GAAoD,2BAAZA,GACxCtB,EAAEyB,KAAK,CACHC,KAAM,OACNC,IAAKC,EAAEC,IAAIC,QAAU,gCACrBC,SAAU,OACVR,KAAM,CACFS,OAAQ,sBACRV,QAASA,EACTW,QAASL,EAAEC,IAAII,OACnB,EACAC,QAAS,WACLf,OAAOgB,SAASC,OAAO,CAC3B,EACAC,MAAO,WACHlB,OAAOgB,SAASC,OAAO,CAC3B,CACJ,CAAC,CAET,CAAC,EAtCD1B,KAAK4B,SAAS,EAAElB,GAAGjB,EAAaoC,OAAOC,SAAU7B,EAAuB,SAAS8B,EAAGlB,GAChF,IAAImB,EAAc1C,EAAE2C,MAAMrC,EAAYsC,MAAM,EAC5ClC,KAAKmC,QAAQ,EAAEC,QAAQJ,EAAahC,IAAI,EAEnCgC,EAAYK,mBAAmB,IAChCrC,KAAKsC,KAAK,EACVzB,EAAKC,cAAcyB,eAAe,EAE1C,EAAEC,KAAKxC,IAAI,CAAC,CAChB,EAmCIL,EAAc8C,SAAS5C,EAAgBK,KAAML,EAAiB,uCAAuC,EAIlGA,CACX,CACJ"} \ No newline at end of file +{"version":3,"file":"./build/modal_eula_launch.min.js.map","sources":["./src/modal_eula_launch.js"],"names":["define","$","Ajax","Notification","CustomEvents","Modal","ModalRegistry","ModalEvents","EulaEventListener","ModalEulaLaunch","root","call","this","SELECTORS","TYPE","TEMPLATE","prototype","Object","create","constructor","registerEventListeners","attach","getModal","on","events","activate","e","data","cancelEvent","Event","cancel","getRoot","trigger","isDefaultPrevented","hide","originalEvent","preventDefault","bind","register"],"mappings":"AAQAA,OACI,CACI,SACA,YACA,oBACA,iCACA,aACA,sBACA,oBACA,2CAEJ,SAASC,EAAGC,EAAMC,EAAcC,EAAcC,EAAOC,EAAeC,EAAaC,GAavD,SAAlBC,EAA2BC,GAC3BL,EAAMM,KAAKC,KAAMF,CAAI,CACzB,CAbA,IACIG,EACa,uBAwDjB,OA3CAJ,EAAgBK,KAAO,wCACvBL,EAAgBM,SAAW,0CAC3BN,EAAgBO,UAAYC,OAAOC,OAAOb,EAAMW,SAAS,GAC/BG,YAAcV,GAOxBO,UAAUI,uBAAyB,WAE/Cf,EAAMW,UAAUI,uBAAuBT,KAAKC,IAAI,EAqBhDJ,EAAkBa,OAAO,EAhBzBT,KAAKU,SAAS,EAAEC,GAAGnB,EAAaoB,OAAOC,SAAUZ,EAAuB,SAASa,EAAGC,GAChF,IAAIC,EAAc3B,EAAE4B,MAAMtB,EAAYuB,MAAM,EAC5ClB,KAAKmB,QAAQ,EAAEC,QAAQJ,EAAahB,IAAI,EAEnCgB,EAAYK,mBAAmB,IAChCrB,KAAKsB,KAAK,EACVP,EAAKQ,cAAcC,eAAe,EAE1C,EAAEC,KAAKzB,IAAI,CAAC,CAChB,EAaIN,EAAcgC,SAAS7B,EAAgBK,KAAML,EAAiB,uCAAuC,EAIlGA,CACX,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 index ee1a3680..06d6423d 100644 --- a/amd/build/new_eula_modal.min.js +++ b/amd/build/new_eula_modal.min.js @@ -1,2 +1,2 @@ -define(["jquery","core/templates","core/modal","core/modal_events","plagiarism_turnitin/modal_eula_launch"],function(e,t,n,o,i){return{newEulaLaunch:function(){var t=e(".pp_turnitin_eula");t.show(),e(document).on("mod_forum-post-created",".forum-post-container",function(t,n){e("#post-content-"+n+" .pp_turnitin_eula").show()}),e(document).on("click",".pp_turnitin_eula_link",function(){n.create({type:i.TYPE,template:i.TEMPLATE,templateContext:{cmid:e('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:!0}).then(function(t){t.show(),t.getRoot().find(".modal").addClass("tii_pp_modal_eula"),t.getRoot().find(".modal-content").addClass("tii_pp_modal_eula_content")})}),0 + * @module plagiarism_turnitin/eula_event_listener + */ + +define(['jquery'], function($) { + function handleMessage(ev) { + var message = typeof ev.data === 'undefined' ? ev.originalEvent.data : ev.data; + + // Only make ajax request if message is one of the expected responses. + 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(); + } + }); + } + } + + function attachEventListener() { + $(window).on("message", handleMessage); + } + + return { + attach: attachEventListener + }; +}); \ No newline at end of file diff --git a/amd/src/modal_eula_launch.js b/amd/src/modal_eula_launch.js index e96b5173..a357cbdd 100644 --- a/amd/src/modal_eula_launch.js +++ b/amd/src/modal_eula_launch.js @@ -14,9 +14,10 @@ define( 'core/custom_interaction_events', 'core/modal', 'core/modal_registry', - 'core/modal_events' + 'core/modal_events', + 'plagiarism_turnitin/eula_event_listener' ], - function($, Ajax, Notification, CustomEvents, Modal, ModalRegistry, ModalEvents) { + function($, Ajax, Notification, CustomEvents, Modal, ModalRegistry, ModalEvents, EulaEventListener) { var registered = false; var SELECTORS = { @@ -66,29 +67,7 @@ define( * Method for processing the EULA. */ function processEula() { - $(window).on("message", function(ev) { - var message = typeof ev.data === 'undefined' ? ev.originalEvent.data : ev.data; - - // Only make ajax request if message is one of the expected responses. - 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(); - } - }); - } - }); + EulaEventListener.attach(); } // Automatically register with the modal registry the first time this module is imported so that diff --git a/amd/src/new_eula_modal.js b/amd/src/new_eula_modal.js index 5e4d422a..c42eb4ed 100644 --- a/amd/src/new_eula_modal.js +++ b/amd/src/new_eula_modal.js @@ -11,8 +11,9 @@ define(['jquery', 'core/modal', 'core/modal_events', 'plagiarism_turnitin/modal_eula_launch', + 'plagiarism_turnitin/eula_event_listener' ], - function($, Templates, Modal, ModalEvents, ModalEulaLaunch) { + function($, Templates, Modal, ModalEvents, ModalEulaLaunch, EulaEventListener) { return { newEulaLaunch: function() { var turnitinEulaClass = $(".pp_turnitin_eula"); @@ -38,6 +39,8 @@ define(['jquery', modal.show(); modal.getRoot().find('.modal').addClass('tii_pp_modal_eula'); modal.getRoot().find('.modal-content').addClass('tii_pp_modal_eula_content'); + + EulaEventListener.attach(); }); }); diff --git a/amd/src/new_rubric.js b/amd/src/new_rubric.js index 0b3de53a..135d5094 100644 --- a/amd/src/new_rubric.js +++ b/amd/src/new_rubric.js @@ -11,9 +11,10 @@ define(['jquery', 'core/modal', 'core/modal_events', 'plagiarism_turnitin/modal_rubric_manager_launch', - 'plagiarism_turnitin/modal_rubric_view_launch' + 'plagiarism_turnitin/modal_rubric_view_launch', + 'plagiarism_turnitin/eula_event_listener' ], - function($, Templates, Modal, ModalEvents, ModalRubricManagerLaunch, ModalRubricViewLaunch) { + function($, Templates, Modal, ModalEvents, ModalRubricManagerLaunch, ModalRubricViewLaunch, EulaEventListener) { return { newRubric: function() { var that = this; @@ -62,6 +63,8 @@ define(['jquery', ModalRubricManagerLaunch.refreshRubricSelect(); }, 1500); }); + + EulaEventListener.attach(); }); } }; From ca1da4ea5141485a15100c6444af168db14834e6 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 8 Jul 2024 14:24:34 +0100 Subject: [PATCH 6/7] Add core_userlist_provider --- classes/privacy/provider.php | 70 ++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index a20cd173..10ae87b0 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -28,13 +28,16 @@ defined('MOODLE_INTERNAL') || die(); use core_privacy\local\metadata\collection; +use core_privacy\local\request\approved_userlist; use core_privacy\local\request\contextlist; use core_privacy\local\request\helper; +use core_privacy\local\request\userlist; use core_privacy\local\request\writer; class provider implements // This plugin does store personal user data. \core_privacy\local\metadata\provider, + \core_privacy\local\request\core_userlist_provider, \core_plagiarism\privacy\plagiarism_provider { // This trait must be included to provide the relevant polyfill for the metadata provider. @@ -215,4 +218,71 @@ public static function _delete_plagiarism_for_user($userid, \context $context) { $DB->delete_records('plagiarism_turnitin_files', ['userid' => $userid, 'cm' => $context->instanceid]); } + + /** + * Get a list of users who have data within a context. + * + * @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination. + */ + public static function get_users_in_context(userlist $userlist) { + $context = $userlist->get_context(); + + if ($context->contextlevel != CONTEXT_MODULE) { + return; + } + + $sql = "SELECT ptf.userid + FROM {plagiarism_turnitin_files} ptf + JOIN {course_modules} c + ON ptf.cm = c.id + JOIN {modules} m + ON m.id = c.module AND m.name = :modname + WHERE c.id = :cmid"; + + $params = [ + 'modname' => 'plagiarism_turnitin', + 'cmid' => $context->instanceid + ]; + + $userlist->add_from_sql('userid', $sql, $params); + } + + /** + * Delete data for multiple users within a single context. + * + * @param approved_userlist $userlist The approved context and user information to delete information for. + */ + public static function delete_data_for_users(approved_userlist $userlist) { + global $DB; + + $context = $userlist->get_context(); + + if ($context->contextlevel != CONTEXT_MODULE) { + return; + } + + $userids = $userlist->get_userids(); + + list($insql, $inparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED); + + $sql1 = "SELECT pts.id + FROM {plagiarism_turnitin_files} ptf + JOIN {course_modules} c + ON ptf.cm = c.id + JOIN {modules} m + ON m.id = c.module AND m.name = :modname + WHERE pts.userid $insql + AND c.id = :cmid"; + + $params = [ + 'modname' => 'plagiarism_turnitin', + 'cmid' => $context->instanceid + ]; + + $params = array_merge($params, $inparams); + + $attempt = $DB->get_fieldset_sql($sql1, $params); + + $DB->delete_records_list('plagiarism_turnitin', 'id', array_values($attempt)); + } } \ No newline at end of file From 276e1154f82f729c86467e1595beccc334ce855e Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 24 Jul 2024 15:29:38 +0100 Subject: [PATCH 7/7] release_2024072401 --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ version.php | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4290202b..d8b4da19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,35 @@ +### Date: 2024-July-24 +### Release: v2024072401 + +#### :wrench: Fixes and enhancements + +--- + +#### Issue with rubrics fixed +In Moodle 4.3 and 4.4, Turnitin rubrics were not able to be attached for new Turnitin enabled Moodle assignments. This has now been resolved. + +#### Issue with accepting EULA when initially declined fixed +In Turnitin enabled Moodle assignments, when the student declined the Turnitin EULA, they were not presented the screen to upload their assignment to Moodle. Also in this fix, the second presentation of the EULA for student acceptance which occurred after the student initially the declined the EULA and then successfully uploaded their submission was removed due to the confusion that this caused for the user. Both of these have now been resolved. + +#### Reports now open correctly +There was an issue where in Turnitin enabled Moodle assignments, when the user opened the report, it opened in multiple tabs. This has now been resolved. + +#### Issue with viewing rubric fixed +In Turnitin enabled Moodle assignments, the rubric was not able to be viewed by the students. This has now been resolved. + +#### Userlist provider error message fixed +In Moodle, there was an error message in the plugin privacy compliance registry indicating that the plugin was missing the userlist provider. This has now been resolved. + +--- + ### Date: 2024-February-05 ### Release: v2024020501 #### Issue with PeerMark, Rubric, and QuickMark in Moodle 4.3 fixed In the previous plugin release we resolved an issue with the EULA modal not launching for students. It has since been discovered that all modals in the plugin were affected by the same issue. This update resolves the issues that users have found with launching the PeerMark, Rubric, and QuickMark managers. +--- + ### Date: 2023-December-19 ### Release: v2023121901 @@ -13,9 +39,13 @@ Previously there was an issue with students accepting the EULA in Moodle 4.3. Th #### 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 +--- + #### Report scores should now update as expected An issue was raised requiring instructors to use the ‘refresh all submissions' button in the Plagiarism Plugin assignment settings, in order to see the Turnitin Similarity score. This has now been resolved and users no longer need to select the 'refresh all submissions’ button to see the Turnitin Similarity score appear in the Moodle assignment inbox when using the task Send Queued Files from the Turnitin Plagiarism Plugin. diff --git a/version.php b/version.php index 72591cfe..4f7fb0d0 100644 --- a/version.php +++ b/version.php @@ -19,7 +19,7 @@ * @copyright 2012 iParadigms LLC */ -$plugin->version = 2024020501; +$plugin->version = 2024072401; $plugin->release = "3.5+"; $plugin->requires = 2018051700;