diff options
| author | vin <git@vineetk.net> | 2024-01-12 17:22:35 -0500 |
|---|---|---|
| committer | vin <git@vineetk.net> | 2024-01-12 17:24:09 -0500 |
| commit | cbcc7631a4df81682db46fd6ea7f581f13cb21ea (patch) | |
| tree | b18c8bd1c1a1358bbd0b2e05776f492323e627ba /canvas.go | |
| parent | 1179315d30b3c9bb5962961c158c325ba1eb3243 (diff) | |
send attendance code to all current courses when course not specified
Diffstat (limited to 'canvas.go')
| -rw-r--r-- | canvas.go | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -54,6 +54,7 @@ func get_courses(token string, link string, client http.Client) []CanvasCourse { | |||
| 54 | 54 | ||
| 55 | func init_aplus_toolid(course_id int) error { | 55 | func init_aplus_toolid(course_id int) error { |
| 56 | link := fmt.Sprintf("%s/courses/%d/external_tools?access_token=%s&search_term=aplus&include_parents=true", base_link, course_id, token) | 56 | link := fmt.Sprintf("%s/courses/%d/external_tools?access_token=%s&search_term=aplus&include_parents=true", base_link, course_id, token) |
| 57 | |||
| 57 | resp, err := client.Get(link) | 58 | resp, err := client.Get(link) |
| 58 | if err != nil { | 59 | if err != nil { |
| 59 | return err | 60 | return err |
| @@ -68,7 +69,7 @@ func init_aplus_toolid(course_id int) error { | |||
| 68 | } | 69 | } |
| 69 | 70 | ||
| 70 | for _, tool := range external_tools { | 71 | for _, tool := range external_tools { |
| 71 | if strings.Contains(tool.URL, ".aplusattendance.com/") && base_aplus_link == "" { | 72 | if strings.Contains(tool.URL, ".aplusattendance.com/") { |
| 72 | base_aplus_link = tool.URL | 73 | base_aplus_link = tool.URL |
| 73 | external_tools_code = tool.ID | 74 | external_tools_code = tool.ID |
| 74 | return nil | 75 | return nil |
