Commit ff0c099a authored by liujiangnan's avatar liujiangnan

feat

parent db74ec8a
......@@ -216,7 +216,8 @@
<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')">AI朗读题</el-button>
<el-button size="mini" type="primary" @click="addQuestion('reading_question')">新增AI读题</el-button>
<el-button size="mini" type="primary" @click="addQuestion('reading_answer')">新增AI读答案</el-button>
</div>
<div class="quiz-list" v-if="quizList.length">
<div
......@@ -238,7 +239,7 @@
</div>
<div class="quiz-item-body">
<div class="quiz-row" v-if="q.type !== 'reading' && q.type !== 'show'">
<div class="quiz-row" v-if="q.type !== 'reading' && q.type !== 'reading_question' && q.type !== 'reading_answer'">
<div class="quiz-label">题干</div>
<el-input
size="mini"
......@@ -267,11 +268,23 @@
</el-radio-group>
</div>
<div class="quiz-row" v-if="q.type === 'reading_question' || q.type === 'reading_answer'">
<div class="quiz-label">题干</div>
<el-input
size="mini"
:ref="'quizReadingInput_' + qIndex"
v-model="q.text"
@input="saveData"></el-input>
</div>
<div class="quiz-row" v-if="q.type === 'query'">
<div class="quiz-label">参考答案</div>
<el-input size="mini" v-model="q.answer" @input="saveData"></el-input>
</div>
<div class="quiz-row" v-if="q.type === 'query'">
<div class="quiz-row" v-if="q.type === 'reading_question' || q.type === 'reading_answer'">
<div class="quiz-label">参考答案</div>
<el-input size="mini" v-model="q.answer" @input="saveData"></el-input>
</div>
<div class="quiz-row" v-if="q.type === 'query' || q.type === 'reading_question' || q.type === 'reading_answer'">
<div class="quiz-label">备注</div>
<div class="quiz-inline">
<el-input
......@@ -282,7 +295,7 @@
<el-button size="mini" type="primary" plain @click="fillQueryHint(q)">一键填入图片理解内容</el-button>
</div>
</div>
<div class="quiz-row" v-if="q.type === 'query'">
<div class="quiz-row" v-if="q.type === 'query' || q.type === 'reading_question' || q.type === 'reading_answer'">
<div class="quiz-label">提示</div>
<el-input
type="textarea"
......@@ -302,7 +315,7 @@
</div>
</div>
<div class="quiz-row" v-if="q.type === 'reading' || q.type === 'show'">
<div class="quiz-row" v-if="q.type === 'reading'">
<div class="quiz-label">题干</div>
<el-input
size="mini"
......
......@@ -161,10 +161,32 @@ new Vue({
});
return;
}
if (item.type === 'reading' || item.type === 'show') {
if (item.type === 'reading_question' || item.type === 'reading_answer') {
_this.quizList.push({
id: 'q_' + Date.now() + '_' + Math.random().toString(16).slice(2),
type: item.type,
text: item.text || '',
answer: item.answer || '',
hint: item.hint || '',
tip: item.tip || ''
});
return;
}
if (item.type === 'show') {
_this.quizList.push({
id: 'q_' + Date.now() + '_' + Math.random().toString(16).slice(2),
type: 'reading_question',
text: item.text || '',
answer: item.answer || '',
hint: item.hint || '',
tip: item.tip || ''
});
return;
}
if (item.type === 'reading') {
_this.quizList.push({
id: 'q_' + Date.now() + '_' + Math.random().toString(16).slice(2),
type: 'reading',
text: item.text || ''
});
}
......@@ -246,8 +268,13 @@ new Vue({
item.correct = true;
} else if (type === 'blank') {
item.answers = [''];
} else if (type === 'reading' || type === 'show') {
} else if (type === 'reading') {
item.text = '';
} else if (type === 'reading_question' || type === 'reading_answer') {
item.text = '';
item.answer = '';
item.hint = '';
item.tip = '';
}
this.quizList.push(item);
this.saveData();
......@@ -269,7 +296,7 @@ new Vue({
}.bind(this)).catch(function () {});
},
focusNewQuestionInput: function (index, type) {
var refName = type === 'reading' || type === 'show' ? 'quizReadingInput_' + index : 'quizQuestionInput_' + index;
var refName = type === 'reading' || type === 'reading_question' || type === 'reading_answer' ? 'quizReadingInput_' + index : 'quizQuestionInput_' + index;
var ref = this.$refs[refName];
var inputRef = Array.isArray(ref) ? ref[0] : ref;
if (inputRef && inputRef.$el) {
......@@ -295,8 +322,11 @@ new Vue({
if (type === 'reading') {
return '跟读题';
}
if (type === 'show') {
return '展示题';
if (type === 'reading_question') {
return 'AI读题';
}
if (type === 'reading_answer') {
return 'AI读答案';
}
return '未知';
},
......@@ -336,7 +366,7 @@ new Vue({
this.saveData();
},
fillQueryHint: function (item) {
if (!item || item.type !== 'query') {
if (!item || (item.type !== 'query' && item.type !== 'reading_question' && item.type !== 'reading_answer')) {
return;
}
if (!this.aiImageContent) {
......@@ -774,11 +804,21 @@ Atmosphere and Colors: [Fill in content]
});
return;
}
if (item.type === 'reading' || item.type === 'show') {
if (item.type === 'reading') {
action.push({
type: item.type,
type: 'reading',
text: item.text || ''
});
return;
}
if (item.type === 'reading_question' || item.type === 'reading_answer') {
action.push({
type: item.type,
text: item.text || '',
answer: item.answer || '',
hint: item.hint || '',
tip: item.tip || ''
});
}
});
}
......
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