Skip to content

Commit 8482496

Browse files
committed
Minor fixes to CreateExamData.IsValid method for sample exams.
Signed-off-by: Aliwoto <[email protected]>
1 parent f5859c5 commit 8482496

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/apiHandlers/examHandlers/methods.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
package examHandlers
22

3-
import "time"
3+
import (
4+
"time"
5+
)
46

57
func (d *CreateExamData) IsValid() bool {
8+
if d.IsSampleExam {
9+
d.ExamDate = 0
10+
d.NeedsVideoCall = false
11+
d.NeedsVoiceCall = false
12+
d.Duration = 0
13+
return true
14+
}
15+
616
return d.CourseId != 0 &&
7-
d.Price != "" &&
817
d.Duration > 0 &&
918
d.ExamDate >= time.Now().UTC().Unix()
1019
}

0 commit comments

Comments
 (0)