Compare commits

..

4 Commits

Author SHA1 Message Date
baigl 89ae43a458 Merge pull request 'baigl' (#221) from baigl into main
Reviewed-on: #221
2024-09-19 11:30:20 +08:00
白了个白 9d7aad1946 Merge branch 'zouyf_dev' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk into baigl 2024-09-19 11:28:45 +08:00
ekooo 499e428138 Merge branch 'main' into zouyf_dev
# Conflicts:
#	src/renderer/src/components/set-homework/index.vue
2024-09-18 20:02:53 +08:00
“zouyf” 4e835cac82 Merge branch 'main' into zouyf_dev 2024-09-18 14:57:46 +08:00
3 changed files with 51 additions and 52 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].resultcount > 0) { if (res.rows[i].classworkid == classWorkList.value[t].id && res.rows[i].finishtimelength != '0') {
console.log('==================') console.log('==================')
// / // /
// resultcount0 // resultcount0

View File

@ -79,60 +79,17 @@
<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 <sapn style="background-color: #0ed116; color: white; padding: 0 5px; border-radius: 5px;">{{ formatWorkAnswer(quItem) }}</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;">
<span v-if="quItem.workdesc == ''|| quItem.workdesc == '[]' "> {{ formatFeedContent(stuItem, quItem) }}
<!-- 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>
@ -499,6 +456,7 @@ 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()
@ -842,6 +800,47 @@ 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.resultcount > 0) classWorkAnalysis.classworkdata.filter((item) => item.finishtimelength != '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.resultcount > 0) tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength != '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.resultcount == 0) tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength == '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;