From 912ddd79e8afba597b15ac796dea966c6e5c5c86 Mon Sep 17 00:00:00 2001 From: Vladyslav Hrechenenko <64135767+vladhrech@users.noreply.github.com> Date: Tue, 9 Feb 2021 14:06:51 +0200 Subject: [PATCH] [SkillFacatory2035-1651] Regenerate min js files for ORA2 (#44) * [SkillFacatory2035-1651] Regenerate min js files * [SkillFacatory2035-1651] Update version ora2 --- openassessment/xblock/static/js/openassessment-lms.min.js | 2 +- openassessment/xblock/static/js/openassessment-studio.min.js | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openassessment/xblock/static/js/openassessment-lms.min.js b/openassessment/xblock/static/js/openassessment-lms.min.js index 42ecddd386..a04d18f158 100644 --- a/openassessment/xblock/static/js/openassessment-lms.min.js +++ b/openassessment/xblock/static/js/openassessment-lms.min.js @@ -1 +1 @@ -if("undefined"!=typeof OpenAssessment&&OpenAssessment||(OpenAssessment={}),void 0===window.gettext&&(window.gettext=function(text){return text}),void 0===window.ngetgext&&(window.ngettext=function(singularText,pluralText,n){return 1 header ."+this.SLIDABLE_CLASS,this.element).focus())},srClear:function(){$(this.READER_FEEDBACK_CLASS).html("")},srReadTexts:function(texts){var $readerFeedbackSelector=$(this.READER_FEEDBACK_CLASS),htmlFeedback="";this.srClear(),$.each(texts,function(ids,value){htmlFeedback=htmlFeedback+"

"+value+"

\n"}),$readerFeedbackSelector.html(htmlFeedback)},areSRStepsLoading:function(){return this.responseView.isRendering||this.peerView.isRendering||this.selfView.isRendering||this.gradeView.isRendering||this.trainingView.isRendering||this.staffView.isRendering},announceStatusChangeToSRandFocus:function(stepID,usageID,gradeStatus,currentView,focusID){var text=this.getStatus(stepID,currentView,gradeStatus);void 0!==usageID&&$(stepID,currentView.element).hasClass("is--showing")&&void 0!==focusID?($(focusID,currentView.element).focus(),this.srStatusUpdates.push(text)):currentView.announceStatus&&this.srStatusUpdates.push(text),!this.areSRStepsLoading()&&0")),previewContainer.parent().parent().parent().show(),MathJax.Hub.Queue(["Typeset",MathJax.Hub,previewContainer[0]])})},getUsageID:function(){return this.usageID||(this.usageID=$(this.element).data("usage-id")),this.usageID},load:function(){this.responseView.load(),this.loadAssessmentModules(),this.staffAreaView.load()},loadAssessmentModules:function(usageID){this.trainingView.load(usageID),this.peerView.load(usageID),this.staffView.load(usageID),this.selfView.load(usageID),this.gradeView.load(usageID),this.leaderboardView.load(usageID)},loadMessageView:function(){this.messageView.load()},toggleActionError:function(type,message){var element=this.element,container=null;if("save"===type?container=".response__submission__actions":"submit"===type||"peer"===type||"self"===type||"student-training"===type?container=".step__actions":"feedback_assess"===type?container=".submission__feedback__actions":"upload"===type&&(container=".upload__error"),null===container?null!==message&&console.log(message):($(container+" .message__content",element).html("

"+(message?_.escape(message):"")+"

"),$(container,element).toggleClass("has--error",null!==message),$(container+" > .message",element).focus()),null!==message){var contentTitle=$(container+" .message__title").text();this.srReadTexts([contentTitle,message])}},showLoadError:function(stepName,errorMessage){errorMessage||(errorMessage=gettext("Unable to load"));var $container=$(".step--"+stepName);$container.toggleClass("has--error",!0),$container.removeClass("is--showing"),$container.find(".ui-slidable").attr("aria-expanded","false"),$container.find(".step__status__value i").removeClass().addClass("icon fa fa-exclamation-triangle"),$container.find(".step__status__value .copy").html(_.escape(errorMessage))},unsavedWarningEnabled:function(enabled,key,message){if(void 0===enabled)return null!==window.onbeforeunload;var usageID=$(this.element).data("usage-id");enabled?(void 0!==OpenAssessment.unsavedChanges[usageID]&&OpenAssessment.unsavedChanges[usageID]||(OpenAssessment.unsavedChanges[usageID]={}),OpenAssessment.unsavedChanges[usageID][key]=message,window.onbeforeunload=function(){for(var xblockUsageID in OpenAssessment.unsavedChanges)if(OpenAssessment.unsavedChanges.hasOwnProperty(xblockUsageID))for(var key in OpenAssessment.unsavedChanges[xblockUsageID])if(OpenAssessment.unsavedChanges[xblockUsageID].hasOwnProperty(key))return OpenAssessment.unsavedChanges[xblockUsageID][key]}):void 0!==OpenAssessment.unsavedChanges[usageID]&&(delete OpenAssessment.unsavedChanges[usageID][key],$.isEmptyObject(OpenAssessment.unsavedChanges[usageID])&&delete OpenAssessment.unsavedChanges[usageID],$.isEmptyObject(OpenAssessment.unsavedChanges)&&(window.onbeforeunload=null))},buttonEnabled:function(className,enabled){var $element=$(className,this.element);return void 0===enabled?!$element.prop("disabled"):($element.prop("disabled",!enabled),enabled)}},function(OpenAssessment){"use strict";OpenAssessment.CourseItemsListingView=function(runtime,element){var self=this,$section=$(element),block=$section.find(".open-response-assessment-block"),itemViewEnabled=1===parseInt(block.data("item-view-enabled"))&&XBlock;this.$section=$section,this.runtime=runtime,this.oraData=$.parseJSON($("#open-response-assessment-items").text()),$section.find(".open-response-assessment-content").hide(),$section.find(".open-response-assessment-item").hide(),$section.find(".open-response-assessment-msg").show();var AssessmentCell=Backgrid.UriCell.extend({staff:!1,render:function(){this.$el.empty();var url=this.model.get(this.staff?"url_grade_available_responses":"url_base"),rawValue=this.model.get(this.column.get("name")),staffAssessment=this.model.get("staff_assessment"),formattedValue=this.formatter.fromRaw(rawValue,this.model),link=null;return itemViewEnabled&&(!this.staff||this.staff&&staffAssessment)?(link=$("",{text:formattedValue,title:this.title||formattedValue}),this.$el.append(link),link.on("click",$.proxy(self,"displayOraBlock",url))):this.$el.append(formattedValue),this.delegateEvents(),this}}),StaffCell=AssessmentCell.extend({staff:!0});this._columns=[{name:"parent_name",label:gettext("Unit Name"),label_summary:gettext("Units"),cell:"string",num:!1,editable:!1},{name:"name",label:gettext("Assessment"),label_summary:gettext("Assessments"),cell:AssessmentCell,num:!1,editable:!1},{name:"total",label:gettext("Total Responses"),label_summary:gettext("Total Responses"),cell:"string",num:!0,editable:!1},{name:"training",label:gettext("Training"),label_summary:gettext("Training"),cell:"string",num:!0,editable:!1},{name:"peer",label:gettext("Peer"),label_summary:gettext("Peer"),cell:"string",num:!0,editable:!1},{name:"self",label:gettext("Self"),label_summary:gettext("Self"),cell:"string",num:!0,editable:!1},{name:"waiting",label:gettext("Waiting"),label_summary:gettext("Waiting"),cell:"string",num:!0,editable:!1},{name:"staff",label:gettext("Staff"),label_summary:gettext("Staff"),cell:StaffCell,num:!0,editable:!1},{name:"done",label:gettext("Final Grade Received"),label_summary:gettext("Final Grade Received"),cell:"string",num:!0,editable:!1}]},OpenAssessment.CourseItemsListingView.prototype.refreshGrids=function(force){force=force||!1;var self=this,$section=this.$section,block=$section.find(".open-response-assessment-block"),dataUrl=this.runtime.handlerUrl($section,"get_ora2_responses");if(!parseInt(block.data("rendered"))||force)return $.Deferred(function(defer){$.ajax({type:"GET",dataType:"json",url:dataUrl}).done(function(data){self.renderGrids(data),defer.resolve()}).fail(function(data,textStatus){$section.find(".open-response-assessment-msg").text(gettext("List of Open Assessments is unavailable")),defer.rejectWith(this,[textStatus])})}).promise()},OpenAssessment.CourseItemsListingView.prototype.renderGrids=function(data){var $section=this.$section,block=$section.find(".open-response-assessment-block"),oraSteps=["training","peer","self","waiting","staff","done"];$.each(this.oraData,function(i,oraItem){var total=0,itemId=oraItem.id;$.each(oraSteps,function(j,step){oraItem[step]=0}),itemId in data&&(_.extend(oraItem,data[itemId]),oraItem.staff_assessment&&(oraItem.staff=oraItem.waiting,oraItem.waiting=0)),$.each(oraSteps,function(j,step){total+=oraItem[step]}),oraItem.total=total}),block.data("rendered",1),$section.find(".open-response-assessment-msg").hide(),this.showSummaryGrid(this.oraData),this.showOpenResponsesGrid(this.oraData)},OpenAssessment.CourseItemsListingView.prototype.showSummaryGrid=function(data){var $section=this.$section,summaryData=[],summaryDataMap={};$section.find(".open-response-assessment-summary").empty(),$.each(this._columns,function(index,v){summaryData.push({title:v.label_summary,value:0,num:v.num,class:v.name}),summaryDataMap[v.name]=index}),$.each(data,function(index,obj){$.each(obj,function(key,value){var idx=0;key in summaryDataMap&&(idx=summaryDataMap[key],summaryData[idx].num?summaryData[idx].value+=value:summaryData[idx].value+=1)})});var templateData=_.template($("#open-response-assessment-summary-tpl").text());$section.find(".open-response-assessment-summary").append(templateData({oraSummary:summaryData}))},OpenAssessment.CourseItemsListingView.prototype.showOpenResponsesGrid=function(data){var $section=this.$section;$section.find(".open-response-assessment-content").show();var collection=new Backbone.Collection(data);$section.find(".open-response-assessment-main-table").empty();var grid=new Backgrid.Grid({columns:this._columns,collection:collection});$section.find(".open-response-assessment-main-table").append(grid.render().el)},OpenAssessment.CourseItemsListingView.prototype.displayOraBlock=function(url){var $section=this.$section,self=this;return $section.find(".open-response-assessment-content").hide(),$section.find(".open-response-assessment-msg").text(gettext("Please wait")).show(),$.Deferred(function(defer){$.ajax({type:"GET",dataType:"json",url:url}).done(function(data){var el=$section.find(".open-response-assessment-item"),block=el.find(".open-response-assessment-item-block");$section.find(".open-response-assessment-msg").hide(),el.show(),self.renderBreadcrumbs(),block.html(data.html),XBlock.initializeBlock($(block).find(".xblock")[0]),defer.resolve()}).fail(function(data,textStatus){$section.find(".open-response-assessment-item").show(),$section.find(".open-response-assessment-msg").text(gettext("Block view is unavailable")),self.renderBreadcrumbs(),defer.rejectWith(this,[textStatus])})}).promise()},OpenAssessment.CourseItemsListingView.prototype.renderBreadcrumbs=function(){var breadcrumbs=this.$section.find(".open-response-assessment-item-breadcrumbs"),text=gettext("Back to Full List"),fullListItem=$("",{html:"← "+text,title:text});breadcrumbs.append(fullListItem),fullListItem.on("click",$.proxy(this,"backToOpenResponsesGrid"))},OpenAssessment.CourseItemsListingView.prototype.backToOpenResponsesGrid=function(){var $section=this.$section;$section.find(".open-response-assessment-item-breadcrumbs").empty(),$section.find(".open-response-assessment-item-block").empty(),$section.find(".open-response-assessment-item").hide(),$section.find(".open-response-assessment-msg").text(gettext("Please wait")).show(),this.refreshGrids(!0)}}(OpenAssessment),OpenAssessment.DateTimeFactory=function(element){this.element=element},OpenAssessment.DateTimeFactory.prototype={apply:function(){var dtFactory=this;$(".ora-datetime",this.element).each(function(){dtFactory.elementApply($(this))})},determineContext:function(el){return{datetime:el.data("datetime"),timezone:el.data("timezone"),language:el.data("language"),format:""}},determineDateToken:function(el){var dateToken="date";return this.isValid(el.data("datetoken"))&&(dateToken=el.data("datetoken")),dateToken},elementApply:function(el){var dtFactory=this;(function(require){require(["jquery","edx-ui-toolkit/js/utils/date-utils","edx-ui-toolkit/js/utils/string-utils"],function($,DateUtils,StringUtils){var context,localTimeString,displayDatetime,interpolateDict={};dtFactory.isValid(el.data("datetime"))?(context=dtFactory.determineContext(el),dtFactory.isValid(el.data("format"))&&(context.format=DateUtils.dateFormatEnum[el.data("format")]),localTimeString=DateUtils.localize(context),interpolateDict[dtFactory.determineDateToken(el)]=localTimeString,displayDatetime=dtFactory.isValid(el.data("string"))?StringUtils.interpolate(el.data("string"),interpolateDict):localTimeString):displayDatetime=StringUtils.interpolate(el.data("string"),interpolateDict),el.text(displayDatetime)})}).call(this,require||RequireJS.require)},isValid:function(candidateVariable){return void 0!==candidateVariable&&""!==candidateVariable&&"Invalid date"!==candidateVariable&&"None"!==candidateVariable}},OpenAssessment.FileUploader=function(){this.upload=function(url,file){return $.Deferred(function(defer){$.ajax({url:url,type:"PUT",data:file,async:!1,processData:!1,contentType:file.type}).done(function(){Logger.log("openassessment.upload_file",{fileName:file.name,fileSize:file.size,fileType:file.type}),defer.resolve()}).fail(function(data,textStatus){defer.rejectWith(this,[textStatus])})}).promise()}},OpenAssessment.GradeView=function(element,server,baseView){this.element=element,this.server=server,this.baseView=baseView,this.announceStatus=!1,this.isRendering=!1,this.dateFactory=new OpenAssessment.DateTimeFactory(this.element)},OpenAssessment.GradeView.prototype={load:function(usageID){var view=this,baseView=this.baseView,stepID=".step--grade",focusID="[id='oa_grade_"+usageID+"']";view.isRendering=!0,this.server.render("grade").done(function(html){$(stepID,view.element).replaceWith(html),view.server.renderLatex($(stepID,view.element)),view.isRendering=!1,view.installHandlers(),view.baseView.announceStatusChangeToSRandFocus(stepID,usageID,!0,view,focusID),view.dateFactory.apply()}).fail(function(errMsg){baseView.showLoadError("grade",errMsg)})},installHandlers:function(){var sel=$(".step--grade",this.element);this.baseView.setUpCollapseExpand(sel);var view=this;sel.find(".feedback__submit").click(function(eventObject){eventObject.preventDefault(),view.submitFeedbackOnAssessment()})},feedbackText:function(text){var usageID=this.baseView.getUsageID()||"";if(void 0===text)return $("[id='feedback__remarks__value__"+usageID+"']",this.element).val();$("[id='feedback__remarks__value__"+usageID+"']",this.element).val(text)},feedbackOptions:function(options){var view=this,usageID=this.baseView.getUsageID()||"";if(void 0===options)return $.map($(".feedback__overall__value:checked",view.element),function(element){return $(element).val()});$(".feedback__overall__value",this.element).prop("checked",!1),$.each(options,function(index,opt){$("[id='feedback__overall__value--"+opt+"__"+usageID+"']",view.element).prop("checked",!0)})},setHidden:function(selector,hidden){selector.toggleClass("is--hidden",hidden),selector.attr("aria-hidden",hidden?"true":"false")},isHidden:function(selector){return selector.hasClass("is--hidden")&&"true"===selector.attr("aria-hidden")},feedbackState:function(newState){var containerSel=$(".submission__feedback__content",this.element),instructionsSel=containerSel.find(".submission__feedback__instructions"),fieldsSel=containerSel.find(".submission__feedback__fields"),actionsSel=containerSel.find(".submission__feedback__actions"),transitionSel=containerSel.find(".transition__status"),messageSel=containerSel.find(".message--complete");if(void 0===newState){var isSubmitting=containerSel.hasClass("is--transitioning")&&containerSel.hasClass("is--submitting")&&!this.isHidden(transitionSel)&&this.isHidden(messageSel)&&this.isHidden(instructionsSel)&&this.isHidden(fieldsSel)&&this.isHidden(actionsSel),hasSubmitted=containerSel.hasClass("is--submitted")&&this.isHidden(transitionSel)&&!this.isHidden(messageSel)&&this.isHidden(instructionsSel)&&this.isHidden(fieldsSel)&&this.isHidden(actionsSel);if(!containerSel.hasClass("is--submitted")&&!containerSel.hasClass("is--transitioning")&&!containerSel.hasClass("is--submitting")&&this.isHidden(transitionSel)&&this.isHidden(messageSel)&&!this.isHidden(instructionsSel)&&!this.isHidden(fieldsSel)&&!this.isHidden(actionsSel))return"open";if(isSubmitting)return"submitting";if(hasSubmitted)return"submitted";throw"Invalid feedback state"}"open"===newState?(containerSel.toggleClass("is--transitioning",!1),containerSel.toggleClass("is--submitting",!1),containerSel.toggleClass("is--submitted",!1),this.setHidden(instructionsSel,!1),this.setHidden(fieldsSel,!1),this.setHidden(actionsSel,!1),this.setHidden(transitionSel,!0),this.setHidden(messageSel,!0)):"submitting"===newState?(containerSel.toggleClass("is--transitioning",!0),containerSel.toggleClass("is--submitting",!0),containerSel.toggleClass("is--submitted",!1),this.setHidden(instructionsSel,!0),this.setHidden(fieldsSel,!0),this.setHidden(actionsSel,!0),this.setHidden(transitionSel,!1),this.setHidden(messageSel,!0)):"submitted"===newState&&(containerSel.toggleClass("is--transitioning",!1),containerSel.toggleClass("is--submitting",!1),containerSel.toggleClass("is--submitted",!0),this.setHidden(instructionsSel,!0),this.setHidden(fieldsSel,!0),this.setHidden(actionsSel,!0),this.setHidden(transitionSel,!0),this.setHidden(messageSel,!1))},submitFeedbackOnAssessment:function(){var view=this,baseView=this.baseView;$(".feedback__submit",this.element).prop("disabled",!0),view.feedbackState("submitting"),this.server.submitFeedbackOnAssessment(this.feedbackText(),this.feedbackOptions()).done(function(){view.feedbackState("submitted")}).fail(function(errMsg){baseView.toggleActionError("feedback_assess",errMsg)})}},OpenAssessment.LeaderboardView=function(element,server,baseView){this.element=element,this.server=server,this.baseView=baseView},OpenAssessment.LeaderboardView.prototype={load:function(usageID){var view=this,baseView=this.baseView,stepID=".step--leaderboard";this.server.render("leaderboard").done(function(html){$(stepID,view.element).replaceWith(html),view.server.renderLatex($(stepID,view.element)),view.installHandlers(),void 0!==usageID&&$(stepID,view.element).hasClass("is--showing")&&$("[id='oa_leaderboard_"+usageID+"']",view.element).focus()}).fail(function(errMsg){baseView.showLoadError("leaderboard",errMsg)})},installHandlers:function(){this.baseView.setUpCollapseExpand($(".step--leaderboard",this.element))}},OpenAssessment.MessageView=function(element,server,baseView){this.element=element,this.server=server,this.baseView=baseView},OpenAssessment.MessageView.prototype={load:function(){var view=this,baseView=this.baseView;this.server.render("message").done(function(html){$(".openassessment__message",view.element).replaceWith(html),view.server.renderLatex($(".openassessment__message",view.element))}).fail(function(errMsg){baseView.showLoadError("message",errMsg)})}},OpenAssessment.PeerView=function(element,server,baseView){this.element=element,this.server=server,this.baseView=baseView,this.rubric=null,this.isRendering=!1,this.announceStatus=!1,this.dateFactory=new OpenAssessment.DateTimeFactory(this.element)},OpenAssessment.PeerView.prototype={UNSAVED_WARNING_KEY:"peer-assessment",load:function(usageID){var view=this,stepID=".step--peer-assessment",focusID="[id='oa_peer_"+usageID+"']";view.isRendering=!0,this.server.render("peer_assessment").done(function(html){$(stepID,view.element).replaceWith(html),view.isRendering=!1,view.server.renderLatex($(stepID,view.element)),view.installHandlers(!1),view.baseView.announceStatusChangeToSRandFocus(stepID,usageID,!1,view,focusID),view.announceStatus=!1,view.dateFactory.apply()}).fail(function(){view.baseView.showLoadError("peer-assessment")}),view.baseView.loadMessageView()},loadContinuedAssessment:function(usageID){var view=this,focusID="[id='oa_peer_"+usageID+"']";view.continueAssessmentEnabled(!1),view.isRendering=!0,this.server.renderContinuedPeer().done(function(html){$(".step--peer-assessment",view.element).replaceWith(html),view.server.renderLatex($(".step--peer-assessment",view.element)),view.isRendering=!1,view.installHandlers(!0),view.baseView.announceStatusChangeToSRandFocus(".step--peer-assessment",usageID,!1,view,focusID)}).fail(function(){view.baseView.showLoadError("peer-assessment"),view.continueAssessmentEnabled(!0)})},continueAssessmentEnabled:function(enabled){return this.baseView.buttonEnabled(".action--continue--grading",enabled)},installHandlers:function(isContinuedAssessment){var sel=$(".step--peer-assessment",this.element),view=this;this.baseView.setUpCollapseExpand(sel),this.baseView.bindLatexPreview(sel);var rubricSelector=$(".peer-assessment--001__assessment",this.element);if(0'+_.escape(label)+":\n"+msg)},response:function(texts){var sel=$(".response__submission .submission__answer__part__text__value",this.element);if(void 0===texts)return sel.map(function(){return $.trim($(this).val())}).get();sel.map(function(index){$(this).val(texts[index])})},responseChanged:function(){var savedResponse=this.savedResponse;return this.response().some(function(element,index){return element!==savedResponse[index]})},autoSave:function(){var timeSinceLastChange=Date.now()-this.lastChangeTime;this.responseChanged()&&timeSinceLastChange>this.AUTO_SAVE_WAIT&&!this.errorOnLastSave&&this.save()},handleResponseChanged:function(){if(this.checkSubmissionAbility(),this.responseChanged()){var saveAbility=this.checkSaveAbility();this.saveEnabled(saveAbility),this.previewEnabled(saveAbility),this.saveStatus(gettext("This response has not been saved.")),this.baseView.unsavedWarningEnabled(!0,this.UNSAVED_WARNING_KEY,gettext("If you leave this page without saving or submitting your response, you will lose any work you have done on the response."))}this.lastChangeTime=Date.now()},save:function(){this.errorOnLastSave=!1,this.saveStatus(gettext("Saving...")),this.baseView.toggleActionError("save",null),this.baseView.unsavedWarningEnabled(!1,this.UNSAVED_WARNING_KEY);var view=this,savedResponse=this.response();this.server.save(savedResponse).done(function(){if(view.savedResponse=savedResponse,view.checkSubmissionAbility(),view.response().every(function(element,index){return element===savedResponse[index]})){view.saveEnabled(!1);var msg=gettext("This response has been saved but not submitted.");view.saveStatus(msg),view.baseView.srReadTexts([msg])}}).fail(function(errMsg){view.saveStatus(gettext("Error")),view.baseView.toggleActionError("save",errMsg),view.errorOnLastSave=!0})},submit:function(){this.submitEnabled(!1);var view=this,baseView=this.baseView,fileDefer=$.Deferred();if(view.hasPendingUploadFiles()){if(!view.hasAllUploadFiles())return;var msg=gettext("Do you want to upload your file before submitting?");if(confirm(msg)&&!1===(fileDefer=view.uploadFiles()))return}else fileDefer.resolve();fileDefer.pipe(function(){return view.confirmSubmission().pipe(function(){var submission=view.response();return baseView.toggleActionError("response",null),view.server.submit(submission)})}).done($.proxy(view.moveToNextStep,view)).fail(function(errCode,errMsg){"ENOMULTI"===errCode?view.moveToNextStep():(errMsg&&baseView.toggleActionError("submit",errMsg),view.submitEnabled(!0))})},moveToNextStep:function(){var baseView=this.baseView,usageID=baseView.getUsageID();this.load(usageID),baseView.loadAssessmentModules(usageID),this.announceStatus=!0,baseView.unsavedWarningEnabled(!1,this.UNSAVED_WARNING_KEY)},confirmSubmission:function(){var msg=gettext("You're about to submit your response for this assignment. After you submit this response, you can't change it or submit a new response.");return $.Deferred(function(defer){confirm(msg)?defer.resolve():defer.reject()})},prepareUpload:function(files,uploadType,descriptions){this.files=null,this.filesType=uploadType;for(var totalSize=0,ext=null,fileType=null,errorCheckerTriggered=this.filesUploaded=!1,i=0;ithis.MAX_FILES_SIZE){this.baseView.toggleActionError("upload",gettext("File size must be 10MB or less.")),errorCheckerTriggered=!0;break}if("image"===uploadType&&-1===this.data.ALLOWED_IMAGE_MIME_TYPES.indexOf(fileType)){this.baseView.toggleActionError("upload",gettext("You can upload files with these file types: ")+"JPG, PNG or GIF"),errorCheckerTriggered=!0;break}if("pdf-and-image"===uploadType&&-1===this.data.ALLOWED_FILE_MIME_TYPES.indexOf(fileType)){this.baseView.toggleActionError("upload",gettext("You can upload files with these file types: ")+"JPG, PNG, GIF or PDF"),errorCheckerTriggered=!0;break}if("custom"===uploadType&&-1===this.data.FILE_TYPE_WHITE_LIST.indexOf(ext)){this.baseView.toggleActionError("upload",gettext("You can upload files with these file types: ")+this.data.FILE_TYPE_WHITE_LIST.join(", ")),errorCheckerTriggered=!0;break}if(-1!==this.data.FILE_EXT_BLACK_LIST.indexOf(ext)){this.baseView.toggleActionError("upload",gettext("File type is not allowed.")),errorCheckerTriggered=!0;break}}errorCheckerTriggered||(this.baseView.toggleActionError("upload",null),0"),(divLabel=$("
")).addClass("submission__file__description__label"),divLabel.text(gettext("Describe ")+files[i].name+" "+gettext("(required):")),divLabel.appendTo(mainDiv),(divTextarea=$("
")).addClass("submission__file__description"),textarea=$("