mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-12 20:36:48 +08:00
fix:修改评估题目显示问题
This commit is contained in:
@@ -51,7 +51,7 @@ export const COMMENT_PRAISE = '/comment/praise post'
|
|||||||
export const COMMENT_COLLECTION = '/comment/collection post'
|
export const COMMENT_COLLECTION = '/comment/collection post'
|
||||||
|
|
||||||
export const ASSESSMENT_SUBMIT_QUERY = assessmentId => `/assessmentSubmit/queryAssessmentSubmitDetailById?assessmentSubmitId=${assessmentId} post`
|
export const ASSESSMENT_SUBMIT_QUERY = assessmentId => `/assessmentSubmit/queryAssessmentSubmitDetailById?assessmentSubmitId=${assessmentId} post`
|
||||||
export const ASSESSMENT_QUERY = assessmentId => `/stu/task/evaluate/get`
|
export const ASSESSMENT_QUERY = assessmentId => `/stu/task/queryAssessmentDetailById`
|
||||||
export const ASSESSMENT_SUBMIT = '/stu/task/evaluate/commit post'
|
export const ASSESSMENT_SUBMIT = '/stu/task/evaluate/commit post'
|
||||||
|
|
||||||
export const ACTIVITY = '/activity'
|
export const ACTIVITY = '/activity'
|
||||||
|
|||||||
@@ -44,13 +44,9 @@
|
|||||||
return a[0].orderNumber - b[0].orderNumber
|
return a[0].orderNumber - b[0].orderNumber
|
||||||
}) }} -->
|
}) }} -->
|
||||||
|
|
||||||
<div class="question" v-for="
|
<div class="question" v-for="(value, index) in questionList " :key="index" :style="{ 'margin-top': index === 0 ? '57px' : '41px' }">
|
||||||
(value, index) in formateArr([data.assessmentEssayQuestionDtoList, data.assessmentMultipleChoiceDtoList, data.assessmentScoringQuestionDtoList, data.assessmentSingleChoiceDtoList]).sort((a, b) => {
|
<div v-if="value.questionType == '4'">
|
||||||
return a[0].orderNumber - b[0].orderNumber
|
<div class="question" :style="{ 'margin-top': index === 0 ? '57px' : '41px' }">
|
||||||
}) " :key="index" :style="{ 'margin-top': index === 0 ? '57px' : '41px' }">
|
|
||||||
<div v-if="value[0].questionType == '4'">
|
|
||||||
<div class="question" v-for="(value, index) in data.assessmentScoringQuestionDtoList" :key="index"
|
|
||||||
:style="{ 'margin-top': index === 0 ? '57px' : '41px' }">
|
|
||||||
<div class="text">{{ value.assessmentScTitle }}</div>
|
<div class="text">{{ value.assessmentScTitle }}</div>
|
||||||
<div class="answer">
|
<div class="answer">
|
||||||
<div class="answerL">完全没用</div>
|
<div class="answerL">完全没用</div>
|
||||||
@@ -84,69 +80,62 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="value[0].questionType == '1'">
|
<div v-else-if="value.questionType == '1'">
|
||||||
<div class="question" style="margin-top: 41px" v-if="
|
<div class="question" style="margin-top: 41px">
|
||||||
data.assessmentSingleChoiceDtoList &&
|
|
||||||
data.assessmentSingleChoiceDtoList.length
|
|
||||||
">
|
|
||||||
<div class="text">
|
<div class="text">
|
||||||
{{ data.assessmentSingleChoiceDtoList[0]?.singleStemName }}
|
{{ value?.singleStemName }}
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(value, index) in data.assessmentSingleChoiceDtoList" :key="index"
|
<div v-for="(values, indexs) in value.assessmentSingleChoiceVoList" :key="indexs"
|
||||||
style="display: flex; align-items: center" :style="{
|
style="display: flex; align-items: center" :style="{
|
||||||
'margin-top': index === 0 ? '29px' : '22px',
|
'margin-top': indexs === 0 ? '29px' : '22px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
}" @click="
|
}" @click="
|
||||||
() => {
|
() => {
|
||||||
if (data.isSubmit) {
|
if (data.isSubmit) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data.assessmentSingleChoiceDtoList.forEach((e) => {
|
value.assessmentSingleChoiceVoList.forEach((e) => {
|
||||||
e.select = false;
|
e.select = false;
|
||||||
});
|
});
|
||||||
value.select = true;
|
values.select = true;
|
||||||
}
|
}
|
||||||
">
|
">
|
||||||
<img style="width: 19px; height: 18px; cursor: pointer" :src="value.select ? checkbox : checkbox2" />
|
<img style="width: 19px; height: 18px; cursor: pointer" :src="values.select ? checkbox : checkbox2" />
|
||||||
<div class="people">{{ value.singleOptionName }}</div>
|
<div class="people">{{ values.singleOptionName }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="value[0].questionType == '2'">
|
<div v-else-if="value.questionType == '2'">
|
||||||
<div class="question" style="margin-top: 41px" v-if="
|
<div class="question" style="margin-top: 41px">
|
||||||
data.assessmentMultipleChoiceDtoList &&
|
|
||||||
data.assessmentMultipleChoiceDtoList.length
|
|
||||||
">
|
|
||||||
<div class="text">
|
<div class="text">
|
||||||
{{ data.assessmentMultipleChoiceDtoList[0]?.multipleStemName }}
|
{{ value?.multipleStemName }}
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(value, index) in data.assessmentMultipleChoiceDtoList" :key="index"
|
<div v-for="(values, indexs) in value.multipleChoiceVoList" :key="indexs"
|
||||||
style="display: flex; align-items: center" :style="{
|
style="display: flex; align-items: center" :style="{
|
||||||
'margin-top': index === 0 ? '29px' : '22px',
|
'margin-top': indexs === 0 ? '29px' : '22px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
}" @click="
|
}" @click="
|
||||||
() => {
|
() => {
|
||||||
if (data.isSubmit) {
|
if (data.isSubmit) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
value.select = !value.select;
|
values.select = !values.select;
|
||||||
}
|
}
|
||||||
">
|
">
|
||||||
<img style="width: 19px; height: 18px; cursor: pointer" :src="value.select ? checkbox : checkbox2" />
|
<img style="width: 19px; height: 18px; cursor: pointer" :src="values.select ? checkbox : checkbox2" />
|
||||||
<div class="people">{{ value.multipleOptionName }}</div>
|
<div class="people">{{ values.multipleOptionName }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="value[0].questionType == '3'">
|
<div v-else-if="value.questionType == '3'">
|
||||||
<div class="question" style="margin-top: 41px" v-for="(item, i) in data.assessmentEssayQuestionDtoList"
|
<div class="question" style="margin-top: 41px">
|
||||||
:key="i">
|
<div class="text">{{ value.assessmentQaTitle }}</div>
|
||||||
<div class="text">{{ item.assessmentQaTitle }}</div>
|
|
||||||
<div style="width: 713px; margin-top: 31px; position: relative">
|
<div style="width: 713px; margin-top: 31px; position: relative">
|
||||||
<el-input v-model="item.content" :autosize="{ minRows: 5, maxRows: 5 }" resize="none" maxlength="200"
|
<el-input v-model="value.content" :autosize="{ minRows: 5, maxRows: 5 }" resize="none" maxlength="200"
|
||||||
type="textarea" :readonly="!!data.isSubmit" />
|
type="textarea" :readonly="!!data.isSubmit" />
|
||||||
<div class="words">{{ item.content?.length || 0 }}/200</div>
|
<div class="words">{{ value.content?.length || 0 }}/200</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -290,12 +279,11 @@
|
|||||||
<div class="words">{{ item.content?.length || 0 }}/200</div>
|
<div class="words">{{ item.content?.length || 0 }}/200</div>
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div style="display: flex; justify-content: center" v-if="
|
<div style="display: flex; justify-content: center" v-if="
|
||||||
data.assessmentEssayQuestionDtoList?.length ||
|
data.essayQuestionVoList?.length ||
|
||||||
data.assessmentMultipleChoiceDtoList?.length ||
|
data.multipleStemVoList?.length ||
|
||||||
data.assessmentSingleChoiceDtoList?.length ||
|
data.scoringQuestionVoList?.length ||
|
||||||
data.assessmentScoringQuestionDtoList?.length
|
data.singleStemVoList?.length
|
||||||
"> <div v-if="projectStatus && projectEndTime">
|
"> <div v-if="projectStatus && projectEndTime">
|
||||||
<div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" class="submit" @click="submit" :style="{ background: data.isSubmit ? '#999' : '#2478ff' }">
|
<div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" class="submit" @click="submit" :style="{ background: data.isSubmit ? '#999' : '#2478ff' }">
|
||||||
提交
|
提交
|
||||||
@@ -347,25 +335,34 @@ const returnclick = () => {
|
|||||||
router.back();
|
router.back();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 数组去空对象
|
|
||||||
function formateArr(arr1) {
|
|
||||||
console.log(arr1, arr1[0], arr1[0].length)
|
|
||||||
let newarr = []
|
|
||||||
for (let i = 0; i < arr1.length; i++) {
|
|
||||||
if (arr1[i].length !== 0) {
|
|
||||||
newarr.push(arr1[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return newarr
|
|
||||||
}
|
|
||||||
|
|
||||||
const { data } = useRequest(ASSESSMENT_QUERY(courseId), { id: courseId, type, chapterOrStageId, targetId: infoId ? infoId : 0 });
|
const { data } = useRequest(ASSESSMENT_QUERY(courseId), { id: courseId, type, chapterOrStageId, targetId: infoId ? infoId : 0 });
|
||||||
console.log('我是查询评估的参数', { id: courseId, type, chapterOrStageId, targetId: infoId ? infoId : 0 })
|
console.log('我是查询评估的参数', { id: courseId, type, chapterOrStageId, targetId: infoId ? infoId : 0 })
|
||||||
console.log('我是需要排序得题目', data)
|
console.log('我是需要排序得题目', data)
|
||||||
|
|
||||||
function goHome() {
|
// 数组去空对象
|
||||||
|
function formateArr(datas) {
|
||||||
|
let allArr = []
|
||||||
|
for(let i=0;i<datas.length;i++){
|
||||||
|
for(let j=0;j<datas[i].length;j++){
|
||||||
|
allArr.push(datas[i][j])
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
let newarr = allArr.sort((a, b) => { return a.orderNumber - b.orderNumber})
|
||||||
|
console.log('我是排序后的题目', newarr)
|
||||||
|
return newarr
|
||||||
|
}
|
||||||
|
|
||||||
|
const questionList = ref([])
|
||||||
|
|
||||||
|
const timers = setInterval(() => {
|
||||||
|
console.log(data)
|
||||||
|
console.log(data.value.assessmentId)
|
||||||
|
if(data.value.assessmentId){
|
||||||
|
clearInterval(timers)
|
||||||
|
console.log([data.value.essayQuestionVoList, data.value.multipleStemVoList, data.value.scoringQuestionVoList, data.value.singleStemVoList])
|
||||||
|
questionList.value = formateArr([data.value.essayQuestionVoList, data.value.multipleStemVoList, data.value.scoringQuestionVoList, data.value.singleStemVoList])
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
const centerDialogVisible = ref(false);
|
const centerDialogVisible = ref(false);
|
||||||
const open = () => {
|
const open = () => {
|
||||||
@@ -579,3 +576,4 @@ function submit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user