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 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 ACTIVITY = '/activity'

View File

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

View File

@@ -145,7 +145,7 @@
<div v-else>
<div style="display: flex; justify-content: center">
<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>
@@ -162,7 +162,7 @@
<div v-else>
<div style="display: flex; justify-content: center">
<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>

View File

@@ -44,13 +44,9 @@
return a[0].orderNumber - b[0].orderNumber
}) }} -->
<div class="question" v-for="
(value, index) in formateArr([data.assessmentEssayQuestionDtoList, data.assessmentMultipleChoiceDtoList, data.assessmentScoringQuestionDtoList, data.assessmentSingleChoiceDtoList]).sort((a, b) => {
return a[0].orderNumber - b[0].orderNumber
}) " :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="question" v-for="(value, index) in questionList " :key="index" :style="{ 'margin-top': index === 0 ? '57px' : '41px' }">
<div v-if="value.questionType == '4'">
<div class="question" :style="{ 'margin-top': index === 0 ? '57px' : '41px' }">
<div class="text">{{ value.assessmentScTitle }}</div>
<div class="answer">
<div class="answerL">完全没用</div>
@@ -84,69 +80,62 @@
</div>
</div>
<div v-else-if="value[0].questionType == '1'">
<div class="question" style="margin-top: 41px" v-if="
data.assessmentSingleChoiceDtoList &&
data.assessmentSingleChoiceDtoList.length
">
<div v-else-if="value.questionType == '1'">
<div class="question" style="margin-top: 41px">
<div class="text">
{{ data.assessmentSingleChoiceDtoList[0]?.singleStemName }}
{{ value?.singleStemName }}
</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="{
'margin-top': index === 0 ? '29px' : '22px',
'margin-top': indexs === 0 ? '29px' : '22px',
cursor: 'pointer',
}" @click="
() => {
if (data.isSubmit) {
return;
}
data.assessmentSingleChoiceDtoList.forEach((e) => {
value.assessmentSingleChoiceVoList.forEach((e) => {
e.select = false;
});
value.select = true;
values.select = true;
}
">
<img style="width: 19px; height: 18px; cursor: pointer" :src="value.select ? checkbox : checkbox2" />
<div class="people">{{ value.singleOptionName }}</div>
<img style="width: 19px; height: 18px; cursor: pointer" :src="values.select ? checkbox : checkbox2" />
<div class="people">{{ values.singleOptionName }}</div>
</div>
</div>
</div>
<div v-else-if="value[0].questionType == '2'">
<div class="question" style="margin-top: 41px" v-if="
data.assessmentMultipleChoiceDtoList &&
data.assessmentMultipleChoiceDtoList.length
">
<div v-else-if="value.questionType == '2'">
<div class="question" style="margin-top: 41px">
<div class="text">
{{ data.assessmentMultipleChoiceDtoList[0]?.multipleStemName }}
{{ value?.multipleStemName }}
</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="{
'margin-top': index === 0 ? '29px' : '22px',
'margin-top': indexs === 0 ? '29px' : '22px',
cursor: 'pointer',
}" @click="
() => {
if (data.isSubmit) {
return;
}
value.select = !value.select;
values.select = !values.select;
}
">
<img style="width: 19px; height: 18px; cursor: pointer" :src="value.select ? checkbox : checkbox2" />
<div class="people">{{ value.multipleOptionName }}</div>
<img style="width: 19px; height: 18px; cursor: pointer" :src="values.select ? checkbox : checkbox2" />
<div class="people">{{ values.multipleOptionName }}</div>
</div>
</div>
</div>
<div v-else-if="value[0].questionType == '3'">
<div class="question" style="margin-top: 41px" v-for="(item, i) in data.assessmentEssayQuestionDtoList"
:key="i">
<div class="text">{{ item.assessmentQaTitle }}</div>
<div v-else-if="value.questionType == '3'">
<div class="question" style="margin-top: 41px">
<div class="text">{{ value.assessmentQaTitle }}</div>
<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" />
<div class="words">{{ item.content?.length || 0 }}/200</div>
<div class="words">{{ value.content?.length || 0 }}/200</div>
</div>
</div>
</div>
@@ -290,12 +279,11 @@
<div class="words">{{ item.content?.length || 0 }}/200</div>
</div>
</div> -->
<div style="display: flex; justify-content: center" v-if="
data.assessmentEssayQuestionDtoList?.length ||
data.assessmentMultipleChoiceDtoList?.length ||
data.assessmentSingleChoiceDtoList?.length ||
data.assessmentScoringQuestionDtoList?.length
data.essayQuestionVoList?.length ||
data.multipleStemVoList?.length ||
data.scoringQuestionVoList?.length ||
data.singleStemVoList?.length
"> <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' }">
提交
@@ -338,40 +326,62 @@ import { request, usePage, useRequest } from "@/api/request";
import { ASSESSMENT_QUERY, ASSESSMENT_SUBMIT } from "@/api/api";
import { ElMessage } from "element-plus";
import { ref } from "vue";
import dayjs from "dayjs";
const {
query: { courseId, id: taskId, infoId, type, pName, sName, chapterOrStageId, projectStatus, projectEndTime },
} = useRoute();
const router = useRouter();
const returnclick = () => {
clearInterval(timers)
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 });
console.log('我是查询评估的参数', { id: courseId, type, chapterOrStageId, targetId: infoId ? infoId : 0 })
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 open = () => {
centerDialogVisible.value = true
};
function submit() {
console.log('录入首次进入页面时间', answerTime)
if (1 > 0) {
console.log(data)
console.log('我是提交的数据', {
@@ -436,6 +446,7 @@ function submit() {
taskId: taskId ? taskId : 0,
type,
result: JSON.stringify(data.value),
beginTime: answerTime
}).then(() => {
open();
});
@@ -579,3 +590,4 @@ function submit() {
}
}
</style>