Compare commits
4 Commits
b06ad0f411
...
89ae43a458
Author | SHA1 | Date |
---|---|---|
baigl | 89ae43a458 | |
白了个白 | 9d7aad1946 | |
ekooo | 499e428138 | |
“zouyf” | 4e835cac82 |
|
@ -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('==================')
|
||||||
// 有几个学生完成/正在完成学习任务
|
// 有几个学生完成/正在完成学习任务
|
||||||
// 至少resultcount不是0
|
// 至少resultcount不是0
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue