Compare commits
15 Commits
531a62ad64
...
a0327ad556
Author | SHA1 | Date |
---|---|---|
小杨 | a0327ad556 | |
baigl | ada6659666 | |
白了个白 | d65eb565e5 | |
zouyf | 678f43e548 | |
“zouyf” | 8f4845a37c | |
白了个白 | 2db7d3e872 | |
“zouyf” | 4c10409e07 | |
zhengdegang | 4418d1ae27 | |
zdg | fc7868afa6 | |
zdg | 1b3d226412 | |
zhengdegang | fb5daf221f | |
zdg | eca5f8f815 | |
“zouyf” | d845377879 | |
“zouyf” | 90d37e725b | |
yangws | adc4f99636 |
|
@ -71,6 +71,16 @@ export function updateClassworkeval(data) {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
// 修改classworkeval
|
||||
export function updateClassworkevalList(data) {
|
||||
return request({
|
||||
url: '/education/classworkeval/updateList',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改classworkdata
|
||||
export function updateClassworkdata(data) {
|
||||
return request({
|
||||
|
|
|
@ -147,8 +147,12 @@ const initData = () => {
|
|||
})
|
||||
}
|
||||
else if (o.worktype == '填空题') { // 填空题
|
||||
const regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||
children = (o.title||'').match(regex).map((v,i) => {
|
||||
let title = o.title.replace(/_{3,}/g, '_____'); //将3-10的下划线统一格式为5个
|
||||
let regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||
if (title.indexOf('_____') != -1) {
|
||||
regex = /_{5}/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||
}
|
||||
children = (title||'').match(regex).map((v,i) => {
|
||||
const def = `填空项 ${i+1}`
|
||||
//const code = '( )'
|
||||
const code = '(略)', txt=v
|
||||
|
|
|
@ -27,7 +27,9 @@ const tableData = ref([])
|
|||
const konwledge = ref([])
|
||||
const hasStudents = ref([])
|
||||
// 获取的所有得分
|
||||
const allScore = ref([])
|
||||
const allScore = ref(0)
|
||||
// 平均分
|
||||
const avatarScore = ref()
|
||||
//所有题目的知识点
|
||||
const getKonwledge = () => {
|
||||
const getScoreRate = []
|
||||
|
@ -41,7 +43,7 @@ const getKonwledge = () => {
|
|||
if(!ledges.includes(title.id)){
|
||||
ledges.push(title.id)
|
||||
// 假如分数是0 或者 得分率为空
|
||||
konwledge.value.push({title:title.title,allPoint:allScore.value,id:title.id})
|
||||
konwledge.value.push({title:title.title,allPoint:allScore.value,id:title.id,point:avatarScore.value})
|
||||
}
|
||||
// 判断学生是否答过题
|
||||
if(useOverview.allData[0].hasAnswers.includes(item.studentid))
|
||||
|
@ -51,29 +53,12 @@ const getKonwledge = () => {
|
|||
|
||||
// 看看有几个知识点
|
||||
konwledge.value.forEach(item => {
|
||||
let sunRate = 0
|
||||
let num = 0
|
||||
if(getScoreRate.length === 0) return
|
||||
|
||||
getScoreRate.forEach(item2 => {
|
||||
if(item.id === item2.id){
|
||||
sunRate += extractedNumber(item2.rate)
|
||||
num ++
|
||||
}
|
||||
})
|
||||
const scoreRate = sunRate / num
|
||||
tableData.value.push({
|
||||
scoingRate:scoreRate.toFixed(2),
|
||||
scoingRate:(item.point / item.allPoint * 100).toFixed(2),
|
||||
...item,
|
||||
point:(item.allPoint * scoreRate / 100).toFixed(2)
|
||||
})
|
||||
})
|
||||
}
|
||||
// 获取百分比的数字
|
||||
const extractedNumber = (score) => {
|
||||
const match = score.match(/\d+/);
|
||||
return match ? parseInt(match[0], 10) : null;
|
||||
}
|
||||
//组装tableList表格
|
||||
|
||||
watch(() => useOverview.tableList,() => {
|
||||
|
@ -93,6 +78,15 @@ watch(() => useOverview.tableList,() => {
|
|||
allScore.value = useOverview.allData.reduce((acc, cur) => {
|
||||
return acc + Number(cur.score)
|
||||
},0)
|
||||
// 平均分
|
||||
const studentList = useOverview.tableList.filter(item => useOverview.allData[0].hasAnswers.includes(item.studentid))
|
||||
avatarScore.value = studentList.reduce((acc, cur) => {
|
||||
return acc + Number(cur.getScore)
|
||||
},0) / studentList.length
|
||||
console.log(avatarScore.value,'useOverview.tableList');
|
||||
|
||||
|
||||
// 计算得分率
|
||||
getKonwledge()
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -427,7 +427,7 @@ import useUserStore from '@/store/modules/user'
|
|||
import { ref, reactive } from 'vue'
|
||||
// import { Plus } from '@element-plus/icons-vue'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { updateClassworkeval, updateClassworkdata, getClassworkdata } from '@/api/classTask'
|
||||
import { updateClassworkeval, updateClassworkdata, getClassworkdata, updateClassworkevalList } from '@/api/classTask'
|
||||
import { getTimeDate } from '@/utils/date'
|
||||
import ReFilePreview from '@/components/refile-preview/index.vue'
|
||||
import { quizStrToList } from '@/utils/comm';
|
||||
|
@ -898,6 +898,21 @@ const onSubmit = () => {
|
|||
// }
|
||||
})
|
||||
})
|
||||
// let queryList = [];
|
||||
// classWorkFormScore.teacherRating && classWorkFormScore.teacherRating.map((item, index) => {
|
||||
// const queryParams = {
|
||||
// id: item.id,
|
||||
// teacherRating: item.score, // 教师评分
|
||||
// rating: classWorkFormScore.rating, // 评价
|
||||
// teacherremark: classWorkFormScore.teacherremark, //评分说明
|
||||
// timestamp: getTimeDate() // 时间
|
||||
// }
|
||||
// //console.log(queryParams);
|
||||
// queryList.push(queryParams);
|
||||
// })
|
||||
// //console.log(queryList);
|
||||
// updateClassworkevalList(queryList).then((res) => {
|
||||
// })
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '提交成功!'
|
||||
|
|
|
@ -224,8 +224,13 @@ const initData = () => {
|
|||
})
|
||||
}
|
||||
else if (o.worktype == '填空题') { // 填空题
|
||||
const regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||
children = (o.title||'').match(regex).map((v,i) => {
|
||||
//console.log('填空题->', o.title);
|
||||
let title = o.title.replace(/_{3,}/g, '_____'); //将3-10的下划线统一格式为5个
|
||||
let regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||
if (title.indexOf('_____') != -1) {
|
||||
regex = /_{5}/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||
}
|
||||
children = (title||'').match(regex).map((v,i) => {
|
||||
const def = `填空项 ${i+1}`
|
||||
//const code = '( )'
|
||||
const code = '(略)', txt=v
|
||||
|
|
|
@ -82,25 +82,25 @@
|
|||
<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="rating" align="center" width="120" sortable>
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.teacherRating == 0">
|
||||
<template v-if="scope.row.rating == 0">
|
||||
<span v-if="tableRadio.value==1" style="color: #2196f3">待批阅</span>
|
||||
</template>
|
||||
<!-- 1-优 2-优减 3-良 4-良减 5-差 -->
|
||||
<template v-if="scope.row.teacherRating == 1"
|
||||
<template v-if="scope.row.rating == 1"
|
||||
><el-tag type="danger">完美</el-tag></template
|
||||
>
|
||||
<template v-if="scope.row.teacherRating == 2"
|
||||
<template v-if="scope.row.rating == 2"
|
||||
><el-tag type="danger">优秀</el-tag></template
|
||||
>
|
||||
<template v-if="scope.row.teacherRating == 3"
|
||||
<template v-if="scope.row.rating == 3"
|
||||
><el-tag type="warning">良好</el-tag></template
|
||||
>
|
||||
<template v-if="scope.row.teacherRating == 4"
|
||||
<template v-if="scope.row.rating == 4"
|
||||
><el-tag type="info">及格</el-tag></template
|
||||
>
|
||||
<template v-if="scope.row.teacherRating == 5"
|
||||
<template v-if="scope.row.rating == 5"
|
||||
><el-tag type="info">不及格</el-tag></template
|
||||
>
|
||||
</template>
|
||||
|
@ -345,7 +345,7 @@ const getClassWorkStudentList = (rowId) => {
|
|||
}
|
||||
|
||||
// 老师批阅状态 默认0 未批改
|
||||
response.rows[i].teacherRating = 0
|
||||
response.rows[i].rating = 0
|
||||
|
||||
// 计算每个学生的得分率
|
||||
if (
|
||||
|
@ -371,21 +371,23 @@ const getClassWorkStudentList = (rowId) => {
|
|||
score += evalarray[e].score;
|
||||
evalarray[e].teacherRating = evalarray[e].score
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
const allScore = evalarray.reduce((acc, cur) => acc + cur.score, 0)
|
||||
|
||||
const allTeacherRating = evalarray.reduce((acc, cur) => acc + cur.teacherRating, 0) // 老师评分
|
||||
//console.log(evalarray, 'evalarray------------------------------------')
|
||||
if (feedcount > 0) {
|
||||
// 多个题目的总得分率: 正确题数/(题目数*100)
|
||||
response.rows[i].scoingRate = ((score / allScore) * 100).toFixed(0) + '%'
|
||||
response.rows[i].getScore = score
|
||||
response.rows[i].scoingRate = ((score / allTeacherRating) * 100).toFixed(0) + '%'
|
||||
response.rows[i].getScore = allTeacherRating
|
||||
} else {
|
||||
response.rows[i].scoingRate = '0%'
|
||||
response.rows[i].getScore = 0
|
||||
}
|
||||
// 批阅状态 优良类 :注意:这里题目中的评价都是一样的,所以取第一个
|
||||
if (evalarray[0].rating != '') {
|
||||
response.rows[i].teacherRating = evalarray[0].rating
|
||||
response.rows[i].rating = evalarray[0].rating
|
||||
}
|
||||
} else {
|
||||
response.rows[i].scoingRate = '0%'
|
||||
|
@ -420,7 +422,7 @@ const teacherCriticism = ()=>{
|
|||
tableRadio.list = tableRadio.list.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
teacherRating : item.teacherRating || checkWorkType(item)
|
||||
rating : item.rating || checkWorkType(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -675,10 +677,11 @@ const handleClassOverviewOpen = (type) =>{
|
|||
}
|
||||
}
|
||||
})
|
||||
const allScore = allTopic.reduce((acc, cur) => {
|
||||
return acc + cur.score;
|
||||
const allTeacherRating = allTopic.reduce((acc, cur) => {
|
||||
return acc + cur.teacherRating;
|
||||
},0)
|
||||
rightAnswer > 0?item.scoingRate = (score/allScore * 100).toFixed(0):item.scoingRate = ''
|
||||
|
||||
rightAnswer > 0?item.scoingRate = (score/allTeacherRating * 100).toFixed(0):item.scoingRate = ''
|
||||
item.getScore = score
|
||||
}else{
|
||||
item.scoingRate = ''
|
||||
|
|
|
@ -257,11 +257,11 @@ defineExpose({ trigger })
|
|||
border-radius: 3px;
|
||||
min-width: 15px;
|
||||
// height: 500px;
|
||||
&.like{
|
||||
&.like{ // 点赞
|
||||
background-image: linear-gradient(to top, #d2f0cb, #2f9e44);
|
||||
// animation: striped-flow 5s linear infinite;
|
||||
}
|
||||
&.doubt{
|
||||
&.doubt{ // 疑惑
|
||||
background-image: linear-gradient(to top, #ebc6c6, #ff0000);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue