@zykjcommon/questions 0.0.30 → 0.0.32
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 +144 -124
- package/dist/zykjcommon-questions.umd.js +144 -124
- package/dist/zykjcommon-questions.umd.min.js +3 -3
- package/package.json +1 -1
- package/src/components/questions/Question_Classify.vue +19 -3
- package/src/components/questions/buildEntry.js +99 -97
- package/src/components/questions/developmentEntry.js +99 -97
|
@@ -23814,73 +23814,75 @@ var index = {
|
|
|
23814
23814
|
const Question_Programming_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(Question_Programmingvue_type_script_lang_js, [['render',Question_Programmingvue_type_template_id_411b6dae_render]])
|
|
23815
23815
|
|
|
23816
23816
|
/* harmony default export */ var Question_Programming = (Question_Programming_exports_);
|
|
23817
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[4]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/questions/Question_Classify.vue?vue&type=template&id=
|
|
23817
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[4]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/questions/Question_Classify.vue?vue&type=template&id=1a39958b
|
|
23818
23818
|
|
|
23819
|
-
var
|
|
23819
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_1 = {
|
|
23820
23820
|
class: "zykjcommon-question",
|
|
23821
23821
|
style: {
|
|
23822
23822
|
"width": "100%",
|
|
23823
23823
|
"height": "100%"
|
|
23824
23824
|
}
|
|
23825
23825
|
};
|
|
23826
|
-
var
|
|
23826
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_2 = {
|
|
23827
23827
|
class: "box"
|
|
23828
23828
|
};
|
|
23829
|
-
var
|
|
23829
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_3 = {
|
|
23830
23830
|
class: "main-block"
|
|
23831
23831
|
};
|
|
23832
|
-
var
|
|
23833
|
-
var
|
|
23832
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_4 = ["src"];
|
|
23833
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_5 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23834
23834
|
class: "main-content"
|
|
23835
23835
|
}, [/*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23836
23836
|
class: "main-append"
|
|
23837
23837
|
})], -1);
|
|
23838
|
-
var
|
|
23838
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_6 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23839
23839
|
class: "prev"
|
|
23840
23840
|
}, [/*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23841
23841
|
class: "prev-main"
|
|
23842
23842
|
})], -1);
|
|
23843
|
-
var
|
|
23843
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_7 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23844
23844
|
class: "next"
|
|
23845
23845
|
}, [/*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23846
23846
|
class: "next-main"
|
|
23847
23847
|
})], -1);
|
|
23848
|
-
var
|
|
23848
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_8 = {
|
|
23849
23849
|
class: "list"
|
|
23850
23850
|
};
|
|
23851
|
-
var
|
|
23852
|
-
var
|
|
23851
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_9 = ["idx"];
|
|
23852
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_10 = {
|
|
23853
23853
|
class: "list-item-text"
|
|
23854
23854
|
};
|
|
23855
|
-
function
|
|
23856
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div",
|
|
23855
|
+
function Question_Classifyvue_type_template_id_1a39958b_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
23856
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", Question_Classifyvue_type_template_id_1a39958b_hoisted_1, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23857
23857
|
class: "question-classify",
|
|
23858
23858
|
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)($data.bigBgCss)
|
|
23859
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div",
|
|
23859
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", Question_Classifyvue_type_template_id_1a39958b_hoisted_2, [((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)(external_commonjs_vue_commonjs2_vue_root_Vue_.Fragment, null, (0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderList)($data.bigBoxItemList, function (item, index) {
|
|
23860
23860
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
|
|
23861
23861
|
class: "box-item",
|
|
23862
23862
|
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)(item.bgUrlCss),
|
|
23863
23863
|
key: index
|
|
23864
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div",
|
|
23864
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", Question_Classifyvue_type_template_id_1a39958b_hoisted_3, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("img", {
|
|
23865
23865
|
src: item.imgUrl,
|
|
23866
23866
|
alt: ""
|
|
23867
|
-
}, null, 8,
|
|
23867
|
+
}, null, 8, Question_Classifyvue_type_template_id_1a39958b_hoisted_4)]), Question_Classifyvue_type_template_id_1a39958b_hoisted_5], 4);
|
|
23868
23868
|
}), 128))]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23869
23869
|
class: "list-outter",
|
|
23870
23870
|
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)($data.bottomBgCss)
|
|
23871
|
-
}, [
|
|
23871
|
+
}, [Question_Classifyvue_type_template_id_1a39958b_hoisted_6, Question_Classifyvue_type_template_id_1a39958b_hoisted_7, (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", Question_Classifyvue_type_template_id_1a39958b_hoisted_8, [((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)(external_commonjs_vue_commonjs2_vue_root_Vue_.Fragment, null, (0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderList)($data.optionList, function (item, index) {
|
|
23872
23872
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
|
|
23873
23873
|
class: "list-item",
|
|
23874
23874
|
idx: item.idx,
|
|
23875
23875
|
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)(item.bgUrlCss),
|
|
23876
23876
|
key: index
|
|
23877
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div",
|
|
23877
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", Question_Classifyvue_type_template_id_1a39958b_hoisted_10, (0,external_commonjs_vue_commonjs2_vue_root_Vue_.toDisplayString)(item.content), 1)], 12, Question_Classifyvue_type_template_id_1a39958b_hoisted_9);
|
|
23878
23878
|
}), 128))])], 4)], 4)]);
|
|
23879
23879
|
}
|
|
23880
|
-
;// CONCATENATED MODULE: ./src/components/questions/Question_Classify.vue?vue&type=template&id=
|
|
23880
|
+
;// CONCATENATED MODULE: ./src/components/questions/Question_Classify.vue?vue&type=template&id=1a39958b
|
|
23881
23881
|
|
|
23882
23882
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
|
|
23883
23883
|
var es_array_sort = __webpack_require__(2707);
|
|
23884
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
|
|
23885
|
+
var es_promise = __webpack_require__(8674);
|
|
23884
23886
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find-index.js
|
|
23885
23887
|
var es_array_find_index = __webpack_require__(4553);
|
|
23886
23888
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
|
|
@@ -23946,6 +23948,7 @@ var setRemFixedHeight = function setRemFixedHeight() {
|
|
|
23946
23948
|
|
|
23947
23949
|
|
|
23948
23950
|
|
|
23951
|
+
|
|
23949
23952
|
var env = js_fun.getDeviceEnv();
|
|
23950
23953
|
/* harmony default export */ var Question_Classifyvue_type_script_lang_js = ({
|
|
23951
23954
|
name: 'Question_Classify',
|
|
@@ -23983,8 +23986,10 @@ var env = js_fun.getDeviceEnv();
|
|
|
23983
23986
|
},
|
|
23984
23987
|
mounted: function mounted() {
|
|
23985
23988
|
var _this = this;
|
|
23986
|
-
this.
|
|
23987
|
-
|
|
23989
|
+
this.intervalFindEl().then(function () {
|
|
23990
|
+
_this.setRootFontSize();
|
|
23991
|
+
window.addEventListener('resize', _this.setRootFontSize);
|
|
23992
|
+
});
|
|
23988
23993
|
this.init();
|
|
23989
23994
|
this.$watch('optionList', function (nv) {
|
|
23990
23995
|
if (nv && nv.length) {
|
|
@@ -24080,6 +24085,21 @@ var env = js_fun.getDeviceEnv();
|
|
|
24080
24085
|
var correct = this.questionInfo.answerMap.is_correct === '1' ? true : false;
|
|
24081
24086
|
return correct;
|
|
24082
24087
|
},
|
|
24088
|
+
intervalFindEl: function intervalFindEl() {
|
|
24089
|
+
var _this2 = this;
|
|
24090
|
+
return new Promise(function (resolve, reject) {
|
|
24091
|
+
if (_this2.$el) {
|
|
24092
|
+
resolve();
|
|
24093
|
+
} else {
|
|
24094
|
+
var interval = setInterval(function () {
|
|
24095
|
+
if (_this2.$el) {
|
|
24096
|
+
clearInterval(interval);
|
|
24097
|
+
resolve();
|
|
24098
|
+
}
|
|
24099
|
+
}, 50);
|
|
24100
|
+
}
|
|
24101
|
+
});
|
|
24102
|
+
},
|
|
24083
24103
|
parseLists: function parseLists(nv) {
|
|
24084
24104
|
this.classify_question_info = nv.classify_question_info;
|
|
24085
24105
|
var exam_options_data = nv.exam_options_data;
|
|
@@ -24323,7 +24343,7 @@ var env = js_fun.getDeviceEnv();
|
|
|
24323
24343
|
},
|
|
24324
24344
|
//回显答案
|
|
24325
24345
|
setAnswerDo: function setAnswerDo() {
|
|
24326
|
-
var
|
|
24346
|
+
var _this3 = this;
|
|
24327
24347
|
var self = this;
|
|
24328
24348
|
var listItemIds = [];
|
|
24329
24349
|
$(this.$el).find('.question-classify .list-item').each(function (index, item) {
|
|
@@ -24337,11 +24357,11 @@ var env = js_fun.getDeviceEnv();
|
|
|
24337
24357
|
if (idx > -1) {
|
|
24338
24358
|
//找到一个删掉一个,要不会有问题
|
|
24339
24359
|
listItemIds.splice(idx, 1);
|
|
24340
|
-
var listItemDom = $(
|
|
24360
|
+
var listItemDom = $(_this3.$el).find('.question-classify .list-item').eq(idx);
|
|
24341
24361
|
var attrIdx = listItemDom.attr('idx');
|
|
24342
24362
|
var appendItem = $("<div class=\"append-item\" idx=\"".concat(attrIdx, "\" style=\"").concat(self.listItemBgCss, "\"><div class=\"list-item-text\">").concat(listItemDom.find('.list-item-text').text(), "</div></div>"));
|
|
24343
24363
|
self.bindDragDomEvent(appendItem, 'back');
|
|
24344
|
-
$(
|
|
24364
|
+
$(_this3.$el).find('.main-append').eq(index).append(appendItem);
|
|
24345
24365
|
listItemDom.remove();
|
|
24346
24366
|
}
|
|
24347
24367
|
});
|
|
@@ -24359,7 +24379,7 @@ var env = js_fun.getDeviceEnv();
|
|
|
24359
24379
|
|
|
24360
24380
|
|
|
24361
24381
|
;
|
|
24362
|
-
const Question_Classify_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(Question_Classifyvue_type_script_lang_js, [['render',
|
|
24382
|
+
const Question_Classify_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(Question_Classifyvue_type_script_lang_js, [['render',Question_Classifyvue_type_template_id_1a39958b_render]])
|
|
24363
24383
|
|
|
24364
24384
|
/* harmony default export */ var Question_Classify = (Question_Classify_exports_);
|
|
24365
24385
|
;// CONCATENATED MODULE: ./src/components/questions/const.js
|
|
@@ -24384,8 +24404,6 @@ var questionMapper = {
|
|
|
24384
24404
|
//填空
|
|
24385
24405
|
'17': 'Question_Classify' //分类
|
|
24386
24406
|
};
|
|
24387
|
-
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
|
|
24388
|
-
var es_promise = __webpack_require__(8674);
|
|
24389
24407
|
// EXTERNAL MODULE: ./node_modules/crypto-js/index.js
|
|
24390
24408
|
var crypto_js = __webpack_require__(1354);
|
|
24391
24409
|
// EXTERNAL MODULE: ./node_modules/axios/index.js
|
|
@@ -24692,6 +24710,103 @@ var state = {
|
|
|
24692
24710
|
|
|
24693
24711
|
|
|
24694
24712
|
|
|
24713
|
+
var parseQuestionListItem = function parseQuestionListItem(mode, question_list, answer_map) {
|
|
24714
|
+
var _this = this;
|
|
24715
|
+
var parentIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
24716
|
+
function parseContent(arr, contentWidth) {
|
|
24717
|
+
arr.forEach(function (item) {
|
|
24718
|
+
if (item['<>'] === 'img') {
|
|
24719
|
+
if (item.hasOwnProperty('width')) {
|
|
24720
|
+
var width = Number(item.width);
|
|
24721
|
+
if (width > contentWidth) {
|
|
24722
|
+
item.width = Math.floor(contentWidth);
|
|
24723
|
+
item.height && delete item.height;
|
|
24724
|
+
}
|
|
24725
|
+
}
|
|
24726
|
+
}
|
|
24727
|
+
if (item.html && item.html.length) {
|
|
24728
|
+
parseContent(item.html, contentWidth);
|
|
24729
|
+
}
|
|
24730
|
+
});
|
|
24731
|
+
}
|
|
24732
|
+
question_list.forEach(function (item, index) {
|
|
24733
|
+
item.questionComponent = questionMapper[item.question_type];
|
|
24734
|
+
// item.questionIndex = index + 1
|
|
24735
|
+
if (parentIndex === undefined) {
|
|
24736
|
+
item.questionIndex = index + 1;
|
|
24737
|
+
} else {
|
|
24738
|
+
item.questionIndex = parentIndex + 1 + '-' + (index + 1);
|
|
24739
|
+
item.questionIndex2 = index + 1;
|
|
24740
|
+
}
|
|
24741
|
+
if (answer_map && answer_map.hasOwnProperty(item.question_id)) {
|
|
24742
|
+
item.answerMap = answer_map[item.question_id];
|
|
24743
|
+
if (mode === 'analysis') {
|
|
24744
|
+
//analysis页面特殊处理
|
|
24745
|
+
if (item.answerMap.user_coding_file) {
|
|
24746
|
+
item.answerMap.oss_temp_url = item.answerMap.user_coding_file;
|
|
24747
|
+
}
|
|
24748
|
+
//analysis页面特殊处理score字段为 answerMap.question_max_score
|
|
24749
|
+
item.score = item.answerMap.question_max_score;
|
|
24750
|
+
//预览接口学生答案以user_开头,为适配考试的学生答案,做处理
|
|
24751
|
+
var answerMapKeys = Object.keys(item.answerMap);
|
|
24752
|
+
var reg = /^user_/ig;
|
|
24753
|
+
answerMapKeys.forEach(function (answerMapKeysItem) {
|
|
24754
|
+
if (reg.test(answerMapKeysItem)) {
|
|
24755
|
+
var newProp = answerMapKeysItem.replace(reg, '');
|
|
24756
|
+
item.answerMap[newProp] = item.answerMap[answerMapKeysItem];
|
|
24757
|
+
}
|
|
24758
|
+
});
|
|
24759
|
+
}
|
|
24760
|
+
} else {
|
|
24761
|
+
item.answerMap = null;
|
|
24762
|
+
}
|
|
24763
|
+
var question_type = item.question_type;
|
|
24764
|
+
if (question_type == 3) {
|
|
24765
|
+
//判断题手动构造选项数组
|
|
24766
|
+
item.exam_options_data = [{
|
|
24767
|
+
index: 1,
|
|
24768
|
+
data: {
|
|
24769
|
+
name: '正确'
|
|
24770
|
+
}
|
|
24771
|
+
}, {
|
|
24772
|
+
index: 2,
|
|
24773
|
+
data: {
|
|
24774
|
+
name: '错误'
|
|
24775
|
+
}
|
|
24776
|
+
}];
|
|
24777
|
+
} else {
|
|
24778
|
+
if (item.exam_options_data && item.exam_options_data.length) {
|
|
24779
|
+
item.exam_options_data.forEach(function (subItem, subIndex) {
|
|
24780
|
+
subItem.enIndex = js_fun.indexToEnIndex(subIndex + 1);
|
|
24781
|
+
});
|
|
24782
|
+
}
|
|
24783
|
+
}
|
|
24784
|
+
//转化content富文本
|
|
24785
|
+
try {
|
|
24786
|
+
var contentArr = JSON.parse(item.content);
|
|
24787
|
+
var contentWidth = jQuery('.question-list').width() - 30;
|
|
24788
|
+
//图片宽度超出框架的时候把宽度设置成框架大小
|
|
24789
|
+
parseContent(contentArr, contentWidth);
|
|
24790
|
+
item.htmlContent = $.json2html({}, contentArr);
|
|
24791
|
+
} catch (e) {
|
|
24792
|
+
item.htmlContent = item.content;
|
|
24793
|
+
}
|
|
24794
|
+
//转化analysis富文本
|
|
24795
|
+
try {
|
|
24796
|
+
if (item.analysis) {
|
|
24797
|
+
item.analysisHtmlContent = $.json2html({}, JSON.parse(item.analysis));
|
|
24798
|
+
} else {
|
|
24799
|
+
item.analysisHtmlContent = '';
|
|
24800
|
+
}
|
|
24801
|
+
} catch (e) {
|
|
24802
|
+
item.analysisHtmlContent = item.analysis;
|
|
24803
|
+
}
|
|
24804
|
+
//如果是阅读题要递归解析
|
|
24805
|
+
if (item.sub_questions && item.sub_questions.length) {
|
|
24806
|
+
_this.parseQuestionListItem(mode, item.sub_questions, answer_map, index);
|
|
24807
|
+
}
|
|
24808
|
+
});
|
|
24809
|
+
};
|
|
24695
24810
|
/* harmony default export */ function buildEntry(store) {
|
|
24696
24811
|
//动态注册store
|
|
24697
24812
|
store.registerModule('zykjcommonQuestions', questions_store);
|
|
@@ -24701,103 +24816,7 @@ var state = {
|
|
|
24701
24816
|
Vue.mixin({
|
|
24702
24817
|
methods: {
|
|
24703
24818
|
//公共解析questionItem方法
|
|
24704
|
-
parseQuestionListItem:
|
|
24705
|
-
var _this = this;
|
|
24706
|
-
var parentIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
24707
|
-
function parseContent(arr, contentWidth) {
|
|
24708
|
-
arr.forEach(function (item) {
|
|
24709
|
-
if (item['<>'] === 'img') {
|
|
24710
|
-
if (item.hasOwnProperty('width')) {
|
|
24711
|
-
var width = Number(item.width);
|
|
24712
|
-
if (width > contentWidth) {
|
|
24713
|
-
item.width = Math.floor(contentWidth);
|
|
24714
|
-
item.height && delete item.height;
|
|
24715
|
-
}
|
|
24716
|
-
}
|
|
24717
|
-
}
|
|
24718
|
-
if (item.html && item.html.length) {
|
|
24719
|
-
parseContent(item.html, contentWidth);
|
|
24720
|
-
}
|
|
24721
|
-
});
|
|
24722
|
-
}
|
|
24723
|
-
question_list.forEach(function (item, index) {
|
|
24724
|
-
item.questionComponent = questionMapper[item.question_type];
|
|
24725
|
-
// item.questionIndex = index + 1
|
|
24726
|
-
if (parentIndex === undefined) {
|
|
24727
|
-
item.questionIndex = index + 1;
|
|
24728
|
-
} else {
|
|
24729
|
-
item.questionIndex = parentIndex + 1 + '-' + (index + 1);
|
|
24730
|
-
item.questionIndex2 = index + 1;
|
|
24731
|
-
}
|
|
24732
|
-
if (answer_map && answer_map.hasOwnProperty(item.question_id)) {
|
|
24733
|
-
item.answerMap = answer_map[item.question_id];
|
|
24734
|
-
if (mode === 'analysis') {
|
|
24735
|
-
//analysis页面特殊处理
|
|
24736
|
-
if (item.answerMap.user_coding_file) {
|
|
24737
|
-
item.answerMap.oss_temp_url = item.answerMap.user_coding_file;
|
|
24738
|
-
}
|
|
24739
|
-
//analysis页面特殊处理score字段为 answerMap.question_max_score
|
|
24740
|
-
item.score = item.answerMap.question_max_score;
|
|
24741
|
-
//预览接口学生答案以user_开头,为适配考试的学生答案,做处理
|
|
24742
|
-
var answerMapKeys = Object.keys(item.answerMap);
|
|
24743
|
-
var reg = /^user_/ig;
|
|
24744
|
-
answerMapKeys.forEach(function (answerMapKeysItem) {
|
|
24745
|
-
if (reg.test(answerMapKeysItem)) {
|
|
24746
|
-
var newProp = answerMapKeysItem.replace(reg, '');
|
|
24747
|
-
item.answerMap[newProp] = item.answerMap[answerMapKeysItem];
|
|
24748
|
-
}
|
|
24749
|
-
});
|
|
24750
|
-
}
|
|
24751
|
-
} else {
|
|
24752
|
-
item.answerMap = null;
|
|
24753
|
-
}
|
|
24754
|
-
var question_type = item.question_type;
|
|
24755
|
-
if (question_type == 3) {
|
|
24756
|
-
//判断题手动构造选项数组
|
|
24757
|
-
item.exam_options_data = [{
|
|
24758
|
-
index: 1,
|
|
24759
|
-
data: {
|
|
24760
|
-
name: '正确'
|
|
24761
|
-
}
|
|
24762
|
-
}, {
|
|
24763
|
-
index: 2,
|
|
24764
|
-
data: {
|
|
24765
|
-
name: '错误'
|
|
24766
|
-
}
|
|
24767
|
-
}];
|
|
24768
|
-
} else {
|
|
24769
|
-
if (item.exam_options_data && item.exam_options_data.length) {
|
|
24770
|
-
item.exam_options_data.forEach(function (subItem, subIndex) {
|
|
24771
|
-
subItem.enIndex = js_fun.indexToEnIndex(subIndex + 1);
|
|
24772
|
-
});
|
|
24773
|
-
}
|
|
24774
|
-
}
|
|
24775
|
-
//转化content富文本
|
|
24776
|
-
try {
|
|
24777
|
-
var contentArr = JSON.parse(item.content);
|
|
24778
|
-
var contentWidth = jQuery('.question-list').width() - 30;
|
|
24779
|
-
//图片宽度超出框架的时候把宽度设置成框架大小
|
|
24780
|
-
parseContent(contentArr, contentWidth);
|
|
24781
|
-
item.htmlContent = $.json2html({}, contentArr);
|
|
24782
|
-
} catch (e) {
|
|
24783
|
-
item.htmlContent = item.content;
|
|
24784
|
-
}
|
|
24785
|
-
//转化analysis富文本
|
|
24786
|
-
try {
|
|
24787
|
-
if (item.analysis) {
|
|
24788
|
-
item.analysisHtmlContent = $.json2html({}, JSON.parse(item.analysis));
|
|
24789
|
-
} else {
|
|
24790
|
-
item.analysisHtmlContent = '';
|
|
24791
|
-
}
|
|
24792
|
-
} catch (e) {
|
|
24793
|
-
item.analysisHtmlContent = item.analysis;
|
|
24794
|
-
}
|
|
24795
|
-
//如果是阅读题要递归解析
|
|
24796
|
-
if (item.sub_questions && item.sub_questions.length) {
|
|
24797
|
-
_this.parseQuestionListItem(mode, item.sub_questions, answer_map, index);
|
|
24798
|
-
}
|
|
24799
|
-
});
|
|
24800
|
-
}
|
|
24819
|
+
parseQuestionListItem: parseQuestionListItem
|
|
24801
24820
|
}
|
|
24802
24821
|
});
|
|
24803
24822
|
Vue.component('Question_SingleChoice', Question_SingleChoice);
|
|
@@ -24808,6 +24827,7 @@ var state = {
|
|
|
24808
24827
|
Vue.component('Question_Programming', Question_Programming);
|
|
24809
24828
|
Vue.component('Question_Classify', Question_Classify);
|
|
24810
24829
|
},
|
|
24830
|
+
parseQuestionListItem: parseQuestionListItem,
|
|
24811
24831
|
questionMapper: questionMapper,
|
|
24812
24832
|
Question_SingleChoice: Question_SingleChoice,
|
|
24813
24833
|
Question_MultipleChoice: Question_MultipleChoice,
|