Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
yuping
2023-01-11 10:19:50 +08:00
4 changed files with 70 additions and 58 deletions

View File

@@ -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'

View File

@@ -163,7 +163,7 @@ const download = (url) => {
window.open(url); window.open(url);
}; };
const downloads = (url) => { const downloads = (url) => {
ElMessage.warning("未到开始时间,请耐心等待!"); ElMessage.warning("未在有效时间范围内,请耐心等待!");
}; };
let timer = null; let timer = null;

View File

@@ -145,7 +145,7 @@
<div v-else> <div v-else>
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<button disabled class="tijiao" <button disabled class="tijiao"
style="background:#999;border-radius: 6px;cursor: not-allowed;">到开始时间</button> style="background:#999;border-radius: 6px;cursor: not-allowed;">在有效时间范围内</button>
</div> </div>
</div> </div>
</div> </div>
@@ -162,7 +162,7 @@
<div v-else> <div v-else>
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<button disabled class="tijiao" <button disabled class="tijiao"
style="background:#999;border-radius: 6px;cursor: not-allowed;">到开始时间</button> style="background:#999;border-radius: 6px;cursor: not-allowed;">在有效时间范围内</button>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -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' }">
提交 提交
@@ -338,40 +326,62 @@ import { request, usePage, useRequest } from "@/api/request";
import { ASSESSMENT_QUERY, ASSESSMENT_SUBMIT } from "@/api/api"; import { ASSESSMENT_QUERY, ASSESSMENT_SUBMIT } from "@/api/api";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { ref } from "vue"; import { ref } from "vue";
import dayjs from "dayjs";
const { const {
query: { courseId, id: taskId, infoId, type, pName, sName, chapterOrStageId, projectStatus, projectEndTime }, query: { courseId, id: taskId, infoId, type, pName, sName, chapterOrStageId, projectStatus, projectEndTime },
} = useRoute(); } = useRoute();
const router = useRouter(); const router = useRouter();
const returnclick = () => { const returnclick = () => {
clearInterval(timers)
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() { // 答题时间
const answerTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
console.log('录入首次进入页面时间', answerTime)
// 数组去空对象
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);
setTimeout(() => {
clearInterval(timers);
}, 30000);
const centerDialogVisible = ref(false); const centerDialogVisible = ref(false);
const open = () => { const open = () => {
centerDialogVisible.value = true centerDialogVisible.value = true
}; };
function submit() { function submit() {
console.log('录入首次进入页面时间', answerTime)
if (1 > 0) { if (1 > 0) {
console.log(data) console.log(data)
console.log('我是提交的数据', { console.log('我是提交的数据', {
@@ -436,6 +446,7 @@ function submit() {
taskId: taskId ? taskId : 0, taskId: taskId ? taskId : 0,
type, type,
result: JSON.stringify(data.value), result: JSON.stringify(data.value),
beginTime: answerTime
}).then(() => { }).then(() => {
open(); open();
}); });
@@ -579,3 +590,4 @@ function submit() {
} }
} }
</style> </style>