diff options
Diffstat (limited to 'aplus.go')
| -rw-r--r-- | aplus.go | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -7,6 +7,7 @@ import ( | |||
| 7 | "io" | 7 | "io" |
| 8 | "net/http" | 8 | "net/http" |
| 9 | "net/url" | 9 | "net/url" |
| 10 | "os" | ||
| 10 | "strings" | 11 | "strings" |
| 11 | ) | 12 | ) |
| 12 | 13 | ||
| @@ -60,6 +61,12 @@ func submit_code(course_code int, attendance_code string) { | |||
| 60 | } | 61 | } |
| 61 | 62 | ||
| 62 | func launch_aplus(course_code int) string { | 63 | func launch_aplus(course_code int) string { |
| 64 | err := init_aplus_toolid(course_code) | ||
| 65 | if err != nil { | ||
| 66 | fmt.Println("Failed to get A+ base URL and tool ID") | ||
| 67 | os.Exit(1) | ||
| 68 | } | ||
| 69 | |||
| 63 | aplus_link := fmt.Sprintf("%s/courses/%d/external_tools/sessionless_launch?id=%d&access_token=%s", | 70 | aplus_link := fmt.Sprintf("%s/courses/%d/external_tools/sessionless_launch?id=%d&access_token=%s", |
| 64 | base_link, course_code, external_tools_code, token) | 71 | base_link, course_code, external_tools_code, token) |
| 65 | aplus := get_aplus(token, aplus_link, client) | 72 | aplus := get_aplus(token, aplus_link, client) |
