芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/moodledata/localcache/js/593f4b849dd1bb00ae4f2e164e8f2dcecb892636
M.gradereport_grader={classes:{},init_report:function(Y,cfg,items,users,feedback,grades){new this.classes.report(Y,cfg,items,users,feedback,grades)}};M.gradereport_grader.classes.report=function(Y,cfg,items,users,feedback,grades){this.Y=Y;this.isediting=(cfg.isediting);this.ajaxenabled=(cfg.ajaxenabled);this.items=items;this.users=users;this.feedback=feedback;this.table=Y.one('#user-grades');this.grades=grades;if(this.ajaxenabled){this.ajax=new M.gradereport_grader.classes.ajax(this,cfg)}};M.gradereport_grader.classes.report.prototype.table=null;M.gradereport_grader.classes.report.prototype.items=[];M.gradereport_grader.classes.report.prototype.users=[];M.gradereport_grader.classes.report.prototype.feedback=[];M.gradereport_grader.classes.report.prototype.ajaxenabled=!1;M.gradereport_grader.classes.report.prototype.ajax=null;M.gradereport_grader.classes.report.prototype.get_cell_info=function(arg){var userid=null;var itemid=null;var feedback='';var cell=null;var i=null;if(arg instanceof this.Y.Node){if(arg.get('nodeName').toUpperCase()!=='TD'){arg=arg.ancestor('td.cell')} var regexp=/^u(\d+)i(\d+)$/;var parts=regexp.exec(arg.getAttribute('id'));userid=parts[1];itemid=parts[2];cell=arg}else{userid=arg[0];itemid=arg[1];cell=this.Y.one('#u'+userid+'i'+itemid)} if(!cell){return null} for(i in this.feedback){if(this.feedback[i]&&this.feedback[i].user==userid&&this.feedback[i].item==itemid){feedback=this.feedback[i].content;break}} return{id:cell.getAttribute('id'),userid:userid,username:this.users[userid],itemid:itemid,itemname:this.items[itemid].name,itemtype:this.items[itemid].type,itemscale:this.items[itemid].scale,itemdp:this.items[itemid].decimals,feedback:feedback,cell:cell}};M.gradereport_grader.classes.report.prototype.update_feedback=function(userid,itemid,newfeedback){for(var i in this.feedback){if(this.feedback[i].user==userid&&this.feedback[i].item==itemid){this.feedback[i].content=newfeedback;return!0}} this.feedback.push({user:userid,item:itemid,content:newfeedback});return!0};M.gradereport_grader.classes.ajax=function(report,cfg){this.report=report;this.courseid=cfg.courseid||null;this.feedbacktrunclength=cfg.feedbacktrunclength||null;this.studentsperpage=cfg.studentsperpage||null;this.showquickfeedback=cfg.showquickfeedback||!1;this.scales=cfg.scales||null;this.existingfields=[];if(!report.isediting){report.table.all('.clickable').on('click',this.make_editable,this)}else{for(var userid in report.users){if(!this.existingfields[userid]){this.existingfields[userid]=[]} for(var itemid in report.items){this.existingfields[userid][itemid]=new M.gradereport_grader.classes.existingfield(this,userid,itemid)}} submitbutton=this.report.Y.one('#gradersubmit');submitbutton.set('disabled',!0)}};M.gradereport_grader.classes.ajax.prototype.report=null;M.gradereport_grader.classes.ajax.prototype.courseid=null;M.gradereport_grader.classes.ajax.prototype.feedbacktrunclength=null;M.gradereport_grader.classes.ajax.prototype.studentsperpage=null;M.gradereport_grader.classes.ajax.prototype.showquickfeedback=null;M.gradereport_grader.classes.ajax.prototype.current=null;M.gradereport_grader.classes.ajax.prototype.pendingsubmissions=[];M.gradereport_grader.classes.ajax.prototype.scales=[];M.gradereport_grader.classes.ajax.prototype.make_editable=function(e){var node=e;if(e.halt){e.halt();node=e.target} if(node.get('nodeName').toUpperCase()!=='TD'){node=node.ancestor('td')} this.report.Y.detach('click',this.make_editable,node);if(this.current){this.process_editable_field(node);return} var fieldtype='value';if(node.hasClass('grade_type_scale')){fieldtype='scale'}else if(node.hasClass('grade_type_text')){fieldtype='text'} switch(fieldtype){case 'scale':this.current=new M.gradereport_grader.classes.scalefield(this.report,node);break;case 'text':this.current=new M.gradereport_grader.classes.feedbackfield(this.report,node);break;default:this.current=new M.gradereport_grader.classes.textfield(this.report,node);break} this.current.replace().attach_key_events();Y.Global.fire('moodle-gradereport_grader:resized')};M.gradereport_grader.classes.ajax.prototype.keypress_enter=function(e){this.process_editable_field(null)};M.gradereport_grader.classes.ajax.prototype.keypress_tab=function(e,ignoreshift){e.preventDefault();var next=null;if(e.shiftKey){if(ignoreshift){return} next=this.get_above_cell()}else{next=this.get_below_cell()} this.process_editable_field(next)};M.gradereport_grader.classes.ajax.prototype.keypress_arrows=function(e){e.preventDefault();var next=null;switch(e.keyCode){case 37:next=this.get_prev_cell();break;case 38:next=this.get_above_cell();break;case 39:next=this.get_next_cell();break;case 40:next=this.get_below_cell();break} this.process_editable_field(next)};M.gradereport_grader.classes.ajax.prototype.process_editable_field=function(next){if(this.current.has_changed()){var properties=this.report.get_cell_info(this.current.node);var values=this.current.commit();this.current.revert();this.submit(properties,values)}else{this.current.revert()} this.current=null;if(next){this.make_editable(next,null)} Y.Global.fire('moodle-gradereport_grader:resized')};M.gradereport_grader.classes.ajax.prototype.get_next_cell=function(cell){var n=cell||this.current.node;var next=n.next('td');var tr=null;if(!next&&(tr=n.ancestor('tr').next('tr'))){next=tr.all('.grade').item(0)} if(!next){return this.current.node} if(!next.hasClass('gbnavigable')){return this.get_next_cell(next)} return next};M.gradereport_grader.classes.ajax.prototype.get_prev_cell=function(cell){var n=cell||this.current.node;var next=n.previous('.grade');var tr=null;if(!next&&(tr=n.ancestor('tr').previous('tr'))){var cells=tr.all('.grade');next=cells.item(cells.size()-1)} if(!next){return this.current.node} if(!next.hasClass('gbnavigable')){return this.get_prev_cell(next)} return next};M.gradereport_grader.classes.ajax.prototype.get_above_cell=function(cell){var n=cell||this.current.node;var tr=n.ancestor('tr').previous('tr');var next=null;if(tr){var column=0;var ntemp=n;while(ntemp=ntemp.previous('td.cell')){column++} next=tr.all('td.cell').item(column)} if(!next){return this.current.node} if(!next.hasClass('gbnavigable')){return this.get_above_cell(next)} return next};M.gradereport_grader.classes.ajax.prototype.get_below_cell=function(cell){var n=cell||this.current.node;var tr=n.ancestor('tr').next('tr');var next=null;if(tr&&!tr.hasClass('avg')){var column=0;var ntemp=n;while(ntemp=ntemp.previous('td.cell')){column++} next=tr.all('td.cell').item(column)} if(!next){return this.current.node} if(!next.hasClass('gbnavigable')){return this.get_below_cell(next)} return next};M.gradereport_grader.classes.ajax.prototype.submit=function(properties,values){this.report.Y.io.queue.stop();if(values.grade!==values.oldgrade){this.pendingsubmissions.push({transaction:this.report.Y.io.queue(M.cfg.wwwroot+'/grade/report/grader/ajax_callbacks.php',{method:'POST',data:'id='+this.courseid+'&userid='+properties.userid+'&itemid='+properties.itemid+'&action=update&newvalue='+values.grade+'&type='+properties.itemtype+'&sesskey='+M.cfg.sesskey,on:{complete:this.submission_outcome},context:this,arguments:{properties:properties,values:values,type:'grade'}}),complete:!1,outcome:null})} if(values.editablefeedback&&values.feedback!==values.oldfeedback){values.feedback=encodeURIComponent(values.feedback);this.pendingsubmissions.push({transaction:this.report.Y.io.queue(M.cfg.wwwroot+'/grade/report/grader/ajax_callbacks.php',{method:'POST',data:'id='+this.courseid+'&userid='+properties.userid+'&itemid='+properties.itemid+'&action=update&newvalue='+values.feedback+'&type=feedback&sesskey='+M.cfg.sesskey,on:{complete:this.submission_outcome},context:this,arguments:{properties:properties,values:values,type:'feedback'}}),complete:!1,outcome:null})} this.report.Y.io.queue.start()};M.gradereport_grader.classes.ajax.prototype.submission_outcome=function(tid,outcome,args){try{outcome=this.report.Y.JSON.parse(outcome.responseText)}catch(e){var message=M.util.get_string('ajaxfailedupdate','gradereport_grader');message=message.replace(/\[1\]/,args.type);message=message.replace(/\[2\]/,this.report.users[args.properties.userid]);this.display_submission_error(message,args.properties.cell);return} var i=null;if(outcome.result=='success'){for(i in outcome.row){if(outcome.row[i]&&outcome.row[i].userid&&outcome.row[i].itemid){var r=outcome.row[i];var info=this.report.get_cell_info([r.userid,r.itemid]);if(!info){continue} var finalgrade='';var scalegrade=-1;if(!r.finalgrade){if(this.report.isediting){finalgrade=''}else{finalgrade='-'}}else{if(r.scale){scalegrade=parseFloat(r.finalgrade);finalgrade=this.scales[r.scale][scalegrade-1]}else{finalgrade=parseFloat(r.finalgrade).toFixed(info.itemdp)}} if(this.report.isediting){var grade=info.cell.one('#grade_'+r.userid+'_'+r.itemid);if(grade){var parent=grade.ancestor('td');if(parent.hasClass('grade_type_scale')){grade.all('option').each(function(option){if(option.get('value')==scalegrade){option.setAttribute('selected','selected')}else{option.removeAttribute('selected')}})}else{grade.set('value',finalgrade)}}else if(info.cell.one('.gradevalue')){info.cell.one('.gradevalue').set('innerHTML',finalgrade)}}else{if(!this.current||info.cell.get('id')!=this.current.node.get('id')){var node=info.cell.one('.gradevalue');var td=node.ancestor('td');if(td.hasClass('grade_type_value')||td.hasClass('grade_type_scale')){node.set('innerHTML',finalgrade)}}else if(this.current&&info.cell.get('id')==this.current.node.get('id')){if(!this.current.has_changed()||confirm(M.util.get_string('ajaxfieldchanged','gradereport_grader'))){this.current.set_grade(finalgrade);if(this.current.grade){this.current.grade.set('value',finalgrade)}}}}}} args.properties.cell.addClass('ajaxoverridden')}else{var p=args.properties;if(args.type=='grade'){var oldgrade=args.values.oldgrade;p.cell.one('.gradevalue').set('innerHTML',oldgrade)}else if(args.type=='feedback'){this.report.update_feedback(p.userid,p.itemid,args.values.oldfeedback)} this.display_submission_error(outcome.message,p.cell)} var allcomplete=!0;for(i in this.pendingsubmissions){if(this.pendingsubmissions[i]){if(this.pendingsubmissions[i].transaction.id==tid){this.pendingsubmissions[i].complete=!0;this.pendingsubmissions[i].outcome=outcome;this.report.Y.io.queue.remove(this.pendingsubmissions[i].transaction)} if(!this.pendingsubmissions[i].complete){allcomplete=!1}}} if(allcomplete){this.pendingsubmissions=[]}};M.gradereport_grader.classes.ajax.prototype.display_submission_error=function(message,cell){var erroroverlay=new this.report.Y.Overlay({headerContent:'<div><strong class="error">'+M.util.get_string('ajaxerror','gradereport_grader')+'</strong> <em>'+M.util.get_string('ajaxclicktoclose','gradereport_grader')+'</em></div>',bodyContent:message,visible:!1,zIndex:3});erroroverlay.set('xy',[cell.getX()+10,cell.getY()+10]);erroroverlay.render(this.report.table.ancestor('div'));erroroverlay.show();erroroverlay.get('boundingBox').on('click',function(){this.get('boundingBox').setStyle('visibility','hidden');this.hide();this.destroy()},erroroverlay);erroroverlay.get('boundingBox').setStyle('visibility','visible')};M.gradereport_grader.classes.existingfield=function(ajax,userid,itemid){this.report=ajax.report;this.userid=userid;this.itemid=itemid;this.editfeedback=ajax.showquickfeedback;this.grade=this.report.Y.one('#grade_'+userid+'_'+itemid);var i=0;if(this.grade){for(i=0;i<this.report.grades.length;i++){if(this.report.grades[i].user==this.userid&&this.report.grades[i].item==this.itemid){this.oldgrade=this.report.grades[i].grade}} if(!this.oldgrade){this.oldgrade=''} this.grade.on('blur',this.submit,this)} if(this.editfeedback){this.feedback=this.report.Y.one('#feedback_'+userid+'_'+itemid);if(this.feedback){for(i=0;i<this.report.feedback.length;i++){if(this.report.feedback[i].user==this.userid&&this.report.feedback[i].item==this.itemid){this.oldfeedback=this.report.feedback[i].content}} if(!this.oldfeedback){this.oldfeedback=''} this.feedback.on('blur',this.submit,this);this.keyevents.push(this.report.Y.on('key',this.keypress_tab,this.feedback,'press:9',this,!0));this.keyevents.push(this.report.Y.on('key',this.keypress_enter,this.feedback,'press:13',this));this.keyevents.push(this.report.Y.on('key',this.keypress_arrows,this.feedback,'press:37,38,39,40+ctrl',this));if(this.grade){this.keyevents.push(this.report.Y.on('key',this.keypress_tab,this.grade,'press:9+shift',this));this.keyevents.push(this.report.Y.on('key',function(e){e.preventDefault();this.grade.focus()},this.feedback,'press:9+shift',this));this.keyevents.push(this.report.Y.on('key',function(e){if(e.shiftKey){return}e.preventDefault();this.feedback.focus()},this.grade,'press:9',this))}}}else if(this.grade){this.keyevents.push(this.report.Y.on('key',this.keypress_tab,this.grade,'down:9',this))} if(this.grade){this.keyevents.push(this.report.Y.on('key',this.keypress_enter,this.grade,'up:13',this));this.keyevents.push(this.report.Y.on('key',this.keypress_arrows,this.grade,'down:37,38,39,40+ctrl',this))}};M.gradereport_grader.classes.existingfield.prototype.userid=null;M.gradereport_grader.classes.existingfield.prototype.itemid=null;M.gradereport_grader.classes.existingfield.prototype.editfeedback=!1;M.gradereport_grader.classes.existingfield.prototype.grade=null;M.gradereport_grader.classes.existingfield.prototype.oldgrade=null;M.gradereport_grader.classes.existingfield.prototype.keyevents=[];M.gradereport_grader.classes.existingfield.prototype.keypress_enter=function(e){e.preventDefault();this.submit()};M.gradereport_grader.classes.existingfield.prototype.keypress_tab=function(e,ignoreshift){e.preventDefault();var next=null;if(e.shiftKey){if(ignoreshift){return} next=this.report.ajax.get_above_cell(this.grade.ancestor('td'))}else{next=this.report.ajax.get_below_cell(this.grade.ancestor('td'))} this.move_focus(next)};M.gradereport_grader.classes.existingfield.prototype.keypress_arrows=function(e){e.preventDefault();var next=null;switch(e.keyCode){case 37:next=this.report.ajax.get_prev_cell(this.grade.ancestor('td'));break;case 38:next=this.report.ajax.get_above_cell(this.grade.ancestor('td'));break;case 39:next=this.report.ajax.get_next_cell(this.grade.ancestor('td'));break;case 40:next=this.report.ajax.get_below_cell(this.grade.ancestor('td'));break} this.move_focus(next)};M.gradereport_grader.classes.existingfield.prototype.move_focus=function(node){if(node){var properties=this.report.get_cell_info(node);this.report.ajax.current=node;switch(properties.itemtype){case 'scale':properties.cell.one('select.select').focus();break;case 'value':default:properties.cell.one('input.text').focus();break}}};M.gradereport_grader.classes.existingfield.prototype.has_changed=function(){if(this.grade){if(this.grade.get('value')!==this.oldgrade){return!0}} if(this.editfeedback&&this.feedback){if(this.feedback.get('value')!==this.oldfeedback){return!0}} return!1};M.gradereport_grader.classes.existingfield.prototype.submit=function(){if(!this.has_changed()){return} var properties=this.report.get_cell_info([this.userid,this.itemid]);var values=(function(f){var feedback,oldfeedback,grade,oldgrade=null;if(f.editfeedback&&f.feedback){feedback=f.feedback.get('value');oldfeedback=f.oldfeedback} if(f.grade){grade=f.grade.get('value');oldgrade=f.oldgrade} return{editablefeedback:f.editfeedback,grade:grade,oldgrade:oldgrade,feedback:feedback,oldfeedback:oldfeedback}})(this);this.oldgrade=values.grade;if(values.editablefeedback&&values.feedback!=values.oldfeedback){this.report.update_feedback(this.userid,this.itemid,values.feedback);this.oldfeedback=values.feedback} this.report.ajax.submit(properties,values)};M.gradereport_grader.classes.textfield=function(report,node){this.report=report;this.node=node;this.gradespan=node.one('.gradevalue');this.inputdiv=this.report.Y.Node.create('<div></div>');this.editfeedback=this.report.ajax.showquickfeedback;this.grade=this.report.Y.Node.create('<input type="text" class="text" value="" name="ajaxgrade" />');this.gradetype='value';this.inputdiv.append(this.grade);if(this.report.ajax.showquickfeedback){this.feedback=this.report.Y.Node.create('<input type="text" class="quickfeedback" value="" name="ajaxfeedback" />');this.inputdiv.append(this.feedback)}};M.gradereport_grader.classes.textfield.prototype.keyevents=[];M.gradereport_grader.classes.textfield.prototype.editable=!1;M.gradereport_grader.classes.textfield.prototype.gradetype=null;M.gradereport_grader.classes.textfield.prototype.grade=null;M.gradereport_grader.classes.textfield.prototype.report=null;M.gradereport_grader.classes.textfield.prototype.node=null;M.gradereport_grader.classes.textfield.prototype.gradespam=null;M.gradereport_grader.classes.textfield.prototype.inputdiv=null;M.gradereport_grader.classes.textfield.prototype.editfeedback=!1;M.gradereport_grader.classes.textfield.prototype.replace=function(){this.set_grade(this.get_grade());if(this.editfeedback){this.set_feedback(this.get_feedback())} this.node.replaceChild(this.inputdiv,this.gradespan);if(this.grade){this.grade.focus()}else if(this.feedback){this.feedback.focus()} this.editable=!0;return this};M.gradereport_grader.classes.textfield.prototype.commit=function(){var result=(function(field){field.editable=!1;var oldgrade=field.get_grade();if(oldgrade=='-'){oldgrade=''} var feedback=null;var oldfeedback=null;if(field.editfeedback){oldfeedback=field.get_feedback()} field.editable=!0;if(field.editfeedback){feedback=field.get_feedback()} return{gradetype:field.gradetype,editablefeedback:field.editfeedback,grade:field.get_grade(),oldgrade:oldgrade,feedback:feedback,oldfeedback:oldfeedback}})(this);this.set_grade(result.grade);if(this.editfeedback){this.set_feedback(result.feedback)} return result};M.gradereport_grader.classes.textfield.prototype.revert=function(){this.node.replaceChild(this.gradespan,this.inputdiv);for(var i in this.keyevents){if(this.keyevents[i]){this.keyevents[i].detach()}} this.keyevents=[];this.node.on('click',this.report.ajax.make_editable,this.report.ajax)};M.gradereport_grader.classes.textfield.prototype.get_grade=function(){if(this.editable){return this.grade.get('value')} return this.gradespan.get('innerHTML')};M.gradereport_grader.classes.textfield.prototype.set_grade=function(value){if(!this.editable){if(value=='-'){value=''} this.grade.set('value',value)}else{if(value==''){value='-'} this.gradespan.set('innerHTML',value)}};M.gradereport_grader.classes.textfield.prototype.get_feedback=function(){if(this.editable){if(this.feedback){return this.feedback.get('value')}else{return null}} var properties=this.report.get_cell_info(this.node);if(properties){return properties.feedback} return ''};M.gradereport_grader.classes.textfield.prototype.set_feedback=function(value){if(!this.editable){if(this.feedback){this.feedback.set('value',value)}}else{var properties=this.report.get_cell_info(this.node);this.report.update_feedback(properties.userid,properties.itemid,value)}};M.gradereport_grader.classes.textfield.prototype.has_changed=function(){if(!this.editable){return!1} if(this.editfeedback){var properties=this.report.get_cell_info(this.node);if(this.get_feedback()!=properties.feedback){return!0}} if(this.grade){return(this.get_grade()!=this.gradespan.get('innerHTML'))}else{return!1}};M.gradereport_grader.classes.textfield.prototype.attach_key_events=function(){var a=this.report.ajax;if(this.editfeedback){if(this.grade){this.keyevents.push(this.report.Y.on('key',a.keypress_tab,this.grade,'down:9+shift',a))} this.keyevents.push(this.report.Y.on('key',a.keypress_tab,this.feedback,'down:9',a,!0));this.keyevents.push(this.report.Y.on('key',a.keypress_enter,this.feedback,'up:13',a))}else{if(this.grade){this.keyevents.push(this.report.Y.on('key',a.keypress_tab,this.grade,'down:9',a))}} this.keyevents.push(this.report.Y.on('key',a.keypress_arrows,this.inputdiv.ancestor('td'),'down:37,38,39,40+ctrl',a));if(this.grade){this.keyevents.push(this.report.Y.on('key',a.keypress_enter,this.grade,'up:13',a));this.keyevents.push(this.report.Y.on('key',function(e){e.preventDefault()},this.grade,'down:37,38,39,40+ctrl'));this.keyevents.push(this.report.Y.on('key',function(e){e.preventDefault()},this.grade,'press:37,38,39,40+ctrl'));this.keyevents.push(this.report.Y.on('key',function(e){e.preventDefault()},this.grade,'up:37,38,39,40+ctrl'))}};M.gradereport_grader.classes.feedbackfield=function(report,node){this.report=report;this.node=node;this.gradespan=node.one('.gradevalue');this.inputdiv=this.report.Y.Node.create('<div></div>');this.editfeedback=this.report.ajax.showquickfeedback;this.gradetype='text';if(this.report.ajax.showquickfeedback){this.feedback=this.report.Y.Node.create('<input type="text" class="quickfeedback" value="" name="ajaxfeedback" />');this.inputdiv.append(this.feedback)}};M.gradereport_grader.classes.feedbackfield.prototype.get_grade=function(){return null};M.gradereport_grader.classes.feedbackfield.prototype.set_grade=function(){return};for(var i in M.gradereport_grader.classes.textfield.prototype){if(!M.gradereport_grader.classes.feedbackfield.prototype[i]){M.gradereport_grader.classes.feedbackfield.prototype[i]=M.gradereport_grader.classes.textfield.prototype[i]}} M.gradereport_grader.classes.scalefield=function(report,node){this.report=report;this.node=node;this.gradespan=node.one('.gradevalue');this.inputdiv=this.report.Y.Node.create('<div></div>');this.editfeedback=this.report.ajax.showquickfeedback;this.grade=this.report.Y.Node.create('<select type="text" class="text" name="ajaxgrade" /><option value="-1">'+M.util.get_string('ajaxchoosescale','gradereport_grader')+'</option></select>');this.gradetype='scale';this.inputdiv.append(this.grade);if(this.editfeedback){this.feedback=this.report.Y.Node.create('<input type="text" class="quickfeedback" value="" name="ajaxfeedback"/>');this.inputdiv.append(this.feedback)} var properties=this.report.get_cell_info(node);this.scale=this.report.ajax.scales[properties.itemscale];for(var i in this.scale){if(this.scale[i]){this.grade.append(this.report.Y.Node.create('<option value="'+(parseFloat(i)+1)+'">'+this.scale[i]+'</option>'))}}};M.gradereport_grader.classes.scalefield.prototype.scale=[];M.gradereport_grader.classes.scalefield.prototype.get_grade=function(){if(this.editable){return this.grade.all('option').item(this.grade.get('selectedIndex')).get('value')}else{var value=this.gradespan.get('innerHTML');for(var i in this.scale){if(this.scale[i]==value){return parseFloat(i)+1}} return-1}};M.gradereport_grader.classes.scalefield.prototype.set_grade=function(value){if(!this.editable){if(value=='-'){value='-1'} this.grade.all('option').each(function(node){if(node.get('value')==value){node.set('selected',!0)}})}else{if(value==''||value=='-1'){value='-'}else{value=this.scale[parseFloat(value)-1]} this.gradespan.set('innerHTML',value)}};M.gradereport_grader.classes.scalefield.prototype.has_changed=function(){if(!this.editable){return!1} var gradef=this.get_grade();this.editable=!1;var gradec=this.get_grade();this.editable=!0;if(this.editfeedback){var properties=this.report.get_cell_info(this.node);var feedback=properties.feedback;return(gradef!=gradec||this.get_feedback()!=feedback)} return(gradef!=gradec)};for(var i in M.gradereport_grader.classes.textfield.prototype){if(!M.gradereport_grader.classes.scalefield.prototype[i]){M.gradereport_grader.classes.scalefield.prototype[i]=M.gradereport_grader.classes.textfield.prototype[i]}}