|
@@ -1,39 +1,39 @@
|
|
|
import { deepCopy } from "@/plugins/utils";
|
|
|
|
|
|
-export const select_question = {
|
|
|
- questionType: 1, // 2多选
|
|
|
- quesBody: {
|
|
|
- sections: [],
|
|
|
- },
|
|
|
+export const selectQuestion = {
|
|
|
+ questionType: "SINGLE_ANSWER_QUESTION", // 2多选
|
|
|
+ quesBody: null,
|
|
|
quesOptions: [
|
|
|
{
|
|
|
number: 1,
|
|
|
- body: {
|
|
|
- sections: [{ blocks: [{ type: "text", value: "黑格尔" }] }],
|
|
|
- },
|
|
|
+ body: null,
|
|
|
},
|
|
|
{
|
|
|
number: 2,
|
|
|
- body: {
|
|
|
- sections: [{ blocks: [{ type: "text", value: "苏格拉底" }] }],
|
|
|
- },
|
|
|
+ body: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ number: 3,
|
|
|
+ body: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ number: 4,
|
|
|
+ body: null,
|
|
|
},
|
|
|
],
|
|
|
- quesAnswer: [4],
|
|
|
- comment: { sections: [] },
|
|
|
+ quesAnswer: null,
|
|
|
+ comment: null,
|
|
|
};
|
|
|
|
|
|
-export const boolean_question = {
|
|
|
- questionType: 3,
|
|
|
- quesBody: {
|
|
|
- sections: [],
|
|
|
- },
|
|
|
- quesAnswer: false,
|
|
|
- comment: { sections: [] },
|
|
|
+export const booleanQuestion = {
|
|
|
+ questionType: "BOOL_ANSWER_QUESTION",
|
|
|
+ quesBody: null,
|
|
|
+ quesAnswer: 0,
|
|
|
+ comment: null,
|
|
|
};
|
|
|
|
|
|
-export const fill_blank_question = {
|
|
|
- questionType: 4,
|
|
|
+export const fillBlankQuestion = {
|
|
|
+ questionType: "FILL_BLANK_QUESTION",
|
|
|
quesBody: {
|
|
|
sections: [],
|
|
|
},
|
|
@@ -50,8 +50,8 @@ export const fill_blank_question = {
|
|
|
comment: { sections: [] },
|
|
|
};
|
|
|
|
|
|
-export const text_answer_question = {
|
|
|
- questionType: 5,
|
|
|
+export const textAnswerQuestion = {
|
|
|
+ questionType: "TEXT_ANSWER_QUESTION",
|
|
|
quesBody: {
|
|
|
sections: [],
|
|
|
},
|
|
@@ -65,8 +65,8 @@ export const text_answer_question = {
|
|
|
comment: { sections: [] },
|
|
|
};
|
|
|
// 完型填空/听力/阅读理解
|
|
|
-export const reading_comprehension_question = {
|
|
|
- questionType: 6,
|
|
|
+export const readingComprehensionQuestion = {
|
|
|
+ questionType: "READING_COMPREHENSION",
|
|
|
quesBody: {
|
|
|
sections: [],
|
|
|
},
|
|
@@ -76,8 +76,8 @@ export const reading_comprehension_question = {
|
|
|
};
|
|
|
|
|
|
// 段落匹配/选词填空
|
|
|
-export const banked_cloze_question = {
|
|
|
- questionType: 8,
|
|
|
+export const bankedClozeQuestion = {
|
|
|
+ questionType: "BANKED_CLOZE",
|
|
|
quesBody: {
|
|
|
sections: [],
|
|
|
},
|
|
@@ -105,14 +105,31 @@ export const banked_cloze_question = {
|
|
|
};
|
|
|
|
|
|
const models = {
|
|
|
- select_question,
|
|
|
- boolean_question,
|
|
|
- fill_blank_question,
|
|
|
- text_answer_question,
|
|
|
- reading_comprehension_question,
|
|
|
- banked_cloze_question,
|
|
|
+ SINGLE_ANSWER_QUESTION: selectQuestion,
|
|
|
+ MULTIPLE_ANSWER_QUESTION: Object.assign({}, selectQuestion, {
|
|
|
+ questionType: "MULTIPLE_ANSWER_QUESTION",
|
|
|
+ }),
|
|
|
+ BOOL_ANSWER_QUESTION: booleanQuestion,
|
|
|
+ FILL_BLANK_QUESTION: fillBlankQuestion,
|
|
|
+ TEXT_ANSWER_QUESTION: textAnswerQuestion,
|
|
|
+ READING_COMPREHENSION: readingComprehensionQuestion,
|
|
|
+ LISTENING_QUESTION: Object.assign({}, readingComprehensionQuestion, {
|
|
|
+ questionType: "LISTENING_QUESTION",
|
|
|
+ }),
|
|
|
+ CLOZE: Object.assign({}, readingComprehensionQuestion, {
|
|
|
+ questionType: "CLOZE",
|
|
|
+ }),
|
|
|
+ PARAGRAPH_MATCHING: Object.assign({}, bankedClozeQuestion, {
|
|
|
+ questionType: "PARAGRAPH_MATCHING",
|
|
|
+ }),
|
|
|
+ BANKED_CLOZE: bankedClozeQuestion,
|
|
|
};
|
|
|
|
|
|
export const getInitQuestionModel = (qtype) => {
|
|
|
- return deepCopy(models[qtype]);
|
|
|
+ return {
|
|
|
+ ...deepCopy(models[qtype]),
|
|
|
+ courseId: "",
|
|
|
+ difficulty: "易",
|
|
|
+ quesProperties: [],
|
|
|
+ };
|
|
|
};
|