From eb4049733a16ece26656a1f72b6541b85e9f954e Mon Sep 17 00:00:00 2001 From: Isaac Xiong Date: Tue, 4 Apr 2023 09:36:58 -0500 Subject: [PATCH 1/9] update_release_notes --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d81a7aed..e0c0f8d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,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. --- From d9ec8e62f3d479bcd9ffd71b1eec812c5af4f4f3 Mon Sep 17 00:00:00 2001 From: Isaac Xiong Date: Wed, 12 Apr 2023 11:43:36 -0500 Subject: [PATCH 2/9] update behat test --- tests/behat/eula.feature | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/behat/eula.feature b/tests/behat/eula.feature index b8c0709b..76d811a1 100644 --- a/tests/behat/eula.feature +++ b/tests/behat/eula.feature @@ -60,7 +60,6 @@ Feature: Plagiarism plugin works with a Moodle Assignment allowing EULA acceptan And I wait "10" seconds And I click save changes button "css_element" "#id_submitbutton" Then I should see "Submitted for grading" - And I should see "Queued" And I should see "Your file has not been submitted to Turnitin. Please click here to accept our EULA." # Trigger cron as admin for submission And I log out From 9d1e3be79febffaa2b458ccf22dfbe3ea8ceea9e Mon Sep 17 00:00:00 2001 From: Isaac Xiong Date: Wed, 12 Apr 2023 12:47:59 -0500 Subject: [PATCH 3/9] update behat tests --- tests/behat/eula.feature | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/behat/eula.feature b/tests/behat/eula.feature index 76d811a1..332d38f3 100644 --- a/tests/behat/eula.feature +++ b/tests/behat/eula.feature @@ -79,7 +79,6 @@ Feature: Plagiarism plugin works with a Moodle Assignment allowing EULA acceptan And I am on "Turnitin Behat EULA Test Course" course homepage And I follow "Test assignment name" And I should see "Your file has not been submitted to Turnitin. Please click here to accept our EULA." - And I should see "This file has not been submitted to Turnitin because the user has not accepted the Turnitin End User Licence Agreement." And I accept the Turnitin EULA if necessary # Admin can trigger a resubmission from the errors tab of the settings page. And I log out From 36e7fbab1b9ec2beb9faa9fa13463d0b91317549 Mon Sep 17 00:00:00 2001 From: Isaac Xiong Date: Thu, 13 Apr 2023 10:39:23 -0500 Subject: [PATCH 4/9] update behat tests --- tests/behat/eula.feature | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/behat/eula.feature b/tests/behat/eula.feature index 332d38f3..03402ee3 100644 --- a/tests/behat/eula.feature +++ b/tests/behat/eula.feature @@ -80,15 +80,9 @@ Feature: Plagiarism plugin works with a Moodle Assignment allowing EULA acceptan And I follow "Test assignment name" And I should see "Your file has not been submitted to Turnitin. Please click here to accept our EULA." And I accept the Turnitin EULA if necessary - # Admin can trigger a resubmission from the errors tab of the settings page. + # Admin can trigger a resubmission And I log out And I log in as "admin" - And I navigate to "Plugins > Plagiarism > Turnitin plagiarism plugin" in site administration - And I click on "Errors" "link" - And I click on ".select_all_checkbox" "css_element" - And I wait "2" seconds - And I press "Resubmit Selected Files" - And I wait "10" seconds And I run the scheduled task "plagiarism_turnitin\task\send_submissions" # Instructor opens assignment. And I log out From 35df6910719b8c87dee13a56f0acf867536c05b8 Mon Sep 17 00:00:00 2001 From: Isaac Xiong Date: Thu, 13 Apr 2023 11:04:53 -0500 Subject: [PATCH 5/9] update behat tests --- tests/behat/eula.feature | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/behat/eula.feature b/tests/behat/eula.feature index 03402ee3..18c8000b 100644 --- a/tests/behat/eula.feature +++ b/tests/behat/eula.feature @@ -80,6 +80,13 @@ Feature: Plagiarism plugin works with a Moodle Assignment allowing EULA acceptan And I follow "Test assignment name" And I should see "Your file has not been submitted to Turnitin. Please click here to accept our EULA." And I accept the Turnitin EULA if necessary + And I press "Edit submission" + # Resubmitting same paper + And I delete "testfile.txt" from "File submissions" filemanager + And I upload "plagiarism/turnitin/tests/fixtures/testfile.txt" file to "File submissions" filemanager + And I press "Save changes" + Then I should see "Submitted for grading" + And I should see "Queued" # Admin can trigger a resubmission And I log out And I log in as "admin" From 83207eb5bff4fc6c80a84a3d89e1181d1cb15945 Mon Sep 17 00:00:00 2001 From: Martin Lenord Date: Tue, 13 Jun 2023 13:37:10 +0100 Subject: [PATCH 6/9] Avoid passing non-arrays into count to prevent warnings in PHP8 --- lib.php | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib.php b/lib.php index dfafe1ab..f97ccefe 100755 --- a/lib.php +++ b/lib.php @@ -1262,35 +1262,35 @@ public function update_grades_from_tii($cm) { global $DB; $submissionids = $this->fetch_updated_paper_ids_from_turnitin($cm); - $return = ($submissionids === false) ? false : true; - + if ($submissionids === false || count($submissionids) < 1) { + return false; + } // Refresh updated submissions. - if (count($submissionids) > 0) { - // Initialise Comms Object. - $turnitincomms = new turnitin_comms(); - $turnitincall = $turnitincomms->initialise_api(); + $return = true; + // Initialise Comms Object. + $turnitincomms = new turnitin_comms(); + $turnitincall = $turnitincomms->initialise_api(); - // Process submissions in batches, depending on the max. number of submissions the Turnitin API returns. - $submissionbatches = array_chunk($submissionids, PLAGIARISM_TURNITIN_NUM_RECORDS_RETURN); + // Process submissions in batches, depending on the max. number of submissions the Turnitin API returns. + $submissionbatches = array_chunk($submissionids, PLAGIARISM_TURNITIN_NUM_RECORDS_RETURN); - foreach ($submissionbatches as $submissionsbatch) { - try { - $submission = new TiiSubmission(); - $submission->setSubmissionIds($submissionsbatch); - - $response = $turnitincall->readSubmissions($submission); - $readsubmissions = $response->getSubmissions(); + foreach ($submissionbatches as $submissionsbatch) { + try { + $submission = new TiiSubmission(); + $submission->setSubmissionIds($submissionsbatch); - foreach ($readsubmissions as $readsubmission) { - $submissiondata = $DB->get_record('plagiarism_turnitin_files', - array('externalid' => $readsubmission->getSubmissionId()), 'id'); - $return = $this->update_submission($cm, $submissiondata->id, $readsubmission); - } + $response = $turnitincall->readSubmissions($submission); + $readsubmissions = $response->getSubmissions(); - } catch (Exception $e) { - $turnitincomms->handle_exceptions($e, 'tiisubmissiongeterror', false); - $return = false; + foreach ($readsubmissions as $readsubmission) { + $submissiondata = $DB->get_record('plagiarism_turnitin_files', + array('externalid' => $readsubmission->getSubmissionId()), 'id'); + $return = $this->update_submission($cm, $submissiondata->id, $readsubmission); } + + } catch (Exception $e) { + $turnitincomms->handle_exceptions($e, 'tiisubmissiongeterror', false); + $return = false; } } @@ -1479,7 +1479,7 @@ private function update_grade($cm, $submission, $userid) { $tiisubmissions = current($tiisubmissions); } - if (count($tiisubmissions) > 1) { + if (is_array($tiisubmissions) && count($tiisubmissions) > 1) { $averagegrade = null; $gradescounted = 0; foreach ($tiisubmissions as $tiisubmission) { @@ -2012,7 +2012,7 @@ public function cron_update_scores() { $submissions = $DB->get_records_select( 'plagiarism_turnitin_files', - 'statuscode = ? + 'statuscode = ? AND ( similarityscore IS NULL OR duedate_report_refresh = 1 ) AND ( orcapable = ? OR orcapable IS NULL ) ', array('success', 1), From fa6e4728ff33c54090af4f4a48eb0442ea4fdaca Mon Sep 17 00:00:00 2001 From: Isaac Xiong Date: Mon, 31 Jul 2023 15:34:40 -0500 Subject: [PATCH 7/9] remove extra min js files --- amd/build/eula.min.min.js | 1 - amd/build/modal_eula_launch.min.min.js | 1 - amd/build/modal_peermark_manager_launch.min.min.js | 1 - amd/build/modal_peermark_reviews_launch.min.min.js | 1 - amd/build/modal_quickmark_launch.min.min.js | 1 - amd/build/modal_rubric_manager_launch.min.min.js | 1 - amd/build/modal_rubric_view_launch.min.min.js | 1 - amd/build/open_viewer.min.min.js | 1 - amd/build/peermark.min.min.js | 1 - amd/build/quickmark.min.min.js | 1 - amd/build/refresh_submissions.min.min.js | 1 - amd/build/resend_submission.min.min.js | 1 - amd/build/rubric.min.min.js | 1 - amd/src/eula.min.js | 1 - amd/src/modal_eula_launch.min.js | 1 - amd/src/modal_peermark_manager_launch.min.js | 1 - amd/src/modal_peermark_reviews_launch.min.js | 1 - amd/src/modal_quickmark_launch.min.js | 1 - amd/src/modal_rubric_manager_launch.min.js | 1 - amd/src/modal_rubric_view_launch.min.js | 1 - amd/src/open_viewer.min.js | 1 - amd/src/peermark.min.js | 1 - amd/src/quickmark.min.js | 1 - amd/src/refresh_submissions.min.js | 1 - amd/src/resend_submission.min.js | 1 - amd/src/rubric.min.js | 1 - 26 files changed, 26 deletions(-) delete mode 100644 amd/build/eula.min.min.js delete mode 100644 amd/build/modal_eula_launch.min.min.js delete mode 100644 amd/build/modal_peermark_manager_launch.min.min.js delete mode 100644 amd/build/modal_peermark_reviews_launch.min.min.js delete mode 100644 amd/build/modal_quickmark_launch.min.min.js delete mode 100644 amd/build/modal_rubric_manager_launch.min.min.js delete mode 100644 amd/build/modal_rubric_view_launch.min.min.js delete mode 100644 amd/build/open_viewer.min.min.js delete mode 100644 amd/build/peermark.min.min.js delete mode 100644 amd/build/quickmark.min.min.js delete mode 100644 amd/build/refresh_submissions.min.min.js delete mode 100644 amd/build/resend_submission.min.min.js delete mode 100644 amd/build/rubric.min.min.js delete mode 100644 amd/src/eula.min.js delete mode 100644 amd/src/modal_eula_launch.min.js delete mode 100644 amd/src/modal_peermark_manager_launch.min.js delete mode 100644 amd/src/modal_peermark_reviews_launch.min.js delete mode 100644 amd/src/modal_quickmark_launch.min.js delete mode 100644 amd/src/modal_rubric_manager_launch.min.js delete mode 100644 amd/src/modal_rubric_view_launch.min.js delete mode 100644 amd/src/open_viewer.min.js delete mode 100644 amd/src/peermark.min.js delete mode 100644 amd/src/quickmark.min.js delete mode 100644 amd/src/refresh_submissions.min.js delete mode 100644 amd/src/resend_submission.min.js delete mode 100644 amd/src/rubric.min.js 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($("