diff --git a/canvas.go b/canvas.go index 356a3a2..7020658 100644 --- a/canvas.go +++ b/canvas.go @@ -79,17 +79,17 @@ func init_aplus_toolid(course_id int) error { return errors.New("Could not find A+ link and tool ID") } -func list_all_courses() { +func list_all_courses(onlyreturn bool) []CanvasCourse { all_courses := fmt.Sprintf("%s/courses?access_token=%s&enrollment_state=active&per_page=100", base_link, token) canvas_courses := get_courses(token, all_courses, client) if !onlyreturn { - for _, course := range canvas_courses { fmt.Printf("%d, %s\n", course.ID%10000, course.Name) } + return nil } return canvas_courses