Compare commits
No commits in common. "a0327ad556db442b7e8d1e1d7826934f3aa470c6" and "531a62ad6499b12c4330e9ce873df306cfa0cc01" have entirely different histories.
a0327ad556
...
531a62ad64
|
@ -71,16 +71,6 @@ 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,12 +147,8 @@ const initData = () => {
|
|||
})
|
||||
}
|
||||
else if (o.worktype == '填空题') { // 填空题
|
||||
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 regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||
children = (o.title||'').match(regex).map((v,i) => {
|
||||
const def = `填空项 ${i+1}`
|
||||
//const code = '( )'
|
||||
const code = '(略)', txt=v
|
||||
|
|
|
@ -27,9 +27,7 @@ const tableData = ref([])
|
|||
const konwledge = ref([])
|
||||
const hasStudents = ref([])
|
||||
// 获取的所有得分
|
||||
const allScore = ref(0)
|
||||
// 平均分
|
||||
const avatarScore = ref()
|
||||
const allScore = ref([])
|
||||
//所有题目的知识点
|
||||
const getKonwledge = () => {
|
||||
const getScoreRate = []
|
||||
|
@ -43,7 +41,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,point:avatarScore.value})
|
||||
konwledge.value.push({title:title.title,allPoint:allScore.value,id:title.id})
|
||||
}
|
||||
// 判断学生是否答过题
|
||||
if(useOverview.allData[0].hasAnswers.includes(item.studentid))
|
||||
|
@ -53,12 +51,29 @@ 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:(item.point / item.allPoint * 100).toFixed(2),
|
||||
scoingRate:scoreRate.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,() => {
|
||||
|
@ -78,15 +93,6 @@ 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, updateClassworkevalList } from '@/api/classTask'
|
||||
import { updateClassworkeval, updateClassworkdata, getClassworkdata } from '@/api/classTask'
|
||||
import { getTimeDate } from '@/utils/date'
|
||||
import ReFilePreview from '@/components/refile-preview/index.vue'
|
||||
import { quizStrToList } from '@/utils/comm';
|
||||
|
@ -898,21 +898,6 @@ 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,13 +224,8 @@ const initData = () => {
|
|||
})
|
||||
}
|
||||
else if (o.worktype == '填空题') { // 填空题
|
||||
//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 regex = /<!--BA-->(.*?)<!--EA-->/g // 定义正则表达式,匹配 <!--BA-->xxx<!--EA--> 格式的内容
|
||||
children = (o.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="rating" align="center" width="120" sortable>
|
||||
<el-table-column label="批阅状态" prop="teacherRating" align="center" width="120" sortable>
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.rating == 0">
|
||||
<template v-if="scope.row.teacherRating == 0">
|
||||
<span v-if="tableRadio.value==1" style="color: #2196f3">待批阅</span>
|
||||
</template>
|
||||
<!-- 1-优 2-优减 3-良 4-良减 5-差 -->
|
||||
<template v-if="scope.row.rating == 1"
|
||||
<template v-if="scope.row.teacherRating == 1"
|
||||
><el-tag type="danger">完美</el-tag></template
|
||||
>
|
||||
<template v-if="scope.row.rating == 2"
|
||||
<template v-if="scope.row.teacherRating == 2"
|
||||
><el-tag type="danger">优秀</el-tag></template
|
||||
>
|
||||
<template v-if="scope.row.rating == 3"
|
||||
<template v-if="scope.row.teacherRating == 3"
|
||||
><el-tag type="warning">良好</el-tag></template
|
||||
>
|
||||
<template v-if="scope.row.rating == 4"
|
||||
<template v-if="scope.row.teacherRating == 4"
|
||||
><el-tag type="info">及格</el-tag></template
|
||||
>
|
||||
<template v-if="scope.row.rating == 5"
|
||||
<template v-if="scope.row.teacherRating == 5"
|
||||
><el-tag type="info">不及格</el-tag></template
|
||||
>
|
||||
</template>
|
||||
|
@ -345,7 +345,7 @@ const getClassWorkStudentList = (rowId) => {
|
|||
}
|
||||
|
||||
// 老师批阅状态 默认0 未批改
|
||||
response.rows[i].rating = 0
|
||||
response.rows[i].teacherRating = 0
|
||||
|
||||
// 计算每个学生的得分率
|
||||
if (
|
||||
|
@ -371,23 +371,21 @@ const getClassWorkStudentList = (rowId) => {
|
|||
score += evalarray[e].score;
|
||||
evalarray[e].teacherRating = evalarray[e].score
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const allTeacherRating = evalarray.reduce((acc, cur) => acc + cur.teacherRating, 0) // 老师评分
|
||||
const allScore = evalarray.reduce((acc, cur) => acc + cur.score, 0)
|
||||
//console.log(evalarray, 'evalarray------------------------------------')
|
||||
if (feedcount > 0) {
|
||||
// 多个题目的总得分率: 正确题数/(题目数*100)
|
||||
response.rows[i].scoingRate = ((score / allTeacherRating) * 100).toFixed(0) + '%'
|
||||
response.rows[i].getScore = allTeacherRating
|
||||
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 != '') {
|
||||
response.rows[i].rating = evalarray[0].rating
|
||||
response.rows[i].teacherRating = evalarray[0].rating
|
||||
}
|
||||
} else {
|
||||
response.rows[i].scoingRate = '0%'
|
||||
|
@ -422,7 +420,7 @@ const teacherCriticism = ()=>{
|
|||
tableRadio.list = tableRadio.list.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
rating : item.rating || checkWorkType(item)
|
||||
teacherRating : item.teacherRating || checkWorkType(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -677,11 +675,10 @@ const handleClassOverviewOpen = (type) =>{
|
|||
}
|
||||
}
|
||||
})
|
||||
const allTeacherRating = allTopic.reduce((acc, cur) => {
|
||||
return acc + cur.teacherRating;
|
||||
const allScore = allTopic.reduce((acc, cur) => {
|
||||
return acc + cur.score;
|
||||
},0)
|
||||
|
||||
rightAnswer > 0?item.scoingRate = (score/allTeacherRating * 100).toFixed(0):item.scoingRate = ''
|
||||
rightAnswer > 0?item.scoingRate = (score/allScore * 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