|
|
@@ -70,6 +70,7 @@
|
|
|
v-if="!fetching"
|
|
|
type="primary"
|
|
|
style="float: right"
|
|
|
+ :disabled="this.state==='FINISHED'"
|
|
|
@click="showQuestionList = true"
|
|
|
>
|
|
|
调整试题
|
|
|
@@ -111,6 +112,8 @@
|
|
|
<script>
|
|
|
import examQuestionsInfo from "@/views/EvalPage/ExamQuestionsInfo.vue";
|
|
|
import questionList from "@/views/EvalPage/QuestionList.vue";
|
|
|
+import Vue from "vue-pdf-embed";
|
|
|
+import vue from "vue";
|
|
|
|
|
|
export default {
|
|
|
name: "teacherExamDetails",
|
|
|
@@ -130,6 +133,7 @@ export default {
|
|
|
showQuestionInfo: true,
|
|
|
showQuestionList: false,
|
|
|
examQuestionAndScore: {},
|
|
|
+ state: ""
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -187,6 +191,68 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+ },
|
|
|
+
|
|
|
+ getExamJoiners(){
|
|
|
+ this.$apis.getExamJoinedUsers(39).then(_res => {
|
|
|
+ this.joinedUsers = _res.data.data.result;
|
|
|
+ console.log(this.joinedUsers);
|
|
|
+ this.$apis.getAllReportByExamId(39).then(res => {
|
|
|
+ const that = this;
|
|
|
+ this.joinedUsers.forEach((user) => {
|
|
|
+ console.log(res.data.data.result);
|
|
|
+ res.data.data.result.forEach((report) => {
|
|
|
+ if (report.userId === user.id) {
|
|
|
+ that.$set(user, "score", report.score);
|
|
|
+ console.log(user);
|
|
|
+ //todo 注意是否有用
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ strFormatToDate(formatStr, dateStr) {
|
|
|
+ let year = 0;
|
|
|
+ let start = -1;
|
|
|
+ const len = dateStr.length;
|
|
|
+ if ((start = formatStr.indexOf("yyyy")) > -1 && start < len) {
|
|
|
+ year = dateStr.substr(start, 4);
|
|
|
+ }
|
|
|
+ let month = 0;
|
|
|
+ if ((start = formatStr.indexOf("MM")) > -1 && start < len) {
|
|
|
+ month = parseInt(dateStr.substr(start, 2)) - 1;
|
|
|
+ }
|
|
|
+ let day = 0;
|
|
|
+ if ((start = formatStr.indexOf("dd")) > -1 && start < len) {
|
|
|
+ day = parseInt(dateStr.substr(start, 2));
|
|
|
+ }
|
|
|
+ let hour = 0;
|
|
|
+ if (((start = formatStr.indexOf("HH")) > -1 || (start = formatStr.indexOf("hh")) > 1) && start < len) {
|
|
|
+ hour = parseInt(dateStr.substr(start, 2));
|
|
|
+ }
|
|
|
+ let minute = 0;
|
|
|
+ if ((start = formatStr.indexOf("mm")) > -1 && start < len) {
|
|
|
+ minute = dateStr.substr(start, 2);
|
|
|
+ }
|
|
|
+ let second = 0;
|
|
|
+ if ((start = formatStr.indexOf("ss")) > -1 && start < len) {
|
|
|
+ second = dateStr.substr(start, 2);
|
|
|
+ }
|
|
|
+ return new Date(year, month, day, hour, minute, second);
|
|
|
+ },
|
|
|
+
|
|
|
+ getState(startTime,endTime){
|
|
|
+ // console.log(this.strFormatToDate("yyyy-MM-dd HH:mm:ss",startTime));
|
|
|
+ if (this.strFormatToDate("yyyy-MM-dd HH:mm:ss",endTime) < new Date()) {
|
|
|
+ return "FINISHED";
|
|
|
+ } else if (this.strFormatToDate("yyyy-MM-dd HH:mm:ss",startTime) > new Date()) {
|
|
|
+ return "NOT_STARTED";
|
|
|
+ } else {
|
|
|
+ return "RUNNING";
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -198,25 +264,15 @@ export default {
|
|
|
this.examInfo = _res.data.data.result;
|
|
|
console.log(this.examInfo);
|
|
|
this.examInfo.skills = this.examInfo.skills.toString();
|
|
|
+ this.state=this.getState(this.examInfo.startTime,this.examInfo.endTime);
|
|
|
+ console.log(this.state);
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getExamQuestions();
|
|
|
-
|
|
|
- this.$apis.getExamJoinedUsers(this.examId).then(_res => {
|
|
|
- this.joinedUsers = _res.data.data.result;
|
|
|
- this.$apis.getAllReportByExamId(this.examId).then(res => {
|
|
|
- const that = this;
|
|
|
- this.joinedUsers.forEach((user) => {
|
|
|
- res.data.data.result.forEach((report) => {
|
|
|
- if (report.userId === user.id) {
|
|
|
- that.$set(user, "score", report.score);
|
|
|
- //todo 注意是否有用
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
+ this.getExamJoiners();
|
|
|
},
|
|
|
|
|
|
|