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