zouyf_dev #380

Merged
zouyf merged 4 commits from zouyf_dev into main 2024-10-31 12:36:33 +08:00
3 changed files with 44 additions and 5 deletions
Showing only changes of commit d845377879 - Show all commits

View File

@ -4,7 +4,7 @@
<el-tab-pane :label="item.label" style="text-align:left" stretch="true"> <el-tab-pane :label="item.label" style="text-align:left" stretch="true">
<template v-if="item.stuList.length > 0"> <template v-if="item.stuList.length > 0">
<template v-for="(stuItem,stuIndex) in item.stuList" :key="stuIndex"> <template v-for="(stuItem,stuIndex) in item.stuList" :key="stuIndex">
<el-tag style="margin:5px 10px 0 0" type="primary">{{stuItem.studentname}}</el-tag> <el-tag style="margin:5px 10px 0 0" type="primary">{{ stuItem.studentname }}:{{ stuItem.getScore }}</el-tag>
</template> </template>
</template> </template>
<template v-else> <template v-else>

View File

@ -87,6 +87,11 @@
<span v-if="tableRadio.value==1">{{ scope.row.updatedate }}</span> <span v-if="tableRadio.value==1">{{ scope.row.updatedate }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="tableRadio.value==0?'':'得分'" prop="score" width="80" align="center" >
<template #default="scope" v-if="tableRadio.value==1">
<span style="color: #2196f3">{{scope.row.getScore || 0}}</span>
</template>
</el-table-column>
<el-table-column label="批阅状态" prop="teacherRating" align="center" width="120" sortable> <el-table-column label="批阅状态" prop="teacherRating" align="center" width="120" sortable>
<template #default="scope"> <template #default="scope">
<template v-if="scope.row.teacherRating == 0"> <template v-if="scope.row.teacherRating == 0">
@ -359,21 +364,27 @@ const getClassWorkStudentList = (rowId) => {
const evalarray = JSON.parse('[' + response.rows[i].classworkevallist + ']') const evalarray = JSON.parse('[' + response.rows[i].classworkevallist + ']')
var scoingCount = 0 var scoingCount = 0
var feedcount = 0 var feedcount = 0
let score = 0
for (var e = 0; e < evalarray.length; e++) { for (var e = 0; e < evalarray.length; e++) {
if (evalarray[e].feedcontent != '') { if (evalarray[e].feedcontent != '') {
feedcount++ feedcount++
// //
if (evalarray[e].feedcontent == evalarray[e].rightanswer) { if (evalarray[e].feedcontent == evalarray[e].rightanswer) {
scoingCount++ scoingCount++
score += evalarray[e].score;
evalarray[e].teacherRating = evalarray[e].score
} }
} }
} }
const allScore = evalarray.reduce((acc, cur) => acc + cur.score, 0)
//console.log(evalarray, 'evalarray------------------------------------') //console.log(evalarray, 'evalarray------------------------------------')
if (feedcount > 0) { if (feedcount > 0) {
// : /*100 // : /*100
response.rows[i].scoingRate = ((scoingCount / feedcount) * 100).toFixed(0) + '%' response.rows[i].scoingRate = ((score / allScore) * 100).toFixed(0) + '%'
response.rows[i].getScore = score
} else { } else {
response.rows[i].scoingRate = '0%' response.rows[i].scoingRate = '0%'
response.rows[i].getScore = 0
} }
// : // :
if (evalarray[0].rating != '') { if (evalarray[0].rating != '') {
@ -381,6 +392,7 @@ const getClassWorkStudentList = (rowId) => {
} }
} else { } else {
response.rows[i].scoingRate = '0%' response.rows[i].scoingRate = '0%'
response.rows[i].getScore = 0
} }
} }
classWorkAnalysis.classworkdata = response.rows classWorkAnalysis.classworkdata = response.rows
@ -624,6 +636,7 @@ const handleClassOverviewOpen = (type) =>{
response.rows.forEach(item => { response.rows.forEach(item => {
let rightAnswer = 0 let rightAnswer = 0
let answers = 0 let answers = 0
let score = 0
if(!item.classworkevallist) return if(!item.classworkevallist) return
// 使 // 使
let replacedString = item.classworkevallist.replace(/""/g, "\""); let replacedString = item.classworkevallist.replace(/""/g, "\"");
@ -642,12 +655,18 @@ const handleClassOverviewOpen = (type) =>{
// //
if(itemTopic.feedcontent === itemTopic.rightanswer){ if(itemTopic.feedcontent === itemTopic.rightanswer){
rightAnswer ++ rightAnswer ++
score += itemTopic.score
itemTopic.teacherRating = itemTopic.score
} }
} }
}) })
rightAnswer > 0?item.scoingRate = (rightAnswer/answers * 100).toFixed(0):item.scoingRate = '' const allScore = allTopic.reduce((acc, cur) => {
return acc + cur.score;
},0)
rightAnswer > 0?item.scoingRate = (score/allScore * 100).toFixed(0):item.scoingRate = ''
}else{ }else{
item.scoingRate = '' item.scoingRate = ''
item.getScore = 0
} }
// //
const point = allTopic.reduce((acc, cur) => { const point = allTopic.reduce((acc, cur) => {

View File

@ -77,6 +77,11 @@
<span v-if="tableRadio.value==1">{{ scope.row.updatedate }}</span> <span v-if="tableRadio.value==1">{{ scope.row.updatedate }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="tableRadio.value==0?'':'得分'" prop="score" width="80" align="center" >
<template #default="scope" v-if="tableRadio.value==1">
<span style="color: #2196f3">{{scope.row.getScore || 0}}</span>
</template>
</el-table-column>
<el-table-column label="批阅状态" prop="teacherRating" align="center" width="120" sortable> <el-table-column label="批阅状态" prop="teacherRating" align="center" width="120" sortable>
<template #default="scope"> <template #default="scope">
<template v-if="scope.row.teacherRating == 0"> <template v-if="scope.row.teacherRating == 0">
@ -356,21 +361,27 @@ const getClassWorkStudentList = (rowId) => {
const evalarray = JSON.parse('[' + response.rows[i].classworkevallist + ']') const evalarray = JSON.parse('[' + response.rows[i].classworkevallist + ']')
var scoingCount = 0 var scoingCount = 0
var feedcount = 0 var feedcount = 0
let score = 0
for (var e = 0; e < evalarray.length; e++) { for (var e = 0; e < evalarray.length; e++) {
if (evalarray[e].feedcontent != '') { if (evalarray[e].feedcontent != '') {
feedcount++ feedcount++
// //
if (evalarray[e].feedcontent == evalarray[e].rightanswer) { if (evalarray[e].feedcontent == evalarray[e].rightanswer) {
scoingCount++ scoingCount++
score += evalarray[e].score;
evalarray[e].teacherRating = evalarray[e].score
} }
} }
} }
const allScore = evalarray.reduce((acc, cur) => acc + cur.score, 0)
//console.log(evalarray, 'evalarray------------------------------------') //console.log(evalarray, 'evalarray------------------------------------')
if (feedcount > 0) { if (feedcount > 0) {
// : /*100 // : /*100
response.rows[i].scoingRate = ((scoingCount / feedcount) * 100).toFixed(0) + '%' response.rows[i].scoingRate = ((score / allScore) * 100).toFixed(0) + '%'
response.rows[i].getScore = score
} else { } else {
response.rows[i].scoingRate = '0%' response.rows[i].scoingRate = '0%'
response.rows[i].getScore = 0
} }
// : // :
if (evalarray[0].rating != '') { if (evalarray[0].rating != '') {
@ -378,6 +389,7 @@ const getClassWorkStudentList = (rowId) => {
} }
} else { } else {
response.rows[i].scoingRate = '0%' response.rows[i].scoingRate = '0%'
response.rows[i].getScore = 0
} }
} }
classWorkAnalysis.classworkdata = response.rows classWorkAnalysis.classworkdata = response.rows
@ -639,6 +651,7 @@ const handleClassOverviewOpen = (type) =>{
response.rows.forEach(item => { response.rows.forEach(item => {
let rightAnswer = 0 let rightAnswer = 0
let answers = 0 let answers = 0
let score = 0
if(!item.classworkevallist) return if(!item.classworkevallist) return
// 使 // 使
let replacedString = item.classworkevallist.replace(/""/g, "\""); let replacedString = item.classworkevallist.replace(/""/g, "\"");
@ -657,12 +670,19 @@ const handleClassOverviewOpen = (type) =>{
// //
if(itemTopic.feedcontent === itemTopic.rightanswer){ if(itemTopic.feedcontent === itemTopic.rightanswer){
rightAnswer ++ rightAnswer ++
score += itemTopic.score
itemTopic.teacherRating = itemTopic.score
} }
} }
}) })
rightAnswer > 0?item.scoingRate = (rightAnswer/answers * 100).toFixed(0):item.scoingRate = '' const allScore = allTopic.reduce((acc, cur) => {
return acc + cur.score;
},0)
rightAnswer > 0?item.scoingRate = (score/allScore * 100).toFixed(0):item.scoingRate = ''
item.getScore = score
}else{ }else{
item.scoingRate = '' item.scoingRate = ''
item.getScore = 0
} }
// //
const point = allTopic.reduce((acc, cur) => { const point = allTopic.reduce((acc, cur) => {