From dacbeef792fef44e1da9beb3f691409b9f3c9214 Mon Sep 17 00:00:00 2001 From: David Hatton Date: Tue, 2 Feb 2016 10:22:28 +0000 Subject: [PATCH 01/36] modified JS to provide a warning. (Doesn't work yet) --- jquery/turnitintooltwo.js | 8 +++++--- jquery/turnitintooltwo.min.js | 2 +- lang/en/turnitintooltwo.php | 1 + turnitintooltwo_view.class.php | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/jquery/turnitintooltwo.js b/jquery/turnitintooltwo.js index cf864449..7a2c6b53 100755 --- a/jquery/turnitintooltwo.js +++ b/jquery/turnitintooltwo.js @@ -670,7 +670,10 @@ jQuery(document).ready(function($) { 'smartDays': true }, validate: function(value) { - if( value.format("X") < moment().unix() && + if (/*value.format("X").unix() < due_date_unix &&*/$this.data('anon') == 1 && $this(hasClass('editable_postdue'))) { + confirm(M.str.turnitintooltwo.postdate_warning); + } + if( value.format("X").unix() < moment().unix() && $(this).hasClass('editable_postdue') && $(this).data('anon') == 1 && $(this).data('unanon') == 0 && @@ -678,7 +681,6 @@ jQuery(document).ready(function($) { { if ( ! confirm(M.str.turnitintooltwo.disableanonconfirm)) { $('.editable-open').editableContainer('hide'); - // Validation only fails if string is returned (We need a string). return ' '; } @@ -1337,4 +1339,4 @@ jQuery(document).ready(function($) { // return converted moment object return moment(date, "DD-MMMM-YYYY hh:mm").unix(); } -}); \ No newline at end of file +}); diff --git a/jquery/turnitintooltwo.min.js b/jquery/turnitintooltwo.min.js index ea4a7df2..2285573e 100755 --- a/jquery/turnitintooltwo.min.js +++ b/jquery/turnitintooltwo.min.js @@ -1 +1 @@ -jQuery(document).ready(function($){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(){var i='
';$("#cboxOverlay").after(i);var e=$(window).scrollTop()+$(window).height()/2;$(".loading_gif").css("top",e+"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.end0&&$(".nonsubmitters_link").attr("style","display: block")}},error:function(i,e){$("#"+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",e=$(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(t){$($(i)).empty();var s=t;$.each(s,function(e,t){$($(i)).append($("