|
@@ -150,7 +150,7 @@
|
|
|
<div class="operation">
|
|
<div class="operation">
|
|
|
<el-button :class="[isQuestionEdit ? 'button_background' : 'is-disabled']"
|
|
<el-button :class="[isQuestionEdit ? 'button_background' : 'is-disabled']"
|
|
|
@click="isQuestionEdit ? HandleFinishCurrentQuestion() : ''">
|
|
@click="isQuestionEdit ? HandleFinishCurrentQuestion() : ''">
|
|
|
- {{(currentSelectedQuestionIndex + 1) < questionaireMsg.questionData?.length ? '下一题' : '提交'}}
|
|
|
|
|
|
|
+ {{(currentSelectedQuestionIndex + 1) < questionnaireSplitData?.length ? '下一题' : '提交'}}
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -476,13 +476,16 @@ const HandleFinishReview = async ()=>{
|
|
|
|
|
|
|
|
if(res?.code == 200){
|
|
if(res?.code == 200){
|
|
|
ElMessage.success('问卷评价提交成功')
|
|
ElMessage.success('问卷评价提交成功')
|
|
|
- // 找到当前选中的教师
|
|
|
|
|
- let currentIndex = teacherList.value.findIndex(item=>{
|
|
|
|
|
- return item.teacherId == currentActiveTeacherId.value
|
|
|
|
|
- })
|
|
|
|
|
- // 跳转到下一个教师的问卷
|
|
|
|
|
- currentActiveTeacherId.value = teacherList.value?.[currentIndex + 1]?.teacherId || ''
|
|
|
|
|
- fullQuestionnaireAnswer.value = {}
|
|
|
|
|
|
|
+ // true 表示当前问卷全部填写完成,跳到下一个问卷( false 没有完成的留在当前问卷页)
|
|
|
|
|
+ if(res.data){
|
|
|
|
|
+ // 找到当前选中的教师
|
|
|
|
|
+ let currentIndex = teacherList.value.findIndex(item=>{
|
|
|
|
|
+ return item.teacherId == currentActiveTeacherId.value
|
|
|
|
|
+ })
|
|
|
|
|
+ // 跳转到下一个教师的问卷
|
|
|
|
|
+ currentActiveTeacherId.value = teacherList.value?.[currentIndex + 1]?.teacherId || ''
|
|
|
|
|
+ fullQuestionnaireAnswer.value = {}
|
|
|
|
|
+ }
|
|
|
// 重新查询教师状态和问卷状态
|
|
// 重新查询教师状态和问卷状态
|
|
|
await GetEvaluationProcessMsg()
|
|
await GetEvaluationProcessMsg()
|
|
|
await GetFullQuestionnaireData()
|
|
await GetFullQuestionnaireData()
|
|
@@ -518,9 +521,13 @@ watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
|
|
|
case 0:
|
|
case 0:
|
|
|
case 3:
|
|
case 3:
|
|
|
{ //单选
|
|
{ //单选
|
|
|
- let rowKeys = { }
|
|
|
|
|
|
|
+ let initRowKeys = {} //初始化的行数据
|
|
|
|
|
+
|
|
|
|
|
+ let singleScoreObj = {}
|
|
|
// 表列(头)获取
|
|
// 表列(头)获取
|
|
|
questionTableColumns.value = currentEditQuestion.value?.answerData?.map((item,index)=>{
|
|
questionTableColumns.value = currentEditQuestion.value?.answerData?.map((item,index)=>{
|
|
|
|
|
+ initRowKeys['sort_'+item.questionSortCode] = false
|
|
|
|
|
+ singleScoreObj[item.questionSortCode] = item.answerScore
|
|
|
return {
|
|
return {
|
|
|
name:'sort_'+item.questionSortCode,
|
|
name:'sort_'+item.questionSortCode,
|
|
|
label:`${getExcelColumn(item.questionSortCode - 1)}. `+item.answerName,
|
|
label:`${getExcelColumn(item.questionSortCode - 1)}. `+item.answerName,
|
|
@@ -533,11 +540,22 @@ watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
|
|
|
}) || []
|
|
}) || []
|
|
|
// 表行数据获取
|
|
// 表行数据获取
|
|
|
questionTableData.value = currentEditQuestion.value?.studentAnswerData?.map((stuAnswer)=>{
|
|
questionTableData.value = currentEditQuestion.value?.studentAnswerData?.map((stuAnswer)=>{
|
|
|
|
|
+ let rowKeys = {
|
|
|
|
|
+ ...initRowKeys,
|
|
|
|
|
+ evaluationCodeRelationId: stuAnswer.evaluationCodeRelationId,
|
|
|
|
|
+ "answerCode": "",
|
|
|
|
|
+ "studentAnswer": "",
|
|
|
|
|
+ studentQuestionScore: currentEditQuestion.value?.questionScore,
|
|
|
|
|
+ "studentAnswerScore": '',
|
|
|
|
|
+ // 评分单选时候,每个选项对应的分值 obj
|
|
|
|
|
+ "answerScoreObj": singleScoreObj
|
|
|
|
|
+ }
|
|
|
let answers = stuAnswer.answerCode?.split('|') || []
|
|
let answers = stuAnswer.answerCode?.split('|') || []
|
|
|
// 回显已经填写完的信息
|
|
// 回显已经填写完的信息
|
|
|
answers.map((ans)=>{
|
|
answers.map((ans)=>{
|
|
|
rowKeys['sort_'+ans] = true
|
|
rowKeys['sort_'+ans] = true
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
return {
|
|
return {
|
|
|
teacher:stuAnswer.teacherName,
|
|
teacher:stuAnswer.teacherName,
|
|
|
...rowKeys
|
|
...rowKeys
|
|
@@ -546,8 +564,9 @@ watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
case 1:{ //多选
|
|
case 1:{ //多选
|
|
|
- let rowKeys = { }
|
|
|
|
|
|
|
+ let initRowKeys = {} //初始化的行数据
|
|
|
questionTableColumns.value = currentEditQuestion.value?.answerData?.map((item,index)=>{
|
|
questionTableColumns.value = currentEditQuestion.value?.answerData?.map((item,index)=>{
|
|
|
|
|
+ initRowKeys['sort_'+item.questionSortCode] = false
|
|
|
return {
|
|
return {
|
|
|
name:'sort_'+item.questionSortCode,
|
|
name:'sort_'+item.questionSortCode,
|
|
|
label:`${getExcelColumn(item.questionSortCode - 1)}. `+item.answerName,
|
|
label:`${getExcelColumn(item.questionSortCode - 1)}. `+item.answerName,
|
|
@@ -560,6 +579,16 @@ watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
|
|
|
}) || []
|
|
}) || []
|
|
|
// 表行数据获取
|
|
// 表行数据获取
|
|
|
questionTableData.value = currentEditQuestion.value?.studentAnswerData?.map((stuAnswer)=>{
|
|
questionTableData.value = currentEditQuestion.value?.studentAnswerData?.map((stuAnswer)=>{
|
|
|
|
|
+ let rowKeys = {
|
|
|
|
|
+ ...initRowKeys,
|
|
|
|
|
+ evaluationCodeRelationId: stuAnswer.evaluationCodeRelationId,
|
|
|
|
|
+ "answerCode": "",
|
|
|
|
|
+ "studentAnswer": "",
|
|
|
|
|
+ studentQuestionScore: '',
|
|
|
|
|
+ "studentAnswerScore": '',
|
|
|
|
|
+ "answerScore": ''
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
let answers = stuAnswer.answerCode?.split('|') || []
|
|
let answers = stuAnswer.answerCode?.split('|') || []
|
|
|
// 回显已经填写完的信息
|
|
// 回显已经填写完的信息
|
|
|
answers.map((ans)=>{
|
|
answers.map((ans)=>{
|
|
@@ -575,12 +604,14 @@ watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
|
|
|
case 5:{
|
|
case 5:{
|
|
|
//评分题
|
|
//评分题
|
|
|
questionTableData.value = currentEditQuestion.value?.studentAnswerData?.map((stuAnswer)=>{
|
|
questionTableData.value = currentEditQuestion.value?.studentAnswerData?.map((stuAnswer)=>{
|
|
|
- let answers = stuAnswer.studentQuestionScore
|
|
|
|
|
|
|
+ let answers = stuAnswer.studentAnswerScore
|
|
|
// 回显已经填写完的信息
|
|
// 回显已经填写完的信息
|
|
|
return {
|
|
return {
|
|
|
teacher:stuAnswer.teacherName,
|
|
teacher:stuAnswer.teacherName,
|
|
|
score:answers,
|
|
score:answers,
|
|
|
- fullScore:currentEditQuestion.value?.questionScore
|
|
|
|
|
|
|
+ fullScore:currentEditQuestion.value?.questionScore,
|
|
|
|
|
+
|
|
|
|
|
+ evaluationCodeRelationId: stuAnswer.evaluationCodeRelationId,
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
break
|
|
break
|
|
@@ -592,7 +623,9 @@ watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
|
|
|
// 回显已经填写完的信息
|
|
// 回显已经填写完的信息
|
|
|
return {
|
|
return {
|
|
|
teacher:stuAnswer.teacherName,
|
|
teacher:stuAnswer.teacherName,
|
|
|
- content:answers
|
|
|
|
|
|
|
+ content:answers,
|
|
|
|
|
+
|
|
|
|
|
+ evaluationCodeRelationId: stuAnswer.evaluationCodeRelationId,
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
break
|
|
break
|
|
@@ -613,13 +646,99 @@ const HandleQuestionAnswerChange = (val)=>{
|
|
|
singleQuestionAnswer.value = val
|
|
singleQuestionAnswer.value = val
|
|
|
}
|
|
}
|
|
|
// 当前题目 有关所有教师的评价数据提交
|
|
// 当前题目 有关所有教师的评价数据提交
|
|
|
-const HandleFinishCurrentQuestion = ()=>{
|
|
|
|
|
|
|
+const HandleFinishCurrentQuestion = async ()=>{
|
|
|
console.log('当前题目的教师评价数据--',singleQuestionAnswer.value )
|
|
console.log('当前题目的教师评价数据--',singleQuestionAnswer.value )
|
|
|
- if((currentSelectedQuestionIndex.value + 1) < questionaireMsg.value.questionData?.length){
|
|
|
|
|
- currentSelectedQuestionIndex.value += 1
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 区分 单选 多选 问答 评价 评分
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ let finalAnswerData:any[] = []
|
|
|
|
|
+
|
|
|
|
|
+ switch(currentEditQuestion.value?.questionType){
|
|
|
|
|
+ // 单选
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ // 多选
|
|
|
|
|
+ case 1:{
|
|
|
|
|
+ finalAnswerData = singleQuestionAnswer.value.map(item=>{
|
|
|
|
|
+ let keys = Object.keys(item).filter(key=>{
|
|
|
|
|
+ return key.includes('sort_') && item[key] === true
|
|
|
|
|
+ })
|
|
|
|
|
+ let answerCode = keys.map(ans=>{
|
|
|
|
|
+ return ans.split('_')[1]
|
|
|
|
|
+ }).join('|')
|
|
|
|
|
+ return {
|
|
|
|
|
+ evaluationCodeRelationId: item.evaluationCodeRelationId,
|
|
|
|
|
+ answerCode: answerCode,
|
|
|
|
|
+ studentAnswer: '',
|
|
|
|
|
+ studentQuestionScore: '',
|
|
|
|
|
+ studentAnswerScore: '',
|
|
|
|
|
+ answerScore: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ case 3:{ //评分单选
|
|
|
|
|
+ finalAnswerData = singleQuestionAnswer.value.map(item=>{
|
|
|
|
|
+ let keys = Object.keys(item).find(key=>{
|
|
|
|
|
+ return key.includes('sort_') && item[key] === true
|
|
|
|
|
+ })
|
|
|
|
|
+ let answerCode = keys?.split('_')[1]
|
|
|
|
|
+ return {
|
|
|
|
|
+ evaluationCodeRelationId: item.evaluationCodeRelationId,
|
|
|
|
|
+ answerCode: answerCode,
|
|
|
|
|
+ studentAnswer: '',
|
|
|
|
|
+ studentQuestionScore: '',
|
|
|
|
|
+ studentAnswerScore: '',
|
|
|
|
|
+ answerScore: item.answerScoreObj?.[answerCode]
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ case 5:{ //评分题
|
|
|
|
|
+ finalAnswerData = singleQuestionAnswer.value.map(item=>{
|
|
|
|
|
+ return {
|
|
|
|
|
+ evaluationCodeRelationId: item.evaluationCodeRelationId,
|
|
|
|
|
+ answerCode: '',
|
|
|
|
|
+ studentAnswer: '',
|
|
|
|
|
+ studentQuestionScore: item.fullScore,
|
|
|
|
|
+ studentAnswerScore: item.score,
|
|
|
|
|
+ answerScore: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ case 2:{ //问答题
|
|
|
|
|
+ finalAnswerData = singleQuestionAnswer.value.map(item=>{
|
|
|
|
|
+ return {
|
|
|
|
|
+ evaluationCodeRelationId: item.evaluationCodeRelationId,
|
|
|
|
|
+ answerCode: '',
|
|
|
|
|
+ studentAnswer: item.content,
|
|
|
|
|
+ studentQuestionScore: '',
|
|
|
|
|
+ studentAnswerScore: '',
|
|
|
|
|
+ answerScore: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- singleQuestionAnswer.value = []
|
|
|
|
|
- isQuestionEdit.value = false
|
|
|
|
|
|
|
+
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ questionId: currentSelectedQuestionnaireData.value.questionId,
|
|
|
|
|
+ lastQuestion: currentSelectedQuestionIndex.value + 1 >= questionnaireSplitData.value?.length ? true : false,
|
|
|
|
|
+ answerData:finalAnswerData
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ let res = await saveEvaluationQuestionDataSplitApi(params)
|
|
|
|
|
+ if(res?.code == 200){
|
|
|
|
|
+ ElMessage.success('问卷评价提交成功')
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // if((currentSelectedQuestionIndex.value + 1) < questionaireMsg.value.questionData?.length){
|
|
|
|
|
+ // currentSelectedQuestionIndex.value += 1
|
|
|
|
|
+ // }
|
|
|
|
|
+ // singleQuestionAnswer.value = []
|
|
|
|
|
+ // isQuestionEdit.value = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//
|
|
//
|