Compare commits

...

3 Commits

1 changed files with 29 additions and 3 deletions

View File

@ -610,7 +610,33 @@ const selectScore = (score) => {
console.log(score, 'score----')
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) => {
console.log(params)
@ -631,7 +657,7 @@ const acceptParams = async (params) => {
teacherFeedContentList.value = []
teachImageList.value = []
teachFileList.value = []
checkWorkType(params)
// -----------------
dialogProps.value = params
classWorkFormScore.name = params.studentObj.studentname
@ -769,7 +795,7 @@ const acceptParams = async (params) => {
console.log(params.studentQuizAllList[0].rating, '----------------------------')
// null 0 0
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