diff --git a/aplus.go b/aplus.go index dfc73e1..29d5033 100644 --- a/aplus.go +++ b/aplus.go @@ -11,17 +11,27 @@ import ( "strings" ) -func submit_code(course_code int, attendance_code string) { +func submit_code(course_code int, attendance_code string) bool { cur_body := launch_aplus(course_code) if verbose { fmt.Printf("%s", cur_body) } + if strings.Contains(cur_body, "Student not known") { + fmt.Println("Student not known. This course must first be visited by an instructor for students to have access.") + return false + } + current_url := fmt.Sprintf("%s/student/", base_aplus_link) // the links to submit the code for a class is under the dayPanel div daypanel_start := strings.Index(cur_body, "