diff --git a/CHANGELOG.md b/CHANGELOG.md index a9a0a8d9..d16de687 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +### Date: 2024-February-06 +### Release: v2024020601 + +#### Anonymous Marking Fixed +An issue has been resolved with anonymous marking, where previously when an instructor made a request to reveal a student’s name prior to the feedback release date, the required reason field for the early reveal was not actually being enforced. Instructors will now be required to fill in this field when deciding to reveal a student name early. + +#### Removed Summary Content in Moodle Direct V2 Assignment Inbox +In versions 4.0+ of Moodle, the assignment summary content was being displayed twice in two separate locations. This update removes the display of the summary content from the Moodle Direct V2 inbox and it is now only displayed just above the inbox. + +#### Resolved Deprecated Warning Messages +This release resolves the issue with deprecated SOAP warnings displaying in PHP 8+. + ### Date: 2023-March-27 ### Release: v2023032701 diff --git a/ajax.php b/ajax.php index c352f61c..486fbb65 100644 --- a/ajax.php +++ b/ajax.php @@ -569,15 +569,12 @@ $turnitintooltwosubmission = new turnitintooltwo_submission($submissionid, "turnitin"); if ($turnitintooltwosubmission->unanonymise_submission($reason)) { if ($turnitintooltwosubmission->userid == 0) { - $tmpuser = new stdClass(); - $tmpuser->firstname = $turnitintooltwosubmission->nmfirstname; - $tmpuser->lastname = $turnitintooltwosubmission->nmlastname; - + $tmpuser->firstname = $turnitintooltwosubmission->firstname; + $tmpuser->lastname = $turnitintooltwosubmission->lastname; $return["name"] = fullname($tmpuser); } else { - $user = new turnitintooltwo_user($turnitintooltwosubmission->userid); - $return["name"] = fullname($user); + $return["name"] = $turnitintooltwosubmission->fullname; } $return["status"] = "success"; $return["userid"] = $turnitintooltwosubmission->userid; diff --git a/classes/v1migration/v1migration.php b/classes/v1migration/v1migration.php index 260c9b5d..f61484af 100644 --- a/classes/v1migration/v1migration.php +++ b/classes/v1migration/v1migration.php @@ -550,7 +550,7 @@ private function log_success_migration_event($turnitintooltwoid, $course_id, $v1 } /** - * Get assignments for migrated data table. Called from ajax.php via turnitintooltwo_extra-2023032701.min.js. + * Get assignments for migrated data table. Called from ajax.php via turnitintooltwo_extra-2024020601.min.js. * * @global type $DB * @return array return array of assignments to display diff --git a/jquery/plugins.php b/jquery/plugins.php index bd5728af..c99f15f7 100644 --- a/jquery/plugins.php +++ b/jquery/plugins.php @@ -19,9 +19,9 @@ $plugins = array( 'turnitintooltwo-dataTables' => array('files' => array('jquery.dataTables.js', 'jquery.dataTables.css')), 'turnitintooltwo-dataTables_plugins' => array('files' => array('jquery.dataTables.plugins.js')), - 'turnitintooltwo-turnitintooltwo' => array('files' => array('turnitintooltwo-2023032701.min.js')), - 'turnitintooltwo-turnitintooltwo_extra' => array('files' => array('turnitintooltwo_extra-2023032701.min.js')), - 'turnitintooltwo-turnitintooltwo_settings' => array('files' => array('turnitintooltwo_settings-2023032701.min.js')), + 'turnitintooltwo-turnitintooltwo' => array('files' => array('turnitintooltwo-2024020601.min.js')), + 'turnitintooltwo-turnitintooltwo_extra' => array('files' => array('turnitintooltwo_extra-2024020601.min.js')), + 'turnitintooltwo-turnitintooltwo_settings' => array('files' => array('turnitintooltwo_settings-2024020601.min.js')), 'turnitintooltwo-datatables_columnfilter' => array('files' => array('jquery.dataTables.columnFilter.js')), 'turnitintooltwo-cookie' => array('files' => array('jquery.cookie.js')), 'turnitintooltwo-colorbox' => array('files' => array('jquery.colorbox.js', 'colorbox.css')), diff --git a/jquery/turnitintooltwo-2023032701.min.js b/jquery/turnitintooltwo-2023032701.min.js deleted file mode 100644 index 523f3ad6..00000000 --- a/jquery/turnitintooltwo-2023032701.min.js +++ /dev/null @@ -1 +0,0 @@ -(function($){$(window).on("load",(function(){if($(".js_required").show(),$(".js_hide").hide(),1==$("#id_submissiontype").val()&&$("#id_submissiontext").parent().parent().hide(),2==$("#id_submissiontype").val()&&$("#id_submissionfile").parent().parent().hide(),$("#id_submissionagreement").length&&$("#id_submitbutton").attr("disabled","disabled"),$("#id_submissionagreement").on("click",(function(){$(this).is(":checked")?$("#id_submissionagreement").each((function(){$("#id_submitbutton").removeAttr("disabled")})):$("#id_submissionagreement").each((function(){$("#id_submitbutton").attr("disabled","disabled")}))})),$("div.mod_turnitintooltwo").parent().css("width","100%"),$(document).on("click",".delete_paper",(function(){var i=$(this).data("confirm"),t=M.str.turnitintooltwo[i].replace(/\\n/g,"\n");confirm(t)&&$.ajax({type:"POST",url:"ajax.php",dataType:"html",data:{action:"deletesubmission",sesskey:M.cfg.sesskey,paper:$(this).data("paper"),part:$(this).data("part"),assignment:$(this).data("assignment")},success:function(){window.location.href=window.location.href}})})),$(document).on("click",".submit_nothing",(function(){if(!$(this).hasClass("disabled")){$(this).addClass("disabled");var i=$(this).prop("id").split("_")[2],t=$(this).prop("id").split("_")[3],e=M.str.turnitintooltwo.submitnothingwarning.replace(/
/g,"\n").replace(/'/g,"'");$.cookie("submitnothingaccept")||confirm(e)?submitNothing(t,i):$(this).removeClass("disabled")}})),$(document).on("change","#id_submissiontype",(function(){1==$("#id_submissiontype").val()&&($("#id_submissiontext").parent().parent().hide(),$("#id_submissionfile").parent().parent().show()),2==$("#id_submissiontype").val()&&($("#id_submissionfile").parent().parent().hide(),$("#id_submissiontext").parent().parent().show())})),$(document).on("submit",".submission_form_container form",(function(){return $("#id_submissiontitle").val().length>0&&($("#general").slideUp("slow"),$(".mod_turnitintooltwo .noticebox").slideUp("slow"),$(".submission_form_container form").slideUp("slow"),$("#submitting_loader").slideDown("slow"),!0)})),$(".toggle_summary").length>0&&($.cookie("show_summary_"+$("#assignment_id").html())||$.cookie("show_summary_"+$("#assignment_id").html(),!0,{expires:30}),"true"==$.cookie("show_summary_"+$("#assignment_id").html())?($(".hide_summary_"+$("#assignment_id").html()).show(),$(".show_summary_"+$("#assignment_id").html()).hide(),$(".introduction").slideDown()):($(".show_summary_"+$("#assignment_id").html()).show(),$(".hide_summary_"+$("#assignment_id").html()).hide(),$(".introduction").slideUp()),$(".toggle_summary i").click((function(){$(this).hasClass("show_summary_"+$("#assignment_id").html())?($.cookie("show_summary_"+$("#assignment_id").html(),!0,{expires:30}),$(".show_summary_"+$("#assignment_id").html()).hide(),$(".hide_summary_"+$("#assignment_id").html()).show(),$(".introduction").slideDown()):($.cookie("show_summary_"+$("#assignment_id").html(),!1,{expires:30}),$(".show_summary_"+$("#assignment_id").html()).show(),$(".hide_summary_"+$("#assignment_id").html()).hide(),$(".introduction").slideUp())}))),$(".toggle_peermarks").length>0&&($.cookie("show_peermarks_"+$("#assignment_id").html())||$.cookie("show_peermarks_"+$("#assignment_id").html(),!0,{expires:30}),"true"==$.cookie("show_peermarks_"+$("#assignment_id").html())?($(".hide_peermarks_"+$("#assignment_id").html()).show(),$(".show_peermarks_"+$("#assignment_id").html()).hide(),$(".peermark_assignments_container").slideDown()):($(".show_peermarks_"+$("#assignment_id").html()).show(),$(".hide_peermarks_"+$("#assignment_id").html()).hide(),$(".peermark_assignments_container").slideUp()),$(".toggle_peermarks i").click((function(){$(this).hasClass("show_peermarks_"+$("#assignment_id").html())?($.cookie("show_peermarks_"+$("#assignment_id").html(),!0,{expires:30}),$(".show_peermarks_"+$("#assignment_id").html()).hide(),$(".hide_peermarks_"+$("#assignment_id").html()).show(),$(".peermark_assignments_container").slideDown()):($.cookie("show_peermarks_"+$("#assignment_id").html(),!1,{expires:30}),$(".show_peermarks_"+$("#assignment_id").html()).show(),$(".hide_peermarks_"+$("#assignment_id").html()).hide(),$(".peermark_assignments_container").slideUp())}))),$(document).on("click",".show_peermark_instructions, .hide_peermark_instructions",(function(){var i=$(this).attr("id").split("_");"show"==i[0]?($("#show_peermark_instructions_"+i[3]).hide(),$("#hide_peermark_instructions_"+i[3]).show(),$("#peermark_instructions_"+i[3]).slideDown()):($("#show_peermark_instructions_"+i[3]).show(),$("#hide_peermark_instructions_"+i[3]).hide(),$("#peermark_instructions_"+i[3]).slideUp())})),showPartDatesBoxes(),$(document).on("change","#id_numparts",(function(){showPartDatesBoxes()})),$(document).on("click",".splitter-lastname, .splitter-firstname",(function(i){var t=$(i.target),e=t.hasClass("sorting_asc"),s="asc",n="desc",o=t.attr("data-col");e||(s="desc",n="asc"),t.closest(".mod_turnitintooltwo_submissions_data_table").DataTable().order([o,n]).draw(),t.addClass("sorting_"+n).removeClass("sorting sorting_"+s),t.parent().removeClass("sorting sorting_asc sorting_desc"),t.siblings().removeClass("sorting_asc sorting_desc").addClass("sorting")})),$("#dataTable").length>0&&$("#dataTable").dataTable(),void 0!==M.str.turnitintooltwo)var dataTablesLang={sProcessing:''+M.str.turnitintooltwo.sprocessing+"",sZeroRecords:M.str.turnitintooltwo.szerorecords,sInfo:M.str.turnitintooltwo.sinfo,sSearch:M.str.turnitintooltwo.ssearch,sLengthMenu:M.str.turnitintooltwo.slengthmenu,oPaginate:{sNext:M.str.turnitintooltwo.snext,sPrevious:M.str.turnitintooltwo.sprevious}};if($("#tabs").length>0){var activeTab=0;$("#tab_position").length>0&&(activeTab=$("#tab_position").text()),$("#tabs").tabs({active:activeTab,show:function(){var i=$.fn.dataTable.fnTables(!0);i.length>0&&$(i).dataTable().fnAdjustColumnSizing()}})}$(".enrolledMembers").length>0&&$(".enrolledMembers").dataTable({bProcessing:!0,sAjaxSource:"ajax.php",aoColumnDefs:[{bSortable:!1,sClass:"centered_cell",aTargets:[0]},{sClass:"left",aTargets:[1]}],oLanguage:dataTablesLang,fnServerData:function(i,t,e){$.ajax({dataType:"json",type:"POST",url:i,data:{action:"get_members",assignment:$("#assignment_id").html(),role:$("#user_role").html()},success:function(i){e(i)},error:function(i,t){$(".dataTables_processing").attr("style","visibility: hidden"),$(".dataTables_empty").html(M.str.turnitintooltwo.membercheckerror)}})}});var submissionsDataTableColumns=[],visibleCols=[],noOfColumns=$("table.mod_turnitintooltwo_submissions_data_table th").length/$("table.mod_turnitintooltwo_submissions_data_table").length,notStudentView=$("table.mod_turnitintooltwo_submissions_data_table th.sorting_name").length>0,showOrigReport=$("table.mod_turnitintooltwo_submissions_data_table th.creport").length>0,useGradeMark=$("table.mod_turnitintooltwo_submissions_data_table th.cgrade").length>0,multipleParts=$("table.mod_turnitintooltwo_submissions_data_table th.coverallgrade").length>0;if(notStudentView)for(var i=0;i=9&&!showOrigReport&&!useGradeMark||i>=11&&(!showOrigReport&&useGradeMark||showOrigReport&&!useGradeMark)||i>=13&&showOrigReport&&useGradeMark?(submissionsDataTableColumns.push({sClass:"center",bSortable:!1}),visibleCols.push(!0)):(0==i||4==i||7==i||9==i&&showOrigReport||9==i&&!showOrigReport||11==i&&useGradeMark)&&(submissionsDataTableColumns.push({bVisible:!1}),visibleCols.push(!1));else for(var i=0;i=8&&!showOrigReport&&!useGradeMark||i>=10&&(!showOrigReport&&useGradeMark||showOrigReport&&!useGradeMark)||i>=12&&showOrigReport&&useGradeMark?(submissionsDataTableColumns.push({sClass:"center",bSortable:!1}),visibleCols.push(!0)):(0==i||3==i||6==i||8==i&&showOrigReport||8==i&&!showOrigReport||10==i&&useGradeMark)&&(submissionsDataTableColumns.push({bVisible:!1}),visibleCols.push(!1));var partTables=[],refreshRequested=[];$("table.mod_turnitintooltwo_submissions_data_table").each((function(){var i=$(this).attr("id");refreshRequested[i]=0,partTables[i]=$("table#"+i).dataTable({bProcessing:!0,aoColumns:submissionsDataTableColumns,aLengthMenu:[[10,25,50,100,-1],[10,25,50,100,"All"]],aaSorting:[[2,"asc"],[4,"asc"]],sAjaxSource:"ajax.php",oLanguage:dataTablesLang,sDom:'r<"mod_turnitintooltwo_listbar-container"<"top mod_turnitintooltwo_listbar clearfix"lf>><"dt_pagination clearfix"pi>t<"bottom"><"dt_pagination clearfix"pi>',fnServerData:function(t,e,s){$.ajax({dataType:"json",type:"POST",url:t,data:{action:"initialise_redraw"},success:function(t){disableEditingText(i),s(t),$("#"+i+"_processing").attr("style","visibility: visible"),getSubmissions(partTables[i],$("#assignment_id").html(),i,0,refreshRequested,0)}})},bStateSave:!0,fnStateSave:function(t,e){try{localStorage.setItem(i+"DataTables",JSON.stringify(e))}catch(i){}},fnStateSaveParams:function(i,t){t.abVisCols=visibleCols},fnStateLoad:function(t){try{return JSON.parse(localStorage.getItem(i+"DataTables"))}catch(i){}},fnStateLoadParams:function(i,t){t.abVisCols=visibleCols},fnDrawCallback:function(t){initialiseDigitalReceipt(),initialiseDVLaunchers("all",0,i,0),initialiseRefreshRow("all",0,i,0),initialiseUploadBox("all",0,0,0),initialiseZipDownloads(i),initialiseCheckboxes(0,i),initialiseUnanoymiseForm("all",0,0)}})})),$("table.mod_turnitintooltwo_submissions_data_table").each((function(){refreshPeermarkAssignments($(this).attr("id"),0)})),$(".messages_amount").length>0&&refreshUserMessages(),$(".tii_table_functions").each((function(){var i=$(this).attr("id").split("tii_table_functions_")[1],t=$("#tii_table_functions_"+i).html();$("#tii_table_functions_"+i).remove(),$("#"+i+"_length").after(t),$(".mod_turnitintooltwo_messages_inbox").show(),$("#refresh_"+i).show(),$("#refreshing_"+i).hide()}));var zip_downloads=$(".mod_turnitintooltwo_zip_downloads");if($.each(zip_downloads,(function(){var i=$(this).attr("id").split("_")[1];$(this).remove(),$("#"+i+"_length").after($(this))})),"Learner"==$("#user_role").html()&&$(".dataTables_length, .dataTables_filter, .dt_pagination").hide(),$(".mod_turnitintooltwo_refresh_link").click((function(){return $(this).is(":visible")&&($(".mod_turnitintooltwo_refresh_link").hide(),$(".mod_turnitintooltwo_refreshing_link").show(),$("table.mod_turnitintooltwo_submissions_data_table").each((function(){refreshRequested[$(this).attr("id")]=1,partTables[$(this).attr("id")].fnReloadAjax(),partTables[$(this).attr("id")].fnStandingRedraw()}))),!1})),$("#turnitin_sync_all_grades").length>0&&$(".turnitin_sync_grades").click((function(){$(".turnitin_sync_grades").hide(),$(".turnitin_syncing_grades").show(),$.ajax({type:"POST",url:M.cfg.wwwroot+"/mod/turnitintooltwo/ajax.php",dataType:"json",data:{action:"sync_all_submissions",assignment:$("#turnitin_sync_all_grades").data("turnitintooltwoid"),sesskey:M.cfg.sesskey},success:function(i){$(".turnitin_sync_grades").show(),$(".turnitin_syncing_grades").hide()}})})),$(".submission_failure_msg").length>0&&window.parent.$(".upload_box").colorbox.resize({width:"800px",height:"240px"}),$(".enrol_link").click((function(){$("#enrolling_error").hide(),$(".enrol_link").hide(),$(".enrolling_container").show(),$.ajax({type:"POST",url:"ajax.php",dataType:"html",data:{action:"enrol_all_students",assignment:$("#assignment_id").html(),sesskey:M.cfg.sesskey},success:function(i){window.location.href=window.location.href},error:function(i,t){$(".enrol_link").show(),$(".enrolling_container").hide(),$("#enrolling_error").show()}})})),$(".mod_turnitintooltwo_rubric_manager_launch").length>0&&$(".mod_turnitintooltwo_rubric_manager_launch").colorbox({iframe:!0,width:"832px",height:"682px",opacity:"0.7",className:"rubric_manager",transition:"none",onLoad:function(){lightBoxCloseButton(),getLoadingGif()},onCleanup:function(){hideLoadingGif(),"rubric_manager_inbox_launch"!=$(this).attr("id")&&refreshRubricSelect(),$("#tii_close_bar").remove()}}),$(".mod_turnitintooltwo_rubric_view_launch").length>0&&$(".mod_turnitintooltwo_rubric_view_launch").colorbox({iframe:!0,width:"832px",height:"682px",opacity:"0.7",className:"rubric_view",transition:"none",onLoad:function(){lightBoxCloseButton(),getLoadingGif()},onCleanup:function(){$("#tii_close_bar").remove(),hideLoadingGif()}}),$("#id_rubric, #id_plagiarism_rubric").mousedown((function(){""!=$('input[name="instance"]').val()&&"Y"!=$('input[name="rubric_warning_seen"]').val()&&confirm(M.str.turnitintooltwo.changerubricwarning)&&$('input[name="rubric_warning_seen"]').val("Y")})),$(".mod_turnitintooltwo_quickmark_manager_launch").length>0&&$(".mod_turnitintooltwo_quickmark_manager_launch").colorbox({iframe:!0,width:"770px",height:"600px",opacity:"0.7",className:"quickmark_manager",transition:"none",onLoad:function(){lightBoxCloseButton(),getLoadingGif()},onCleanup:function(){$("#tii_close_bar").remove(),hideLoadingGif()}}),$(".tii_peermark_manager_launch").length>0&&$(".tii_peermark_manager_launch").colorbox({iframe:!0,width:"915px",height:"772px",opacity:"0.7",className:"peermark_manager",transition:"none",onLoad:function(){lightBoxCloseButton(),getLoadingGif()},onCleanup:function(){$("#tii_close_bar").remove(),hideLoadingGif()},onClosed:function(){refreshPeermarkAssignments($(this).attr("id").split("_")[2],1)}}),$(".tii_peermark_reviews_launch").length>0&&$(".tii_peermark_reviews_launch").colorbox({iframe:!0,width:"915px",height:"772px",opacity:"0.7",className:"peermark_reviews",transition:"none",onLoad:function(){lightBoxCloseButton(),getLoadingGif()},onCleanup:function(){$("#tii_close_bar").remove(),hideLoadingGif()}}),$(".mod_turnitintooltwo_messages_inbox").length>0&&$(".mod_turnitintooltwo_messages_inbox").colorbox({iframe:!0,width:"772px",height:"772px",opacity:"0.7",className:"messages",transition:"none",closeButton:!0,onLoad:function(){lightBoxCloseButton(),getLoadingGif()},onCleanup:function(){$("#tii_close_bar").remove(),hideLoadingGif()}}),$(".mod_turnitintooltwo_nonsubmitters_link").length>0&&$(".mod_turnitintooltwo_nonsubmitters_link").colorbox({iframe:!0,width:"740px",height:"540px",opacity:"0.7",className:"nonsubmitters",transition:"none",closeButton:!0,onLoad:function(){lightBoxCloseButton(),getLoadingGif()},onCleanup:function(){$("#tii_close_bar").remove(),hideLoadingGif()}}),$(".mod_turnitintooltwo_nonsubmittersformsuccessmsg").length>0&&(hideLoadingGif(),window.parent.$(".nonsubmitters").colorbox.resize({width:"740px",height:"120px"})),$(".mod_turnitintooltwo_rubric_view_launch").length>0&&$(".mod_turnitintooltwo_rubric_view_launch").colorbox({iframe:!0,width:"832px",height:"682px",opacity:"0.7",className:"rubric_view",transition:"none",onLoad:function(){lightBoxCloseButton(),getLoadingGif()},onCleanup:function(){$("#tii_close_bar").remove(),hideLoadingGif()}}),$(document).on("click",".default_open, .origreport_open, .grademark_open",(function(){var i=!0,t=$(this).attr("id").split("_"),e=$("#date_due_"+t[2]).html(),s=moment(e).unix(),n=t[0],o=t[1],a=t[2];if(s>moment().unix()&&$(this).hasClass("graded_warning")&&(confirm(M.str.turnitintooltwo.resubmissiongradewarn)||(i=!1)),i){dvWindow=window.open("","_blank");var r='
';r+='',r+='

'+M.str.turnitintooltwo.loadingdv+"

",r+="
",$(dvWindow.document.body).html(r),$.ajax({type:"POST",url:M.cfg.wwwroot+"/mod/turnitintooltwo/ajax.php",dataType:"json",data:{action:n,submission:o,assignment:$("#assignment_id").html()},success:function(i){$(dvWindow.document.body).html(r+i),dvWindow.document.forms[0].submit(),dvWindow.document.close(),checkDVClosed(a)}})}})),$("#id_rubric").length>0&&refreshRubricSelect(),self!=top&&"box"==$("#view_context").html()?$("html").css("background","none"):self!=top&&"box_solid"==$("#view_context").html()&&$("html").css("background","#FFF"),$(".editable_postdue").on("click",(function(){1==$(this).data("anon")&&alert(M.str.turnitintooltwo.postdate_warning)})),$(".max_marks_warning").on("click",(function(){alert(M.str.turnitintooltwo.max_marks_warning)})),$(".editable_text").length>0){$.fn.editable.defaults.mode="inline",$.fn.editable.defaults.url="ajax.php",$.fn.editable.defaults.onblur="submit",$.fn.editable.defaults.showbuttons=!1,$.fn.editable.defaults.ajaxOptions={dataType:"json"},$(".editable_text").editable({validate:function(i){if($(this).attr("id").indexOf("marks_")>=0&&(Math.floor(i)!=i||!$.isNumeric(i)||-1!=i.indexOf(".")))return M.str.turnitintooltwo.maxmarkserror},success:function(i,t){if(!i.success)return i.msg;if("maxmarks"==i.field)$("#refresh_"+i.partid).click(),$.ajax({type:"POST",url:M.cfg.wwwroot+"/mod/turnitintooltwo/ajax.php",dataType:"json",data:{action:"sync_all_submissions",assignment:$("#assignment_id").html(),sesskey:M.cfg.sesskey}});else if("partname"==i.field){var e=$(this).parentsUntil(".ui-tabs-panel").parent().attr("aria-labelledby");$("#"+e).text(t)}}}),$("#export_options").hasClass("tii_export_options_hide")&&($("#export_options").hide(),$(".export_data").html('--')),$(".editable_postdue").on("click",(function(){var i=$(this);$.ajax({type:"POST",url:"ajax.php",dataType:"json",data:{action:"check_anon",part:i.data("pk"),assignment:$("#assignment_id").html()},success:function(t){i.data("anon",t.anon),i.data("unanon",t.unanon),i.data("submitted",t.submitted)}})}));var theDate=new Date;$(".editable_date").editable({type:"combodate",format:"YYYY-MM-DD HH:mm",viewformat:"D MMM YYYY, HH:mm",template:"D MMM YYYY HH:mm",combodate:{minuteStep:1,minYear:2e3,maxYear:theDate.getFullYear()+2,smartDays:!0},validate:function(i){if(i.format("X")--')):($(".empty-dash").remove(),$("#export_options").show())}}),$(".editable_date").click((function(){if($(this).hasClass("editable-disabled"))return!1})),$(".editable_date, .editable_text").on("shown",(function(i,t){var e=$(this).prop("id");$(".editable_date, .editable_text").not("#"+e).editable("disable"),$(".submit_nothing").addClass("disabled")})),$(".editable_date, .editable_text").on("hidden",(function(){var i=$(this).prop("id");$(".editable_date, .editable_text").not("#"+i).editable("enable"),$(".submit_nothing").removeClass("disabled")}))}function enableEditingText(i){$("#tabs-"+i+" .editable_date, #tabs-"+i+" .editable_text").editable("enable")}function disableEditingText(i){$("#tabs-"+i+" .editable_date, #tabs-"+i+" .editable_text").editable("disable")}function getLoadingGif(){$("#cboxOverlay").after('
');var i=$(window).scrollTop()+$(window).height()/2;$(".loading_gif").css("top",i+"px")}function hideLoadingGif(){$(".loading_gif").remove()}function getSubmissions(table,assignment_id,part_id,start,refresh_requested,total){$.ajax({dataType:"json",type:"POST",url:"ajax.php",async:!0,data:{action:"get_submissions",assignment:assignment_id,part:part_id,start:start,refresh_requested:refresh_requested[part_id],sesskey:M.cfg.sesskey,total:total},success:function(result){if(eval(result),start=result.end,result.aaData.length>0&&table.fnAddData(result.aaData),result.end$(".mod_turnitintooltwo_submissions_data_table .refresh_row").length&&$(".mod_turnitintooltwo_nonsubmitters_link").attr("style","display: block")}},error:function(i,t){$("#"+part_id+"_processing").attr("style","visibility: hidden"),$(".dataTables_empty").html(M.str.turnitintooltwo.tiisubmissionsgeterror)}})}function submitVisibility(){1==$(".upload_box").data("user-type")||1==$(".upload_box").data("eula")?$(".upload_box").show():$(".upload_box").hide()}function refreshRubricSelect(){var i=$("#id_rubric").length?"#id_rubric":"#id_plagiarism_rubric",t=$(i).val();$.ajax({dataType:"json",type:"POST",url:"../mod/turnitintooltwo/ajax.php",data:{action:"refresh_rubric_select",assignment:$('input[name="instance"]').val(),modulename:$('input[name="modulename"]').val(),course:$('input[name="course"]').val()},success:function(e){$($(i)).empty();var s=e;$.each(s,(function(t,e){if($.isNumeric(t)||""===t)$($(i)).append($("");s.attr("label",t),$.each(e,(function(i,t){var e=$("");e.val(i),e.text(t),s.append(e)})),$(i).append(s)}})),$(i+' option[value="'+t+'"]').attr("selected","selected")}})}function refreshUserMessages(){$(".mod_turnitintooltwo_messages_loading").show(),$(".messages_amount").html(""),$.ajax({dataType:"html",type:"POST",url:"ajax.php",data:{action:"refresh_user_messages",assignment:$("#assignment_id").html()},success:function(i){$(".mod_turnitintooltwo_messages_loading").hide(),$(".messages_amount").html(i)}})}function resetPeermarkSection(i){$("#tabs-"+i+" .toggle_peermarks").hide(),$("#tabs-"+i+" .peermark_count").html(""),$("#tabs-"+i+" .peermark-loading").show(),$("#tabs-"+i+" .peermark_assignments_container").hide()}function refreshPeermarkAssignments(part_id,refresh_requested){var user_role=$(".tii_peermark_manager_launch").length>0?"Instructor":"Learner";$("#tabs-"+part_id+" .peermark_assignments_container").length>0&&(resetPeermarkSection(part_id),$.ajax({dataType:"json",type:"POST",url:"ajax.php",data:{action:"refresh_peermark_assignments",assignment:$("#assignment_id").html(),part:part_id,refresh_requested:refresh_requested,sesskey:M.cfg.sesskey},success:function(data){eval(data),$("#tabs-"+part_id+" .peermark_assignments_container").html(data.peermark_table),$("#tabs-"+part_id+" .peermark-loading").hide(),$("#tabs-"+part_id+" .peermark_count").html(data.no_of_peermarks),data.no_of_peermarks>0?$("#tabs-"+part_id+" .toggle_peermarks").show():$("#tabs-"+part_id+" .toggle_peermarks").hide(),(data.no_of_peermarks>0&&"Instructor"==user_role||data.peermarks_active&&"Learner"==user_role)&&$("#tabs-"+part_id+" .row_peermark_reviews").show(),"true"==$.cookie("show_peermarks_"+$("#assignment_id").html())&&data.no_of_peermarks>0?($(".show_peermarks_"+$("#assignment_id").html()).hide(),$(".hide_peermarks_"+$("#assignment_id").html()).show(),$(".peermark_assignments_container").slideDown()):($(".show_peermarks_"+$("#assignment_id").html()).show(),$(".hide_peermarks_"+$("#assignment_id").html()).hide(),$(".peermark_assignments_container").slideUp())}}))}function initialiseUnanoymiseForm(scope,assignment_id,submission_id){var identifier="a.unanonymise";"row"==scope&&(identifier="#submission_"+submission_id),$(identifier).colorbox({inline:!0,width:"50%",top:"100px",height:"260px",opacity:"0.7",className:"tii_unanonymise_reveal_form",onComplete:function(){var idStr=$(this).attr("id").split("_");if(0==submission_id||null==submission_id)var submission_id=idStr[1];0==assignment_id&&(assignment_id=$("#assignment_id").html()),$("#submission_id").html(submission_id),$("#cboxLoadedContent .mod_turnitintooltwo_unanonymise_form").show(),$("#id_reveal").unbind("click"),$("#id_reveal").click((function(){$.ajax({dataType:"json",type:"POST",url:"ajax.php",data:{action:"reveal_submission_name",assignment:assignment_id,submission_id:submission_id,reason:encodeURIComponent($("#id_anonymous_reveal_reason").val()),sesskey:M.cfg.sesskey},success:function(data){if(eval(data),"success"==data.status)$.colorbox.close(),$("#submission_"+submission_id).attr("href",M.cfg.wwwroot+"/user/view.php?id="+data.userid+"&course="+data.courseid),$("#submission_"+submission_id).html(data.name),$("#submission_"+submission_id).removeClass("unanonymise cboxElement");else{var current_msg=$("#mod_turnitintooltwo_unanonymise_desc").html;$("#mod_turnitintooltwo_unanonymise_desc").html(current_msg+" "+data.msg)}}})}))},onCleanup:function(){$(".mod_turnitintooltwo_unanonymise_form").hide()}})}function initialiseUploadBox(i,t,e,s){var n=".upload_box";"row"==i&&(n="#upload_"+t+"_"+e+"_"+s);$(n).colorbox({onLoad:function(){getLoadingGif(),lightBoxCloseButton(),$(this).hide()},onClosed:function(){hideLoadingGif()},onCleanup:function(){hideLoadingGif();var i=$(this).attr("id").split("_");refreshInboxRow("upload",i[1],i[2],i[3]),$("#tii_close_bar").remove()},iframe:!0,width:"80%",height:"80%",opacity:"0.7",className:"upload",transition:"none"})}function initialiseZipDownloads(i){$("#tabs-"+i+" .orig_zip_open, #tabs-"+i+" .pdf_zip_open, #tabs-"+i+" .xls_inbox_open").unbind("click"),$("#tabs-"+i+" .orig_zip_open, #tabs-"+i+" .pdf_zip_open, #tabs-"+i+" .xls_inbox_open").click((function(){var i=$(this).attr("id").split("_");downloadZipFile(i[0]+"_"+i[1],i[2])})),$("#tabs-"+i+" .downloadpdf_box").colorbox({iframe:!0,width:"40%",height:"60%",opacity:"0.7",className:"downloadpdf_window",transition:"none",onLoad:function(){lightBoxCloseButton(),getLoadingGif()},onCleanup:function(){$("#tii_close_bar").remove(),hideLoadingGif()},onClosed:function(){refreshUserMessages()}}),$(document).on("click","#tabs-"+i+" .mod_turnitintooltwo_gmpdfzip_box",(function(t){return $(this).colorbox({open:!0,iframe:!0,width:"786px",height:"300px",opacity:"0.7",className:"gmpdfzip_window",transition:"none",href:function(){var t="";return $("#tabs-"+i+" .inbox_checkbox:checked").each((function(i){t+="&submission_id"+i+"="+$(this).val(),i++})),$(this).attr("href")+t},onLoad:function(){getLoadingGif()},onCleanup:function(){hideLoadingGif()},onClosed:function(){refreshUserMessages()}}),!1}))}function lightBoxCloseButton(){$("body").append('")}function initialiseDigitalReceipt(){$(".mod_turnitintooltwo_digital_receipt").length>0&&$(".mod_turnitintooltwo_digital_receipt").colorbox({iframe:!0,width:"832px",height:"482px",opacity:"0.7",className:"rubric_view",transition:"none",onLoad:function(){lightBoxCloseButton(),getLoadingGif()},onCleanup:function(){$("#tii_close_bar").remove(),hideLoadingGif()}})}function initialiseHiddenZipDownloads(i){$("#tabs-"+i+" .mod_turnitintooltwo_origchecked_zip_open").unbind("click"),$("#tabs-"+i+" .mod_turnitintooltwo_origchecked_zip_open").click((function(){var t=$(this).attr("id").split("_");return downloadZipFile(t[0]+"_"+t[1],i),!1}))}function initialiseRefreshRow(i,t,e,s){var n=".refresh_row .fa-refresh";"row"==i&&(n="#refreshrow_"+t+"_"+e+"_"+s+" .fa-refresh"),$(n).unbind("click"),$(n).click((function(){$(this).hide(),$(this).siblings(".fa-spinner").css("display","inline-block").addClass("fa-lg");var i=$(this).parent().attr("id").split("_");refreshInboxRow(i[0],i[1],i[2],i[3])}))}function initialiseDVLaunchers(i,t,e,s){var n="#"+e+" .download_original_open";"row"==i&&(n="#downloadoriginal_"+t+"_"+e+"_"+s),$(n).unbind("click"),$(n).click((function(){var i=$(this).attr("id").split("_");$(this).children(".score_colour").hasClass("score_colour_")||downloadOriginalFile(i[0],i[1],i[2],i[3])}))}function downloadZipFile(i,t){var e=[];"origchecked_zip"!=i&&"gmpdf_zip"!=i||$("#tabs-"+t+" .inbox_checkbox:checked").each((function(i){e[i]=$(this).val()})),$.ajax({type:"POST",url:"ajax.php",dataType:"html",data:{action:i,assignment:$("#assignment_id").html(),part:t,submission_ids:e},success:function(e){$("#"+i+"_form_"+t).html(e),$("#"+i+"_form_"+t).children("form").submit(),$("#"+i+"_form_"+t).html("")}})}function downloadOriginalFile(i,t,e,s){$.ajax({type:"POST",url:M.cfg.wwwroot+"/mod/turnitintooltwo/ajax.php",dataType:"html",data:{action:i,submission:t,assignment:$("#assignment_id").html()},success:function(e){$("#"+i+"_form_"+t).html(e),$("#"+i+"_form_"+t).children("form").submit(),$("#"+i+"_form_"+t).html("")}})}function checkDVClosed(i){window.dvWindow.closed?$("#refresh_"+i).click():setTimeout((function(){checkDVClosed(i)}),500)}function submitNothing(user_id,part_id){$("#submitnothing_0_"+part_id+"_"+user_id+" i").attr("class","fa fa-spin fa-spinner fa-lg"),$.ajax({type:"POST",url:"ajax.php",dataType:"json",data:{action:"submit_nothing",assignment:$("#assignment_id").html(),part:part_id,user:user_id,sesskey:M.cfg.sesskey},success:function(data){eval(data),$.cookie("submitnothingaccept",!0,{expires:365}),$("table#"+part_id+" .select_all_checkbox").attr("checked",!1)},error:function(i){$("#submitnothing_0_"+part_id+"_"+user_id+" i").attr("class","fa fa-pencil fa-lg"),$("#submitnothing_0_"+part_id+"_"+user_id).removeClass("disabled"),alert(i.responseText)},complete:function(){refreshInboxRow("submitnothing",0,part_id,user_id)}})}function refreshInboxRow(link,submission_id,part_id,user_id){$.ajax({type:"POST",url:"ajax.php",dataType:"json",data:{action:"refresh_submission_row",assignment:$("#assignment_id").html(),part:part_id,user:user_id,sesskey:M.cfg.sesskey},success:function(data){$("table#"+part_id+" .select_all_checkbox").attr("checked",!1),eval(data);var i=0;0==submission_id?(link+="_0",submission_id=data.submission_id):link=null==data.submission_id&&0!=submission_id?link+"_"+submission_id:link+"_"+data.submission_id,0!=submission_id&&$("#export_links").removeClass("hidden_class"),oTable=$("table#"+part_id).dataTable();var tr=$("#"+link+"_"+part_id+"_"+user_id).parent().parent(),rowindex=tr.index();oTable.fnDeleteRow(tr),oTable.fnAddData(data.row),submitVisibility(),initialiseUploadBox("row",data.submission_id,part_id,user_id),initialiseDVLaunchers("row",data.submission_id,part_id,user_id),initialiseRefreshRow("row",data.submission_id,part_id,user_id),initialiseCheckboxes(data.submission_id,part_id),initialiseUnanoymiseForm("row",$("#assignment_id").html(),data.submission_id)}})}function initialiseCheckboxes(i,t){var e="#tabs-"+t+" .inbox_checkbox";0!=i&&(e="check_"+i),$("#tabs-"+t+" .inbox_checkbox").click((function(){$("table#"+t+" .select_all_checkbox").attr("checked",!1)})),$(document).on("click",e+", .select_all_checkbox",(function(){$("#tabs-"+t+" .inbox_checkbox:checked").length>0?($("#tabs-"+t+" .mod_turnitintooltwo_zip_downloads button").prop("disabled",!1),$("#tabs-"+t+" .mod_turnitintooltwo_zip_downloads button").removeAttr("title"),initialiseHiddenZipDownloads(t)):($("#tabs-"+t+" .mod_turnitintooltwo_origchecked_zip_open").unbind("click"),$("#tabs-"+t+" .mod_turnitintooltwo_zip_downloads button").prop("disabled",!0),$("#tabs-"+t+" .mod_turnitintooltwo_zip_downloads button").prop("title",M.str.turnitintooltwo.download_button_warning))}))}function showPartDatesBoxes(){for(var i=0;i<=5;i++)i<=$("#id_numparts").val()?$('fieldset[id$="partdates'+i+'"]').slideDown():$('fieldset[id$="partdates'+i+'"]').slideUp()}$("#inbox_form form, .launch_form form").submit(),$(".turnitin_eula_link").length>0&&$(".turnitin_eula_link").colorbox({iframe:!0,width:"766px",height:"596px",opacity:"0.7",className:"eula_view",scrolling:"false",onLoad:function(){getLoadingGif()},onComplete:function(){$(window).on("message",(function(i){var t=void 0===i.data?i.originalEvent.data:i.data;"turnitin_eula_declined"!=t&&"turnitin_eula_accepted"!=t||$.ajax({type:"POST",url:M.cfg.wwwroot+"/mod/turnitintooltwo/ajax.php",dataType:"json",data:{action:"acceptuseragreement",message:t,sesskey:M.cfg.sesskey},success:function(i){window.location.reload()},error:function(i){window.location.reload()}})}))},onCleanup:function(){hideLoadingGif()}}),$("#mod_turnitintooltwo_receipt_print").click((function(){window.print()})),$(".select_all_checkbox").on("click",(function(){var i=$(this).parent().parent().parent().parent().attr("id");$(this).is(":checked")?($("#"+i+" .inbox_checkbox").length&&($("#tabs-"+i+" .mod_turnitintooltwo_zip_downloads button").prop("disabled",!1),$("#tabs-"+i+" .mod_turnitintooltwo_zip_downloads button").removeAttr("title")),$("#"+i+" .inbox_checkbox").each((function(){$(this).prop("checked",!0)}))):($("#"+i+" .inbox_checkbox").each((function(){$(this).prop("checked",!1)})),$("#"+i+" .inbox_checkbox").length&&($("#tabs-"+i+" .mod_turnitintooltwo_zip_downloads button").prop("disabled",!0),$("#tabs-"+i+" .mod_turnitintooltwo_zip_downloads button").prop("title",M.str.turnitintooltwo.download_button_warning)))})),$("[id^=fitem_id_dtpost] select").change((function(){var i=$(this).parent().parent().parent();buildUnixDate("#fitem_id_dtpost",i.data("partId"))