|
@@ -1,7 +1,11 @@
|
|
|
<template>
|
|
|
<div class="c_box">
|
|
|
<div class="c_box_title">{{ title }}</div>
|
|
|
- <div class="c_box_score">总分:{{ score }}分<span v-if="name" style="margin-left: 10px;">答题人:{{ name }}</span></div>
|
|
|
+ <div class="c_box_score">
|
|
|
+ <span>总分:{{ score }}</span>
|
|
|
+ <span v-if="name" style="margin-left: 10px;">答题人:{{ name }}</span>
|
|
|
+ <span style="margin-left: 10px;">得分:{{ score2 }}</span>
|
|
|
+ </div>
|
|
|
<div class="c_body">
|
|
|
<div v-if="type == 3">
|
|
|
<div v-for="(item, index) in checkArray[page].array" :key="index" class="check_box">
|
|
@@ -110,7 +114,7 @@ export default {
|
|
|
},
|
|
|
score() {
|
|
|
let score = 0
|
|
|
- this.cJson.forEach(el => {
|
|
|
+ this.checkArray.forEach(el => {
|
|
|
if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
|
|
|
el.array.forEach(item => {
|
|
|
if (item.ttype == 2 && item.array.length > 0) {
|
|
@@ -127,7 +131,29 @@ export default {
|
|
|
score += el.json.score ? parseFloat(el.json.score) : 0
|
|
|
}
|
|
|
})
|
|
|
- return score > 0 ? score : '未设置分数'
|
|
|
+ return score > 0 ? score + '分' : '未设置分数'
|
|
|
+ },
|
|
|
+ score2() {
|
|
|
+ let score = 0
|
|
|
+ // let type = 1
|
|
|
+ this.checkArray.forEach(el => {
|
|
|
+ if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
|
|
|
+ el.array.forEach(item => {
|
|
|
+ if (item.ttype == 2 && item.array.length > 0) {
|
|
|
+ item.array.forEach(item2 => {
|
|
|
+ if (item2.ttype == 1 && item2.json) {
|
|
|
+ score += item2.json.score2 ? parseFloat(item2.json.score2) : 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (item.ttype == 1 && item.json) {
|
|
|
+ score += item.json.score2 ? parseFloat(item.json.score2) : 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (el.ttype == 1 && el.json) {
|
|
|
+ score += el.json.score2 ? parseFloat(el.json.score2) : 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return score + '分'
|
|
|
}
|
|
|
},
|
|
|
watch: {
|