@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
|
@@ -23824,73 +23824,75 @@ var index = {
|
|
|
23824
23824
|
const Question_Programming_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(Question_Programmingvue_type_script_lang_js, [['render',Question_Programmingvue_type_template_id_411b6dae_render]])
|
|
23825
23825
|
|
|
23826
23826
|
/* harmony default export */ var Question_Programming = (Question_Programming_exports_);
|
|
23827
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-86.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=
|
|
23827
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-86.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
|
|
23828
23828
|
|
|
23829
|
-
var
|
|
23829
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_1 = {
|
|
23830
23830
|
class: "zykjcommon-question",
|
|
23831
23831
|
style: {
|
|
23832
23832
|
"width": "100%",
|
|
23833
23833
|
"height": "100%"
|
|
23834
23834
|
}
|
|
23835
23835
|
};
|
|
23836
|
-
var
|
|
23836
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_2 = {
|
|
23837
23837
|
class: "box"
|
|
23838
23838
|
};
|
|
23839
|
-
var
|
|
23839
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_3 = {
|
|
23840
23840
|
class: "main-block"
|
|
23841
23841
|
};
|
|
23842
|
-
var
|
|
23843
|
-
var
|
|
23842
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_4 = ["src"];
|
|
23843
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_5 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23844
23844
|
class: "main-content"
|
|
23845
23845
|
}, [/*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23846
23846
|
class: "main-append"
|
|
23847
23847
|
})], -1);
|
|
23848
|
-
var
|
|
23848
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_6 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23849
23849
|
class: "prev"
|
|
23850
23850
|
}, [/*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23851
23851
|
class: "prev-main"
|
|
23852
23852
|
})], -1);
|
|
23853
|
-
var
|
|
23853
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_7 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23854
23854
|
class: "next"
|
|
23855
23855
|
}, [/*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23856
23856
|
class: "next-main"
|
|
23857
23857
|
})], -1);
|
|
23858
|
-
var
|
|
23858
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_8 = {
|
|
23859
23859
|
class: "list"
|
|
23860
23860
|
};
|
|
23861
|
-
var
|
|
23862
|
-
var
|
|
23861
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_9 = ["idx"];
|
|
23862
|
+
var Question_Classifyvue_type_template_id_1a39958b_hoisted_10 = {
|
|
23863
23863
|
class: "list-item-text"
|
|
23864
23864
|
};
|
|
23865
|
-
function
|
|
23866
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div",
|
|
23865
|
+
function Question_Classifyvue_type_template_id_1a39958b_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
23866
|
+
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", {
|
|
23867
23867
|
class: "question-classify",
|
|
23868
23868
|
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)($data.bigBgCss)
|
|
23869
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div",
|
|
23869
|
+
}, [(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) {
|
|
23870
23870
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
|
|
23871
23871
|
class: "box-item",
|
|
23872
23872
|
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)(item.bgUrlCss),
|
|
23873
23873
|
key: index
|
|
23874
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div",
|
|
23874
|
+
}, [(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", {
|
|
23875
23875
|
src: item.imgUrl,
|
|
23876
23876
|
alt: ""
|
|
23877
|
-
}, null, 8,
|
|
23877
|
+
}, null, 8, Question_Classifyvue_type_template_id_1a39958b_hoisted_4)]), Question_Classifyvue_type_template_id_1a39958b_hoisted_5], 4);
|
|
23878
23878
|
}), 128))]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
|
|
23879
23879
|
class: "list-outter",
|
|
23880
23880
|
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)($data.bottomBgCss)
|
|
23881
|
-
}, [
|
|
23881
|
+
}, [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) {
|
|
23882
23882
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", {
|
|
23883
23883
|
class: "list-item",
|
|
23884
23884
|
idx: item.idx,
|
|
23885
23885
|
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.normalizeStyle)(item.bgUrlCss),
|
|
23886
23886
|
key: index
|
|
23887
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div",
|
|
23887
|
+
}, [(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);
|
|
23888
23888
|
}), 128))])], 4)], 4)]);
|
|
23889
23889
|
}
|
|
23890
|
-
;// CONCATENATED MODULE: ./src/components/questions/Question_Classify.vue?vue&type=template&id=
|
|
23890
|
+
;// CONCATENATED MODULE: ./src/components/questions/Question_Classify.vue?vue&type=template&id=1a39958b
|
|
23891
23891
|
|
|
23892
23892
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
|
|
23893
23893
|
var es_array_sort = __webpack_require__(2707);
|
|
23894
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
|
|
23895
|
+
var es_promise = __webpack_require__(8674);
|
|
23894
23896
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find-index.js
|
|
23895
23897
|
var es_array_find_index = __webpack_require__(4553);
|
|
23896
23898
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
|
|
@@ -23956,6 +23958,7 @@ var setRemFixedHeight = function setRemFixedHeight() {
|
|
|
23956
23958
|
|
|
23957
23959
|
|
|
23958
23960
|
|
|
23961
|
+
|
|
23959
23962
|
var env = js_fun.getDeviceEnv();
|
|
23960
23963
|
/* harmony default export */ var Question_Classifyvue_type_script_lang_js = ({
|
|
23961
23964
|
name: 'Question_Classify',
|
|
@@ -23993,8 +23996,10 @@ var env = js_fun.getDeviceEnv();
|
|
|
23993
23996
|
},
|
|
23994
23997
|
mounted: function mounted() {
|
|
23995
23998
|
var _this = this;
|
|
23996
|
-
this.
|
|
23997
|
-
|
|
23999
|
+
this.intervalFindEl().then(function () {
|
|
24000
|
+
_this.setRootFontSize();
|
|
24001
|
+
window.addEventListener('resize', _this.setRootFontSize);
|
|
24002
|
+
});
|
|
23998
24003
|
this.init();
|
|
23999
24004
|
this.$watch('optionList', function (nv) {
|
|
24000
24005
|
if (nv && nv.length) {
|
|
@@ -24090,6 +24095,21 @@ var env = js_fun.getDeviceEnv();
|
|
|
24090
24095
|
var correct = this.questionInfo.answerMap.is_correct === '1' ? true : false;
|
|
24091
24096
|
return correct;
|
|
24092
24097
|
},
|
|
24098
|
+
intervalFindEl: function intervalFindEl() {
|
|
24099
|
+
var _this2 = this;
|
|
24100
|
+
return new Promise(function (resolve, reject) {
|
|
24101
|
+
if (_this2.$el) {
|
|
24102
|
+
resolve();
|
|
24103
|
+
} else {
|
|
24104
|
+
var interval = setInterval(function () {
|
|
24105
|
+
if (_this2.$el) {
|
|
24106
|
+
clearInterval(interval);
|
|
24107
|
+
resolve();
|
|
24108
|
+
}
|
|
24109
|
+
}, 50);
|
|
24110
|
+
}
|
|
24111
|
+
});
|
|
24112
|
+
},
|
|
24093
24113
|
parseLists: function parseLists(nv) {
|
|
24094
24114
|
this.classify_question_info = nv.classify_question_info;
|
|
24095
24115
|
var exam_options_data = nv.exam_options_data;
|
|
@@ -24333,7 +24353,7 @@ var env = js_fun.getDeviceEnv();
|
|
|
24333
24353
|
},
|
|
24334
24354
|
//回显答案
|
|
24335
24355
|
setAnswerDo: function setAnswerDo() {
|
|
24336
|
-
var
|
|
24356
|
+
var _this3 = this;
|
|
24337
24357
|
var self = this;
|
|
24338
24358
|
var listItemIds = [];
|
|
24339
24359
|
$(this.$el).find('.question-classify .list-item').each(function (index, item) {
|
|
@@ -24347,11 +24367,11 @@ var env = js_fun.getDeviceEnv();
|
|
|
24347
24367
|
if (idx > -1) {
|
|
24348
24368
|
//找到一个删掉一个,要不会有问题
|
|
24349
24369
|
listItemIds.splice(idx, 1);
|
|
24350
|
-
var listItemDom = $(
|
|
24370
|
+
var listItemDom = $(_this3.$el).find('.question-classify .list-item').eq(idx);
|
|
24351
24371
|
var attrIdx = listItemDom.attr('idx');
|
|
24352
24372
|
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>"));
|
|
24353
24373
|
self.bindDragDomEvent(appendItem, 'back');
|
|
24354
|
-
$(
|
|
24374
|
+
$(_this3.$el).find('.main-append').eq(index).append(appendItem);
|
|
24355
24375
|
listItemDom.remove();
|
|
24356
24376
|
}
|
|
24357
24377
|
});
|
|
@@ -24369,7 +24389,7 @@ var env = js_fun.getDeviceEnv();
|
|
|
24369
24389
|
|
|
24370
24390
|
|
|
24371
24391
|
;
|
|
24372
|
-
const Question_Classify_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(Question_Classifyvue_type_script_lang_js, [['render',
|
|
24392
|
+
const Question_Classify_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(Question_Classifyvue_type_script_lang_js, [['render',Question_Classifyvue_type_template_id_1a39958b_render]])
|
|
24373
24393
|
|
|
24374
24394
|
/* harmony default export */ var Question_Classify = (Question_Classify_exports_);
|
|
24375
24395
|
;// CONCATENATED MODULE: ./src/components/questions/const.js
|
|
@@ -24394,8 +24414,6 @@ var questionMapper = {
|
|
|
24394
24414
|
//填空
|
|
24395
24415
|
'17': 'Question_Classify' //分类
|
|
24396
24416
|
};
|
|
24397
|
-
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
|
|
24398
|
-
var es_promise = __webpack_require__(8674);
|
|
24399
24417
|
// EXTERNAL MODULE: ./node_modules/crypto-js/index.js
|
|
24400
24418
|
var crypto_js = __webpack_require__(1354);
|
|
24401
24419
|
// EXTERNAL MODULE: ./node_modules/axios/index.js
|
|
@@ -24702,6 +24720,103 @@ var state = {
|
|
|
24702
24720
|
|
|
24703
24721
|
|
|
24704
24722
|
|
|
24723
|
+
var parseQuestionListItem = function parseQuestionListItem(mode, question_list, answer_map) {
|
|
24724
|
+
var _this = this;
|
|
24725
|
+
var parentIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
24726
|
+
function parseContent(arr, contentWidth) {
|
|
24727
|
+
arr.forEach(function (item) {
|
|
24728
|
+
if (item['<>'] === 'img') {
|
|
24729
|
+
if (item.hasOwnProperty('width')) {
|
|
24730
|
+
var width = Number(item.width);
|
|
24731
|
+
if (width > contentWidth) {
|
|
24732
|
+
item.width = Math.floor(contentWidth);
|
|
24733
|
+
item.height && delete item.height;
|
|
24734
|
+
}
|
|
24735
|
+
}
|
|
24736
|
+
}
|
|
24737
|
+
if (item.html && item.html.length) {
|
|
24738
|
+
parseContent(item.html, contentWidth);
|
|
24739
|
+
}
|
|
24740
|
+
});
|
|
24741
|
+
}
|
|
24742
|
+
question_list.forEach(function (item, index) {
|
|
24743
|
+
item.questionComponent = questionMapper[item.question_type];
|
|
24744
|
+
// item.questionIndex = index + 1
|
|
24745
|
+
if (parentIndex === undefined) {
|
|
24746
|
+
item.questionIndex = index + 1;
|
|
24747
|
+
} else {
|
|
24748
|
+
item.questionIndex = parentIndex + 1 + '-' + (index + 1);
|
|
24749
|
+
item.questionIndex2 = index + 1;
|
|
24750
|
+
}
|
|
24751
|
+
if (answer_map && answer_map.hasOwnProperty(item.question_id)) {
|
|
24752
|
+
item.answerMap = answer_map[item.question_id];
|
|
24753
|
+
if (mode === 'analysis') {
|
|
24754
|
+
//analysis页面特殊处理
|
|
24755
|
+
if (item.answerMap.user_coding_file) {
|
|
24756
|
+
item.answerMap.oss_temp_url = item.answerMap.user_coding_file;
|
|
24757
|
+
}
|
|
24758
|
+
//analysis页面特殊处理score字段为 answerMap.question_max_score
|
|
24759
|
+
item.score = item.answerMap.question_max_score;
|
|
24760
|
+
//预览接口学生答案以user_开头,为适配考试的学生答案,做处理
|
|
24761
|
+
var answerMapKeys = Object.keys(item.answerMap);
|
|
24762
|
+
var reg = /^user_/ig;
|
|
24763
|
+
answerMapKeys.forEach(function (answerMapKeysItem) {
|
|
24764
|
+
if (reg.test(answerMapKeysItem)) {
|
|
24765
|
+
var newProp = answerMapKeysItem.replace(reg, '');
|
|
24766
|
+
item.answerMap[newProp] = item.answerMap[answerMapKeysItem];
|
|
24767
|
+
}
|
|
24768
|
+
});
|
|
24769
|
+
}
|
|
24770
|
+
} else {
|
|
24771
|
+
item.answerMap = null;
|
|
24772
|
+
}
|
|
24773
|
+
var question_type = item.question_type;
|
|
24774
|
+
if (question_type == 3) {
|
|
24775
|
+
//判断题手动构造选项数组
|
|
24776
|
+
item.exam_options_data = [{
|
|
24777
|
+
index: 1,
|
|
24778
|
+
data: {
|
|
24779
|
+
name: '正确'
|
|
24780
|
+
}
|
|
24781
|
+
}, {
|
|
24782
|
+
index: 2,
|
|
24783
|
+
data: {
|
|
24784
|
+
name: '错误'
|
|
24785
|
+
}
|
|
24786
|
+
}];
|
|
24787
|
+
} else {
|
|
24788
|
+
if (item.exam_options_data && item.exam_options_data.length) {
|
|
24789
|
+
item.exam_options_data.forEach(function (subItem, subIndex) {
|
|
24790
|
+
subItem.enIndex = js_fun.indexToEnIndex(subIndex + 1);
|
|
24791
|
+
});
|
|
24792
|
+
}
|
|
24793
|
+
}
|
|
24794
|
+
//转化content富文本
|
|
24795
|
+
try {
|
|
24796
|
+
var contentArr = JSON.parse(item.content);
|
|
24797
|
+
var contentWidth = jQuery('.question-list').width() - 30;
|
|
24798
|
+
//图片宽度超出框架的时候把宽度设置成框架大小
|
|
24799
|
+
parseContent(contentArr, contentWidth);
|
|
24800
|
+
item.htmlContent = $.json2html({}, contentArr);
|
|
24801
|
+
} catch (e) {
|
|
24802
|
+
item.htmlContent = item.content;
|
|
24803
|
+
}
|
|
24804
|
+
//转化analysis富文本
|
|
24805
|
+
try {
|
|
24806
|
+
if (item.analysis) {
|
|
24807
|
+
item.analysisHtmlContent = $.json2html({}, JSON.parse(item.analysis));
|
|
24808
|
+
} else {
|
|
24809
|
+
item.analysisHtmlContent = '';
|
|
24810
|
+
}
|
|
24811
|
+
} catch (e) {
|
|
24812
|
+
item.analysisHtmlContent = item.analysis;
|
|
24813
|
+
}
|
|
24814
|
+
//如果是阅读题要递归解析
|
|
24815
|
+
if (item.sub_questions && item.sub_questions.length) {
|
|
24816
|
+
_this.parseQuestionListItem(mode, item.sub_questions, answer_map, index);
|
|
24817
|
+
}
|
|
24818
|
+
});
|
|
24819
|
+
};
|
|
24705
24820
|
/* harmony default export */ function buildEntry(store) {
|
|
24706
24821
|
//动态注册store
|
|
24707
24822
|
store.registerModule('zykjcommonQuestions', questions_store);
|
|
@@ -24711,103 +24826,7 @@ var state = {
|
|
|
24711
24826
|
Vue.mixin({
|
|
24712
24827
|
methods: {
|
|
24713
24828
|
//公共解析questionItem方法
|
|
24714
|
-
parseQuestionListItem:
|
|
24715
|
-
var _this = this;
|
|
24716
|
-
var parentIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
24717
|
-
function parseContent(arr, contentWidth) {
|
|
24718
|
-
arr.forEach(function (item) {
|
|
24719
|
-
if (item['<>'] === 'img') {
|
|
24720
|
-
if (item.hasOwnProperty('width')) {
|
|
24721
|
-
var width = Number(item.width);
|
|
24722
|
-
if (width > contentWidth) {
|
|
24723
|
-
item.width = Math.floor(contentWidth);
|
|
24724
|
-
item.height && delete item.height;
|
|
24725
|
-
}
|
|
24726
|
-
}
|
|
24727
|
-
}
|
|
24728
|
-
if (item.html && item.html.length) {
|
|
24729
|
-
parseContent(item.html, contentWidth);
|
|
24730
|
-
}
|
|
24731
|
-
});
|
|
24732
|
-
}
|
|
24733
|
-
question_list.forEach(function (item, index) {
|
|
24734
|
-
item.questionComponent = questionMapper[item.question_type];
|
|
24735
|
-
// item.questionIndex = index + 1
|
|
24736
|
-
if (parentIndex === undefined) {
|
|
24737
|
-
item.questionIndex = index + 1;
|
|
24738
|
-
} else {
|
|
24739
|
-
item.questionIndex = parentIndex + 1 + '-' + (index + 1);
|
|
24740
|
-
item.questionIndex2 = index + 1;
|
|
24741
|
-
}
|
|
24742
|
-
if (answer_map && answer_map.hasOwnProperty(item.question_id)) {
|
|
24743
|
-
item.answerMap = answer_map[item.question_id];
|
|
24744
|
-
if (mode === 'analysis') {
|
|
24745
|
-
//analysis页面特殊处理
|
|
24746
|
-
if (item.answerMap.user_coding_file) {
|
|
24747
|
-
item.answerMap.oss_temp_url = item.answerMap.user_coding_file;
|
|
24748
|
-
}
|
|
24749
|
-
//analysis页面特殊处理score字段为 answerMap.question_max_score
|
|
24750
|
-
item.score = item.answerMap.question_max_score;
|
|
24751
|
-
//预览接口学生答案以user_开头,为适配考试的学生答案,做处理
|
|
24752
|
-
var answerMapKeys = Object.keys(item.answerMap);
|
|
24753
|
-
var reg = /^user_/ig;
|
|
24754
|
-
answerMapKeys.forEach(function (answerMapKeysItem) {
|
|
24755
|
-
if (reg.test(answerMapKeysItem)) {
|
|
24756
|
-
var newProp = answerMapKeysItem.replace(reg, '');
|
|
24757
|
-
item.answerMap[newProp] = item.answerMap[answerMapKeysItem];
|
|
24758
|
-
}
|
|
24759
|
-
});
|
|
24760
|
-
}
|
|
24761
|
-
} else {
|
|
24762
|
-
item.answerMap = null;
|
|
24763
|
-
}
|
|
24764
|
-
var question_type = item.question_type;
|
|
24765
|
-
if (question_type == 3) {
|
|
24766
|
-
//判断题手动构造选项数组
|
|
24767
|
-
item.exam_options_data = [{
|
|
24768
|
-
index: 1,
|
|
24769
|
-
data: {
|
|
24770
|
-
name: '正确'
|
|
24771
|
-
}
|
|
24772
|
-
}, {
|
|
24773
|
-
index: 2,
|
|
24774
|
-
data: {
|
|
24775
|
-
name: '错误'
|
|
24776
|
-
}
|
|
24777
|
-
}];
|
|
24778
|
-
} else {
|
|
24779
|
-
if (item.exam_options_data && item.exam_options_data.length) {
|
|
24780
|
-
item.exam_options_data.forEach(function (subItem, subIndex) {
|
|
24781
|
-
subItem.enIndex = js_fun.indexToEnIndex(subIndex + 1);
|
|
24782
|
-
});
|
|
24783
|
-
}
|
|
24784
|
-
}
|
|
24785
|
-
//转化content富文本
|
|
24786
|
-
try {
|
|
24787
|
-
var contentArr = JSON.parse(item.content);
|
|
24788
|
-
var contentWidth = jQuery('.question-list').width() - 30;
|
|
24789
|
-
//图片宽度超出框架的时候把宽度设置成框架大小
|
|
24790
|
-
parseContent(contentArr, contentWidth);
|
|
24791
|
-
item.htmlContent = $.json2html({}, contentArr);
|
|
24792
|
-
} catch (e) {
|
|
24793
|
-
item.htmlContent = item.content;
|
|
24794
|
-
}
|
|
24795
|
-
//转化analysis富文本
|
|
24796
|
-
try {
|
|
24797
|
-
if (item.analysis) {
|
|
24798
|
-
item.analysisHtmlContent = $.json2html({}, JSON.parse(item.analysis));
|
|
24799
|
-
} else {
|
|
24800
|
-
item.analysisHtmlContent = '';
|
|
24801
|
-
}
|
|
24802
|
-
} catch (e) {
|
|
24803
|
-
item.analysisHtmlContent = item.analysis;
|
|
24804
|
-
}
|
|
24805
|
-
//如果是阅读题要递归解析
|
|
24806
|
-
if (item.sub_questions && item.sub_questions.length) {
|
|
24807
|
-
_this.parseQuestionListItem(mode, item.sub_questions, answer_map, index);
|
|
24808
|
-
}
|
|
24809
|
-
});
|
|
24810
|
-
}
|
|
24829
|
+
parseQuestionListItem: parseQuestionListItem
|
|
24811
24830
|
}
|
|
24812
24831
|
});
|
|
24813
24832
|
Vue.component('Question_SingleChoice', Question_SingleChoice);
|
|
@@ -24818,6 +24837,7 @@ var state = {
|
|
|
24818
24837
|
Vue.component('Question_Programming', Question_Programming);
|
|
24819
24838
|
Vue.component('Question_Classify', Question_Classify);
|
|
24820
24839
|
},
|
|
24840
|
+
parseQuestionListItem: parseQuestionListItem,
|
|
24821
24841
|
questionMapper: questionMapper,
|
|
24822
24842
|
Question_SingleChoice: Question_SingleChoice,
|
|
24823
24843
|
Question_MultipleChoice: Question_MultipleChoice,
|