Compare commits

..

No commits in common. "9d7aad19462e21d0947b1c43967273975f61b10a" and "129f87546923242e567290db0fefc1eb29800574" have entirely different histories.

3 changed files with 52 additions and 51 deletions

View File

@ -220,7 +220,7 @@ const getStudentClassWorkData = () => {
}).then((res) => { }).then((res) => {
for (var t = 0; t < classWorkList.value.length; t++) { for (var t = 0; t < classWorkList.value.length; t++) {
for (var i = 0; i < res.rows.length; i++) { for (var i = 0; i < res.rows.length; i++) {
if (res.rows[i].classworkid == classWorkList.value[t].id && res.rows[i].finishtimelength != '0') { if (res.rows[i].classworkid == classWorkList.value[t].id && res.rows[i].resultcount > 0) {
console.log('==================') console.log('==================')
// / // /
// resultcount0 // resultcount0

View File

@ -79,17 +79,60 @@
<template #footer> <template #footer>
<el-row> <el-row>
<el-col :span="6" style="padding: 10px"> <el-col :span="6" style="padding: 10px">
<span>参考答案 <span
>参考答案
<span v-if="quItem.workanswerFormat != ''"> <span v-if="quItem.workanswerFormat != ''">
<sapn style="background-color: #0ed116; color: white; padding: 0 5px; border-radius: 5px;">{{ formatWorkAnswer(quItem) }}</sapn> <sapn
style="
background-color: #0ed116;
color: white;
padding: 0 5px;
border-radius: 5px;
"
>{{ quItem.workanswerFormat.replace(/<[^>]+>/g, '') }}</sapn
>
</span> </span>
</span> </span>
</el-col> </el-col>
<el-col :span="6" style="padding: 10px"> <el-col :span="6" style="padding: 10px">
<!-- <span>学生答案{{ stuItem.feedcontent }}</span> --> <!-- <span>学生答案{{ stuItem.feedcontent }}</span> -->
<span>学生答案 <span
<span v-if="stuItem.feedcontent !=''" style="background-color: red; color: white; padding: 0 5px; border-radius: 5px;"> >学生答案
{{ formatFeedContent(stuItem, quItem) }} <span v-if="quItem.workdesc == ''|| quItem.workdesc == '[]' ">
<!-- quItem.workdesc 没值说明是非选择题 -->
<span
v-if="stuItem.feedcontent != ''"
style="
background-color: red;
color: white;
padding: 0 5px;
border-radius: 5px;
"
>
{{ stuItem.feedcontent.replace('#', '、') }}
</span>
</span>
<span v-else>
<!-- 选择题类型学生答题转换为 ABCD格式 -->
<span
v-if="stuItem.feedcontent != ''"
style="
background-color: red;
color: white;
padding: 0 5px;
border-radius: 5px;
"
>
{{
JSON.parse(quItem.workdesc)
.map((item, index) => {
if (item == stuItem.feedcontent) {
return String.fromCharCode(65 + Number(index))
}
})
.filter(Boolean)[0]
}}
</span>
</span> </span>
</span> </span>
</el-col> </el-col>
@ -456,7 +499,6 @@ import { ElMessageBox, ElMessage } from 'element-plus'
import { updateClassworkeval, updateClassworkdata } from '@/api/classTask' import { updateClassworkeval, updateClassworkdata } from '@/api/classTask'
import { getTimeDate } from '@/utils/date' import { getTimeDate } from '@/utils/date'
import ReFilePreview from '@/components/refile-preview/index.vue' import ReFilePreview from '@/components/refile-preview/index.vue'
import { quizStrToList } from '@/utils/comm';
const userStore = useUserStore() const userStore = useUserStore()
@ -800,47 +842,6 @@ const acceptParams = (params) => {
analysisScoreOpen.value = true analysisScoreOpen.value = true
} }
const formatWorkAnswer = (quItem) => {
let format = '';
if (!Array.isArray(quItem.workanswerFormat)) {
format = quItem.workanswerFormat.replace(/<[^>]+>/g, '')
} else {
format = quItem.workanswerFormat.map(item => item.replace(/<[^>]+>/g, '')).join('、');
}
return format;
}
//
const formatFeedContent = (stuItem, quItem) => {
let format = '';
if (quItem.workdesc == '' || quItem.workdesc == '[]') {
//
const arr = stuItem.feedcontent.split('#');
return arr.map(item => {
if (item == '') {
item = '空';
}
return item;
}).join('、');
}else {
const list = quizStrToList(quItem.workdesc);
format = list.map((item,index) =>{
if (quItem.worktype == '单选题') {
const workdesc = item.replace(/<[^>]*>/g,'');
const feedcontent = stuItem.feedcontent.replace(/<[^>]*>/g,'');
if(workdesc == feedcontent){
return (String.fromCharCode(65+Number(index)))
}
} else if (quItem.worktype == '多选题') {
const arr = stuItem.feedcontent.split(',');
return arr.map(item => String.fromCharCode(65+Number(item))).join('');
}
}).filter(Boolean)[0];
}
return format;
}
// //
const onClassWorkFormScoreSave = () => { const onClassWorkFormScoreSave = () => {
console.log(classWorkFormScore) console.log(classWorkFormScore)

View File

@ -383,7 +383,7 @@ const getClassWorkStudentList = (rowId) => {
// //
tableRadio.list = tableRadio.list =
classWorkAnalysis.classworkdata && classWorkAnalysis.classworkdata &&
classWorkAnalysis.classworkdata.filter((item) => item.finishtimelength != '0') classWorkAnalysis.classworkdata.filter((item) => item.resultcount > 0)
tableRadio.value = '1' tableRadio.value = '1'
tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length
tableRadio.num1 = tableRadio.list.length tableRadio.num1 = tableRadio.list.length
@ -506,12 +506,12 @@ const tableRadioChange = (e) => {
console.log(e,'??????') console.log(e,'??????')
console.log("学生列表:", classWorkAnalysis.classworkdata) console.log("学生列表:", classWorkAnalysis.classworkdata)
if(e=='1'){ if(e=='1'){
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength != '0') tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.resultcount > 0)
tableRadio.value = '1'; tableRadio.value = '1';
tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length; tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length;
tableRadio.num1 = tableRadio.list.length; tableRadio.num1 = tableRadio.list.length;
}else if(e=='0'){ }else if(e=='0'){
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength == '0') tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.resultcount == 0)
tableRadio.value = '0'; tableRadio.value = '0';
tableRadio.num0 = tableRadio.list.length; tableRadio.num0 = tableRadio.list.length;
tableRadio.num1 = classWorkAnalysis.classworkdata.length - tableRadio.list.length; tableRadio.num1 = classWorkAnalysis.classworkdata.length - tableRadio.list.length;