//method that gets the user's list of current classes //use linq to find classes whose last day did not pass current date public async Task <List <SchoolCourse> > Getcurrentclasses() { List <SchoolCourse> currentcourses = new List <SchoolCourse>(); try { List <SchoolCourse> classes = await ClsCourseApi.GetCourses(Access_token, Lms_url, 0).ConfigureAwait(false); foreach (SchoolCourse active in classes) { //get each end date of course DateTime dt = Convert.ToDateTime(active.End_at); if (DateTime.Now < dt) { currentcourses.Add(active); } } } catch (FileNotFoundException ex) { Console.Write("error thrown ==> " + ex.Message); } return(currentcourses); }
//method that gets the user's list of current classes //use linq to find classes whose last day did not pass current date public async Task <List <SchoolCourse> > GetCurrentClasses() { List <SchoolCourse> currentCourses = new List <SchoolCourse>(); try { List <SchoolCourse> classes = await ClsCourseApi.GetCourses(ACCESS_TOKEN, LMS_URL, 0); foreach (SchoolCourse active in classes) { //get each end date of course DateTime dt = Convert.ToDateTime(active.End_at); if (DateTime.Now < dt) { currentCourses.Add(active); } } } catch (Exception ex) { Console.Write("Error thrown " + ex.Message); } return(currentCourses); }
public static async Task <List <Enrollment> > GetStudentEnrollment() { List <Enrollment> currentEnrollment = new List <Enrollment>(); try { currentEnrollment = await ClsCourseApi.GetUserEnrollments(ACCESS_TOKEN, LMS_URL, 0).ConfigureAwait(false); } catch (FileNotFoundException ex) { Console.Write("error thrown ==> " + ex.Message); } return(currentEnrollment); }
//method that gets the user's todo list //the list will need some logic public async Task <List <Assignment> > GetTodolist() { List <Assignment> not_submitted = new List <Assignment>(); try { List <Assignment> tasks = await ClsCourseApi.List_Todo(Access_token, Lms_url, 0).ConfigureAwait(false); foreach (Assignment task in tasks) { if (!task.Has_submitted) { not_submitted.Add(task); } } } catch (FileNotFoundException ex) { Console.Write("error thrown ==> " + ex.Message); } return(not_submitted); }
//method that gets the user's todo list //the list will need some logic public async Task <List <Assignment> > GetTodoList() { List <Assignment> not_submitted = new List <Assignment>(); try { List <Assignment> tasks = await ClsCourseApi.List_Todo(ACCESS_TOKEN, LMS_URL, 0); foreach (Assignment task in tasks) { if (!task.Has_submitted) { not_submitted.Add(task); } } } catch (Exception ex) { Console.Write("Error thrown " + ex.Message); } return(not_submitted); }
public static async Task <List <SchoolCourse> > GetCurrentClasses() { List <SchoolCourse> currentcourses = new List <SchoolCourse>(); try { List <SchoolCourse> classes = await ClsCourseApi.GetCourses(ACCESS_TOKEN, LMS_URL, 0).ConfigureAwait(false); foreach (SchoolCourse active in classes) { //get each end date of course if (DateTime.Now < Convert.ToDateTime(active.End_at)) { currentcourses.Add(active); } } } catch (FileNotFoundException ex) { Console.Write("error thrown ==> " + ex.Message); } return(currentcourses); }