You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/public/react/build/static/js/186.e1ac2071.chunk.js

1 line
27 KiB

6 years ago
webpackJsonp([186],{3465:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(291),l=(a.n(n),a(289)),D=a.n(l),i=a(288),s=(a.n(i),a(286)),G=a.n(s),r=a(36),c=(a.n(r),a(37)),q=a.n(c),o=a(64),u=(a.n(o),a(65)),W=a.n(u),p=a(166),m=(a.n(p),a(162)),F=a.n(m),h=a(290),d=(a.n(h),a(287)),J=a.n(d),f=a(0),L=a.n(f),R=a(45),v=a(26),g=a.n(v),$=a(8),b=a(340),x=(a.n(b),function(e,t,a){return t&&E(e.prototype,t),a&&E(e,a),e});function E(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function y(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}Object($.N)();var _=Object($.N)("/editormd/lib/"),N=window.$,z=J.a.Option,U=F.a.Group;var k=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(w,f.Component),x(w,[{key:"exerciseMD",value:function(e,t){var a=this;this.contentChanged=!1;var n=function(e,t,a,n,l,i){var s=window.editormd(e,{width:t,height:a,path:_,syncScrolling:"single",tex:!0,tocm:!0,emoji:!0,taskList:!0,codeFold:!0,searchReplace:!0,htmlDecode:"style,script,iframe",sequenceDiagram:!0,autoFocus:!1,toolbarIcons:function(){return["bold","italic","|","list-ul","list-ol","|","code","code-block","|","testIcon","testIcon1","|","image","table","|","watch","clear"]},toolbarCustomIcons:{testIcon:'<a type="inline" class="latex" ><div class=\'zbg\'></div></a>',testIcon1:'<a type="latex" class="latex" ><div class=\'zbg_latex\'></div></a>'},saveHTMLToTextarea:!0,dialogMaskOpacity:.6,placeholder:n,imageUpload:!0,imageFormats:["jpg","jpeg","gif","png","bmp","webp","JPG","JPEG","GIF","PNG","BMP","WEBP"],imageUploadURL:l,onload:function(){N("#"+e+' [type="latex"]').bind("click",function(){s.cm.replaceSelection("```latex"),s.cm.replaceSelection("\n"),s.cm.replaceSelection("\n"),s.cm.replaceSelection("```");var e=s.cm.getDoc().getCursor();s.cm.setCursor(e.line-1,0)}),N("#"+e+' [type="inline"]').bind("click",function(){s.cm.replaceSelection("$$$$");var e=s.cm.getDoc().getCursor();s.cm.setCursor(e.line,e.ch-2),s.cm.focus()}),N('[type="inline"]').attr("title","行内公式"),N('[type="latex"]').attr("title","多行公式"),window.md_elocalStorage(s,"exercise__"+e,"Memochallengesnew"),i&&i()}});return s}(t,"100%",400,"","/api/attachments.json",function(){setTimeout(function(){n.resize(),n.cm&&n.cm.refresh()},500),null!=e&&n.setValue(e),n.cm.on("change",function(e,t){a.contentChanged=!0})});this.exercise_editormd=n,window.exercise_editormd=n}},{key:"componentDidMount",value:function(){var l=this,i=this.props.match.params.shixunId,e=this.props.match.params.checkpointId;this.setState({shixunId:i,checkpointId:e});var s="/shixuns/"+i+"/challenges/newquestion",r="/shixuns/"+i+"/challenges/new",c="/shixuns/"+i+"/challenges",t="/shixuns/"+i+"/challenges/"+e+"/edit.json?tab=1";g.a.get(t).then(function(e){var t=e.data.prev_challenge,a=e.data.next_challenge;null!=t&&(t=0===t.st?"/shixuns/"+i+"/challenges/"+t.id+"/editcheckpoint":"/shixuns/"+i+"/challenges/"+t.id+"/editquestion"),null!=a&&(a=0===a.st?"/shixuns/"+i+"/challenges/"+a.id+"/editcheckpoint":"/shixuns/"+i+"/challenges/"+a.id+"/editquestion");var n=[];n=0===e.data.test_sets.length?[{hidden:0,input:"",output:"",score:50},{hidden:0,input:"",output:"",score:50}]:e.data.test_sets,l.setState({power:e.data.power,evaluationlist:n,shixunfilepath:e.data.path,shixunfilepathplay:e.data.exec_path,pathoptionvalue:e.data.show_type,shixunfileexpectpicturepath:e.data.original_picture_path,shixunfilestandardpicturepath:e.data.expect_picture_path,shixunfilepicturepath:e.data.picture_path,prev_challenge:t,next_challenge:a,choice_url:s,practice_url:r,go_back_url:c,position:e.data.position,scorevalue:e.data.test_set_score,markvalue:e.data.test_set_average,web_route:e.data.web_rou