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.
NewEduCoderBuild/p__Shixuns__Detail__Challen...

2 lines
12 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[169],{"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"),W=r("kPKH"),ot=r("SIvP"),I=r("q1tI"),c=r.n(I),tt=r("WHYC"),T=r("9kvl"),d=r("uYtH"),Q=r("nZ20"),X=r.n(Q),et=function(h){var N,b,K,l,E=h.shixunsDetail,y=h.dispatch,M=h.loading,C=h.match,V=h.data,s=V===void 0?{}:V,f=h.title,H=Object(ot.a)(h,["shixunsDetail","dispatch","loading","match","data","title"]),P=Object(tt.m)(),m=!(((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(W.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(W.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,g=s.prev_challenge.st===0?"/editcheckpoint":"/editquestion",x="/shixuns/".concat(P.id,"/challenges/").concat(s==null||((v=s.prev_challenge)===null||v===void 0)?void 0:v.id).concat(g);T.c.replace(x)}},"\u4E0A\u4E00\u5173"),s.next_challenge&&c.a.createElement(B.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var v,g=s.next_challenge.st===0?"/editcheckpoint":"/editquestion",x="/shixuns/".concat(P.id,"/challenges/").concat(s==null||((v=s.next_challenge)===null||v===void 0)?void 0:v.id).concat(g);T.c.replace(x)}},"\u4E0B\u4E00\u5173"),m&&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")),m&&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(T.a)(function(j){var h=j.shixunsDetail,N=j.newCourse,b=j.loading,K=j.globalSetting;return{shixunsDetail:h,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("5Tp6"),W=r("XEnU"),ot=r("y8nQ"),I=r("Vl3Y"),c=r("k16G"),tt=r("SIvP"),T=r("q1tI"),d=r.n(T),Q=r("9kvl"),X=r("Ot1p"),et=r("HBuW"),j=r("1mRG"),h=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,y=E.hasOwnProperty,M=typeof Symbol=="function"?Symbol:{},C=M.iterator||"@@iterator",V=M.asyncIterator||"@@asyncIterator",s=M.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(n,a,o){return n[a]=o}}function H(e,t,n,a){var o=t&&t.prototype instanceof F?t:F,i=Object.create(o.prototype),u=new L(a||[]);return i._invoke=function(D,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 at=S(st,_);if(at){if(at===m)continue;return at}}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(D,R,_);if(Z.type==="normal"){if(p=_.done?"completed":"suspendedYield",Z.arg===m)continue;return{value:Z.arg,done:_.done}}Z.type==="throw"&&(p="completed",_.method="throw",_.arg=Z.arg)}}}(e,n,u),i}function P(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(a){return{type:"throw",arg:a}}}l.wrap=H;var m={};function F(){}function v(){}function g(){}var x={};f(x,C,function(){return this});var G=Object.getPrototypeOf,$=G&&G(G(nt([])));$&&$!==E&&y.call($,C)&&(x=$);var O=g.prototype=F.prototype=Object.create(x);function J(e){["next","throw","return"].forEach(function(t){f(e,t,function(n){return this._invoke(t,n)})})}function k(e,t){function n(o,i,u,D){var R=P(e[o],e,i);if(R.type!=="throw"){var _=R.arg,p=_.value;return p&&typeof p=="object"&&y.call(p,"__await")?t.resolve(p.__await).then(function(U){n("next",U,u,D)},function(U){n("throw",U,u,D)}):t.resolve(p).then(function(U){_.value=U,u(_)},function(U){return n("throw",U,u,D)})}D(R.arg)}var a;this._invoke=function(o,i){function u(){return new t(function(D,R){n(o,i,D,R)})}return a=a?a.then(u,u):u()}}function S(e,t){var n=e.iterator[t.method];if(n===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 m;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=P(n,e.iterator,t.arg);if(a.type==="throw")return t.method="throw",t.arg=a.arg,t.delegate=null,m;var o=a.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,m):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}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 nt(e){if(e){var t=e[C];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var n=-1,a=function o(){for(;++n<e.length;)if(y.call(e,n))return o.value=e[n],o.done=!1,o;return o.value=void 0,o.done=!0,o};return a.next=a}}return{next:it}}function it(){return{value:void 0,done:!0}}return v.prototype=g,f(O,"constructor",g),f(g,"constructor",v),v.displayName=f(g,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,g):(e.__proto__=g,f(e,s,"GeneratorFunction")),e.prototype=Object.create(O),e},l.awrap=function(e){return{__await:e}},J(k.prototype),f(k.prototype,V,function(){return this}),l.AsyncIterator=k,l.async=function(e,t,n,a,o){o===void 0&&(o=Promise);var i=new k(H(e,t,n,a),o);return l.isGeneratorFunction(t)?i:i.next().then(function(u){return u.done?u.value:i.next()})},J(O),f(O,s,"Generator"),f(O,C,function(){return this}),f(O,"toString",function(){return"[object Generator]"}),l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function a(){for(;t.length;){var o=t.pop();if(o in e)return a.value=o,a.done=!1,a}return a.done=!0,a}},l.values=nt,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 n in this)n.charAt(0)==="t"&&y.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function a(_,p){return u.type="throw",u.arg=t,n.next=_,p&&(n.method="next",n.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 a("end");if(i.tryLoc<=this.prev){var D=y.call(i,"catchLoc"),R=y.call(i,"finallyLoc");if(D&&R){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(D){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!R)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,n){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&y.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(u)},complete:function(t,n){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"&&n&&(this.next=n),m},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),q(a),m}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc===t){var o=a.completion;if(o.type==="throw"){var i=o.arg;q(a)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,a){return this.delegate={iterator:nt(t),resultName:n,nextLoc:a},this.method==="next"&&(this.arg=void 0),m}},l}var K=function(E){var y,M=E.shixunsDetail,C=E.dispatch,V=E.loading,s=E.match,f=Object(tt.a)(E,["shixunsDetail","dispatch","loading","match"]),H=I.a.useForm(),P=Object(c.a)(H,1),m=P[0],F=Object(T.useState)({}),v=Object(c.a)(F,2),g=v[0],x=v[1],G=M.challengesNew;Object(T.useEffect)(function(){C({type:"shixunsDetail/getChallengesNew",payload:Object(W.a)({},s.params)})},[s.params]);var $=function(){var O=Object(rt.a)(b().mark(function J(k){var S,Y;return b().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return S=Object(W.a)({},g),S.identifier=s.params.id,S.st=1,L.next=5,Object(et.b)(Object(W.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()}},J)}));return function(k){return O.apply(this,arguments)}}();return d.a.createElement("section",{className:h.a.bg},d.a.createElement(N.a,{data:G,title:"\u9009\u62E9\u9898"}),d.a.createElement(I.a,{form:m,className:h.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){x(Object(W.a)({},m.getFieldsValue()))},onFinish:$},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(B.a,{maxLength:60,suffix:"".concat(((y=g.subject)===null||y===void 0?void 0:y.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:G.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(s.params.id,"/challenges"))}},"\u53D6\u6D88"))))))};A.default=Object(Q.a)(function(l){var E=l.shixunsDetail,y=l.newCourse,M=l.loading,C=l.globalSetting;return{shixunsDetail:E,newCourse:y,globalSetting:C,loading:M.effects}})(K)}}]);