Commit 751be055 authored by liujiangnan's avatar liujiangnan

feat

parent 8a0fcb3e
......@@ -212,10 +212,11 @@
@close="closeQuizDialog">
<div class="quiz-toolbar">
<el-button size="mini" type="primary" @click="addQuestion('choice')">新增选择题</el-button>
<el-button size="mini" type="primary" @click="addQuestion('query')">新增问答题</el-button>
<el-button size="mini" type="primary" @click="addQuestion('judge')">新增判断题</el-button>
<el-button size="mini" type="primary" @click="addQuestion('blank')">新增填空题</el-button>
<el-button size="mini" type="primary" @click="addQuestion('query')">新增问答题</el-button>
<el-button size="mini" type="primary" @click="addQuestion('reading')">新增跟读题</el-button>
<el-button size="mini" type="primary" @click="addQuestion('show')">新增展示题</el-button>
</div>
<div class="quiz-list" v-if="quizList.length">
<div
......@@ -237,7 +238,7 @@
</div>
<div class="quiz-item-body">
<div class="quiz-row" v-if="q.type !== 'reading'">
<div class="quiz-row" v-if="q.type !== 'reading' && q.type !== 'show'">
<div class="quiz-label">题干</div>
<el-input
size="mini"
......@@ -301,7 +302,7 @@
</div>
</div>
<div class="quiz-row" v-if="q.type === 'reading'">
<div class="quiz-row" v-if="q.type === 'reading' || q.type === 'show'">
<div class="quiz-label">题干</div>
<el-input
size="mini"
......
......@@ -161,10 +161,10 @@ new Vue({
});
return;
}
if (item.type === 'reading') {
if (item.type === 'reading' || item.type === 'show') {
_this.quizList.push({
id: 'q_' + Date.now() + '_' + Math.random().toString(16).slice(2),
type: 'reading',
type: item.type,
text: item.text || ''
});
}
......@@ -246,7 +246,7 @@ new Vue({
item.correct = true;
} else if (type === 'blank') {
item.answers = [''];
} else if (type === 'reading') {
} else if (type === 'reading' || type === 'show') {
item.text = '';
}
this.quizList.push(item);
......@@ -269,7 +269,7 @@ new Vue({
}.bind(this)).catch(function () {});
},
focusNewQuestionInput: function (index, type) {
var refName = type === 'reading' ? 'quizReadingInput_' + index : 'quizQuestionInput_' + index;
var refName = type === 'reading' || type === 'show' ? 'quizReadingInput_' + index : 'quizQuestionInput_' + index;
var ref = this.$refs[refName];
var inputRef = Array.isArray(ref) ? ref[0] : ref;
if (inputRef && inputRef.$el) {
......@@ -295,6 +295,9 @@ new Vue({
if (type === 'reading') {
return '跟读题';
}
if (type === 'show') {
return '展示题';
}
return '未知';
},
addChoiceOption: function (qIndex) {
......@@ -771,9 +774,9 @@ Atmosphere and Colors: [Fill in content]
});
return;
}
if (item.type === 'reading') {
if (item.type === 'reading' || item.type === 'show') {
action.push({
type: 'reading',
type: item.type,
text: item.text || ''
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment