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