Merge pull request 'fix:新增学生的得分以及修改得分率;' (#377) from yangws into main

Reviewed-on: #377
This commit is contained in:
yangws 2024-10-29 14:13:33 +08:00
commit adc4f99636
3 changed files with 44 additions and 5 deletions

View File

@ -4,7 +4,7 @@
<el-tab-pane :label="item.label" style="text-align:left" stretch="true">
<template v-if="item.stuList.length > 0">
<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 v-else>

View File

@ -87,6 +87,11 @@
<span v-if="tableRadio.value==1">{{ scope.row.updatedate }}</span>
</template>
</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>
<template #default="scope">
<template v-if="scope.row.teacherRating == 0">
@ -359,21 +364,27 @@ const getClassWorkStudentList = (rowId) => {
const evalarray = JSON.parse('[' + response.rows[i].classworkevallist + ']')
var scoingCount = 0
var feedcount = 0
let score = 0
for (var e = 0; e < evalarray.length; e++) {
if (evalarray[e].feedcontent != '') {
feedcount++
//
if (evalarray[e].feedcontent == evalarray[e].rightanswer) {
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------------------------------------')
if (feedcount > 0) {
// : /*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 {
response.rows[i].scoingRate = '0%'
response.rows[i].getScore = 0
}
// :
if (evalarray[0].rating != '') {
@ -381,6 +392,7 @@ const getClassWorkStudentList = (rowId) => {
}
} else {
response.rows[i].scoingRate = '0%'
response.rows[i].getScore = 0
}
}
classWorkAnalysis.classworkdata = response.rows
@ -624,6 +636,7 @@ const handleClassOverviewOpen = (type) =>{
response.rows.forEach(item => {
let rightAnswer = 0
let answers = 0
let score = 0
if(!item.classworkevallist) return
// 使
let replacedString = item.classworkevallist.replace(/""/g, "\"");
@ -642,12 +655,18 @@ const handleClassOverviewOpen = (type) =>{
//
if(itemTopic.feedcontent === itemTopic.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{
item.scoingRate = ''
item.getScore = 0
}
//
const point = allTopic.reduce((acc, cur) => {

View File

@ -77,6 +77,11 @@
<span v-if="tableRadio.value==1">{{ scope.row.updatedate }}</span>
</template>
</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>
<template #default="scope">
<template v-if="scope.row.teacherRating == 0">
@ -356,21 +361,27 @@ const getClassWorkStudentList = (rowId) => {
const evalarray = JSON.parse('[' + response.rows[i].classworkevallist + ']')
var scoingCount = 0
var feedcount = 0
let score = 0
for (var e = 0; e < evalarray.length; e++) {
if (evalarray[e].feedcontent != '') {
feedcount++
//
if (evalarray[e].feedcontent == evalarray[e].rightanswer) {
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------------------------------------')
if (feedcount > 0) {
// : /*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 {
response.rows[i].scoingRate = '0%'
response.rows[i].getScore = 0
}
// :
if (evalarray[0].rating != '') {
@ -378,6 +389,7 @@ const getClassWorkStudentList = (rowId) => {
}
} else {
response.rows[i].scoingRate = '0%'
response.rows[i].getScore = 0
}
}
classWorkAnalysis.classworkdata = response.rows
@ -639,6 +651,7 @@ const handleClassOverviewOpen = (type) =>{
response.rows.forEach(item => {
let rightAnswer = 0
let answers = 0
let score = 0
if(!item.classworkevallist) return
// 使
let replacedString = item.classworkevallist.replace(/""/g, "\"");
@ -657,12 +670,19 @@ const handleClassOverviewOpen = (type) =>{
//
if(itemTopic.feedcontent === itemTopic.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{
item.scoingRate = ''
item.getScore = 0
}
//
const point = allTopic.reduce((acc, cur) => {