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.
2 lines
12 KiB
2 lines
12 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[167],{"1mRG":function(L,w,i){L.exports={flex_box_center:"flex_box_center___3n1bh",flex_space_between:"flex_space_between___2-n65",flex_box_vertical_center:"flex_box_vertical_center___1GNdj",flex_box_center_end:"flex_box_center_end___1A6DR",flex_box_column:"flex_box_column___2ZUFV",bg:"bg___2CTpz",flexRow:"flexRow___yGmwj",flexJustifyCenter:"flexJustifyCenter___2AjL6",flexAlignEnd:"flexAlignEnd___2ryQB",flexAlignCenter:"flexAlignCenter___2aRaC",flexColumn:"flexColumn___2ZS6b",formWrap:"formWrap___A51-e",titleWrap:"titleWrap___1MBaC",fieldWrap:"fieldWrap___23lH0",mdWrap:"mdWrap___yhmX6",backgroundFa:"backgroundFa___FLGhP",button:"button___1NmEr",icons:"icons___2U8PU"}},CJF0:function(L,w,i){"use strict";var st=i("14J3"),z=i("BMrR"),ut=i("+L6B"),A=i("2/Rp"),ot=i("jCWc"),B=i("kPKH"),it=i("PpiC"),I=i("q1tI"),c=i.n(I),tt=i("Ty5D"),T=i("9kvl"),d=i("55Ip"),Q=i("nZ20"),X=i.n(Q),et=function(h){var j,P,F,u,_=h.shixunsDetail,x=h.dispatch,v=h.loading,O=h.match,K=h.data,l=K===void 0?{}:K,Y=h.title,H=Object(it.a)(h,["shixunsDetail","dispatch","loading","match","data","title"]),m=Object(tt.m)(),b=!(((j=_.detail)===null||j===void 0?void 0:j.identity)>4||((P=_.detail)===null||P===void 0?void 0:P.identity)===void 0||((F=_.detail)===null||F===void 0?void 0:F.shixun_status)===2||((u=_.detail)===null||u===void 0?void 0:u.shixun_status)===1);return c.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(X.a.wrap)},c.a.createElement(z.a,{gutter:[20,20],align:"middle"},c.a.createElement(B.a,{flex:1},c.a.createElement("span",{className:X.a.icons},c.a.createElement("img",{src:i("csWT"),width:"14"})),c.a.createElement("span",{className:"font16"},"\u7B2C ",l==null?void 0:l.position," \u5173\uFF1A",Y)),c.a.createElement(B.a,null,(l==null?void 0:l.prev_challenge)&&c.a.createElement(A.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var p,R=l.prev_challenge.st===0?"/editcheckpoint":"/editquestion",C="/shixuns/".concat(m.id,"/challenges/").concat(l==null||((p=l.prev_challenge)===null||p===void 0)?void 0:p.id).concat(R);T.c.replace(C)}},"\u4E0A\u4E00\u5173"),l.next_challenge&&c.a.createElement(A.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var p,R=l.next_challenge.st===0?"/editcheckpoint":"/editquestion",C="/shixuns/".concat(m.id,"/challenges/").concat(l==null||((p=l.next_challenge)===null||p===void 0)?void 0:p.id).concat(R);T.c.replace(C)}},"\u4E0B\u4E00\u5173"),b&&c.a.createElement(A.a,{type:"primary"},c.a.createElement(d.Link,{to:"/shixuns/".concat(m.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),b&&c.a.createElement(A.a,{type:"primary",className:"ml5"},c.a.createElement(d.Link,{to:"/shixuns/".concat(m.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),c.a.createElement(A.a,{type:"primary",className:"ml5"},c.a.createElement(d.Link,{to:"/shixuns/".concat(m.id,"/challenges")},"\u8FD4\u56DE")))))};w.a=Object(T.a)(function(W){var h=W.shixunsDetail,j=W.newCourse,P=W.loading,F=W.globalSetting;return{shixunsDetail:h,newCourse:j,globalSetting:F,loading:P.effects}})(et)},csWT:function(L,w,i){L.exports=i.p+"static/choose.4ad1045f.svg"},nZ20:function(L,w,i){L.exports={icons:"icons___3O80F"}},wxaI:function(L,w,i){"use strict";i.r(w);var st=i("+L6B"),z=i("2/Rp"),ut=i("5NDa"),A=i("5rEg"),ot=i("9og8"),B=i("k1fw"),it=i("y8nQ"),I=i("Vl3Y"),c=i("tJVT"),tt=i("PpiC"),T=i("q1tI"),d=i.n(T),Q=i("9kvl"),X=i("Ot1p"),et=i("HBuW"),W=i("1mRG"),h=i.n(W),j=i("CJF0");function P(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */P=function(){return _};var u,_={},x=Object.prototype,v=x.hasOwnProperty,O=Object.defineProperty||function(a,t,e){a[t]=e.value},K=typeof Symbol=="function"?Symbol:{},l=K.iterator||"@@iterator",Y=K.asyncIterator||"@@asyncIterator",H=K.toStringTag||"@@toStringTag";function m(a,t,e){return Object.defineProperty(a,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),a[t]}try{m({},"")}catch(a){m=function(e,n,o){return e[n]=o}}function b(a,t,e,n){var o=t&&t.prototype instanceof G?t:G,r=Object.create(o.prototype),s=new nt(n||[]);return O(r,"_invoke",{value:ct(a,e,s)}),r}function N(a,t,e){try{return{type:"normal",arg:a.call(t,e)}}catch(n){return{type:"throw",arg:n}}}_.wrap=b;var p="suspendedStart",R="suspendedYield",C="executing",S="completed",y={};function G(){}function k(){}function D(){}var U={};m(U,l,function(){return this});var $=Object.getPrototypeOf,Z=$&&$($(rt([])));Z&&Z!==x&&v.call(Z,l)&&(U=Z);var g=D.prototype=G.prototype=Object.create(U);function lt(a){["next","throw","return"].forEach(function(t){m(a,t,function(e){return this._invoke(t,e)})})}function q(a,t){function e(o,r,s,f){var E=N(a[o],a,r);if(E.type!=="throw"){var V=E.arg,M=V.value;return M&&typeof M=="object"&&v.call(M,"__await")?t.resolve(M.__await).then(function(J){e("next",J,s,f)},function(J){e("throw",J,s,f)}):t.resolve(M).then(function(J){V.value=J,s(V)},function(J){return e("throw",J,s,f)})}f(E.arg)}var n;O(this,"_invoke",{value:function(r,s){function f(){return new t(function(E,V){e(r,s,E,V)})}return n=n?n.then(f,f):f()}})}function ct(a,t,e){var n=p;return function(o,r){if(n===C)throw new Error("Generator is already running");if(n===S){if(o==="throw")throw r;return{value:u,done:!0}}for(e.method=o,e.arg=r;;){var s=e.delegate;if(s){var f=_t(s,e);if(f){if(f===y)continue;return f}}if(e.method==="next")e.sent=e._sent=e.arg;else if(e.method==="throw"){if(n===p)throw n=S,e.arg;e.dispatchException(e.arg)}else e.method==="return"&&e.abrupt("return",e.arg);n=C;var E=N(a,t,e);if(E.type==="normal"){if(n=e.done?S:R,E.arg===y)continue;return{value:E.arg,done:e.done}}E.type==="throw"&&(n=S,e.method="throw",e.arg=E.arg)}}}function _t(a,t){var e=t.method,n=a.iterator[e];if(n===u)return t.delegate=null,e==="throw"&&a.iterator.return&&(t.method="return",t.arg=u,_t(a,t),t.method==="throw")||e!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+e+"' method")),y;var o=N(n,a.iterator,t.arg);if(o.type==="throw")return t.method="throw",t.arg=o.arg,t.delegate=null,y;var r=o.arg;return r?r.done?(t[a.resultName]=r.value,t.next=a.nextLoc,t.method!=="return"&&(t.method="next",t.arg=u),t.delegate=null,y):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function dt(a){var t={tryLoc:a[0]};1 in a&&(t.catchLoc=a[1]),2 in a&&(t.finallyLoc=a[2],t.afterLoc=a[3]),this.tryEntries.push(t)}function at(a){var t=a.completion||{};t.type="normal",delete t.arg,a.completion=t}function nt(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(dt,this),this.reset(!0)}function rt(a){if(a||a===""){var t=a[l];if(t)return t.call(a);if(typeof a.next=="function")return a;if(!isNaN(a.length)){var e=-1,n=function o(){for(;++e<a.length;)if(v.call(a,e))return o.value=a[e],o.done=!1,o;return o.value=u,o.done=!0,o};return n.next=n}}throw new TypeError(typeof a+" is not iterable")}return k.prototype=D,O(g,"constructor",{value:D,configurable:!0}),O(D,"constructor",{value:k,configurable:!0}),k.displayName=m(D,H,"GeneratorFunction"),_.isGeneratorFunction=function(a){var t=typeof a=="function"&&a.constructor;return!!t&&(t===k||(t.displayName||t.name)==="GeneratorFunction")},_.mark=function(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,D):(a.__proto__=D,m(a,H,"GeneratorFunction")),a.prototype=Object.create(g),a},_.awrap=function(a){return{__await:a}},lt(q.prototype),m(q.prototype,Y,function(){return this}),_.AsyncIterator=q,_.async=function(a,t,e,n,o){o===void 0&&(o=Promise);var r=new q(b(a,t,e,n),o);return _.isGeneratorFunction(t)?r:r.next().then(function(s){return s.done?s.value:r.next()})},lt(g),m(g,H,"Generator"),m(g,l,function(){return this}),m(g,"toString",function(){return"[object Generator]"}),_.keys=function(a){var t=Object(a),e=[];for(var n in t)e.push(n);return e.reverse(),function o(){for(;e.length;){var r=e.pop();if(r in t)return o.value=r,o.done=!1,o}return o.done=!0,o}},_.values=rt,nt.prototype={constructor:nt,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(at),!t)for(var e in this)e.charAt(0)==="t"&&v.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(V,M){return s.type="throw",s.arg=t,e.next=V,M&&(e.method="next",e.arg=u),!!M}for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o],s=r.completion;if(r.tryLoc==="root")return n("end");if(r.tryLoc<=this.prev){var f=v.call(r,"catchLoc"),E=v.call(r,"finallyLoc");if(f&&E){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(f){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&v.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}r&&(t==="break"||t==="continue")&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var s=r?r.completion:{};return s.type=t,s.arg=e,r?(this.method="next",this.next=r.finallyLoc,y):this.complete(s)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),at(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var o=n.completion;if(o.type==="throw"){var r=o.arg;at(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:rt(t),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=u),y}},_}var F=function(_){var x,v=_.shixunsDetail,O=_.dispatch,K=_.loading,l=_.match,Y=Object(tt.a)(_,["shixunsDetail","dispatch","loading","match"]),H=I.a.useForm(),m=Object(c.a)(H,1),b=m[0],N=Object(T.useState)({}),p=Object(c.a)(N,2),R=p[0],C=p[1],S=v.challengesNew;Object(T.useEffect)(function(){O({type:"shixunsDetail/getChallengesNew",payload:Object(B.a)({},l.params)})},[l.params]);var y=function(){var G=Object(ot.a)(P().mark(function k(D){var U,$;return P().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return U=Object(B.a)({},R),U.identifier=l.params.id,U.st=1,g.next=5,Object(et.b)(Object(B.a)({},U));case 5:$=g.sent,$.status===1&&Y.history.replace("/shixuns/".concat(l.params.id,"/challenges/").concat($.challenge_id,"/editquestion"));case 7:case"end":return g.stop()}},k)}));return function(D){return G.apply(this,arguments)}}();return d.a.createElement("section",{className:h.a.bg},d.a.createElement(j.a,{data:S,title:"\u9009\u62E9\u9898"}),d.a.createElement(I.a,{form:b,className:h.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){C(Object(B.a)({},b.getFieldsValue()))},onFinish:y},d.a.createElement("div",{className:h.a.fieldWrap},d.a.createElement(I.a.Item,{name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},d.a.createElement(A.a,{maxLength:60,suffix:"".concat(((x=R.subject)===null||x===void 0?void 0:x.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),d.a.createElement("div",{className:h.a.mdWrap},d.a.createElement(I.a.Item,{name:"task_pass",label:"\u8FC7\u5173\u4EFB\u52A1:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u6700\u5927\u9650\u523635000\u4E2A\u5B57\u7B26"}]},d.a.createElement(X.a,{watch:!0,defaultValue:S.task_pass_default}))),d.a.createElement("div",{className:h.a.backgroundFa},d.a.createElement("div",{className:"pt40 mb30"},d.a.createElement(I.a.Item,null,d.a.createElement(z.a,{size:"large",type:"primary",className:"".concat(h.a.button," mr20"),htmlType:"submit"},"\u63D0\u4EA4"),d.a.createElement(z.a,{size:"large",type:"primary",ghost:!0,className:h.a.button,onClick:function(){return Q.c.push("/shixuns/".concat(l.params.id,"/challenges"))}},"\u53D6\u6D88"))))))};w.default=Object(Q.a)(function(u){var _=u.shixunsDetail,x=u.newCourse,v=u.loading,O=u.globalSetting;return{shixunsDetail:_,newCourse:x,globalSetting:O,loading:v.effects}})(F)}}]);
|