diff --git a/CHANGELOG.md b/CHANGELOG.md index d81a7aed..b329206f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +### 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. + +#### Core Moodle PhpUnit Test now functioning as expected + +A core PhpUnit test was failing due to extra minified JS files. These files have now been removed and the test should no longer fail. +This improvement was submitted as a pull request by @petersistrom on Github. Thanks, Peter! + ### Date: 2023-March-30 ### Release: v2023033001 @@ -7,11 +19,11 @@ We have fixed an issue that was preventing students from being able to resubmit #### Inbox now displays the highest score when Translated Matching is enabled -We have fixed an issue with the similarity score value in the Moodle Plagiarism Plugin inbox. Previously it wasn't updating with the highest score when translated matching was enabled, and instead the inbox continued to display the first score, even if it was the lower of the two. +We have fixed an issue with the similarity score value in the Moodle Plagiarism Plugin inbox. Previously it wasn't updating with the highest score when Translated Matching was enabled, and instead the inbox continued to display the first score, even if it was the lower of the two. #### Duplicate quiz responses are now handled separately -We have fixed an issue where if a student submitted the same response multiple times on a quiz, all duplicate responses would be linked to same report, which would not allow them to be reviewed by an instructor as separate responses. Each response now generates a separate report. +We have fixed an issue where if a student submitted the same response multiple times on a quiz, all duplicate responses would be linked to the same report, which would not allow them to be reviewed by an instructor as separate responses. Each response now generates a separate report. --- diff --git a/amd/build/eula.min.min.js b/amd/build/eula.min.min.js deleted file mode 100644 index 03985fe1..00000000 --- a/amd/build/eula.min.min.js +++ /dev/null @@ -1 +0,0 @@ -define("plagiarism_turnitin/eula",["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_eula_launch"],function($,Templates,ModalFactory,ModalEvents,ModalEulaLaunch){return{eulaLaunch:function(){var turnitinEulaClass=$(".pp_turnitin_eula");turnitinEulaClass.show(),$(document).on("mod_forum-post-created",".forum-post-container",function(event,newid){$("#post-content-"+newid+" .pp_turnitin_eula").show()}),$(document).on("click",".pp_turnitin_eula_link",function(){ModalFactory.create({type:ModalEulaLaunch.TYPE,templateContext:{cmid:$('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:!0}).then(function(modal){modal.show(),modal.getRoot().find(".modal").addClass("tii_pp_modal_eula"),modal.getRoot().find(".modal-content").addClass("tii_pp_modal_eula_content")})}),$(".pp_turnitin_eula_ignored").length>0&&($(".editsubmissionform").length>0&&$(".editsubmissionform").hide(),turnitinEulaClass.siblings(".mform").length>0&&turnitinEulaClass.siblings(".mform").hide())}}}); \ No newline at end of file diff --git a/amd/build/modal_eula_launch.min.min.js b/amd/build/modal_eula_launch.min.min.js deleted file mode 100644 index 1e9d4472..00000000 --- a/amd/build/modal_eula_launch.min.min.js +++ /dev/null @@ -1 +0,0 @@ -define("plagiarism_turnitin/modal_eula_launch",["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function($,Ajax,Notification,CustomEvents,Modal,ModalRegistry,ModalEvents){var registered=!1,SELECTORS_HIDE_BUTTON='[data-action="hide"]',ModalEulaLaunch=function(root){Modal.call(this,root)};return ModalEulaLaunch.TYPE="plagiarism_turnitin-modal_eula_launch",(ModalEulaLaunch.prototype=Object.create(Modal.prototype)).constructor=ModalEulaLaunch,ModalEulaLaunch.prototype.registerEventListeners=function(){Modal.prototype.registerEventListeners.call(this),$(window).on("message",function(ev){var message=void 0===ev.data?ev.originalEvent.data:ev.data;"turnitin_eula_declined"!==message&&"turnitin_eula_accepted"!==message||$.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"actionuseragreement",message:message,sesskey:M.cfg.sesskey},success:function(){window.location.reload()},error:function(){window.location.reload()}})}),this.getModal().on(CustomEvents.events.activate,SELECTORS_HIDE_BUTTON,function(e,data){var cancelEvent=$.Event(ModalEvents.cancel);this.getRoot().trigger(cancelEvent,this),cancelEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this))},registered||(ModalRegistry.register(ModalEulaLaunch.TYPE,ModalEulaLaunch,"plagiarism_turnitin/modal_eula_launch"),registered=!0),ModalEulaLaunch}); \ No newline at end of file diff --git a/amd/build/modal_peermark_manager_launch.min.min.js b/amd/build/modal_peermark_manager_launch.min.min.js deleted file mode 100644 index d78049b2..00000000 --- a/amd/build/modal_peermark_manager_launch.min.min.js +++ /dev/null @@ -1 +0,0 @@ -define("plagiarism_turnitin/modal_peermark_manager_launch",["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function($,Ajax,Notification,CustomEvents,Modal,ModalRegistry,ModalEvents){var registered=!1,SELECTORS_HIDE_BUTTON='[data-action="hide"]',SELECTORS_MODAL='[data-region="modal"]',ModalPeermarkManagerLaunch=function(root){Modal.call(this,root)};function refreshPeermarkAssignments(){$.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"refresh_peermark_assignments",cmid:$('input[name="coursemodule"]').val(),sesskey:M.cfg.sesskey}})}return ModalPeermarkManagerLaunch.TYPE="plagiarism_turnitin-modal_peermark_manager_launch",(ModalPeermarkManagerLaunch.prototype=Object.create(Modal.prototype)).constructor=ModalPeermarkManagerLaunch,ModalPeermarkManagerLaunch.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),cancelEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault(),refreshPeermarkAssignments())}.bind(this)),this.getRoot().click(function(e){$(e.target).closest(SELECTORS_MODAL).length||refreshPeermarkAssignments()}.bind(this))},registered||(ModalRegistry.register(ModalPeermarkManagerLaunch.TYPE,ModalPeermarkManagerLaunch,"plagiarism_turnitin/modal_peermark_manager_launch"),registered=!0),ModalPeermarkManagerLaunch}); \ No newline at end of file diff --git a/amd/build/modal_peermark_reviews_launch.min.min.js b/amd/build/modal_peermark_reviews_launch.min.min.js deleted file mode 100644 index b155e876..00000000 --- a/amd/build/modal_peermark_reviews_launch.min.min.js +++ /dev/null @@ -1 +0,0 @@ -define("plagiarism_turnitin/modal_peermark_reviews_launch",["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function($,Ajax,Notification,CustomEvents,Modal,ModalRegistry,ModalEvents){var registered=!1,SELECTORS_HIDE_BUTTON='[data-action="hide"]',ModalPeermarkReviewsLaunch=function(root){Modal.call(this,root)};return ModalPeermarkReviewsLaunch.TYPE="plagiarism_turnitin-modal_peermark_reviews_launch",(ModalPeermarkReviewsLaunch.prototype=Object.create(Modal.prototype)).constructor=ModalPeermarkReviewsLaunch,ModalPeermarkReviewsLaunch.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),cancelEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this))},registered||(ModalRegistry.register(ModalPeermarkReviewsLaunch.TYPE,ModalPeermarkReviewsLaunch,"plagiarism_turnitin/modal_peermark_reviews_launch"),registered=!0),ModalPeermarkReviewsLaunch}); \ No newline at end of file diff --git a/amd/build/modal_quickmark_launch.min.min.js b/amd/build/modal_quickmark_launch.min.min.js deleted file mode 100644 index 36af3c5b..00000000 --- a/amd/build/modal_quickmark_launch.min.min.js +++ /dev/null @@ -1 +0,0 @@ -define("plagiarism_turnitin/modal_quickmark_launch",["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function($,Ajax,Notification,CustomEvents,Modal,ModalRegistry,ModalEvents){var registered=!1,SELECTORS_HIDE_BUTTON='[data-action="hide"]',ModalQuickmarkLaunch=function(root){Modal.call(this,root)};return ModalQuickmarkLaunch.TYPE="plagiarism_turnitin-modal_quickmark_launch",(ModalQuickmarkLaunch.prototype=Object.create(Modal.prototype)).constructor=ModalQuickmarkLaunch,ModalQuickmarkLaunch.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),cancelEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this))},registered||(ModalRegistry.register(ModalQuickmarkLaunch.TYPE,ModalQuickmarkLaunch,"plagiarism_turnitin/modal_quickmark_launch"),registered=!0),ModalQuickmarkLaunch}); \ No newline at end of file diff --git a/amd/build/modal_rubric_manager_launch.min.min.js b/amd/build/modal_rubric_manager_launch.min.min.js deleted file mode 100644 index 3e299311..00000000 --- a/amd/build/modal_rubric_manager_launch.min.min.js +++ /dev/null @@ -1 +0,0 @@ -define("plagiarism_turnitin/modal_rubric_manager_launch",["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function($,Ajax,Notification,CustomEvents,Modal,ModalRegistry,ModalEvents){var registered=!1,SELECTORS_HIDE_BUTTON='[data-action="hide"]',SELECTORS_MODAL='[data-region="modal"]',ModalRubricManagerLaunch=function(root){Modal.call(this,root)};function refreshRubricSelect(){var currentRubric=$("#id_plagiarism_rubric").val();$.ajax({dataType:"json",type:"POST",url:"../plagiarism/turnitin/ajax.php",data:{action:"refresh_rubric_select",assignment:$('input[name="instance"]').val(),modulename:$('input[name="modulename"]').val(),course:$('input[name="course"]').val()},success:function(data){$($("#id_plagiarism_rubric")).empty();var options=data;$.each(options,function(i,val){if($.isNumeric(i)||""===i)$($("#id_plagiarism_rubric")).append($("");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)}}),$('#id_plagiarism_rubric option[value="'+currentRubric+'"]').attr("selected","selected")}})}return ModalRubricManagerLaunch.TYPE="plagiarism_turnitin-modal_rubric_manager_launch",(ModalRubricManagerLaunch.prototype=Object.create(Modal.prototype)).constructor=ModalRubricManagerLaunch,ModalRubricManagerLaunch.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),cancelEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault(),refreshRubricSelect())}.bind(this)),this.getRoot().click(function(e){$(e.target).closest(SELECTORS_MODAL).length||refreshRubricSelect()}.bind(this))},registered||(ModalRegistry.register(ModalRubricManagerLaunch.TYPE,ModalRubricManagerLaunch,"plagiarism_turnitin/modal_rubric_manager_launch"),registered=!0),ModalRubricManagerLaunch}); \ No newline at end of file diff --git a/amd/build/modal_rubric_view_launch.min.min.js b/amd/build/modal_rubric_view_launch.min.min.js deleted file mode 100644 index 725f3872..00000000 --- a/amd/build/modal_rubric_view_launch.min.min.js +++ /dev/null @@ -1 +0,0 @@ -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=!1,SELECTORS_HIDE_BUTTON='[data-action="hide"]',ModalRubricViewLaunch=function(root){Modal.call(this,root)};return ModalRubricViewLaunch.TYPE="plagiarism_turnitin-modal_rubric_view_launch",(ModalRubricViewLaunch.prototype=Object.create(Modal.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),cancelEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this))},registered||(ModalRegistry.register(ModalRubricViewLaunch.TYPE,ModalRubricViewLaunch,"plagiarism_turnitin/modal_rubric_view_launch"),registered=!0),ModalRubricViewLaunch}); \ No newline at end of file diff --git a/amd/build/open_viewer.min.min.js b/amd/build/open_viewer.min.min.js deleted file mode 100644 index d11ae956..00000000 --- a/amd/build/open_viewer.min.min.js +++ /dev/null @@ -1 +0,0 @@ -define("plagiarism_turnitin/open_viewer",["jquery"],function($){return{origreport_open:function(){var that=this;$(document).on("click",".pp_origreport_open",function(){for(var classList=$(this).attr("class").replace(/\s+/," ").split(" "),i=0;i';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()}})}}}); \ No newline at end of file diff --git a/amd/build/peermark.min.min.js b/amd/build/peermark.min.min.js deleted file mode 100644 index df870175..00000000 --- a/amd/build/peermark.min.min.js +++ /dev/null @@ -1 +0,0 @@ -define("plagiarism_turnitin/peermark",["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_peermark_manager_launch","plagiarism_turnitin/modal_peermark_reviews_launch"],function($,Templates,ModalFactory,ModalEvents,ModalPeermarkManagerLaunch,ModalPeermarkReviewsLaunch){return{peermarkLaunch:function(){var that=this;$(".peermark_manager_launch").on("click",function(event){event.preventDefault(),that.peermarkCreateModal(ModalPeermarkManagerLaunch.TYPE)}),$(document).on("click",".peermark_reviews_pp_launch",function(){that.peermarkCreateModal(ModalPeermarkReviewsLaunch.TYPE)})},peermarkCreateModal:function(modalType){if($('input[name="coursemodule"]').val())var cmid=$('input[name="coursemodule"]').val();else cmid=new URLSearchParams(window.location.search).get("id");ModalFactory.create({type:modalType,templateContext:{cmid:cmid,wwwroot:M.cfg.wwwroot},large:!0}).then(function(modal){modal.show()})}}}); \ No newline at end of file diff --git a/amd/build/quickmark.min.min.js b/amd/build/quickmark.min.min.js deleted file mode 100644 index 9fd53aa7..00000000 --- a/amd/build/quickmark.min.min.js +++ /dev/null @@ -1 +0,0 @@ -define("plagiarism_turnitin/quickmark",["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_quickmark_launch"],function($,Templates,ModalFactory,ModalEvents,ModalQuickmarkLaunch){return{quickmarkLaunch:function(){$(".plagiarism_turnitin_quickmark_manager_launch").on("click",function(event){event.preventDefault(),ModalFactory.create({type:ModalQuickmarkLaunch.TYPE,templateContext:{cmid:$('input[name="coursemodule"]').val(),wwwroot:M.cfg.wwwroot},large:!0}).then(function(modal){modal.show()})})}}}); \ No newline at end of file diff --git a/amd/build/refresh_submissions.min.min.js b/amd/build/refresh_submissions.min.min.js deleted file mode 100644 index eadfeb5a..00000000 --- a/amd/build/refresh_submissions.min.min.js +++ /dev/null @@ -1 +0,0 @@ -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()}})})}}}); \ No newline at end of file diff --git a/amd/build/resend_submission.min.min.js b/amd/build/resend_submission.min.min.js deleted file mode 100644 index 0c72f5bf..00000000 --- a/amd/build/resend_submission.min.min.js +++ /dev/null @@ -1 +0,0 @@ -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})}}}); \ No newline at end of file diff --git a/amd/build/rubric.min.min.js b/amd/build/rubric.min.min.js deleted file mode 100644 index f54cfce6..00000000 --- a/amd/build/rubric.min.min.js +++ /dev/null @@ -1 +0,0 @@ -define("plagiarism_turnitin/rubric",["jquery","core/templates","core/modal_factory","core/modal_events","plagiarism_turnitin/modal_rubric_manager_launch","plagiarism_turnitin/modal_rubric_view_launch"],function($,Templates,ModalFactory,ModalEvents,ModalRubricManagerLaunch,ModalRubricViewLaunch){return{rubric:function(){var that=this;$(".rubric_manager_launch").on("click",function(){var courseid=$(this).data("courseid"),cmid=$(this).data("cmid");that.rubricCreateModal(ModalRubricManagerLaunch.TYPE,courseid,cmid)}),$(document).on("click",".rubric_view",function(){var courseid=$(this).data("courseid"),cmid=$(this).data("cmid");that.rubricCreateModal(ModalRubricViewLaunch.TYPE,courseid,cmid)}),$("#id_plagiarism_rubric").mousedown(function(){""!=$('input[name="instance"]').val()&&"Y"!=$('input[name="rubric_warning_seen"]').val()&&confirm(M.str.plagiarism_turnitin.changerubricwarning)&&$('input[name="rubric_warning_seen"]').val("Y")})},rubricCreateModal:function(modalType,courseid,cmid){ModalFactory.create({type:modalType,templateContext:{courseid:courseid,cmid:cmid,wwwroot:M.cfg.wwwroot},large:!0}).then(function(modal){modal.show(),modal.getRoot().find(".modal").addClass("tii_pp_modal_rubric"),modal.getRoot().find(".modal-dialog").addClass("tii_pp_modal_rubric_content")})}}}); \ No newline at end of file diff --git a/amd/src/eula.min.js b/amd/src/eula.min.js deleted file mode 100644 index 86253974..00000000 --- a/amd/src/eula.min.js +++ /dev/null @@ -1 +0,0 @@ -define(["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()}}}}}); \ No newline at end of file diff --git a/amd/src/modal_eula_launch.min.js b/amd/src/modal_eula_launch.min.js deleted file mode 100644 index 739f0b16..00000000 --- a/amd/src/modal_eula_launch.min.js +++ /dev/null @@ -1 +0,0 @@ -define(["jquery","core/ajax","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_events"],function($,Ajax,Notification,CustomEvents,Modal,ModalRegistry,ModalEvents){var registered=false;var SELECTORS={HIDE_BUTTON:'[data-action="hide"]',MODAL:'[data-region="modal"]'};var ModalEulaLaunch=function(root){Modal.call(this,root)};ModalEulaLaunch.TYPE="plagiarism_turnitin-modal_eula_launch";ModalEulaLaunch.prototype=Object.create(Modal.prototype);ModalEulaLaunch.prototype.constructor=ModalEulaLaunch;ModalEulaLaunch.prototype.registerEventListeners=function(){Modal.prototype.registerEventListeners.call(this);processEula();this.getModal().on(CustomEvents.events.activate,SELECTORS.HIDE_BUTTON,function(e,data){var cancelEvent=$.Event(ModalEvents.cancel);this.getRoot().trigger(cancelEvent,this);if(!cancelEvent.isDefaultPrevented()){this.hide();data.originalEvent.preventDefault()}}.bind(this))};function processEula(){$(window).on("message",function(ev){var message=typeof ev.data==="undefined"?ev.originalEvent.data:ev.data;if(message==="turnitin_eula_declined"||message==="turnitin_eula_accepted"){$.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"actionuseragreement",message:message,sesskey:M.cfg.sesskey},success:function(){window.location.reload()},error:function(){window.location.reload()}})}})}if(!registered){ModalRegistry.register(ModalEulaLaunch.TYPE,ModalEulaLaunch,"plagiarism_turnitin/modal_eula_launch");registered=true}return ModalEulaLaunch}); \ No newline at end of file diff --git a/amd/src/modal_peermark_manager_launch.min.js b/amd/src/modal_peermark_manager_launch.min.js deleted file mode 100644 index fec1cc58..00000000 --- a/amd/src/modal_peermark_manager_launch.min.js +++ /dev/null @@ -1 +0,0 @@ -define(["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 ModalPeermarkManagerLaunch=function(root){Modal.call(this,root)};ModalPeermarkManagerLaunch.TYPE="plagiarism_turnitin-modal_peermark_manager_launch";ModalPeermarkManagerLaunch.prototype=Object.create(Modal.prototype);ModalPeermarkManagerLaunch.prototype.constructor=ModalPeermarkManagerLaunch;ModalPeermarkManagerLaunch.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();refreshPeermarkAssignments()}}.bind(this));this.getRoot().click(function(e){if(!$(e.target).closest(SELECTORS.MODAL).length){refreshPeermarkAssignments()}}.bind(this))};function refreshPeermarkAssignments(){$.ajax({type:"POST",url:M.cfg.wwwroot+"/plagiarism/turnitin/ajax.php",dataType:"json",data:{action:"refresh_peermark_assignments",cmid:$('input[name="coursemodule"]').val(),sesskey:M.cfg.sesskey}})}if(!registered){ModalRegistry.register(ModalPeermarkManagerLaunch.TYPE,ModalPeermarkManagerLaunch,"plagiarism_turnitin/modal_peermark_manager_launch");registered=true}return ModalPeermarkManagerLaunch}); \ No newline at end of file diff --git a/amd/src/modal_peermark_reviews_launch.min.js b/amd/src/modal_peermark_reviews_launch.min.js deleted file mode 100644 index bfcd50cf..00000000 --- a/amd/src/modal_peermark_reviews_launch.min.js +++ /dev/null @@ -1 +0,0 @@ -define(["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 ModalPeermarkReviewsLaunch=function(root){Modal.call(this,root)};ModalPeermarkReviewsLaunch.TYPE="plagiarism_turnitin-modal_peermark_reviews_launch";ModalPeermarkReviewsLaunch.prototype=Object.create(Modal.prototype);ModalPeermarkReviewsLaunch.prototype.constructor=ModalPeermarkReviewsLaunch;ModalPeermarkReviewsLaunch.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(ModalPeermarkReviewsLaunch.TYPE,ModalPeermarkReviewsLaunch,"plagiarism_turnitin/modal_peermark_reviews_launch");registered=true}return ModalPeermarkReviewsLaunch}); \ No newline at end of file diff --git a/amd/src/modal_quickmark_launch.min.js b/amd/src/modal_quickmark_launch.min.js deleted file mode 100644 index d86369d0..00000000 --- a/amd/src/modal_quickmark_launch.min.js +++ /dev/null @@ -1 +0,0 @@ -define(["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 ModalQuickmarkLaunch=function(root){Modal.call(this,root)};ModalQuickmarkLaunch.TYPE="plagiarism_turnitin-modal_quickmark_launch";ModalQuickmarkLaunch.prototype=Object.create(Modal.prototype);ModalQuickmarkLaunch.prototype.constructor=ModalQuickmarkLaunch;ModalQuickmarkLaunch.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(ModalQuickmarkLaunch.TYPE,ModalQuickmarkLaunch,"plagiarism_turnitin/modal_quickmark_launch");registered=true}return ModalQuickmarkLaunch}); \ No newline at end of file diff --git a/amd/src/modal_rubric_manager_launch.min.js b/amd/src/modal_rubric_manager_launch.min.js deleted file mode 100644 index a918eb1f..00000000 --- a/amd/src/modal_rubric_manager_launch.min.js +++ /dev/null @@ -1 +0,0 @@ -define(["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 ModalRubricManagerLaunch=function(root){Modal.call(this,root)};ModalRubricManagerLaunch.TYPE="plagiarism_turnitin-modal_rubric_manager_launch";ModalRubricManagerLaunch.prototype=Object.create(Modal.prototype);ModalRubricManagerLaunch.prototype.constructor=ModalRubricManagerLaunch;ModalRubricManagerLaunch.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();refreshRubricSelect()}}.bind(this));this.getRoot().click(function(e){if(!$(e.target).closest(SELECTORS.MODAL).length){refreshRubricSelect()}}.bind(this))};function refreshRubricSelect(){var currentRubric=$("#id_plagiarism_rubric").val();$.ajax({dataType:"json",type:"POST",url:"../plagiarism/turnitin/ajax.php",data:{action:"refresh_rubric_select",assignment:$('input[name="instance"]').val(),modulename:$('input[name="modulename"]').val(),course:$('input[name="course"]').val()},success:function(data){$($("#id_plagiarism_rubric")).empty();var options=data;$.each(options,function(i,val){if(!$.isNumeric(i)&&i!==""){var optgroup=$("");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($("