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.
1 line
28 KiB
1 line
28 KiB
5 years ago
|
webpackJsonp([233],{3715:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(162),l=(a.n(n),a(161)),D=a.n(l),i=a(284),s=(a.n(i),a(282)),G=a.n(s),r=a(30),c=(a.n(r),a(31)),R=a.n(c),o=a(65),u=(a.n(o),a(66)),q=a.n(u),p=a(166),m=(a.n(p),a(165)),W=a.n(m),h=a(287),d=(a.n(h),a(283)),F=a.n(d),f=a(0),L=a.n(f),$=a(45),v=a(12),x=a.n(v),z=a(5),g=a(335),b=(a.n(g),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(z.Q)();var _=Object(z.Q)("/editormd/lib/"),N=window.$,J=F.a.Option,U=W.a.Group,B=q.a.TextArea;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),b(w,[{key:"exerciseMD",value:function(e,t){var a=this;this.contentChanged=!1;var n,l,i,s,r,c,o,u=(n=t,l="100%",i=400,s="",r="/api/attachments.json",c=function(){setTimeout(function(){u.resize(),u.cm&&u.cm.refresh()},500),null!=e&&u.setValue(e),u.cm.on("change",function(e,t){console.log("....contentChanged"),a.contentChanged=!0})},o=window.editormd(n,{width:l,height:i,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:s,imageUpload:!0,imageFormats:["jpg","jpeg","gif","png","bmp","webp","JPG","JPEG","GIF","PNG","BMP","WEBP"],imageUploadURL:r,onload:function(){N("#"+n+' [type="latex"]').bind("click",function(){o.cm.replaceSelection("```latex"),o.cm.replaceSelection("\n"),o.cm.replaceSelection("\n"),o.cm.replaceSelection("```");var e=o.cm.getDoc().getCursor();o.cm.setCursor(e.line-1,0)}),N("#"+n+' [type="inline"]').bind("click",function(){o.cm.replaceSelection("`$$$$`");var e=o.cm.getDoc().getCursor();o.cm.setCursor(e.line,e.ch-3),o.cm.focus()}),N('[type="inline"]').attr("title","行内公式"),N('[type="latex"]').attr("title","多行公式"),window.md_elocalStorage(o,"exercise__"+n,"Memochallengesnew"),c&&c()}}));this.exercise_editormd=u,window.exercise_editormd=u}},{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";x.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
|