@zykjcommon/questions 0.0.25 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/zykjcommon-questions.common.js +63 -50
- package/dist/zykjcommon-questions.css +1 -0
- package/dist/zykjcommon-questions.umd.js +63 -50
- package/dist/zykjcommon-questions.umd.min.js +1 -1
- package/package.json +1 -1
- package/src/assets/js/rem.js +3 -1
- package/src/assets/scss/questions/zykjcommon-questions.scss +60 -60
- package/src/assets/scss/questions/zykjcommon-questions2.scss +600 -0
- package/src/components/questions/Question_Classify.vue +39 -31
- package/src/components/questions/buildEntry.js +1 -0
- package/src/main.ts +2 -1
- package/src/views/exam/FullScreen.vue +34 -0
|
@@ -24,4 +24,4 @@ return function(t){var n=e,o=n.lib,i=o.WordArray,r=o.Hasher,s=n.algo,a=i.create(
|
|
|
24
24
|
* (c) 2022 Evan You
|
|
25
25
|
* @license MIT
|
|
26
26
|
*/
|
|
27
|
-
var mo="store";function To(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function go(e){return null!==e&&"object"===typeof e}function bo(e){return e&&"function"===typeof e.then}function So(e,t){return function(){return e(t)}}function vo(e,t,n){return t.indexOf(e)<0&&(n&&n.prepend?t.unshift(e):t.push(e)),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function Mo(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;Bo(e,n,[],e._modules.root,!0),yo(e,n,t)}function yo(e,t,o){var i=e._state,r=e._scope;e.getters={},e._makeLocalGettersCache=Object.create(null);var s=e._wrappedGetters,a={},c={},l=(0,n.effectScope)(!0);l.run((function(){To(s,(function(t,o){a[o]=So(t,e),c[o]=(0,n.computed)((function(){return a[o]()})),Object.defineProperty(e.getters,o,{get:function(){return c[o].value},enumerable:!0})}))})),e._state=(0,n.reactive)({data:t}),e._scope=l,e.strict&&Go(e),i&&o&&e._withCommit((function(){i.data=null})),r&&r.stop()}function Bo(e,t,n,o,i){var r=!n.length,s=e._modules.getNamespace(n);if(o.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=o),!r&&!i){var a=xo(t,n.slice(0,-1)),c=n[n.length-1];e._withCommit((function(){a[c]=o.state}))}var l=o.context=Co(e,s,n);o.forEachMutation((function(t,n){var o=s+n;Po(e,o,t,l)})),o.forEachAction((function(t,n){var o=t.root?n:s+n,i=t.handler||t;Eo(e,o,i,l)})),o.forEachGetter((function(t,n){var o=s+n;Io(e,o,t,l)})),o.forEachChild((function(o,r){Bo(e,t,n.concat(r),o,i)}))}function Co(e,t,n){var o=""===t,i={dispatch:o?e.dispatch:function(n,o,i){var r=Do(n,o,i),s=r.payload,a=r.options,c=r.type;return a&&a.root||(c=t+c),e.dispatch(c,s)},commit:o?e.commit:function(n,o,i){var r=Do(n,o,i),s=r.payload,a=r.options,c=r.type;a&&a.root||(c=t+c),e.commit(c,s,a)}};return Object.defineProperties(i,{getters:{get:o?function(){return e.getters}:function(){return wo(e,t)}},state:{get:function(){return xo(e.state,n)}}}),i}function wo(e,t){if(!e._makeLocalGettersCache[t]){var n={},o=t.length;Object.keys(e.getters).forEach((function(i){if(i.slice(0,o)===t){var r=i.slice(o);Object.defineProperty(n,r,{get:function(){return e.getters[i]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}function Po(e,t,n,o){var i=e._mutations[t]||(e._mutations[t]=[]);i.push((function(t){n.call(e,o.state,t)}))}function Eo(e,t,n,o){var i=e._actions[t]||(e._actions[t]=[]);i.push((function(t){var i=n.call(e,{dispatch:o.dispatch,commit:o.commit,getters:o.getters,state:o.state,rootGetters:e.getters,rootState:e.state},t);return bo(i)||(i=Promise.resolve(i)),e._devtoolHook?i.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):i}))}function Io(e,t,n,o){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(e){return n(o.state,o.getters,e.state,e.getters)})}function Go(e){(0,n.watch)((function(){return e._state.data}),(function(){0}),{deep:!0,flush:"sync"})}function xo(e,t){return t.reduce((function(e,t){return e[t]}),e)}function Do(e,t,n){return go(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}var ko="vuex bindings",Ho="vuex:mutations",No="vuex:actions",Oo="vuex",Lo=0;function Vo(e,t){Ao({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[ko]},(function(n){n.addTimelineLayer({id:Ho,label:"Vuex Mutations",color:_o}),n.addTimelineLayer({id:No,label:"Vuex Actions",color:_o}),n.addInspector({id:Oo,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree((function(n){if(n.app===e&&n.inspectorId===Oo)if(n.filter){var o=[];Qo(o,t._modules.root,n.filter,""),n.rootNodes=o}else n.rootNodes=[Uo(t._modules.root,"")]})),n.on.getInspectorState((function(n){if(n.app===e&&n.inspectorId===Oo){var o=n.nodeId;wo(t,o),n.state=Xo(Ko(t._modules,o),"root"===o?t.getters:t._makeLocalGettersCache,o)}})),n.on.editInspectorState((function(n){if(n.app===e&&n.inspectorId===Oo){var o=n.nodeId,i=n.path;"root"!==o&&(i=o.split("/").filter(Boolean).concat(i)),t._withCommit((function(){n.set(t._state.data,i,n.state.value)}))}})),t.subscribe((function(e,t){var o={};e.payload&&(o.payload=e.payload),o.state=t,n.notifyComponentUpdate(),n.sendInspectorTree(Oo),n.sendInspectorState(Oo),n.addTimelineEvent({layerId:Ho,event:{time:Date.now(),title:e.type,data:o}})})),t.subscribeAction({before:function(e,t){var o={};e.payload&&(o.payload=e.payload),e._id=Lo++,e._time=Date.now(),o.state=t,n.addTimelineEvent({layerId:No,event:{time:e._time,title:e.type,groupId:e._id,subtitle:"start",data:o}})},after:function(e,t){var o={},i=Date.now()-e._time;o.duration={_custom:{type:"duration",display:i+"ms",tooltip:"Action duration",value:i}},e.payload&&(o.payload=e.payload),o.state=t,n.addTimelineEvent({layerId:No,event:{time:Date.now(),title:e.type,groupId:e._id,subtitle:"end",data:o}})}})}))}var _o=8702998,Fo=6710886,Ro=16777215,qo={label:"namespaced",textColor:Ro,backgroundColor:Fo};function jo(e){return e&&"root"!==e?e.split("/").slice(-2,-1)[0]:"Root"}function Uo(e,t){return{id:t||"root",label:jo(t),tags:e.namespaced?[qo]:[],children:Object.keys(e._children).map((function(n){return Uo(e._children[n],t+n+"/")}))}}function Qo(e,t,n,o){o.includes(n)&&e.push({id:o||"root",label:o.endsWith("/")?o.slice(0,o.length-1):o||"Root",tags:t.namespaced?[qo]:[]}),Object.keys(t._children).forEach((function(i){Qo(e,t._children[i],n,o+i+"/")}))}function Xo(e,t,n){t="root"===n?t:t[n];var o=Object.keys(t),i={state:Object.keys(e.state).map((function(t){return{key:t,editable:!0,value:e.state[t]}}))};if(o.length){var r=Wo(t);i.getters=Object.keys(r).map((function(e){return{key:e.endsWith("/")?jo(e):e,editable:!1,value:zo((function(){return r[e]}))}}))}return i}function Wo(e){var t={};return Object.keys(e).forEach((function(n){var o=n.split("/");if(o.length>1){var i=t,r=o.pop();o.forEach((function(e){i[e]||(i[e]={_custom:{value:{},display:e,tooltip:"Module",abstract:!0}}),i=i[e]._custom.value})),i[r]=zo((function(){return e[n]}))}else t[n]=zo((function(){return e[n]}))})),t}function Ko(e,t){var n=t.split("/").filter((function(e){return e}));return n.reduce((function(e,o,i){var r=e[o];if(!r)throw new Error('Missing module "'+o+'" for path "'+t+'".');return i===n.length-1?r:r._children}),"root"===t?e:e.root._children)}function zo(e){try{return e()}catch(t){return t}}var Yo=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"===typeof n?n():n)||{}},Jo={namespaced:{configurable:!0}};Jo.namespaced.get=function(){return!!this._rawModule.namespaced},Yo.prototype.addChild=function(e,t){this._children[e]=t},Yo.prototype.removeChild=function(e){delete this._children[e]},Yo.prototype.getChild=function(e){return this._children[e]},Yo.prototype.hasChild=function(e){return e in this._children},Yo.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},Yo.prototype.forEachChild=function(e){To(this._children,e)},Yo.prototype.forEachGetter=function(e){this._rawModule.getters&&To(this._rawModule.getters,e)},Yo.prototype.forEachAction=function(e){this._rawModule.actions&&To(this._rawModule.actions,e)},Yo.prototype.forEachMutation=function(e){this._rawModule.mutations&&To(this._rawModule.mutations,e)},Object.defineProperties(Yo.prototype,Jo);var Zo=function(e){this.register([],e,!1)};function $o(e,t,n){if(t.update(n),n.modules)for(var o in n.modules){if(!t.getChild(o))return void 0;$o(e.concat(o),t.getChild(o),n.modules[o])}}Zo.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},Zo.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return t=t.getChild(n),e+(t.namespaced?n+"/":"")}),"")},Zo.prototype.update=function(e){$o([],this.root,e)},Zo.prototype.register=function(e,t,n){var o=this;void 0===n&&(n=!0);var i=new Yo(t,n);if(0===e.length)this.root=i;else{var r=this.get(e.slice(0,-1));r.addChild(e[e.length-1],i)}t.modules&&To(t.modules,(function(t,i){o.register(e.concat(i),t,n)}))},Zo.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1],o=t.getChild(n);o&&o.runtime&&t.removeChild(n)},Zo.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];return!!t&&t.hasChild(n)};var ei=function(e){var t=this;void 0===e&&(e={});var n=e.plugins;void 0===n&&(n=[]);var o=e.strict;void 0===o&&(o=!1);var i=e.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new Zo(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=i;var r=this,s=this,a=s.dispatch,c=s.commit;this.dispatch=function(e,t){return a.call(r,e,t)},this.commit=function(e,t,n){return c.call(r,e,t,n)},this.strict=o;var l=this._modules.root.state;Bo(this,l,[],this._modules.root),yo(this,l),n.forEach((function(e){return e(t)}))},ti={state:{configurable:!0}};ei.prototype.install=function(e,t){e.provide(t||mo,this),e.config.globalProperties.$store=this;var n=void 0!==this._devtools&&this._devtools;n&&Vo(e,this)},ti.state.get=function(){return this._state.data},ti.state.set=function(e){0},ei.prototype.commit=function(e,t,n){var o=this,i=Do(e,t,n),r=i.type,s=i.payload,a=(i.options,{type:r,payload:s}),c=this._mutations[r];c&&(this._withCommit((function(){c.forEach((function(e){e(s)}))})),this._subscribers.slice().forEach((function(e){return e(a,o.state)})))},ei.prototype.dispatch=function(e,t){var n=this,o=Do(e,t),i=o.type,r=o.payload,s={type:i,payload:r},a=this._actions[i];if(a){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(s,n.state)}))}catch(l){0}var c=a.length>1?Promise.all(a.map((function(e){return e(r)}))):a[0](r);return new Promise((function(e,t){c.then((function(t){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(s,n.state)}))}catch(l){0}e(t)}),(function(e){try{n._actionSubscribers.filter((function(e){return e.error})).forEach((function(t){return t.error(s,n.state,e)}))}catch(l){0}t(e)}))}))}},ei.prototype.subscribe=function(e,t){return vo(e,this._subscribers,t)},ei.prototype.subscribeAction=function(e,t){var n="function"===typeof e?{before:e}:e;return vo(n,this._actionSubscribers,t)},ei.prototype.watch=function(e,t,o){var i=this;return(0,n.watch)((function(){return e(i.state,i.getters)}),t,Object.assign({},o))},ei.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._state.data=e}))},ei.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"===typeof e&&(e=[e]),this._modules.register(e,t),Bo(this,this.state,e,this._modules.get(e),n.preserveState),yo(this,this.state)},ei.prototype.unregisterModule=function(e){var t=this;"string"===typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){var n=xo(t.state,e.slice(0,-1));delete n[e[e.length-1]]})),Mo(this)},ei.prototype.hasModule=function(e){return"string"===typeof e&&(e=[e]),this._modules.isRegistered(e)},ei.prototype.hotUpdate=function(e){this._modules.update(e),Mo(this,!0)},ei.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(ei.prototype,ti);var ni=si((function(e,t){var n={};return ii(t).forEach((function(t){var o=t.key,i=t.val;n[o]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var o=ai(this.$store,"mapState",e);if(!o)return;t=o.context.state,n=o.context.getters}return"function"===typeof i?i.call(this,t,n):t[i]},n[o].vuex=!0})),n})),oi=(si((function(e,t){var n={};return ii(t).forEach((function(t){var o=t.key,i=t.val;n[o]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var o=this.$store.commit;if(e){var r=ai(this.$store,"mapMutations",e);if(!r)return;o=r.context.commit}return"function"===typeof i?i.apply(this,[o].concat(t)):o.apply(this.$store,[i].concat(t))}})),n})),si((function(e,t){var n={};return ii(t).forEach((function(t){var o=t.key,i=t.val;i=e+i,n[o]=function(){if(!e||ai(this.$store,"mapGetters",e))return this.$store.getters[i]},n[o].vuex=!0})),n})),si((function(e,t){var n={};return ii(t).forEach((function(t){var o=t.key,i=t.val;n[o]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var o=this.$store.dispatch;if(e){var r=ai(this.$store,"mapActions",e);if(!r)return;o=r.context.dispatch}return"function"===typeof i?i.apply(this,[o].concat(t)):o.apply(this.$store,[i].concat(t))}})),n})));function ii(e){return ri(e)?Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}})):[]}function ri(e){return Array.isArray(e)||go(e)}function si(e){return function(t,n){return"string"!==typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function ai(e,t,n){var o=e._modulesNamespaceMap[n];return o}var ci={name:"Question_Programming",props:{isEnterCodeByInit:{type:Boolean,default:!1},urlQuery:{type:String,default:""},isSub:{type:Boolean,default:!1},questionInfo:{type:Object,default:{}},bus:{type:Object,default:{}},mode:{type:String,default:"exam"}},mounted(){H(this),this.$watch("oss_temp_url",(e=>{if(e){let e=this.isAnswered();this.$emit("getIsAnswered",e),"exam"===this.mode&&this.bus.$emit("questionCardChange",{questionIndex:this.questionInfo.questionIndex-1,answered:e})}}),{immediate:!0})},created(){this.isEnterCodeByInit&&(this.oss_temp_url?this.startCode("2"):this.startCode("1"))},data(){return{iframe:null,showFrame:!1,analyCorrectAnswer:"",iframeUrl:"",code_file_oss_temp_path:"",oss_temp_url:"",scratch_answer_json:"",loading:!1,enterCode:!1,codeTypeMap:{1:"Scratch",2:"Python",3:"PyGame",4:"C++"},codeTypeImgMap:{1:o(3031),2:o(3843),3:o(6543),4:o(2657)},answerMap:{},...JSON.parse(k)}},watch:{questionInfo:{handler(e,t){if(e){this.answerMap=e.answerMap;let t=e.answerMap;t&&(this.code_file_oss_temp_path=t.code_file_oss_temp_path,this.oss_temp_url=t.oss_temp_url)}},immediate:!0}},computed:{...ni("zykjcommonQuestions",["pythonCodeWebPath","scratchCodeWebPath","cplusCodeWebPath"])},methods:{...oi("zykjcommonQuestions",["getEditorUrlActions"]),getAnswer(){return{code_file_oss_temp_path:this.code_file_oss_temp_path,oss_temp_url:this.oss_temp_url,scratch_answer_json:this.scratch_answer_json}},isAnswered(){let e=""!==this.oss_temp_url;return e},isCorrect(){let e="1"===this.questionInfo.answerMap.is_correct;return e},getCodeWebPath(e){this.pythonCodeWebPath||this.scratchCodeWebPath||this.cplusCodeWebPath?e&&e():(this.loading=!0,this.getEditorUrlActions().then((()=>{this.loading=!1,e&&e()}),(()=>{this.loading=!1})))},startCode(e){let t=this;this.loading||(this.getCodeWebPath((function(){let n={1:t.questionInfo.template_file_full_url,2:t.oss_temp_url,3:t.oss_temp_url,4:t.questionInfo.reference_file_full_url},o="",i=t.questionInfo.code_type,r=n[e],s=t.urlQuery+`&codeUrl=${r}`;switch(i){case 1:o=`${t.scratchCodeWebPath}/?${s}`;break;case 2:o=`${t.pythonCodeWebPath}/?${s}`;break;case 3:o=`${t.pythonCodeWebPath}/?${s}&pygame=true`;break;case 4:o=`${t.cplusCodeWebPath}/?${s}`;break}t.iframeUrl=o})),this.showFrame=!0)},getQuestionInfo(){let e=this,t={type:"getQuestionInfo",data:e.questionInfo.htmlContent};this.iframe&&this.iframe.contentWindow.postMessage(JSON.stringify(t),"*")},submitCodeQuestionByTimeover(){let e={type:"submitCodeQuestionByTimeover"};this.iframe&&this.iframe.contentWindow.postMessage(JSON.stringify(e),"*")},iframeLoaded(e){this.iframe=e,this.enterCode=!0,this.bus.$emit("enterCode",!0)},closeIframe(){this.enterCode=!1,this.bus.$emit("enterCode",!1),this.showFrame=!1},closeAndSave(e){this.saveCodeOnly(e),this.isEnterCodeByInit||this.closeIframe(),this.$emit("closeAndSave",e)},saveCodeOnly(e){let t=this;this.code_file_oss_temp_path=e.codeFileOssTempPath,this.oss_temp_url=e.ossTempUrl,this.scratch_answer_json=e.scratch_answer_json,this.bus.$emit("submitQuestion",{saveType:1,submitRequestAutoQuit:!1,needSubmitRequest:!1});let n=this.isAnswered();"exam"===this.mode&&this.bus.$emit("questionCardChange",{questionIndex:t.questionInfo.questionIndex-1,answered:n}),this.$emit("saveCodeOnly",e)},uploadCodingFileSuccess(e){this.code_file_oss_temp_path=e.codeFileOssTempPath,this.oss_temp_url=e.ossTempUrl,this.scratch_answer_json=e.scratch_answer_json,this.bus.$emit("uploadCodingFileSuccess")}},components:{IframeComponent:oo,MediaLooker:De,Loading:eo}};const li=(0,Ge.Z)(ci,[["render",Un]]);var ui=li;const di={class:"zykjcommon-question",style:{width:"100%",height:"100%"}},fi={class:"box"},hi={class:"main-block"},pi=["src"],Ai=(0,n.createElementVNode)("div",{class:"main-content"},[(0,n.createElementVNode)("div",{class:"main-append"})],-1),mi=(0,n.createElementVNode)("div",{class:"prev"},[(0,n.createElementVNode)("div",{class:"prev-main"})],-1),Ti=(0,n.createElementVNode)("div",{class:"next"},[(0,n.createElementVNode)("div",{class:"next-main"})],-1),gi={class:"list"},bi=["idx"],Si={class:"list-item-text"};function vi(e,t,o,i,r,s){return(0,n.openBlock)(),(0,n.createElementBlock)("div",di,[(0,n.createElementVNode)("div",{class:"question-classify",style:(0,n.normalizeStyle)(r.bigBgCss)},[(0,n.createElementVNode)("div",fi,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(r.bigBoxItemList,((e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:"box-item",style:(0,n.normalizeStyle)(e.bgUrlCss),key:t},[(0,n.createElementVNode)("div",hi,[(0,n.createElementVNode)("img",{src:e.imgUrl,alt:""},null,8,pi)]),Ai],4)))),128))]),(0,n.createElementVNode)("div",{class:"list-outter",style:(0,n.normalizeStyle)(r.bottomBgCss)},[mi,Ti,(0,n.createElementVNode)("div",gi,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(r.optionList,((e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:"list-item",idx:e.idx,style:(0,n.normalizeStyle)(e.bgUrlCss),key:t},[(0,n.createElementVNode)("div",Si,(0,n.toDisplayString)(e.content),1)],12,bi)))),128))])],4)],4)])}let Mi=function(e=1440,t=0,n=1){let o=100,i=document.documentElement.clientWidth||document.body.clientWidth,r=document.documentElement.clientHeight||document.body.clientHeight;r-=t;let s=document.getElementsByTagName("html")[0],a=4/3,c=a/(i/r),l=parseInt(i*c);s.style.fontSize=l/e*o*n+"px",console.log(s.style.fontSize)},yi=Ee.getDeviceEnv();var Bi={name:"Question_Classify",props:{questionInfo:{type:Object,default:{}},bus:{type:Object,default:{}},mode:{type:String,default:"exam"},screenRepairH:{type:Number,default:0},screenScale:{type:Number,default:0}},created(){this.setRootFontSize(),window.addEventListener("resize",this.setRootFontSize)},unmounted(){this.unmountedDo()},destroyed(){this.unmountedDo()},mounted(){this.init(),this.$watch("optionList",(e=>{e&&e.length&&this.$nextTick((()=>{this.dothings()}))}),{immediate:!0,deep:!0})},data(){return{analyCorrectAnswer:"",classify_question_info:{},answerMap:{},optionList:[],bigBoxItemList:[],bigBgCss:"",bottomBgCss:"",listItemBgCss:"",env:yi,p1:{},p2:{},listItem:null,moveDiv:null,timer:null,mousedown:"mobile"===yi?"touchstart":"mousedown",mousemove:"mobile"===yi?"touchmove":"mousemove",mouseup:"mobile"===yi?"touchend":"mouseup",dragWay:"",flag:!1,scrollDistance:3e3}},watch:{questionInfo:{handler(e,t){e&&(console.log(e,33),this.parseLists(e),this.answerMap=e.answerMap,e.answerMap&&this.mode)},immediate:!0}},computed:{},methods:{getAnswer(){let e=[];return $(this.$el).find(".box-item").each((function(t,n){let o=$(this),i=[];o.find(".append-item").each(((e,t)=>{i.push(Number($(t).attr("idx")))})),i=i.sort((function(e,t){return e-t})),console.log(i,345),e.push({big_type_index:t+1,small_type_index_list:i})})),{classify_mapping_list:e}},isAnswered(){let e=$(this.$el).find(".list .list-item").length,t=0===e;return t},isCorrect(){let e="1"===this.questionInfo.answerMap.is_correct;return e},parseLists(e){this.classify_question_info=e.classify_question_info;let t=e.exam_options_data;this.classify_question_info.background_file&&(this.bigBgCss=`background: url(${this.classify_question_info.background_file.file_url}) no-repeat center;background-size: 100% 100%`),this.classify_question_info.bottom_img_file&&(this.bottomBgCss=`background: url(${this.classify_question_info.bottom_img_file.file_url}) no-repeat center;background-size: 100% 100%`);let n=[];t.forEach((e=>{n.push({content:e.data.option_content,bgUrlCss:`background: url(${e.data.file_url}) no-repeat center;background-size: 100% 100%`,idx:e.index})})),this.optionList=n,this.listItemBgCss=n[0]?n[0].bgUrlCss:"";let o=[],i=this.classify_question_info.big_type_box_image_list,r=this.classify_question_info.big_type_option_list;i.forEach(((e,t)=>{o.push({imgUrl:r[t].file_url,bgUrl:e.file_url,bgUrlCss:`background: url(${e.file_url}) no-repeat center;background-size: 100% 100%`})})),this.bigBoxItemList=o},setRootFontSize(){Mi(1e3,this.screenRepairH,this.screenScale)},unmountedDo(){window.removeEventListener("resize",this.setRootFontSize),document.removeEventListener("gesturestart",this.gesturestartListener),this.$el,$(this.$el).find(".question-classify .append-item").off(this.mousedown),$(this.$el).find(".question-classify .list-item").off(this.mousedown),$(document).off(this.mouseup);let e=document.getElementsByTagName("html")[0];e.style.fontSize=""},answeredNotify(){let e=this,t=e.isAnswered();e.$emit("getIsAnswered",t),"exam"===e.mode&&e.bus.$emit("questionCardChange",{questionIndex:e.questionInfo.questionIndex-1,answered:t})},gesturestartListener(e){e.preventDefault()},init(){"mobile"===yi&&document.addEventListener("gesturestart",this.gesturestartListener)},getSpecArr(){let e=this,t=[],n=e.moveDiv.offset().left,o=n+e.moveDiv.width(),i=e.moveDiv.offset().top,r=i+e.moveDiv.height();return $(this.$el).find(".box-item").each(((e,s)=>{let a=$(s),c=a.offset().left,l=c+a.width(),u=a.offset().top,d=u+a.height();n>c&&o<l&&i>u&&r<d&&t.push({dom:a})})),t},bindDragDomEvent(e,t){let n=this;e.on(this.mousedown,(function(e){if(n.moveDiv)return;n.flag=!1,n.dragWay=t,console.log(e),e.stopPropagation(),e.preventDefault(),n.listItem=$(this),n.listItem.addClass("drag"),n.p1.moveX=n.listItem.offset().left,n.p1.moveY=n.listItem.offset().top-30;let o=n.listItem.attr("idx");n.moveDiv=$(`<div class="question-classify-moveDiv" idx="${o}" style="${n.listItemBgCss}"><div class="list-item-text">${n.listItem.find(".list-item-text").text()}</div></div>`),n.moveDiv.css({left:`${n.p1.moveX}px`,top:`${n.p1.moveY}px`}),$("body").append(n.moveDiv),$(document).on(n.mousemove,(function(e){e.stopPropagation(),n.p2.moveX=e.clientX||e.originalEvent.touches&&e.originalEvent.touches[0].clientX,n.p2.moveY=e.clientY||e.originalEvent.touches&&e.originalEvent.touches[0].clientY;let t=n.p2.moveX-n.moveDiv.width()/2,o=n.p2.moveY-n.moveDiv.height()/2;n.moveDiv.css({left:t+"px",top:o+"px"})}))}))},appendMoveDiv(e){let t=this;t.listItem.remove();let n=t.moveDiv.attr("idx"),o=$(`<div class="${e.appendItemClassName}" idx="${n}" style="${t.listItemBgCss}"><div class="list-item-text">${t.moveDiv.find(".list-item-text").text()}</div></div>`);o.css({opacity:0}),e.targetList.append(o),e.targetList[e.scrollDirection](t.scrollDistance);let i=o.offset().left,r=o.offset().top;t.moveDiv.css({transition:"all 0.5s",left:i,top:r}).on("transitionend",(function(){t.flag||(t.moveDiv.remove(),t.moveDiv.off("transitionend"),t.moveDiv=null,o.css({opacity:1}),t.answeredNotify(),t.bindDragDomEvent(o,e.op)),t.flag=!0}))},bindNextPrevEvent(e){let t=this;$(this.$el).find(`.question-classify .${e}`).on("click",(function(n){n.stopPropagation(),n.preventDefault();let o=$(t.$el).find(".question-classify .list-item"),i=$(t.$el).find(".question-classify .list"),r=o.outerWidth()*("next"===e?1:-1),s=i.scrollLeft();console.log(s),$(t.$el).find(".question-classify .list").stop(!0).animate({scrollLeft:s+r},500)}))},dothings(){let e=this;this.answerMap&&this.answerMap.classify_mapping_list&&this.answerMap.classify_mapping_list.length&&this.setAnswerDo(),e.bindDragDomEvent($(this.$el).find(".question-classify .list-item"),"go"),$(document).on(e.mouseup,(function(t){if("go"===e.dragWay){if($(document).off(e.mousemove),e.listItem&&e.listItem.removeClass("drag"),e.moveDiv){let t=e.getSpecArr();if(0===t.length)e.moveDiv&&(e.moveDiv.remove(),e.moveDiv=null);else{let n=t[0].dom;e.appendMoveDiv({targetList:n.find(".main-append"),appendItemClassName:"append-item",op:"back",scrollDirection:"scrollTop"})}}}else if("back"===e.dragWay&&($(document).off(e.mousemove),e.listItem&&e.listItem.removeClass("drag"),e.moveDiv)){let t=e.getSpecArr();if(0===t.length)e.appendMoveDiv({targetList:$(e.$el).find(".question-classify .list"),appendItemClassName:"list-item",op:"go",scrollDirection:"scrollLeft"});else{let n=t[0].dom,o=e.listItem.parents(".question-classify .box-item");n.get(0)===o.get(0)?(console.log("自己"),e.moveDiv.remove(),e.moveDiv=null,e.listItem&&e.listItem.removeClass("drag")):(console.log("不是自己"),e.appendMoveDiv({targetList:n.find(".main-append"),appendItemClassName:"append-item",op:"back",scrollDirection:"scrollTop"}),console.log("不是自己"))}console.log(t.length)}})),e.bindNextPrevEvent("next"),e.bindNextPrevEvent("prev")},setAnswerDo(){let e=this,t=[];$(this.$el).find(".question-classify .list-item").each(((e,n)=>{t.push(Number($(n).attr("idx")))})),this.answerMap.classify_mapping_list.forEach(((n,o)=>{n.small_type_index_list.forEach((n=>{let i=t.findIndex((e=>e==n));if(i>-1){t.splice(i,1);let n=$(this.$el).find(".question-classify .list-item").eq(i),r=n.attr("idx"),s=$(`<div class="append-item" idx="${r}" style="${e.listItemBgCss}"><div class="list-item-text">${n.find(".list-item-text").text()}</div></div>`);e.bindDragDomEvent(s,"back"),$(this.$el).find(".main-append").eq(o).append(s),n.remove()}}))})),this.answeredNotify()}},components:{}};const Ci=(0,Ge.Z)(Bi,[["render",vi]]);var wi=Ci;let Pi={1:"Question_SingleChoice",2:"Question_MultipleChoice",3:"Question_SingleChoice",7:"Question_BriefAnswer",16:"Question_Programming",11:"Question_Reading",4:"Question_FillBlank",17:"Question_Classify"};var Ei=o(1354),Ii=o(9669),Gi=o.n(Ii),xi=o(7631),Di=o.n(xi);let ki="piw38kulfozrea7ydmjnvbc965q1gt2x",Hi=function(e,t,n,o){void 0!=n&&"undefined"!==typeof n["password"]&&(n["password"]=Di().hex_md5(Di().hex_md5(n["password"]+"FE605C9343A3A47764598FDC184EC66F").toUpperCase()+"FE605C9343A3A47764598FDC184EC66F").toUpperCase());let i=e+"\n/student-web"+t+"\n"+o+"\n"+(n?JSON.stringify(n):""),r=Ei.enc.Base64.stringify((0,Ei.HmacSHA256)(i,ki)),s=function(e){let t=e.replace(/\+/g,"-");t=t.replace(/\//g,"_");let n=t.length%4,o="====";return t+=o.substring(0,n),t};return s(r)};Gi().defaults.baseURL="https://jsl-api.thedeer.cn/student-web/",Gi().defaults.timeout=6e4,Gi().defaults.withCredentials=!0;let Ni=(e,t)=>{if(t&&-1!=t["Content-Type"].indexOf("multipart/form-data")){let t=new FormData;for(let n in e)t.append(n,e[n]);return t}return JSON.stringify(e)},Oi=e=>{e=JSON.parse(e),e.hasOwnProperty("errorCode")&&(e.error_code=e.errorCode);let{error_code:t,message:n}=e;if(t){let e=[39002,39003];if(e.indexOf(t)<=-1){let e=n||"系统异常";Ee.messageTip("warning",e)}}return e};function Li(e,t,n,o,i){let r,s;e=e.toUpperCase(),t+=0===n.indexOf("/")?n.substr(1):n;let a=window.isMock;"undefined"!==typeof i&&"undefined"!==typeof i.isMock&&(a=i.isMock,delete i.isMock),a&&i&&i.onUploadProgress&&delete i.onUploadProgress;let c=n;"/"!==n[0]&&(c="/"+n);let l=(new Date).getTime(),u={ts:l,sign:Hi(e,c,o,l),token:Ee.getToken()};switch(e){case"Get":s=o||{};break;default:case"POST":r=o||{},u["Content-Type"]=i&&i.contentType?i.contentType:"application/json";break}return t instanceof Array?Gi().all([]).then(Gi().spread((function(){}))):Gi()(Object.assign({headers:u,method:e,url:t,data:r,params:s,transformRequest:Ni,transformResponse:Oi},i)).then((e=>e.data)).catch((e=>(console.log("服务端请求/响应错误:",e,e.config),Promise.reject(e))))}const Vi=(e,t,n)=>Li("GET","",e,t,n);let _i={editorUrl:"/open/editor-url"};const Fi={pythonCodeWebPath:"",scratchCodeWebPath:"",cplusCodeWebPath:""};var Ri={namespaced:!0,state:Fi,getters:{},mutations:{setCodeWebPath(e,t){e.pythonCodeWebPath=t.pythonCodeWebPath,e.scratchCodeWebPath=t.scratchCodeWebPath,e.cplusCodeWebPath=t.cplusCodeWebPath}},actions:{getEditorUrlActions({commit:e,dispatch:t}){return new Promise(((t,n)=>{Vi(`${_i.editorUrl}`).then((n=>{let{error_code:o,data:i}=n;if(!o){let{pythonCodeWebPath:t,scratchCodeWebPath:n,cplusCodeWebPath:o}=i;e("setCodeWebPath",{pythonCodeWebPath:t,scratchCodeWebPath:n,cplusCodeWebPath:o})}t(n)}),(e=>{n(e)}))}))}}};function qi(e){return e.registerModule("zykjcommonQuestions",Ri),{install(e){Ee.getVueVersion();e.mixin({methods:{parseQuestionListItem(e,t,n,o=void 0){function i(e,t){e.forEach((e=>{if("img"===e["<>"]&&e.hasOwnProperty("width")){let n=Number(e.width);n>t&&(e.width=Math.floor(t),e.height&&delete e.height)}e.html&&e.html.length&&i(e.html,t)}))}t.forEach(((t,r)=>{if(t.questionComponent=Pi[t.question_type],void 0===o?t.questionIndex=r+1:(t.questionIndex=o+1+"-"+(r+1),t.questionIndex2=r+1),n&&n.hasOwnProperty(t.question_id)){if(t.answerMap=n[t.question_id],"analysis"===e){t.answerMap.user_coding_file&&(t.answerMap.oss_temp_url=t.answerMap.user_coding_file),t.score=t.answerMap.question_max_score;let e=Object.keys(t.answerMap),n=/^user_/gi;e.forEach((e=>{if(n.test(e)){let o=e.replace(n,"");t.answerMap[o]=t.answerMap[e]}}))}}else t.answerMap=null;let s=t.question_type;3==s?t.exam_options_data=[{index:1,data:{name:"正确"}},{index:2,data:{name:"错误"}}]:t.exam_options_data&&t.exam_options_data.length&&t.exam_options_data.forEach(((e,t)=>{e.enIndex=Ee.indexToEnIndex(t+1)}));try{let e=JSON.parse(t.content),n=jQuery(".question-list").width()-30;i(e,n),t.htmlContent=$.json2html({},e)}catch(a){t.htmlContent=t.content}try{t.analysis?t.analysisHtmlContent=$.json2html({},JSON.parse(t.analysis)):t.analysisHtmlContent=""}catch(a){t.analysisHtmlContent=t.analysis}t.sub_questions&&t.sub_questions.length&&this.parseQuestionListItem(e,t.sub_questions,n,r)}))}}}),e.component("Question_SingleChoice",Ne),e.component("Question_MultipleChoice",Tt),e.component("Question_Reading",xt),e.component("Question_BriefAnswer",cn),e.component("Question_FillBlank",bn),e.component("Question_Programming",ui),e.component("Question_Classify",wi)},Question_SingleChoice:Ne,Question_MultipleChoice:Tt,Question_Reading:xt,Question_BriefAnswer:cn,Question_FillBlank:bn,Question_Programming:ui,Question_Classify:wi}}var ji=qi}(),i}()}));
|
|
27
|
+
var mo="store";function To(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function go(e){return null!==e&&"object"===typeof e}function bo(e){return e&&"function"===typeof e.then}function So(e,t){return function(){return e(t)}}function vo(e,t,n){return t.indexOf(e)<0&&(n&&n.prepend?t.unshift(e):t.push(e)),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function Mo(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;Bo(e,n,[],e._modules.root,!0),yo(e,n,t)}function yo(e,t,o){var i=e._state,r=e._scope;e.getters={},e._makeLocalGettersCache=Object.create(null);var s=e._wrappedGetters,a={},c={},l=(0,n.effectScope)(!0);l.run((function(){To(s,(function(t,o){a[o]=So(t,e),c[o]=(0,n.computed)((function(){return a[o]()})),Object.defineProperty(e.getters,o,{get:function(){return c[o].value},enumerable:!0})}))})),e._state=(0,n.reactive)({data:t}),e._scope=l,e.strict&&Go(e),i&&o&&e._withCommit((function(){i.data=null})),r&&r.stop()}function Bo(e,t,n,o,i){var r=!n.length,s=e._modules.getNamespace(n);if(o.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=o),!r&&!i){var a=xo(t,n.slice(0,-1)),c=n[n.length-1];e._withCommit((function(){a[c]=o.state}))}var l=o.context=Co(e,s,n);o.forEachMutation((function(t,n){var o=s+n;Po(e,o,t,l)})),o.forEachAction((function(t,n){var o=t.root?n:s+n,i=t.handler||t;Eo(e,o,i,l)})),o.forEachGetter((function(t,n){var o=s+n;Io(e,o,t,l)})),o.forEachChild((function(o,r){Bo(e,t,n.concat(r),o,i)}))}function Co(e,t,n){var o=""===t,i={dispatch:o?e.dispatch:function(n,o,i){var r=Do(n,o,i),s=r.payload,a=r.options,c=r.type;return a&&a.root||(c=t+c),e.dispatch(c,s)},commit:o?e.commit:function(n,o,i){var r=Do(n,o,i),s=r.payload,a=r.options,c=r.type;a&&a.root||(c=t+c),e.commit(c,s,a)}};return Object.defineProperties(i,{getters:{get:o?function(){return e.getters}:function(){return wo(e,t)}},state:{get:function(){return xo(e.state,n)}}}),i}function wo(e,t){if(!e._makeLocalGettersCache[t]){var n={},o=t.length;Object.keys(e.getters).forEach((function(i){if(i.slice(0,o)===t){var r=i.slice(o);Object.defineProperty(n,r,{get:function(){return e.getters[i]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}function Po(e,t,n,o){var i=e._mutations[t]||(e._mutations[t]=[]);i.push((function(t){n.call(e,o.state,t)}))}function Eo(e,t,n,o){var i=e._actions[t]||(e._actions[t]=[]);i.push((function(t){var i=n.call(e,{dispatch:o.dispatch,commit:o.commit,getters:o.getters,state:o.state,rootGetters:e.getters,rootState:e.state},t);return bo(i)||(i=Promise.resolve(i)),e._devtoolHook?i.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):i}))}function Io(e,t,n,o){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(e){return n(o.state,o.getters,e.state,e.getters)})}function Go(e){(0,n.watch)((function(){return e._state.data}),(function(){0}),{deep:!0,flush:"sync"})}function xo(e,t){return t.reduce((function(e,t){return e[t]}),e)}function Do(e,t,n){return go(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}var ko="vuex bindings",Ho="vuex:mutations",No="vuex:actions",Oo="vuex",Lo=0;function Vo(e,t){Ao({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[ko]},(function(n){n.addTimelineLayer({id:Ho,label:"Vuex Mutations",color:_o}),n.addTimelineLayer({id:No,label:"Vuex Actions",color:_o}),n.addInspector({id:Oo,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree((function(n){if(n.app===e&&n.inspectorId===Oo)if(n.filter){var o=[];Qo(o,t._modules.root,n.filter,""),n.rootNodes=o}else n.rootNodes=[Uo(t._modules.root,"")]})),n.on.getInspectorState((function(n){if(n.app===e&&n.inspectorId===Oo){var o=n.nodeId;wo(t,o),n.state=Xo(Ko(t._modules,o),"root"===o?t.getters:t._makeLocalGettersCache,o)}})),n.on.editInspectorState((function(n){if(n.app===e&&n.inspectorId===Oo){var o=n.nodeId,i=n.path;"root"!==o&&(i=o.split("/").filter(Boolean).concat(i)),t._withCommit((function(){n.set(t._state.data,i,n.state.value)}))}})),t.subscribe((function(e,t){var o={};e.payload&&(o.payload=e.payload),o.state=t,n.notifyComponentUpdate(),n.sendInspectorTree(Oo),n.sendInspectorState(Oo),n.addTimelineEvent({layerId:Ho,event:{time:Date.now(),title:e.type,data:o}})})),t.subscribeAction({before:function(e,t){var o={};e.payload&&(o.payload=e.payload),e._id=Lo++,e._time=Date.now(),o.state=t,n.addTimelineEvent({layerId:No,event:{time:e._time,title:e.type,groupId:e._id,subtitle:"start",data:o}})},after:function(e,t){var o={},i=Date.now()-e._time;o.duration={_custom:{type:"duration",display:i+"ms",tooltip:"Action duration",value:i}},e.payload&&(o.payload=e.payload),o.state=t,n.addTimelineEvent({layerId:No,event:{time:Date.now(),title:e.type,groupId:e._id,subtitle:"end",data:o}})}})}))}var _o=8702998,Fo=6710886,Ro=16777215,qo={label:"namespaced",textColor:Ro,backgroundColor:Fo};function jo(e){return e&&"root"!==e?e.split("/").slice(-2,-1)[0]:"Root"}function Uo(e,t){return{id:t||"root",label:jo(t),tags:e.namespaced?[qo]:[],children:Object.keys(e._children).map((function(n){return Uo(e._children[n],t+n+"/")}))}}function Qo(e,t,n,o){o.includes(n)&&e.push({id:o||"root",label:o.endsWith("/")?o.slice(0,o.length-1):o||"Root",tags:t.namespaced?[qo]:[]}),Object.keys(t._children).forEach((function(i){Qo(e,t._children[i],n,o+i+"/")}))}function Xo(e,t,n){t="root"===n?t:t[n];var o=Object.keys(t),i={state:Object.keys(e.state).map((function(t){return{key:t,editable:!0,value:e.state[t]}}))};if(o.length){var r=Wo(t);i.getters=Object.keys(r).map((function(e){return{key:e.endsWith("/")?jo(e):e,editable:!1,value:zo((function(){return r[e]}))}}))}return i}function Wo(e){var t={};return Object.keys(e).forEach((function(n){var o=n.split("/");if(o.length>1){var i=t,r=o.pop();o.forEach((function(e){i[e]||(i[e]={_custom:{value:{},display:e,tooltip:"Module",abstract:!0}}),i=i[e]._custom.value})),i[r]=zo((function(){return e[n]}))}else t[n]=zo((function(){return e[n]}))})),t}function Ko(e,t){var n=t.split("/").filter((function(e){return e}));return n.reduce((function(e,o,i){var r=e[o];if(!r)throw new Error('Missing module "'+o+'" for path "'+t+'".');return i===n.length-1?r:r._children}),"root"===t?e:e.root._children)}function zo(e){try{return e()}catch(t){return t}}var Yo=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"===typeof n?n():n)||{}},Jo={namespaced:{configurable:!0}};Jo.namespaced.get=function(){return!!this._rawModule.namespaced},Yo.prototype.addChild=function(e,t){this._children[e]=t},Yo.prototype.removeChild=function(e){delete this._children[e]},Yo.prototype.getChild=function(e){return this._children[e]},Yo.prototype.hasChild=function(e){return e in this._children},Yo.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},Yo.prototype.forEachChild=function(e){To(this._children,e)},Yo.prototype.forEachGetter=function(e){this._rawModule.getters&&To(this._rawModule.getters,e)},Yo.prototype.forEachAction=function(e){this._rawModule.actions&&To(this._rawModule.actions,e)},Yo.prototype.forEachMutation=function(e){this._rawModule.mutations&&To(this._rawModule.mutations,e)},Object.defineProperties(Yo.prototype,Jo);var Zo=function(e){this.register([],e,!1)};function $o(e,t,n){if(t.update(n),n.modules)for(var o in n.modules){if(!t.getChild(o))return void 0;$o(e.concat(o),t.getChild(o),n.modules[o])}}Zo.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},Zo.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return t=t.getChild(n),e+(t.namespaced?n+"/":"")}),"")},Zo.prototype.update=function(e){$o([],this.root,e)},Zo.prototype.register=function(e,t,n){var o=this;void 0===n&&(n=!0);var i=new Yo(t,n);if(0===e.length)this.root=i;else{var r=this.get(e.slice(0,-1));r.addChild(e[e.length-1],i)}t.modules&&To(t.modules,(function(t,i){o.register(e.concat(i),t,n)}))},Zo.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1],o=t.getChild(n);o&&o.runtime&&t.removeChild(n)},Zo.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];return!!t&&t.hasChild(n)};var ei=function(e){var t=this;void 0===e&&(e={});var n=e.plugins;void 0===n&&(n=[]);var o=e.strict;void 0===o&&(o=!1);var i=e.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new Zo(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=i;var r=this,s=this,a=s.dispatch,c=s.commit;this.dispatch=function(e,t){return a.call(r,e,t)},this.commit=function(e,t,n){return c.call(r,e,t,n)},this.strict=o;var l=this._modules.root.state;Bo(this,l,[],this._modules.root),yo(this,l),n.forEach((function(e){return e(t)}))},ti={state:{configurable:!0}};ei.prototype.install=function(e,t){e.provide(t||mo,this),e.config.globalProperties.$store=this;var n=void 0!==this._devtools&&this._devtools;n&&Vo(e,this)},ti.state.get=function(){return this._state.data},ti.state.set=function(e){0},ei.prototype.commit=function(e,t,n){var o=this,i=Do(e,t,n),r=i.type,s=i.payload,a=(i.options,{type:r,payload:s}),c=this._mutations[r];c&&(this._withCommit((function(){c.forEach((function(e){e(s)}))})),this._subscribers.slice().forEach((function(e){return e(a,o.state)})))},ei.prototype.dispatch=function(e,t){var n=this,o=Do(e,t),i=o.type,r=o.payload,s={type:i,payload:r},a=this._actions[i];if(a){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(s,n.state)}))}catch(l){0}var c=a.length>1?Promise.all(a.map((function(e){return e(r)}))):a[0](r);return new Promise((function(e,t){c.then((function(t){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(s,n.state)}))}catch(l){0}e(t)}),(function(e){try{n._actionSubscribers.filter((function(e){return e.error})).forEach((function(t){return t.error(s,n.state,e)}))}catch(l){0}t(e)}))}))}},ei.prototype.subscribe=function(e,t){return vo(e,this._subscribers,t)},ei.prototype.subscribeAction=function(e,t){var n="function"===typeof e?{before:e}:e;return vo(n,this._actionSubscribers,t)},ei.prototype.watch=function(e,t,o){var i=this;return(0,n.watch)((function(){return e(i.state,i.getters)}),t,Object.assign({},o))},ei.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._state.data=e}))},ei.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"===typeof e&&(e=[e]),this._modules.register(e,t),Bo(this,this.state,e,this._modules.get(e),n.preserveState),yo(this,this.state)},ei.prototype.unregisterModule=function(e){var t=this;"string"===typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){var n=xo(t.state,e.slice(0,-1));delete n[e[e.length-1]]})),Mo(this)},ei.prototype.hasModule=function(e){return"string"===typeof e&&(e=[e]),this._modules.isRegistered(e)},ei.prototype.hotUpdate=function(e){this._modules.update(e),Mo(this,!0)},ei.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(ei.prototype,ti);var ni=si((function(e,t){var n={};return ii(t).forEach((function(t){var o=t.key,i=t.val;n[o]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var o=ai(this.$store,"mapState",e);if(!o)return;t=o.context.state,n=o.context.getters}return"function"===typeof i?i.call(this,t,n):t[i]},n[o].vuex=!0})),n})),oi=(si((function(e,t){var n={};return ii(t).forEach((function(t){var o=t.key,i=t.val;n[o]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var o=this.$store.commit;if(e){var r=ai(this.$store,"mapMutations",e);if(!r)return;o=r.context.commit}return"function"===typeof i?i.apply(this,[o].concat(t)):o.apply(this.$store,[i].concat(t))}})),n})),si((function(e,t){var n={};return ii(t).forEach((function(t){var o=t.key,i=t.val;i=e+i,n[o]=function(){if(!e||ai(this.$store,"mapGetters",e))return this.$store.getters[i]},n[o].vuex=!0})),n})),si((function(e,t){var n={};return ii(t).forEach((function(t){var o=t.key,i=t.val;n[o]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var o=this.$store.dispatch;if(e){var r=ai(this.$store,"mapActions",e);if(!r)return;o=r.context.dispatch}return"function"===typeof i?i.apply(this,[o].concat(t)):o.apply(this.$store,[i].concat(t))}})),n})));function ii(e){return ri(e)?Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}})):[]}function ri(e){return Array.isArray(e)||go(e)}function si(e){return function(t,n){return"string"!==typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function ai(e,t,n){var o=e._modulesNamespaceMap[n];return o}var ci={name:"Question_Programming",props:{isEnterCodeByInit:{type:Boolean,default:!1},urlQuery:{type:String,default:""},isSub:{type:Boolean,default:!1},questionInfo:{type:Object,default:{}},bus:{type:Object,default:{}},mode:{type:String,default:"exam"}},mounted(){H(this),this.$watch("oss_temp_url",(e=>{if(e){let e=this.isAnswered();this.$emit("getIsAnswered",e),"exam"===this.mode&&this.bus.$emit("questionCardChange",{questionIndex:this.questionInfo.questionIndex-1,answered:e})}}),{immediate:!0})},created(){this.isEnterCodeByInit&&(this.oss_temp_url?this.startCode("2"):this.startCode("1"))},data(){return{iframe:null,showFrame:!1,analyCorrectAnswer:"",iframeUrl:"",code_file_oss_temp_path:"",oss_temp_url:"",scratch_answer_json:"",loading:!1,enterCode:!1,codeTypeMap:{1:"Scratch",2:"Python",3:"PyGame",4:"C++"},codeTypeImgMap:{1:o(3031),2:o(3843),3:o(6543),4:o(2657)},answerMap:{},...JSON.parse(k)}},watch:{questionInfo:{handler(e,t){if(e){this.answerMap=e.answerMap;let t=e.answerMap;t&&(this.code_file_oss_temp_path=t.code_file_oss_temp_path,this.oss_temp_url=t.oss_temp_url)}},immediate:!0}},computed:{...ni("zykjcommonQuestions",["pythonCodeWebPath","scratchCodeWebPath","cplusCodeWebPath"])},methods:{...oi("zykjcommonQuestions",["getEditorUrlActions"]),getAnswer(){return{code_file_oss_temp_path:this.code_file_oss_temp_path,oss_temp_url:this.oss_temp_url,scratch_answer_json:this.scratch_answer_json}},isAnswered(){let e=""!==this.oss_temp_url;return e},isCorrect(){let e="1"===this.questionInfo.answerMap.is_correct;return e},getCodeWebPath(e){this.pythonCodeWebPath||this.scratchCodeWebPath||this.cplusCodeWebPath?e&&e():(this.loading=!0,this.getEditorUrlActions().then((()=>{this.loading=!1,e&&e()}),(()=>{this.loading=!1})))},startCode(e){let t=this;this.loading||(this.getCodeWebPath((function(){let n={1:t.questionInfo.template_file_full_url,2:t.oss_temp_url,3:t.oss_temp_url,4:t.questionInfo.reference_file_full_url},o="",i=t.questionInfo.code_type,r=n[e],s=t.urlQuery+`&codeUrl=${r}`;switch(i){case 1:o=`${t.scratchCodeWebPath}/?${s}`;break;case 2:o=`${t.pythonCodeWebPath}/?${s}`;break;case 3:o=`${t.pythonCodeWebPath}/?${s}&pygame=true`;break;case 4:o=`${t.cplusCodeWebPath}/?${s}`;break}t.iframeUrl=o})),this.showFrame=!0)},getQuestionInfo(){let e=this,t={type:"getQuestionInfo",data:e.questionInfo.htmlContent};this.iframe&&this.iframe.contentWindow.postMessage(JSON.stringify(t),"*")},submitCodeQuestionByTimeover(){let e={type:"submitCodeQuestionByTimeover"};this.iframe&&this.iframe.contentWindow.postMessage(JSON.stringify(e),"*")},iframeLoaded(e){this.iframe=e,this.enterCode=!0,this.bus.$emit("enterCode",!0)},closeIframe(){this.enterCode=!1,this.bus.$emit("enterCode",!1),this.showFrame=!1},closeAndSave(e){this.saveCodeOnly(e),this.isEnterCodeByInit||this.closeIframe(),this.$emit("closeAndSave",e)},saveCodeOnly(e){let t=this;this.code_file_oss_temp_path=e.codeFileOssTempPath,this.oss_temp_url=e.ossTempUrl,this.scratch_answer_json=e.scratch_answer_json,this.bus.$emit("submitQuestion",{saveType:1,submitRequestAutoQuit:!1,needSubmitRequest:!1});let n=this.isAnswered();"exam"===this.mode&&this.bus.$emit("questionCardChange",{questionIndex:t.questionInfo.questionIndex-1,answered:n}),this.$emit("saveCodeOnly",e)},uploadCodingFileSuccess(e){this.code_file_oss_temp_path=e.codeFileOssTempPath,this.oss_temp_url=e.ossTempUrl,this.scratch_answer_json=e.scratch_answer_json,this.bus.$emit("uploadCodingFileSuccess")}},components:{IframeComponent:oo,MediaLooker:De,Loading:eo}};const li=(0,Ge.Z)(ci,[["render",Un]]);var ui=li;const di={class:"zykjcommon-question",style:{width:"100%",height:"100%"}},fi={class:"box"},hi={class:"main-block"},pi=["src"],Ai=(0,n.createElementVNode)("div",{class:"main-content"},[(0,n.createElementVNode)("div",{class:"main-append"})],-1),mi=(0,n.createElementVNode)("div",{class:"prev"},[(0,n.createElementVNode)("div",{class:"prev-main"})],-1),Ti=(0,n.createElementVNode)("div",{class:"next"},[(0,n.createElementVNode)("div",{class:"next-main"})],-1),gi={class:"list"},bi=["idx"],Si={class:"list-item-text"};function vi(e,t,o,i,r,s){return(0,n.openBlock)(),(0,n.createElementBlock)("div",di,[(0,n.createElementVNode)("div",{class:"question-classify",style:(0,n.normalizeStyle)(r.bigBgCss)},[(0,n.createElementVNode)("div",fi,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(r.bigBoxItemList,((e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:"box-item",style:(0,n.normalizeStyle)(e.bgUrlCss),key:t},[(0,n.createElementVNode)("div",hi,[(0,n.createElementVNode)("img",{src:e.imgUrl,alt:""},null,8,pi)]),Ai],4)))),128))]),(0,n.createElementVNode)("div",{class:"list-outter",style:(0,n.normalizeStyle)(r.bottomBgCss)},[mi,Ti,(0,n.createElementVNode)("div",gi,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(r.optionList,((e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:"list-item",idx:e.idx,style:(0,n.normalizeStyle)(e.bgUrlCss),key:t},[(0,n.createElementVNode)("div",Si,(0,n.toDisplayString)(e.content),1)],12,bi)))),128))])],4)],4)])}let Mi=function(e=1440,t=0,n=1){let o=100,i=document.documentElement.clientWidth||document.body.clientWidth,r=document.documentElement.clientHeight||document.body.clientHeight;r-=t;let s=document.getElementsByTagName("html")[0],a=4/3,c=a/(i/r),l=parseInt(i*c),u=document.querySelector(".zykjcommon-question");u.style.fontSize=l/e*o*n+"px",console.log(s.style.fontSize)},yi=Ee.getDeviceEnv();var Bi={name:"Question_Classify",props:{questionInfo:{type:Object,default:{}},bus:{type:Object,default:{}},mode:{type:String,default:"exam"},screenRepairH:{type:Number,default:0},screenScale:{type:Number,default:0}},created(){},unmounted(){this.unmountedDo()},destroyed(){this.unmountedDo()},mounted(){this.setRootFontSize(),window.addEventListener("resize",this.setRootFontSize),this.init(),this.$watch("optionList",(e=>{e&&e.length&&this.$nextTick((()=>{this.dothings()}))}),{immediate:!0,deep:!0})},data(){return{animationing:!1,analyCorrectAnswer:"",classify_question_info:{},answerMap:{},optionList:[],bigBoxItemList:[],bigBgCss:"",bottomBgCss:"",listItemBgCss:"",env:yi,p1:{},p2:{},listItem:null,moveDiv:null,timer:null,mousedown:"mobile"===yi?"touchstart":"mousedown",mousemove:"mobile"===yi?"touchmove":"mousemove",mouseup:"mobile"===yi?"touchend":"mouseup",dragWay:"",flag:!1,scrollDistance:3e3}},watch:{questionInfo:{handler(e,t){e&&(console.log(e,33),this.parseLists(e),this.answerMap=e.answerMap,e.answerMap&&this.mode)},immediate:!0}},computed:{},methods:{getAnswer(){let e=[];return $(this.$el).find(".box-item").each((function(t,n){let o=$(this),i=[];o.find(".append-item").each(((e,t)=>{i.push(Number($(t).attr("idx")))})),i=i.sort((function(e,t){return e-t})),console.log(i,345),e.push({big_type_index:t+1,small_type_index_list:i})})),{classify_mapping_list:e}},isAnswered(){let e=$(this.$el).find(".list .list-item").length,t=0===e;return t},isCorrect(){let e="1"===this.questionInfo.answerMap.is_correct;return e},parseLists(e){this.classify_question_info=e.classify_question_info;let t=e.exam_options_data;if(this.classify_question_info){this.classify_question_info.background_file&&(this.bigBgCss=`background: url(${this.classify_question_info.background_file.file_url}) no-repeat center;background-size: 100% 100%`),this.classify_question_info.bottom_img_file&&(this.bottomBgCss=`background: url(${this.classify_question_info.bottom_img_file.file_url}) no-repeat center;background-size: 100% 100%`);let e=[];t.forEach((t=>{e.push({content:t.data.option_content,bgUrlCss:`background: url(${t.data.file_url}) no-repeat center;background-size: 100% 100%`,idx:t.index})})),this.optionList=e,this.listItemBgCss=e[0]?e[0].bgUrlCss:"";let n=[],o=this.classify_question_info.big_type_box_image_list,i=this.classify_question_info.big_type_option_list;o.forEach(((e,t)=>{n.push({imgUrl:i[t].file_url,bgUrl:e.file_url,bgUrlCss:`background: url(${e.file_url}) no-repeat center;background-size: 100% 100%`})})),this.bigBoxItemList=n}},setRootFontSize(){Mi(1e3,this.screenRepairH,this.screenScale)},unmountedDo(){window.removeEventListener("resize",this.setRootFontSize),document.removeEventListener("gesturestart",this.gesturestartListener),$(this.$el).find(".question-classify .append-item").off(this.mousedown),$(this.$el).find(".question-classify .list-item").off(this.mousedown),$(document).off(this.mouseup);let e=document.getElementsByTagName("html")[0];e.style.fontSize=""},answeredNotify(){let e=this,t=e.isAnswered();e.$emit("getIsAnswered",t),"exam"===e.mode&&e.bus.$emit("questionCardChange",{questionIndex:e.questionInfo.questionIndex-1,answered:t})},gesturestartListener(e){e.preventDefault()},init(){"mobile"===yi&&document.addEventListener("gesturestart",this.gesturestartListener)},getSpecArr(){let e=this,t=[],n=e.moveDiv.offset().left,o=n+e.moveDiv.width(),i=e.moveDiv.offset().top,r=i+e.moveDiv.height();return $(this.$el).find(".box-item").each(((e,s)=>{let a=$(s),c=a.offset().left,l=c+a.width(),u=a.offset().top,d=u+a.height();n>c&&o<l&&i>u&&r<d&&t.push({dom:a})})),t},bindDragDomEvent(e,t){let n=this;e.on(this.mousedown,(function(e){if(n.moveDiv)return;n.flag=!1,n.dragWay=t,console.log(e),e.stopPropagation(),e.preventDefault(),n.listItem=$(this),n.listItem.addClass("drag"),n.p1.moveX=n.listItem.offset().left,n.p1.moveY=n.listItem.offset().top-30;let o=n.listItem.attr("idx");n.moveDiv=$(`<div class="question-classify-moveDiv" idx="${o}" style="${n.listItemBgCss}"><div class="list-item-text">${n.listItem.find(".list-item-text").text()}</div></div>`),n.moveDiv.css({left:`${n.p1.moveX}px`,top:`${n.p1.moveY}px`}),$(n.$el).append(n.moveDiv),$(document).on(n.mousemove,(function(e){e.stopPropagation(),n.p2.moveX=e.clientX||e.originalEvent.touches&&e.originalEvent.touches[0].clientX,n.p2.moveY=e.clientY||e.originalEvent.touches&&e.originalEvent.touches[0].clientY;let t=n.p2.moveX-n.moveDiv.width()/2,o=n.p2.moveY-n.moveDiv.height()/2;n.moveDiv.css({left:t+"px",top:o+"px"})}))}))},appendMoveDiv(e){let t=this;t.listItem.remove();let n=t.moveDiv.attr("idx"),o=$(`<div class="${e.appendItemClassName}" idx="${n}" style="${t.listItemBgCss}"><div class="list-item-text">${t.moveDiv.find(".list-item-text").text()}</div></div>`);o.css({opacity:0}),e.targetList.append(o),e.targetList[e.scrollDirection](t.scrollDistance);let i=o.offset().left,r=o.offset().top;t.animationing=!0,t.moveDiv.css({transition:"all 0.5s",left:i,top:r}).on("transitionend",(function(){t.flag||(t.moveDiv.remove(),t.moveDiv.off("transitionend"),t.moveDiv=null,o.css({opacity:1}),t.answeredNotify(),t.bindDragDomEvent(o,e.op),t.animationing=!1),t.flag=!0}))},bindNextPrevEvent(e){let t=this;$(this.$el).find(`.question-classify .${e}`).on("click",(function(n){n.stopPropagation(),n.preventDefault();let o=$(t.$el).find(".question-classify .list-item"),i=$(t.$el).find(".question-classify .list"),r=o.outerWidth()*("next"===e?1:-1),s=i.scrollLeft();console.log(s),$(t.$el).find(".question-classify .list").stop(!0).animate({scrollLeft:s+r},500)}))},dothings(){let e=this;this.answerMap&&this.answerMap.classify_mapping_list&&this.answerMap.classify_mapping_list.length&&this.setAnswerDo(),e.bindDragDomEvent($(this.$el).find(".question-classify .list-item"),"go"),$(document).on(e.mouseup,(function(t){if(!e.animationing)if("go"===e.dragWay){if($(document).off(e.mousemove),e.listItem&&e.listItem.removeClass("drag"),e.moveDiv){let t=e.getSpecArr();if(0===t.length)e.moveDiv&&(e.moveDiv.remove(),e.moveDiv=null);else{let n=t[0].dom;e.appendMoveDiv({targetList:n.find(".main-append"),appendItemClassName:"append-item",op:"back",scrollDirection:"scrollTop"})}}}else if("back"===e.dragWay&&($(document).off(e.mousemove),e.listItem&&e.listItem.removeClass("drag"),e.moveDiv)){let t=e.getSpecArr();if(0===t.length)e.appendMoveDiv({targetList:$(e.$el).find(".question-classify .list"),appendItemClassName:"list-item",op:"go",scrollDirection:"scrollLeft"});else{let n=t[0].dom,o=e.listItem.parents(".question-classify .box-item");n.get(0)===o.get(0)?(console.log("自己"),e.moveDiv.remove(),e.moveDiv=null,e.listItem&&e.listItem.removeClass("drag")):(console.log("不是自己"),e.appendMoveDiv({targetList:n.find(".main-append"),appendItemClassName:"append-item",op:"back",scrollDirection:"scrollTop"}),console.log("不是自己"))}console.log(t.length)}})),e.bindNextPrevEvent("next"),e.bindNextPrevEvent("prev")},setAnswerDo(){let e=this,t=[];$(this.$el).find(".question-classify .list-item").each(((e,n)=>{t.push(Number($(n).attr("idx")))})),this.answerMap.classify_mapping_list.forEach(((n,o)=>{n.small_type_index_list.forEach((n=>{let i=t.findIndex((e=>e==n));if(i>-1){t.splice(i,1);let n=$(this.$el).find(".question-classify .list-item").eq(i),r=n.attr("idx"),s=$(`<div class="append-item" idx="${r}" style="${e.listItemBgCss}"><div class="list-item-text">${n.find(".list-item-text").text()}</div></div>`);e.bindDragDomEvent(s,"back"),$(this.$el).find(".main-append").eq(o).append(s),n.remove()}}))})),this.answeredNotify()}},components:{}};const Ci=(0,Ge.Z)(Bi,[["render",vi]]);var wi=Ci;let Pi={1:"Question_SingleChoice",2:"Question_MultipleChoice",3:"Question_SingleChoice",7:"Question_BriefAnswer",16:"Question_Programming",11:"Question_Reading",4:"Question_FillBlank",17:"Question_Classify"};var Ei=o(1354),Ii=o(9669),Gi=o.n(Ii),xi=o(7631),Di=o.n(xi);let ki="piw38kulfozrea7ydmjnvbc965q1gt2x",Hi=function(e,t,n,o){void 0!=n&&"undefined"!==typeof n["password"]&&(n["password"]=Di().hex_md5(Di().hex_md5(n["password"]+"FE605C9343A3A47764598FDC184EC66F").toUpperCase()+"FE605C9343A3A47764598FDC184EC66F").toUpperCase());let i=e+"\n/student-web"+t+"\n"+o+"\n"+(n?JSON.stringify(n):""),r=Ei.enc.Base64.stringify((0,Ei.HmacSHA256)(i,ki)),s=function(e){let t=e.replace(/\+/g,"-");t=t.replace(/\//g,"_");let n=t.length%4,o="====";return t+=o.substring(0,n),t};return s(r)};Gi().defaults.baseURL="https://jsl-api.thedeer.cn/student-web/",Gi().defaults.timeout=6e4,Gi().defaults.withCredentials=!0;let Ni=(e,t)=>{if(t&&-1!=t["Content-Type"].indexOf("multipart/form-data")){let t=new FormData;for(let n in e)t.append(n,e[n]);return t}return JSON.stringify(e)},Oi=e=>{e=JSON.parse(e),e.hasOwnProperty("errorCode")&&(e.error_code=e.errorCode);let{error_code:t,message:n}=e;if(t){let e=[39002,39003];if(e.indexOf(t)<=-1){let e=n||"系统异常";Ee.messageTip("warning",e)}}return e};function Li(e,t,n,o,i){let r,s;e=e.toUpperCase(),t+=0===n.indexOf("/")?n.substr(1):n;let a=window.isMock;"undefined"!==typeof i&&"undefined"!==typeof i.isMock&&(a=i.isMock,delete i.isMock),a&&i&&i.onUploadProgress&&delete i.onUploadProgress;let c=n;"/"!==n[0]&&(c="/"+n);let l=(new Date).getTime(),u={ts:l,sign:Hi(e,c,o,l),token:Ee.getToken()};switch(e){case"Get":s=o||{};break;default:case"POST":r=o||{},u["Content-Type"]=i&&i.contentType?i.contentType:"application/json";break}return t instanceof Array?Gi().all([]).then(Gi().spread((function(){}))):Gi()(Object.assign({headers:u,method:e,url:t,data:r,params:s,transformRequest:Ni,transformResponse:Oi},i)).then((e=>e.data)).catch((e=>(console.log("服务端请求/响应错误:",e,e.config),Promise.reject(e))))}const Vi=(e,t,n)=>Li("GET","",e,t,n);let _i={editorUrl:"/open/editor-url"};const Fi={pythonCodeWebPath:"",scratchCodeWebPath:"",cplusCodeWebPath:""};var Ri={namespaced:!0,state:Fi,getters:{},mutations:{setCodeWebPath(e,t){e.pythonCodeWebPath=t.pythonCodeWebPath,e.scratchCodeWebPath=t.scratchCodeWebPath,e.cplusCodeWebPath=t.cplusCodeWebPath}},actions:{getEditorUrlActions({commit:e,dispatch:t}){return new Promise(((t,n)=>{Vi(`${_i.editorUrl}`).then((n=>{let{error_code:o,data:i}=n;if(!o){let{pythonCodeWebPath:t,scratchCodeWebPath:n,cplusCodeWebPath:o}=i;e("setCodeWebPath",{pythonCodeWebPath:t,scratchCodeWebPath:n,cplusCodeWebPath:o})}t(n)}),(e=>{n(e)}))}))}}};function qi(e){return e.registerModule("zykjcommonQuestions",Ri),{install(e){Ee.getVueVersion();e.mixin({methods:{parseQuestionListItem(e,t,n,o=void 0){function i(e,t){e.forEach((e=>{if("img"===e["<>"]&&e.hasOwnProperty("width")){let n=Number(e.width);n>t&&(e.width=Math.floor(t),e.height&&delete e.height)}e.html&&e.html.length&&i(e.html,t)}))}t.forEach(((t,r)=>{if(t.questionComponent=Pi[t.question_type],void 0===o?t.questionIndex=r+1:(t.questionIndex=o+1+"-"+(r+1),t.questionIndex2=r+1),n&&n.hasOwnProperty(t.question_id)){if(t.answerMap=n[t.question_id],"analysis"===e){t.answerMap.user_coding_file&&(t.answerMap.oss_temp_url=t.answerMap.user_coding_file),t.score=t.answerMap.question_max_score;let e=Object.keys(t.answerMap),n=/^user_/gi;e.forEach((e=>{if(n.test(e)){let o=e.replace(n,"");t.answerMap[o]=t.answerMap[e]}}))}}else t.answerMap=null;let s=t.question_type;3==s?t.exam_options_data=[{index:1,data:{name:"正确"}},{index:2,data:{name:"错误"}}]:t.exam_options_data&&t.exam_options_data.length&&t.exam_options_data.forEach(((e,t)=>{e.enIndex=Ee.indexToEnIndex(t+1)}));try{let e=JSON.parse(t.content),n=jQuery(".question-list").width()-30;i(e,n),t.htmlContent=$.json2html({},e)}catch(a){t.htmlContent=t.content}try{t.analysis?t.analysisHtmlContent=$.json2html({},JSON.parse(t.analysis)):t.analysisHtmlContent=""}catch(a){t.analysisHtmlContent=t.analysis}t.sub_questions&&t.sub_questions.length&&this.parseQuestionListItem(e,t.sub_questions,n,r)}))}}}),e.component("Question_SingleChoice",Ne),e.component("Question_MultipleChoice",Tt),e.component("Question_Reading",xt),e.component("Question_BriefAnswer",cn),e.component("Question_FillBlank",bn),e.component("Question_Programming",ui),e.component("Question_Classify",wi)},Question_SingleChoice:Ne,Question_MultipleChoice:Tt,Question_Reading:xt,Question_BriefAnswer:cn,Question_FillBlank:bn,Question_Programming:ui,Question_Classify:wi}}var ji=qi}(),i}()}));
|
package/package.json
CHANGED
package/src/assets/js/rem.js
CHANGED
|
@@ -41,6 +41,8 @@ export let setRemFixedHeight = function(designWidth=1440,repairH = 0,scale=1){
|
|
|
41
41
|
let frameBili = 4 / 3
|
|
42
42
|
let b = frameBili / (winWidth / winHeight)
|
|
43
43
|
let realW = parseInt(winWidth * b)
|
|
44
|
-
|
|
44
|
+
let parent = document.querySelector('.zykjcommon-question')
|
|
45
|
+
parent.style.fontSize = (realW / designWidth) * baseNum * scale + 'px';
|
|
46
|
+
// html.style.fontSize = (realW / designWidth) * baseNum * scale + 'px';
|
|
45
47
|
console.log(html.style.fontSize);
|
|
46
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
$greenItemFontSize:0.
|
|
1
|
+
$greenItemFontSize:0.14em;
|
|
2
2
|
.zykjcommon-question{
|
|
3
3
|
.editor-content{
|
|
4
4
|
margin-top: 10px;
|
|
@@ -345,47 +345,47 @@ $greenItemFontSize:0.14rem;
|
|
|
345
345
|
|
|
346
346
|
.question-classify{
|
|
347
347
|
margin: 0 auto;
|
|
348
|
-
width:
|
|
348
|
+
width: 10em;
|
|
349
349
|
height: 100%;
|
|
350
350
|
position: relative;
|
|
351
351
|
/*background: url("../../img/classify-bg-seaworld.png") no-repeat center;*/
|
|
352
352
|
/*background-size: 100% 100%;*/
|
|
353
353
|
overflow: auto;
|
|
354
354
|
.box{
|
|
355
|
-
padding: 0 0.
|
|
355
|
+
padding: 0 0.8em;
|
|
356
356
|
width: 100%;
|
|
357
357
|
display: flex;
|
|
358
358
|
justify-content: space-between;
|
|
359
|
-
margin-top: 0.
|
|
359
|
+
margin-top: 0.72em;
|
|
360
360
|
}
|
|
361
361
|
.box-item{
|
|
362
|
-
width:
|
|
363
|
-
height: 4.
|
|
362
|
+
width: 4em;
|
|
363
|
+
height: 4.4em;
|
|
364
364
|
display: flex;
|
|
365
365
|
flex-direction: column;
|
|
366
366
|
/*background: url("../../img/classify-boxitem-bg.png") no-repeat center;*/
|
|
367
367
|
/*background-size: 100% 100%;*/
|
|
368
368
|
}
|
|
369
369
|
.main-block{
|
|
370
|
-
margin:0.
|
|
371
|
-
width: 1.
|
|
372
|
-
height: 1.
|
|
370
|
+
margin:0.38em auto 0;
|
|
371
|
+
width: 1.1em;
|
|
372
|
+
height: 1.1em;
|
|
373
373
|
background: #76d2ff;
|
|
374
374
|
border: 1px dashed #ffffff;
|
|
375
|
-
border-radius: 0.
|
|
375
|
+
border-radius: 0.11em;
|
|
376
376
|
flex-shrink: 0;
|
|
377
377
|
img{
|
|
378
378
|
width: 100%;
|
|
379
379
|
height: 100%;
|
|
380
|
-
border-radius: 0.
|
|
380
|
+
border-radius: 0.11em;
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
.main-content{
|
|
384
|
-
padding: 0 0.
|
|
384
|
+
padding: 0 0.28em 0.15em 0.35em;
|
|
385
385
|
flex: 1;
|
|
386
386
|
.main-append{
|
|
387
|
-
/*height: 2.
|
|
388
|
-
height: 2.
|
|
387
|
+
/*height: 2.72em;*/
|
|
388
|
+
height: 2.9em;
|
|
389
389
|
overflow: auto;
|
|
390
390
|
display: flex;
|
|
391
391
|
flex-wrap: wrap;
|
|
@@ -396,50 +396,50 @@ $greenItemFontSize:0.14rem;
|
|
|
396
396
|
.append-item{
|
|
397
397
|
/*background: url("../../img/classify-green-item.png") no-repeat center;
|
|
398
398
|
background-size: 100% 100%;*/
|
|
399
|
-
width: 1.
|
|
400
|
-
height: 1.
|
|
401
|
-
margin-right: 0.
|
|
399
|
+
width: 1.3em;
|
|
400
|
+
height: 1.3em;
|
|
401
|
+
margin-right: 0.1em;
|
|
402
402
|
flex-shrink: 0;
|
|
403
403
|
cursor: move;
|
|
404
404
|
text-align: center;
|
|
405
|
-
font-size: $greenItemFontSize;
|
|
406
405
|
color:rgb(238,252,149);
|
|
407
|
-
padding:0 0.
|
|
406
|
+
padding:0 0.2em;
|
|
408
407
|
display: flex;
|
|
409
408
|
justify-content: center;
|
|
410
409
|
align-items: center;
|
|
411
410
|
line-height: 1.2em;
|
|
412
411
|
/*letter-spacing: 0.8px;*/
|
|
413
412
|
.list-item-text{
|
|
414
|
-
|
|
413
|
+
font-size: $greenItemFontSize;
|
|
414
|
+
margin-top: 0.1em;
|
|
415
415
|
display: inline-block;
|
|
416
416
|
}
|
|
417
417
|
&:nth-child(2n+1){
|
|
418
|
-
margin-left: 0.
|
|
418
|
+
margin-left: 0.2em;
|
|
419
419
|
}
|
|
420
420
|
&:nth-child(2n){
|
|
421
|
-
margin-right: 0.
|
|
421
|
+
margin-right: 0.2em;
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
.list-outter{
|
|
425
|
-
padding: 0 0.
|
|
426
|
-
height: 1.
|
|
425
|
+
padding: 0 0.33em;
|
|
426
|
+
height: 1.5em;
|
|
427
427
|
position: absolute;
|
|
428
|
-
bottom: 0.
|
|
428
|
+
bottom: 0.2em;
|
|
429
429
|
left:50%;
|
|
430
|
-
margin-left: -4.
|
|
431
|
-
width:
|
|
430
|
+
margin-left: -4.5em;
|
|
431
|
+
width: 9em;
|
|
432
432
|
/*background: url("../../img/classify-list-bg.png") no-repeat center;*/
|
|
433
433
|
/*background-size: 100% 100%;*/
|
|
434
434
|
.list{
|
|
435
|
-
height: 1.
|
|
435
|
+
height: 1.5em;
|
|
436
436
|
display: flex;
|
|
437
437
|
align-items: center;
|
|
438
438
|
overflow-x: auto;
|
|
439
439
|
width: 100%;
|
|
440
440
|
}
|
|
441
441
|
.prev,.next{
|
|
442
|
-
width: 0.
|
|
442
|
+
width: 0.24em;
|
|
443
443
|
height: 100%;
|
|
444
444
|
display: flex;
|
|
445
445
|
align-items: center;
|
|
@@ -454,8 +454,8 @@ $greenItemFontSize:0.14rem;
|
|
|
454
454
|
right:5px;
|
|
455
455
|
}
|
|
456
456
|
.prev-main,.next-main{
|
|
457
|
-
width: 0.
|
|
458
|
-
height: 0.
|
|
457
|
+
width: 0.24em;
|
|
458
|
+
height: 0.28em;
|
|
459
459
|
top:50%;
|
|
460
460
|
}
|
|
461
461
|
.prev-main{
|
|
@@ -470,22 +470,22 @@ $greenItemFontSize:0.14rem;
|
|
|
470
470
|
.list-item{
|
|
471
471
|
/*background: url("../../img/classify-green-item.png") no-repeat center;
|
|
472
472
|
background-size: 100% 100%;*/
|
|
473
|
-
width: 1.
|
|
474
|
-
height: 1.
|
|
475
|
-
margin-right: 0.
|
|
473
|
+
width: 1.3em;
|
|
474
|
+
height: 1.3em;
|
|
475
|
+
margin-right: 0.1em;
|
|
476
476
|
flex-shrink: 0;
|
|
477
477
|
cursor: move;
|
|
478
478
|
text-align: center;
|
|
479
|
-
font-size: $greenItemFontSize;
|
|
480
479
|
color:rgb(238,252,149);
|
|
481
|
-
padding:0 0.
|
|
480
|
+
padding:0 0.2em;
|
|
482
481
|
display: flex;
|
|
483
482
|
justify-content: center;
|
|
484
483
|
align-items: center;
|
|
485
484
|
line-height: 1.2em;
|
|
486
485
|
/*letter-spacing: 0.8px;*/
|
|
487
486
|
.list-item-text{
|
|
488
|
-
|
|
487
|
+
font-size: $greenItemFontSize;
|
|
488
|
+
margin-top: 0.1em;
|
|
489
489
|
display: inline-block;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
@@ -497,6 +497,29 @@ $greenItemFontSize:0.14rem;
|
|
|
497
497
|
}
|
|
498
498
|
|
|
499
499
|
}
|
|
500
|
+
.question-classify-moveDiv{
|
|
501
|
+
position: fixed;
|
|
502
|
+
/*background: url("../../img/classify-green-item.png") no-repeat center;
|
|
503
|
+
background-size: 100% 100%;*/
|
|
504
|
+
width: 1.3em;
|
|
505
|
+
height: 1.3em;
|
|
506
|
+
margin-right: 0.1em;
|
|
507
|
+
flex-shrink: 0;
|
|
508
|
+
cursor: move;
|
|
509
|
+
text-align: center;
|
|
510
|
+
color:rgb(238,252,149);
|
|
511
|
+
padding:0 0.2em;
|
|
512
|
+
display: flex;
|
|
513
|
+
justify-content: center;
|
|
514
|
+
align-items: center;
|
|
515
|
+
line-height: 1.2em;
|
|
516
|
+
/*letter-spacing: 0.8px;*/
|
|
517
|
+
.list-item-text{
|
|
518
|
+
font-size: $greenItemFontSize;
|
|
519
|
+
display: inline-block;
|
|
520
|
+
margin-top: 0.1em;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
500
523
|
}
|
|
501
524
|
|
|
502
525
|
.imgLookerDialog{
|
|
@@ -574,27 +597,4 @@ $greenItemFontSize:0.14rem;
|
|
|
574
597
|
&:hover {
|
|
575
598
|
background-color: #fff;
|
|
576
599
|
}
|
|
577
|
-
}
|
|
578
|
-
.question-classify-moveDiv{
|
|
579
|
-
position: fixed;
|
|
580
|
-
/*background: url("../../img/classify-green-item.png") no-repeat center;
|
|
581
|
-
background-size: 100% 100%;*/
|
|
582
|
-
width: 1.3rem;
|
|
583
|
-
height: 1.3rem;
|
|
584
|
-
margin-right: 0.1rem;
|
|
585
|
-
flex-shrink: 0;
|
|
586
|
-
cursor: move;
|
|
587
|
-
text-align: center;
|
|
588
|
-
font-size: $greenItemFontSize;
|
|
589
|
-
color:rgb(238,252,149);
|
|
590
|
-
padding:0 0.2rem;
|
|
591
|
-
display: flex;
|
|
592
|
-
justify-content: center;
|
|
593
|
-
align-items: center;
|
|
594
|
-
line-height: 1.2em;
|
|
595
|
-
/*letter-spacing: 0.8px;*/
|
|
596
|
-
.list-item-text{
|
|
597
|
-
display: inline-block;
|
|
598
|
-
margin-top: 0.1rem;
|
|
599
|
-
}
|
|
600
600
|
}
|