|
|
@ -139,8 +139,7 @@ export class StudentIndexComponent implements OnInit { |
|
|
|
if (int_second < 10) |
|
|
|
if (int_second < 10) |
|
|
|
int_second = "0" + int_second; |
|
|
|
int_second = "0" + int_second; |
|
|
|
this.str_time = int_hour + ":" + int_minute + ":" + int_second; |
|
|
|
this.str_time = int_hour + ":" + int_minute + ":" + int_second; |
|
|
|
if(this.str_time=="00:00:00") |
|
|
|
if (this.str_time == "00:00:00") { this.str_time = "已结束" } |
|
|
|
{this.str_time="已结束"} |
|
|
|
|
|
|
|
//console.log(this.str_time)
|
|
|
|
//console.log(this.str_time)
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//timer=timer;
|
|
|
|
//timer=timer;
|
|
|
@ -150,12 +149,18 @@ export class StudentIndexComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
//参加考试
|
|
|
|
//参加考试
|
|
|
|
takeTest(e) { |
|
|
|
takeTest(e) { |
|
|
|
|
|
|
|
console.log(e) |
|
|
|
let body = { |
|
|
|
let body = { |
|
|
|
name: e.title, |
|
|
|
name: e.title, |
|
|
|
paperId: e.id, |
|
|
|
paperId: e.id, |
|
|
|
} |
|
|
|
} |
|
|
|
this.http.post('/api/Examinations', body).subscribe((data: any) => { |
|
|
|
this.http.post('/api/Examinations', body).subscribe((data: any) => { |
|
|
|
window.open(`/examinationDetails?paperId=${e.id}&examId=${data.id}`) |
|
|
|
window.open(`/examinationDetails?paperId=${e.id}&examId=${data.id}`) |
|
|
|
|
|
|
|
}, err => { |
|
|
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
|
|
|
this.snackBar.open(err, '确定', config); |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|