Merge pull request 'yangws' (#357) from yangws into main

Reviewed-on: #357
This commit is contained in:
yangws 2024-10-23 15:50:44 +08:00
commit 14340e211d
1 changed files with 29 additions and 3 deletions

View File

@ -610,7 +610,33 @@ const selectScore = (score) => {
console.log(score, 'score----') console.log(score, 'score----')
classWorkFormScore.rating = score.ratingKey classWorkFormScore.rating = score.ratingKey
} }
const checkWorkType = (params) => {
//
const subType = params.quizlist.map(item => item.worktype)
const objectiveQuestion = ['单选题','多选题','判断题']
//
if(subType.every(item => objectiveQuestion.includes(item))){
//
const score = extractedNumber(params.studentObj.scoingRate)
if(0<=score<=59){
classWorkFormScore.rating = 5
}else if(60<=score<=69){
classWorkFormScore.rating = 4
}else if(70<=score<=79){
classWorkFormScore.rating = 3
}else if(80<=score<=99){
classWorkFormScore.rating = 2
}else{
classWorkFormScore.rating = 1
}
}
}
//
const extractedNumber = (score) => {
const match = score.match(/\d+/);
return match ? parseInt(match[0], 10) : null;
}
// //
const acceptParams = async (params) => { const acceptParams = async (params) => {
console.log(params) console.log(params)
@ -631,7 +657,7 @@ const acceptParams = async (params) => {
teacherFeedContentList.value = [] teacherFeedContentList.value = []
teachImageList.value = [] teachImageList.value = []
teachFileList.value = [] teachFileList.value = []
checkWorkType(params)
// ----------------- // -----------------
dialogProps.value = params dialogProps.value = params
classWorkFormScore.name = params.studentObj.studentname classWorkFormScore.name = params.studentObj.studentname
@ -769,7 +795,7 @@ const acceptParams = async (params) => {
console.log(params.studentQuizAllList[0].rating, '----------------------------') console.log(params.studentQuizAllList[0].rating, '----------------------------')
// null 0 0 // null 0 0
classWorkFormScore.rating = classWorkFormScore.rating =
params.studentQuizAllList[0].rating == 0 ? 0 : params.studentQuizAllList[0].rating params.studentQuizAllList[0].rating == 0 ? classWorkFormScore.rating : params.studentQuizAllList[0].rating
} }
analysisScoreOpen.value = true analysisScoreOpen.value = true