|
@@ -9,14 +9,13 @@
|
|
|
</div>
|
|
|
<div class="exersices-attr my-radio-style">
|
|
|
<IconText :text="$t('evaluation.newExercise.knowledge')" :color="'#00b8ff'" :icon="'md-infinite'"></IconText>
|
|
|
- <Button type="info" style="margin-top: 20px" @click="onSelectPoints" v-if="exercisePoints.length === 0">{{$t('evaluation.newExercise.choosePoint')}}</Button>
|
|
|
+ <Button type="info" style="margin-top: 20px" @click="onSelectPoints" v-if="exercisePoints.length === 0">{{ $t("evaluation.newExercise.choosePoint") }}</Button>
|
|
|
<div v-else style="margin-top: 10px">
|
|
|
<span v-for="(item, index) in exercisePoints" :key="index" class="exercise-item-point">
|
|
|
{{ item }}
|
|
|
- <span class="exercise-item-point-close">
|
|
|
- <Icon type="md-close" @click="onDeletePoint(index)" /></span>
|
|
|
+ <span class="exercise-item-point-close"> <Icon type="md-close" @click="onDeletePoint(index)" /></span>
|
|
|
</span>
|
|
|
- <span class="exercise-item-point-modify" @click="selectPointsModal = true">{{ $t('evaluation.newExercise.modify') }}</span>
|
|
|
+ <span class="exercise-item-point-modify" @click="selectPointsModal = true">{{ $t("evaluation.newExercise.modify") }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -24,34 +23,34 @@
|
|
|
<div class="exersices-attr my-radio-style">
|
|
|
<IconText :text="$t('evaluation.newExercise.type')" :color="'#00b8ff'" :icon="'md-pricetags'"></IconText>
|
|
|
<RadioGroup v-model="exersicesType" type="button" @on-change="typeChange">
|
|
|
- <Radio label="single" :disabled="isEdit">{{ $t('evaluation.single') }}</Radio>
|
|
|
- <Radio label="multiple" :disabled="isEdit">{{ $t('evaluation.multiple') }}</Radio>
|
|
|
- <Radio label="judge" :disabled="isEdit">{{ $t('evaluation.judge') }}</Radio>
|
|
|
- <Radio label="complete" :disabled="isEdit">{{ $t('evaluation.complete') }}</Radio>
|
|
|
- <Radio label="subjective" :disabled="isEdit">{{ $t('evaluation.subjective') }}</Radio>
|
|
|
- <Radio label="connector" :disabled="isEdit">{{ $t('evaluation.connector') }}</Radio>
|
|
|
- <Radio label="correct" :disabled="isEdit">{{ $t('evaluation.correct') }}</Radio>
|
|
|
+ <Radio label="single" :disabled="isEdit">{{ $t("evaluation.single") }}</Radio>
|
|
|
+ <Radio label="multiple" :disabled="isEdit">{{ $t("evaluation.multiple") }}</Radio>
|
|
|
+ <Radio label="judge" :disabled="isEdit">{{ $t("evaluation.judge") }}</Radio>
|
|
|
+ <Radio label="complete" :disabled="isEdit">{{ $t("evaluation.complete") }}</Radio>
|
|
|
+ <Radio label="subjective" :disabled="isEdit">{{ $t("evaluation.subjective") }}</Radio>
|
|
|
+ <Radio label="connector" :disabled="isEdit">{{ $t("evaluation.connector") }}</Radio>
|
|
|
+ <Radio label="correct" :disabled="isEdit">{{ $t("evaluation.correct") }}</Radio>
|
|
|
</RadioGroup>
|
|
|
</div>
|
|
|
<div class="exersices-attr edit-exersices-attr-diff my-radio-style">
|
|
|
<IconText :text="$t('evaluation.newExercise.diff')" :color="'#00b8ff'" :icon="'md-pulse'"></IconText>
|
|
|
<RadioGroup v-model="exersicesDiff" type="button">
|
|
|
- <Radio label="1" @click.native="diffChange($event, '1')">{{$t('evaluation.diff1')}}</Radio>
|
|
|
- <Radio label="2" @click.native="diffChange($event, '2')">{{$t('evaluation.diff2')}}</Radio>
|
|
|
- <Radio label="3" @click.native="diffChange($event, '3')">{{$t('evaluation.diff3')}}</Radio>
|
|
|
- <Radio label="4" @click.native="diffChange($event, '4')">{{$t('evaluation.diff4')}}</Radio>
|
|
|
- <Radio label="5" @click.native="diffChange($event, '5')">{{$t('evaluation.diff5')}}</Radio>
|
|
|
+ <Radio label="1" @click.native="diffChange($event, '1')">{{ $t("evaluation.diff1") }}</Radio>
|
|
|
+ <Radio label="2" @click.native="diffChange($event, '2')">{{ $t("evaluation.diff2") }}</Radio>
|
|
|
+ <Radio label="3" @click.native="diffChange($event, '3')">{{ $t("evaluation.diff3") }}</Radio>
|
|
|
+ <Radio label="4" @click.native="diffChange($event, '4')">{{ $t("evaluation.diff4") }}</Radio>
|
|
|
+ <Radio label="5" @click.native="diffChange($event, '5')">{{ $t("evaluation.diff5") }}</Radio>
|
|
|
</RadioGroup>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<BaseSingle v-if="exersicesType === 'single'" ref="single" :editInfo="editInfo"></BaseSingle>
|
|
|
<BaseMultiple v-else-if="exersicesType === 'multiple'" ref="multiple" :editInfo="editInfo"></BaseMultiple>
|
|
|
- <BaseJudge v-else-if="exersicesType === 'judge'" ref="judge" :editInfo="editInfo" ></BaseJudge>
|
|
|
- <BaseCompletion v-else-if="exersicesType === 'complete'" ref="complete" :editInfo="editInfo" ></BaseCompletion>
|
|
|
- <BaseConnector v-else-if="exersicesType === 'connector'" ref="connector" :editInfo="editInfo" ></BaseConnector>
|
|
|
- <BaseCorrect v-else-if="exersicesType === 'correct'" ref="correct" :editInfo="editInfo" ></BaseCorrect>
|
|
|
- <BaseSubjective v-else-if="exersicesType === 'subjective'" ref="subjective" :editInfo="editInfo" ></BaseSubjective>
|
|
|
+ <BaseJudge v-else-if="exersicesType === 'judge'" ref="judge" :editInfo="editInfo"></BaseJudge>
|
|
|
+ <BaseCompletion v-else-if="exersicesType === 'complete'" ref="complete" :editInfo="editInfo"></BaseCompletion>
|
|
|
+ <BaseConnector v-else-if="exersicesType === 'connector'" ref="connector" :editInfo="editInfo"></BaseConnector>
|
|
|
+ <BaseCorrect v-else-if="exersicesType === 'correct'" ref="correct" :editInfo="editInfo"></BaseCorrect>
|
|
|
+ <BaseSubjective v-else-if="exersicesType === 'subjective'" ref="subjective" :editInfo="editInfo"></BaseSubjective>
|
|
|
|
|
|
<!-- 解析的富文本部分 -->
|
|
|
<div class="exersices-analysis child-exercise-analysis">
|
|
@@ -68,13 +67,12 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="save-wrap display-flex">
|
|
|
- <Button type="success" @click="getContent(exersicesType)" :loading="saveLoading">{{ $t('evaluation.newExercise.save') }}</Button>
|
|
|
+ <Button type="success" @click="getContent(exersicesType)" :loading="saveLoading">{{ $t("evaluation.newExercise.save") }}</Button>
|
|
|
</div>
|
|
|
|
|
|
<!-- 选择知识点弹窗 -->
|
|
|
<Modal v-model="selectPointsModal" :title="$t('evaluation.newExercise.choosePoint')" width="600px" footer-hide class="related-point-modal" style="z-index: 99999">
|
|
|
- <BasePoints v-if="selectPointsModal" ref="pointRef" :period="schoolInfo.period[curPeriodIndex].id" :subject="schoolInfo.period[curPeriodIndex].subjects[curSubjectIndex].id"
|
|
|
- @onCheckChange="onCheckChange" @onCancel="selectPointsModal = false" :points="exercisePoints" :scope="curScope"></BasePoints>
|
|
|
+ <BasePoints v-if="selectPointsModal" ref="pointRef" :period="schoolInfo.period[curPeriodIndex].id" :subject="schoolInfo.period[curPeriodIndex].subjects[curSubjectIndex].id" @onCheckChange="onCheckChange" @onCancel="selectPointsModal = false" :points="exercisePoints" :scope="curScope"></BasePoints>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -86,8 +84,8 @@
|
|
|
import BaseCompletion from "@/view/evaluation/types/BaseCompletion.vue";
|
|
|
import BaseJudge from "@/view/evaluation/types/BaseJudge.vue";
|
|
|
import BaseSubjective from "@/view/evaluation/types/BaseSubjective.vue";
|
|
|
- import BaseCorrect from "@/view/evaluation/types/BaseCorrect.vue";
|
|
|
- import BaseConnector from "@/view/evaluation/types/BaseConnector.vue";
|
|
|
+ import BaseCorrect from "@/view/evaluation/types/BaseCorrect.vue";
|
|
|
+ import BaseConnector from "@/view/evaluation/types/BaseConnector.vue";
|
|
|
import NewChooseContent from "@/components/selflearn/NewChooseContent";
|
|
|
import E from "wangeditor";
|
|
|
// 默认创建题目模板
|
|
@@ -98,9 +96,12 @@
|
|
|
answer: [],
|
|
|
explain: "",
|
|
|
type: "",
|
|
|
+ answerType: "text",
|
|
|
+ useAutoScore: false,
|
|
|
+ answerLang: "en-US"
|
|
|
};
|
|
|
export default {
|
|
|
- name:'BaseCreateChild',
|
|
|
+ name: "BaseCreateChild",
|
|
|
components: {
|
|
|
IconText,
|
|
|
BaseSingle,
|
|
@@ -110,25 +111,25 @@
|
|
|
BaseSubjective,
|
|
|
BaseCorrect,
|
|
|
BaseConnector,
|
|
|
- NewChooseContent,
|
|
|
+ NewChooseContent
|
|
|
},
|
|
|
props: {
|
|
|
editItem: {
|
|
|
type: Object,
|
|
|
- default: null,
|
|
|
+ default: null
|
|
|
},
|
|
|
refId: {
|
|
|
type: String,
|
|
|
- default: "createChild",
|
|
|
+ default: "createChild"
|
|
|
},
|
|
|
curPeriodIndex: {
|
|
|
type: Number,
|
|
|
- default: 0,
|
|
|
+ default: 0
|
|
|
},
|
|
|
curSubjectIndex: {
|
|
|
type: Number,
|
|
|
- default: 0,
|
|
|
- },
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -141,16 +142,15 @@
|
|
|
editInfo: {},
|
|
|
schoolInfo: {},
|
|
|
saveLoading: false,
|
|
|
- exersicesType: "single",//single
|
|
|
+ exersicesType: "single", //single
|
|
|
exerciseField: 0,
|
|
|
exercisePeriod: 0,
|
|
|
exerciseGrade: [],
|
|
|
exerciseSubject: 0,
|
|
|
exerciseScope: 0,
|
|
|
exercisePoints: [],
|
|
|
- scopeList: [this.$t('evaluation.filter.schoolBank'),this.$t('evaluation.filter.privateBank')],
|
|
|
- fieldList: [this.$t('evaluation.level1'),this.$t('evaluation.level2'),this.$t('evaluation.level3'),
|
|
|
- this.$t('evaluation.level4'),this.$t('evaluation.level5'),this.$t('evaluation.level6')],
|
|
|
+ scopeList: [this.$t("evaluation.filter.schoolBank"), this.$t("evaluation.filter.privateBank")],
|
|
|
+ fieldList: [this.$t("evaluation.level1"), this.$t("evaluation.level2"), this.$t("evaluation.level3"), this.$t("evaluation.level4"), this.$t("evaluation.level5"), this.$t("evaluation.level6")],
|
|
|
periodList: [],
|
|
|
gradeList: [],
|
|
|
subjectList: [],
|
|
@@ -160,12 +160,11 @@
|
|
|
stemContent: "",
|
|
|
analysisEditor: null,
|
|
|
repairEditor: null,
|
|
|
- curId:''
|
|
|
+ curId: ""
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getSchoolInfo();
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
getSchoolInfo() {
|
|
@@ -180,19 +179,18 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
- onSelectPoints(){
|
|
|
- if(this.hasSchool){
|
|
|
- console.log(this.schoolInfo)
|
|
|
- console.log(this.curPeriodIndex)
|
|
|
- console.log(this.curSubjectIndex)
|
|
|
- this.selectPointsModal = true
|
|
|
- }else{
|
|
|
- this.$Message.warning(this.$t('evaluation.newExercise.noSchoolTip'))
|
|
|
+
|
|
|
+ onSelectPoints() {
|
|
|
+ if (this.hasSchool) {
|
|
|
+ console.log(this.schoolInfo);
|
|
|
+ console.log(this.curPeriodIndex);
|
|
|
+ console.log(this.curSubjectIndex);
|
|
|
+ this.selectPointsModal = true;
|
|
|
+ } else {
|
|
|
+ this.$Message.warning(this.$t("evaluation.newExercise.noSchoolTip"));
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
onSelectFile(val) {
|
|
|
this.relateFileList = val.files;
|
|
|
},
|
|
@@ -203,26 +201,21 @@
|
|
|
},
|
|
|
|
|
|
async getContent(type) {
|
|
|
-
|
|
|
let exerciseItem = this.editInfo && this.editInfo.id ? JSON.parse(JSON.stringify(this.editInfo)) : Object.assign({}, defaultExercise);
|
|
|
switch (type) {
|
|
|
case "single":
|
|
|
- this.$refs.single.doSave()
|
|
|
+ this.$refs.single.doSave();
|
|
|
exerciseItem.question = this.$refs.single.stemContent;
|
|
|
exerciseItem.option = this.checkOptionNull(this.$refs.single.optionsContent) ? this.$refs.single.optionsContent : null;
|
|
|
exerciseItem.type = this.exersicesType;
|
|
|
exerciseItem.level = +this.exersicesDiff;
|
|
|
exerciseItem.explain = this.analysisContent;
|
|
|
- exerciseItem.answer = [
|
|
|
- String.fromCharCode(64 + parseInt(this.$refs.single.trueIndex + 1)),
|
|
|
- ];
|
|
|
+ exerciseItem.answer = [String.fromCharCode(64 + parseInt(this.$refs.single.trueIndex + 1))];
|
|
|
break;
|
|
|
case "multiple":
|
|
|
- this.$refs.multiple.doSave()
|
|
|
+ this.$refs.multiple.doSave();
|
|
|
exerciseItem.question = this.$refs.multiple.stemContent;
|
|
|
- exerciseItem.option = this.checkOptionNull(this.$refs.multiple.optionsContent) ?
|
|
|
- this.$refs.multiple.optionsContent :
|
|
|
- null;
|
|
|
+ exerciseItem.option = this.checkOptionNull(this.$refs.multiple.optionsContent) ? this.$refs.multiple.optionsContent : null;
|
|
|
exerciseItem.type = this.exersicesType;
|
|
|
exerciseItem.level = +this.exersicesDiff;
|
|
|
exerciseItem.explain = this.analysisContent;
|
|
@@ -252,6 +245,9 @@
|
|
|
exerciseItem.level = +this.exersicesDiff;
|
|
|
exerciseItem.explain = this.analysisContent;
|
|
|
exerciseItem.answer = [this.$refs.subjective.answerContent];
|
|
|
+ exerciseItem.answerType = this.$refs.subjective.answerType; // 02040301 问答题增加作答类型字段
|
|
|
+ exerciseItem.useAutoScore = this.$refs.subjective.useAutoScore; // 02040301 问答题增加作答类型字段
|
|
|
+ exerciseItem.answerLang = this.$refs.subjective.answerLang; // 02040301 问答题增加作答类型字段
|
|
|
break;
|
|
|
case "connector":
|
|
|
exerciseItem.question = this.$refs.connector.stemContent;
|
|
@@ -268,27 +264,22 @@
|
|
|
exerciseItem.level = +this.exersicesDiff;
|
|
|
exerciseItem.explain = this.analysisContent;
|
|
|
exerciseItem.answer = [this.$refs.correct.answerContent];
|
|
|
- break;
|
|
|
+ break;
|
|
|
}
|
|
|
exerciseItem.repair = this.repairContent;
|
|
|
- exerciseItem.repair = this.formatRepairResource(
|
|
|
- this.$refs.childRepairRef.datas
|
|
|
- );
|
|
|
+ exerciseItem.repair = this.formatRepairResource(this.$refs.childRepairRef.datas);
|
|
|
exerciseItem.field = this.exerciseField + 1;
|
|
|
exerciseItem.knowledge = this.exercisePoints;
|
|
|
exerciseItem.children = [];
|
|
|
- exerciseItem.score = (this.editInfo && this.editInfo.score) ? this.editInfo.score : 0;
|
|
|
- exerciseItem.code =
|
|
|
- this.$parent.$parent.exerciseScope === 0 ?
|
|
|
- this.$store.state.userInfo.TEAMModelId :
|
|
|
- this.$store.state.userInfo.schoolCode;
|
|
|
+ exerciseItem.score = this.editInfo && this.editInfo.score ? this.editInfo.score : 0;
|
|
|
+ exerciseItem.code = this.$parent.$parent.exerciseScope === 0 ? this.$store.state.userInfo.TEAMModelId : this.$store.state.userInfo.schoolCode;
|
|
|
|
|
|
- let confirmSave = await this.checkContent(exerciseItem)
|
|
|
+ let confirmSave = await this.checkContent(exerciseItem);
|
|
|
// 判断获取的数据是否有空数据以及是否为空字符串
|
|
|
if (confirmSave) {
|
|
|
// this.saveLoading = true
|
|
|
exerciseItem.id = this.curId;
|
|
|
- console.log('编辑后的小题',exerciseItem)
|
|
|
+ console.log("编辑后的小题", exerciseItem);
|
|
|
this.$emit("addFinish", exerciseItem);
|
|
|
}
|
|
|
},
|
|
@@ -296,7 +287,7 @@
|
|
|
/* 知识点勾选变动事件 */
|
|
|
onCheckChange(val, list) {
|
|
|
this.exercisePoints = val;
|
|
|
- this.selectPointsModal = false
|
|
|
+ this.selectPointsModal = false;
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -311,8 +302,8 @@
|
|
|
// 题目类型转换
|
|
|
typeChange(val) {
|
|
|
if (this.isEdit) {
|
|
|
- this.$Message.warning(this.$t('evaluation.newExercise.typeChangeTip'));
|
|
|
- }else {
|
|
|
+ this.$Message.warning(this.$t("evaluation.newExercise.typeChangeTip"));
|
|
|
+ } else {
|
|
|
this.exersicesType = val;
|
|
|
this.analysisEditor.txt.clear();
|
|
|
// this.repairEditor.txt.clear()
|
|
@@ -324,13 +315,13 @@
|
|
|
if (list.length) {
|
|
|
let arr = [];
|
|
|
list.forEach((i, index) => {
|
|
|
- i.blobUrl.forEach(j => {
|
|
|
+ i.blobUrl.forEach((j) => {
|
|
|
arr.push({
|
|
|
- blobUrl:j.url,
|
|
|
- name:i.name,
|
|
|
- type:i.type
|
|
|
- })
|
|
|
- })
|
|
|
+ blobUrl: j.url,
|
|
|
+ name: i.name,
|
|
|
+ type: i.type
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
return arr;
|
|
|
} else {
|
|
@@ -343,10 +334,7 @@
|
|
|
this.exersicesDiff = +type;
|
|
|
e.preventDefault();
|
|
|
let colorArr = ["#10abe7", "#E8BE15", "#F19300", "#EB5E00", "#D30000"];
|
|
|
- let ac = document
|
|
|
- .getElementById(this.refId)
|
|
|
- .getElementsByClassName("edit-exersices-attr-diff")[0].children[1]
|
|
|
- .children;
|
|
|
+ let ac = document.getElementById(this.refId).getElementsByClassName("edit-exersices-attr-diff")[0].children[1].children;
|
|
|
for (let i = 0; i < ac.length; i++) {
|
|
|
ac[i].style.background = "#fff";
|
|
|
ac[i].style.color = "#515a6e";
|
|
@@ -374,43 +362,43 @@
|
|
|
|
|
|
// 排除对象空属性
|
|
|
checkContent(Obj) {
|
|
|
- return new Promise(async (r,j) => {
|
|
|
+ return new Promise(async (r, j) => {
|
|
|
let flag = true;
|
|
|
let whiteList = this.getWhiteListByType(Obj.type);
|
|
|
console.log("富文本获取的原始试题数据", Obj);
|
|
|
for (let key in Obj) {
|
|
|
if (whiteList.includes(key) && typeof Obj[key] === "string") {
|
|
|
if (!this.getSimpleText(Obj[key])) {
|
|
|
- flag = await this.emptyConfirm(key)
|
|
|
+ flag = await this.emptyConfirm(key);
|
|
|
r(flag);
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
} else {
|
|
|
if (whiteList.includes(key) && !Obj[key]) {
|
|
|
- flag = await this.emptyConfirm(key)
|
|
|
+ flag = await this.emptyConfirm(key);
|
|
|
r(flag);
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
r(flag);
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
/* 确认是否继续保存 */
|
|
|
emptyConfirm(key) {
|
|
|
return new Promise((r, j) => {
|
|
|
this.$Modal.confirm({
|
|
|
- title: this.$t('evaluation.newExercise.modalTip'),
|
|
|
- content: `${ this.$t('evaluation.currentItem') }${ key === 'question' ? this.$t('evaluation.newExercise.stem') : this.$t('evaluation.newExercise.option') }${ this.$t('evaluation.emptyTip1') }`,
|
|
|
+ title: this.$t("evaluation.newExercise.modalTip"),
|
|
|
+ content: `${this.$t("evaluation.currentItem")}${key === "question" ? this.$t("evaluation.newExercise.stem") : this.$t("evaluation.newExercise.option")}${this.$t("evaluation.emptyTip1")}`,
|
|
|
onOk: () => {
|
|
|
- r(true)
|
|
|
+ r(true);
|
|
|
},
|
|
|
onCancel: () => {
|
|
|
- r(false)
|
|
|
+ r(false);
|
|
|
}
|
|
|
});
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
// 根据不同题型 给出需要必填选项
|
|
@@ -433,44 +421,34 @@
|
|
|
|
|
|
// 渲染编辑习题内容回显
|
|
|
async renderExercise(editItem) {
|
|
|
- console.log('当前小题', editItem);
|
|
|
+ console.log("当前小题", editItem);
|
|
|
this.isEdit = true;
|
|
|
this.exersicesDiff = editItem.level.toString() || "0";
|
|
|
- this.exerciseScope =
|
|
|
- editItem.code === this.$store.state.userInfo.TEAMModelId ? 0 : 1;
|
|
|
+ this.exerciseScope = editItem.code === this.$store.state.userInfo.TEAMModelId ? 0 : 1;
|
|
|
this.exersicesType = editItem.type;
|
|
|
this.exercisePoints = editItem.knowledge || editItem.points;
|
|
|
if (editItem.level) {
|
|
|
- let ac = document
|
|
|
- .getElementById(this.refId)
|
|
|
- .getElementsByClassName("edit-exersices-attr-diff")[0].children[1]
|
|
|
- .children;
|
|
|
+ let ac = document.getElementById(this.refId).getElementsByClassName("edit-exersices-attr-diff")[0].children[1].children;
|
|
|
for (let i = 0; i < ac.length; i++) {
|
|
|
ac[i].style.background = "#fff";
|
|
|
ac[i].style.color = "#515a6e";
|
|
|
}
|
|
|
// 重新渲染题目难度
|
|
|
- let diffDom = document
|
|
|
- .getElementById(this.refId)
|
|
|
- .getElementsByClassName("edit-exersices-attr-diff")[0].children[1]
|
|
|
- .children[editItem.level - 1];
|
|
|
+ let diffDom = document.getElementById(this.refId).getElementsByClassName("edit-exersices-attr-diff")[0].children[1].children[editItem.level - 1];
|
|
|
let colorArr = ["#32CF74", "#E8BE15", "#F19300", "#EB5E00", "#D30000"];
|
|
|
diffDom.style.background = colorArr[editItem.level - 1];
|
|
|
diffDom.style.color = "#fff";
|
|
|
} else {
|
|
|
- let ac = document
|
|
|
- .getElementById(this.refId)
|
|
|
- .getElementsByClassName("edit-exersices-attr-diff")[0].children[1]
|
|
|
- .children;
|
|
|
+ let ac = document.getElementById(this.refId).getElementsByClassName("edit-exersices-attr-diff")[0].children[1].children;
|
|
|
for (let i = 0; i < ac.length; i++) {
|
|
|
ac[i].style.background = "#fff";
|
|
|
ac[i].style.color = "#515a6e";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- let schoolInfo = await this.$store.dispatch('user/getSchoolProfile');
|
|
|
+ let schoolInfo = await this.$store.dispatch("user/getSchoolProfile");
|
|
|
this.schoolInfo = schoolInfo.school_base;
|
|
|
-
|
|
|
+
|
|
|
this.stemContent = editItem.question;
|
|
|
this.relateFileList = editItem.repair || [];
|
|
|
this.optionsContent = editItem.option;
|
|
@@ -478,41 +456,41 @@
|
|
|
this.analysisEditor.txt.html(editItem.explain);
|
|
|
this.editInfo = JSON.parse(JSON.stringify(editItem));
|
|
|
this.exerciseField = this.editInfo.field - 1;
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
let analysisEditor = new E(this.$refs.analysisEditor);
|
|
|
analysisEditor.config.uploadImgShowBase64 = true;
|
|
|
- analysisEditor.config.onchange = (html) => {
|
|
|
+ (analysisEditor.config.onchange = (html) => {
|
|
|
this.analysisContent = html;
|
|
|
- },
|
|
|
- this.$editorTools.initMyEditor(analysisEditor,this)
|
|
|
+ }),
|
|
|
+ this.$editorTools.initMyEditor(analysisEditor, this);
|
|
|
analysisEditor.create();
|
|
|
this.analysisEditor = analysisEditor;
|
|
|
-
|
|
|
- this.curId = this.$tools.guid()
|
|
|
+
|
|
|
+ this.curId = this.$tools.guid();
|
|
|
if (this.editItem && this.editItem.id) {
|
|
|
this.renderExercise(JSON.parse(JSON.stringify(this.editItem)));
|
|
|
// 先生成随机ID
|
|
|
- this.curId = this.editItem.id || this.$tools.guid()
|
|
|
+ this.curId = this.editItem.id || this.$tools.guid();
|
|
|
}
|
|
|
-
|
|
|
- if(this.isEdit){
|
|
|
- this.exerciseScope = this.editItem.scope === 'school' ? 1 : 0
|
|
|
- }else{
|
|
|
- this.exerciseScope = this.$parent.$parent.exerciseScope
|
|
|
+
|
|
|
+ if (this.isEdit) {
|
|
|
+ this.exerciseScope = this.editItem.scope === "school" ? 1 : 0;
|
|
|
+ } else {
|
|
|
+ this.exerciseScope = this.$parent.$parent.exerciseScope;
|
|
|
}
|
|
|
- console.log(this.exerciseScope)
|
|
|
+ console.log(this.exerciseScope);
|
|
|
},
|
|
|
- computed:{
|
|
|
- curScope(){
|
|
|
- return this.exerciseScope === 1 ? 'school' : 'private'
|
|
|
+ computed: {
|
|
|
+ curScope() {
|
|
|
+ return this.exerciseScope === 1 ? "school" : "private";
|
|
|
},
|
|
|
hasSchool() {
|
|
|
- return this.$store.state.userInfo.hasSchool
|
|
|
+ return this.$store.state.userInfo.hasSchool;
|
|
|
},
|
|
|
- isPaperEnv(){
|
|
|
- return sessionStorage.getItem('editorEnv') && sessionStorage.getItem('editorEnv') !== 'normal'
|
|
|
+ isPaperEnv() {
|
|
|
+ return sessionStorage.getItem("editorEnv") && sessionStorage.getItem("editorEnv") !== "normal";
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -522,20 +500,18 @@
|
|
|
console.log("要编辑的小题");
|
|
|
console.log(newValue);
|
|
|
this.renderExercise(JSON.parse(JSON.stringify(newValue)));
|
|
|
- this.curId = newValue.id || this.$tools.guid()
|
|
|
+ this.curId = newValue.id || this.$tools.guid();
|
|
|
// this.$refs.pointRef.doReset()
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
//immediate:true
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
-<style src="../index/CreateExercises.less" lang="less" scoped>
|
|
|
-</style>
|
|
|
+<style src="../index/CreateExercises.less" lang="less" scoped></style>
|
|
|
|
|
|
<style>
|
|
|
-
|
|
|
.related-point-modal .ivu-modal-header-inner {
|
|
|
font-weight: bold;
|
|
|
}
|
|
@@ -552,14 +528,12 @@
|
|
|
.exersices-attr .ivu-select-multiple .ivu-select-selection .ivu-select-placeholder {
|
|
|
line-height: 38px;
|
|
|
}
|
|
|
-
|
|
|
- .child-exercise-analysis .w-e-toolbar{
|
|
|
+
|
|
|
+ .child-exercise-analysis .w-e-toolbar {
|
|
|
z-index: 0 !important;
|
|
|
}
|
|
|
-
|
|
|
- .child-exercise-analysis .w-e-text-container{
|
|
|
+
|
|
|
+ .child-exercise-analysis .w-e-text-container {
|
|
|
position: unset;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
</style>
|