mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-09 19:06:48 +08:00
init
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
<div>
|
||||
<div
|
||||
class="question"
|
||||
v-for="(value, index) in data.scoringQuestionVoList"
|
||||
v-for="(value, index) in data.assessmentScoringQuestionDtoList"
|
||||
:key="index"
|
||||
:style="{ 'margin-top': index === 0 ? '57px' : '41px' }"
|
||||
>
|
||||
@@ -65,6 +65,9 @@
|
||||
}"
|
||||
@click="
|
||||
() => {
|
||||
if(data.isSubmit){
|
||||
return
|
||||
}
|
||||
value.selectAnswer = item;
|
||||
}
|
||||
"
|
||||
@@ -78,18 +81,20 @@
|
||||
<div
|
||||
class="question"
|
||||
style="margin-top: 41px"
|
||||
v-for="(item, i) in data.assessmentSingleChoiceDtoList"
|
||||
:key="i"
|
||||
v-if="data.assessmentSingleChoiceDtoList && data.assessmentSingleChoiceDtoList.length"
|
||||
>
|
||||
<div class="text">{{ item.singleStemName }}</div>
|
||||
<div class="text">{{ data.assessmentSingleChoiceDtoList[0]?.singleStemName }}</div>
|
||||
<div
|
||||
v-for="(value, index) in item.assessmentSingleChoiceDtoList"
|
||||
v-for="(value, index) in data.assessmentSingleChoiceDtoList"
|
||||
:key="index"
|
||||
style="display: flex; align-items: center"
|
||||
:style="{'margin-top': index === 0 ? '29px' : '22px',cursor: 'pointer'}"
|
||||
@click="
|
||||
() => {
|
||||
item.assessmentSingleChoiceDtoList.forEach((e) => {
|
||||
if(data.isSubmit){
|
||||
return
|
||||
}
|
||||
data.assessmentSingleChoiceDtoList.forEach((e) => {
|
||||
e.select = false;
|
||||
});
|
||||
value.select = true;
|
||||
@@ -107,19 +112,23 @@
|
||||
<div
|
||||
class="question"
|
||||
style="margin-top: 41px"
|
||||
v-for="(item, i) in data.multipleStemVoList"
|
||||
:key="i"
|
||||
v-if="data.assessmentMultipleChoiceDtoList && data.assessmentMultipleChoiceDtoList.length"
|
||||
>
|
||||
<div class="text">{{ item.multipleStemName }}</div>
|
||||
<div class="text">{{ data.assessmentMultipleChoiceDtoList[0]?.multipleStemName }}</div>
|
||||
<div
|
||||
v-for="(value, index) in item.multipleChoiceVoList"
|
||||
v-for="(value, index) in data.assessmentMultipleChoiceDtoList"
|
||||
:key="index"
|
||||
style="display: flex; align-items: center"
|
||||
:style="{
|
||||
'margin-top': index === 0 ? '29px' : '22px',
|
||||
cursor: 'pointer',
|
||||
}"
|
||||
@click="() => (value.select = !value.select)"
|
||||
@click="() => {
|
||||
if(data.isSubmit){
|
||||
return
|
||||
}
|
||||
value.select = !value.select
|
||||
}"
|
||||
>
|
||||
<img
|
||||
style="width: 19px; height: 18px; cursor: pointer"
|
||||
@@ -131,7 +140,7 @@
|
||||
<div
|
||||
class="question"
|
||||
style="margin-top: 41px"
|
||||
v-for="(item, i) in data.essayQuestionVoList"
|
||||
v-for="(item, i) in data.assessmentEssayQuestionDtoList"
|
||||
:key="i"
|
||||
>
|
||||
<div class="text">{{ item.assessmentQaTitle }}</div>
|
||||
@@ -142,13 +151,14 @@
|
||||
resize="none"
|
||||
maxlength="200"
|
||||
type="textarea"
|
||||
:readonly="!!data.isSubmit"
|
||||
/>
|
||||
<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">
|
||||
<div class="submit" @click="submit">提交</div>
|
||||
<div class="submit" @click="submit" :style="{background: data.isSubmit?'#999':'#2478ff'}">提交</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -168,13 +178,17 @@ import {
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
const {
|
||||
query: {courseId},
|
||||
query: {courseId, id: taskId, type},
|
||||
} = useRoute();
|
||||
|
||||
const {data} = useRequest(ASSESSMENT_QUERY(courseId), {id:courseId});
|
||||
const {data} = useRequest(ASSESSMENT_QUERY(courseId), {id: courseId});
|
||||
|
||||
function submit() {
|
||||
request(ASSESSMENT_SUBMIT, {assessmentId: courseId, result: JSON.stringify(data.value)})
|
||||
if (data.value.isSubmit) {
|
||||
return
|
||||
}
|
||||
data.value.isSubmit = !data.value.isSubmit
|
||||
request(ASSESSMENT_SUBMIT, {assessmentId: courseId, taskId, type, result: JSON.stringify(data.value)})
|
||||
ElMessage.info("提交成功");
|
||||
router.back()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user