|
@@ -1,6 +1,6 @@
|
|
|
<!-- -->
|
|
|
<template>
|
|
|
- <div :class="['Big-Book-PictureBox']" v-if="curQue">
|
|
|
+ <div :class="['Big-Book-PictureBox']" v-if="curQue && curQue.Bookanswer">
|
|
|
<!-- <ul class="Big-Book-PictureBox-item" v-for="(item,index) in curQue.queList" :key="index"> -->
|
|
|
<li v-for="(items, indexs) in curQue.option" :key="indexs">
|
|
|
<template v-if="ChildType != 'image_gdcy' && items.hanziSite == 'top'">
|
|
@@ -64,7 +64,7 @@
|
|
|
>
|
|
|
<input
|
|
|
class="singleInput"
|
|
|
- v-model="userAnswer.input"
|
|
|
+ v-model="curQue.Bookanswer[0].input"
|
|
|
placeholder="输入"
|
|
|
@blur="handleInput('input')"
|
|
|
/>
|
|
@@ -75,7 +75,7 @@
|
|
|
<div class="fill-box">
|
|
|
<b v-if="items.hanzi">{{ items.hanzi }}</b>
|
|
|
<input
|
|
|
- v-model="userAnswer.input"
|
|
|
+ v-model="curQue.Bookanswer[0].input"
|
|
|
placeholder="输入"
|
|
|
@blur="handleInput('input')"
|
|
|
/>
|
|
@@ -87,12 +87,12 @@
|
|
|
<input
|
|
|
placeholder="输入"
|
|
|
@blur="handleInput('dInput', 0)"
|
|
|
- v-model="userAnswer.dInput[0]"
|
|
|
+ v-model="curQue.Bookanswer[0].dInput[0]"
|
|
|
/>
|
|
|
<input
|
|
|
placeholder="输入"
|
|
|
@blur="handleInput('dInput', 1)"
|
|
|
- v-model="userAnswer.dInput[1]"
|
|
|
+ v-model="curQue.Bookanswer[0].dInput[1]"
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -100,24 +100,30 @@
|
|
|
<template v-if="ChildType == 'image_judge'">
|
|
|
<div class="judge-box">
|
|
|
<a
|
|
|
- :class="['right-btn', userAnswer.judge == 'right' ? 'active' : '']"
|
|
|
+ :class="[
|
|
|
+ 'right-btn',
|
|
|
+ curQue.Bookanswer[0].judge == 'right' ? 'active' : '',
|
|
|
+ ]"
|
|
|
@click="handleSelectJudge('right')"
|
|
|
></a>
|
|
|
<a
|
|
|
- :class="['error-btn', userAnswer.judge == 'error' ? 'active' : '']"
|
|
|
+ :class="[
|
|
|
+ 'error-btn',
|
|
|
+ curQue.Bookanswer[0].judge == 'error' ? 'active' : '',
|
|
|
+ ]"
|
|
|
@click="handleSelectJudge('error')"
|
|
|
></a>
|
|
|
</div>
|
|
|
</template>
|
|
|
<!-- 单选 -->
|
|
|
<template v-if="ChildType == 'image_single'">
|
|
|
- <el-radio v-model="userAnswer.singleRadio" label="1"
|
|
|
+ <el-radio v-model="curQue.Bookanswer[0].singleRadio" label="1"
|
|
|
><span></span
|
|
|
></el-radio>
|
|
|
</template>
|
|
|
<!-- 复选 -->
|
|
|
<template v-if="ChildType == 'image_checkBox'">
|
|
|
- <el-checkbox v-model="userAnswer.singlechecked"
|
|
|
+ <el-checkbox v-model="curQue.Bookanswer[0].singlechecked"
|
|
|
><span></span
|
|
|
></el-checkbox>
|
|
|
</template>
|
|
@@ -167,6 +173,7 @@ export default {
|
|
|
judge: "", // 判断
|
|
|
singleRadio: "",
|
|
|
singlechecked: false,
|
|
|
+ recordList: [],
|
|
|
}, // 记录用户答题内容
|
|
|
recorder: new Recorder({
|
|
|
sampleBits: 16, // 采样位数,支持 8 或 16,默认是16
|
|
@@ -186,17 +193,18 @@ export default {
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
handleFnList() {
|
|
|
+ if (!this.curQue.Bookanswer) {
|
|
|
+ this.$set(this.curQue, "Bookanswer", []);
|
|
|
+ this.curQue.Bookanswer.push(
|
|
|
+ JSON.parse(JSON.stringify(this.userAnswer))
|
|
|
+ );
|
|
|
+ console.log(this.curQue);
|
|
|
+ }
|
|
|
let obj = "";
|
|
|
this.curQue.fn_list.forEach((node) => {
|
|
|
if (node.isFn) {
|
|
|
obj += node.type + ",";
|
|
|
}
|
|
|
- // if(obj.indexOf('input')>-1){
|
|
|
- // node.option.forEach((i)=>{
|
|
|
- // userItem.push('')
|
|
|
- // })
|
|
|
- // }
|
|
|
- // this.userAnswer.push(userItem)
|
|
|
});
|
|
|
this.fn_list_obj = obj;
|
|
|
},
|
|
@@ -218,12 +226,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 去掉前后空格
|
|
|
- handleInput(index, indexs) {
|
|
|
+ handleInput(key, indexs) {
|
|
|
if (indexs || indexs == 0) {
|
|
|
let res = this.userAnswer[index][indexs].trim();
|
|
|
this.$set(this.userAnswer[index], indexs, res);
|
|
|
} else {
|
|
|
- this.userAnswer[index] = this.userAnswer[index].trim();
|
|
|
+ this.curQue.Bookanswer[0][key] = this.curQue.Bookanswer[0][key].trim();
|
|
|
}
|
|
|
},
|
|
|
playmicrophone(url, type) {
|
|
@@ -255,11 +263,9 @@ export default {
|
|
|
handleSelectJudge(obj) {
|
|
|
this.userAnswer.judge = obj;
|
|
|
},
|
|
|
- handleWav(data) {
|
|
|
- this.userAnswer = [];
|
|
|
- this.userAnswer.push(data);
|
|
|
- // this.getAnswer(this.userAnswer, this.queIndex);
|
|
|
- this.cur.BookWavAnswerWav = [data];
|
|
|
+ handleWav(list, tmIndex) {
|
|
|
+ tmIndex = tmIndex ? tmIndex : 0;
|
|
|
+ this.$set(this.curQue.Bookanswer[tmIndex], "recordList", list);
|
|
|
},
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|