|
|
|
@ -59,7 +59,7 @@
|
|
|
|
|
<button
|
|
|
|
|
v-else
|
|
|
|
|
class="start-button"
|
|
|
|
|
@click="startExam(paper.id, paper.name, paper.subject, paper.time)"
|
|
|
|
|
@click="startExam(paper.id, paper.name, paper.subject, paper.time, paper.grade)"
|
|
|
|
|
>
|
|
|
|
|
开始答题
|
|
|
|
|
</button>
|
|
|
|
@ -82,7 +82,7 @@ export default {
|
|
|
|
|
components: {Aside, Header},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
paperTypes: ["固定试卷","班级试卷"], // 试卷类型
|
|
|
|
|
paperTypes: ["班级试卷","固定试卷"], // 试卷类型
|
|
|
|
|
subjects: ["语文", "数学"], // 学科
|
|
|
|
|
selectedType: "班级试卷", // 默认选中的试卷类型
|
|
|
|
|
selectedSubject: "语文", // 默认选中的学科
|
|
|
|
@ -132,8 +132,8 @@ export default {
|
|
|
|
|
this.logoTextShow = true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
startExam(id,name,subject,time) {
|
|
|
|
|
this.$router.push({ name: "ExamPaper", query: { userId: this.userId ,id:id ,name: name, subject: subject ,time:time} });
|
|
|
|
|
startExam(id,name,subject,time,grade) {
|
|
|
|
|
this.$router.push({ name: "ExamPaper", query: { userId: this.userId ,id:id ,name: name, subject: subject ,time:time, grade:grade} });
|
|
|
|
|
},
|
|
|
|
|
handleTypeChange(type) {
|
|
|
|
|
this.selectedType = type; // 修改选中的试卷类型
|
|
|
|
@ -190,7 +190,6 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
console.log("responser",response.data);
|
|
|
|
|
|
|
|
|
|
if (response.data.code === 200) {
|
|
|
|
|
const data = response.data.data;
|
|
|
|
@ -200,6 +199,7 @@ export default {
|
|
|
|
|
const hasTaken = await this.checkExamStatus(record.id);
|
|
|
|
|
return {
|
|
|
|
|
id: record.id,
|
|
|
|
|
grade: record.grade,
|
|
|
|
|
name: record.name,
|
|
|
|
|
subject: record.subject,
|
|
|
|
|
questionCount: record.totalquestion,
|
|
|
|
@ -209,9 +209,7 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
console.log("updatedRecords",updatedRecords);
|
|
|
|
|
this.papers = updatedRecords;
|
|
|
|
|
console.log("更新后的试卷数据:", updatedRecords);
|
|
|
|
|
} else {
|
|
|
|
|
alert("数据加载失败:" + response.data.msg);
|
|
|
|
|
// this.$router.push('/login'); // 引导用户重新登录
|
|
|
|
@ -275,7 +273,6 @@ button.active {
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
gap: 20px;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
justify-content: space-between; /* Ensures spacing between cards */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card {
|
|
|
|
|