package Ġcom . and b . apps . as pen . data . remote Ċ Ċ import Ġcom . and b . apps . as pen . models . Category Ċ import Ġcom . and b . apps . as pen . response .* Ċ import Ġcom . and b . apps . as pen . util . result . Suspend able Result Ċ Ċ class ĠAsp en Api Mock Ġ: ĠAsp en Api Ġ{ ĊĠĠĠ Ġvar Ġjson Requested Ġ= Ġfalse ĊĠĠĠ Ġvar Ġthrow On Request Ġ= Ġtrue ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġcheck Login ( username : ĠString , Ġpassword : ĠString ): ĠS uspend able Result < Check Login Response , ĠException > Ġ= ĠS uspend able Result . of Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( throw On Request ) Ġthrow ĠException () ĊĠĠĠĠĠĠĠ Ġjson Requested Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġreturn @ of ĠCheck Login Response ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġerrors Ġ= ĠError Response ( 0 , Ġnull , Ġnull ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdata Ġ= Ġusername Ġ== Ġ" username " Ġ&& Ġpassword Ġ== Ġ" password ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġas Of Ġ= Ġ 0 ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġget Subject s ( username : ĠString , Ġpassword : ĠString , Ġterm : ĠInt ?): ĠS uspend able Result < Course ListResponse , ĠException > Ġ= ĠS uspend able Result . of Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( throw On Request ) Ġthrow ĠException () ĊĠĠĠĠĠĠĠ Ġjson Requested Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġreturn @ of Ġcourse ListResponse ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġget Recent Assignments ( username : ĠString , Ġpassword : ĠString ): ĠS uspend able Result < Recent Response , ĠException > Ġ= ĠS uspend able Result . of Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( throw On Request ) Ġthrow ĠException () ĊĠĠĠĠĠĠĠ Ġjson Requested Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġreturn @ of Ġrecent Response ĊĠĠĠ Ġ} Ċ } Ċ Ċ private Ġval Ġassignment Response Ġ= ĠAssignment Response ( ĊĠĠĠ Ġid Ġ= Ġ" id ", ĊĠĠĠ Ġname Ġ= Ġ" Assignment ĠName ", ĊĠĠĠ Ġdate Assigned Ġ= Ġ" 2 / 4 / 2 0 2 0 ", ĊĠĠĠ Ġdate Due Ġ= Ġ" 2 / 5 / 2 0 2 0 ", ĊĠĠĠ Ġcredit Ġ= Ġ" 1 0 0 %", ĊĠĠĠ Ġfeedback Ġ= Ġnull , ĊĠĠĠ Ġscore Ġ= Ġ" 5 . 0 ", ĊĠĠĠ Ġpossible Score Ġ= Ġ" 5 . 0 ", ĊĠĠĠ Ġgrade Letter Ġ= Ġ" A ", ĊĠĠĠ Ġcategory Ġ= Ġ" Category ", ĊĠĠĠ Ġstats Ġ= Ġmap Of ( ĊĠĠĠĠĠĠĠ Ġ" high " Ġto Ġ" 5 . 0 ĠA ", ĊĠĠĠĠĠĠĠ Ġ" low " Ġto Ġ" 0 . 0 ĠF ", ĊĠĠĠĠĠĠĠ Ġ" average " Ġto Ġ" 3 . 6 4 ĠC ", ĊĠĠĠĠĠĠĠ Ġ" median " Ġto Ġ" 5 . 0 ĠA " ĊĠĠĠ Ġ) Ċ ) Ċ Ċ private Ġval Ġcourse Response Ġ= ĠCourse Response ( ĊĠĠĠ Ġid Ġ= Ġ" id ", ĊĠĠĠ Ġname Ġ= Ġ" Course ", ĊĠĠĠ Ġteacher Ġ= Ġ" Name , ĠTe acher ", ĊĠĠĠ Ġterm Ġ= Ġ" FY ", ĊĠĠĠ Ġroom Ġ= Ġ" A 1 2 3 ", ĊĠĠĠ Ġcurrent Term Grade Ġ= Ġ" 9 2 . 3 5 ĠA -", ĊĠĠĠ Ġcode Ġ= Ġ" ABC - 1 2 3 ", ĊĠĠĠ Ġposted Gr ades Ġ= Ġhash Map Of ( ĊĠĠĠĠĠĠĠ Ġ" 1 " Ġto Ġ" A ", ĊĠĠĠĠĠĠĠ Ġ" 2 " Ġto Ġ" B ", ĊĠĠĠĠĠĠĠ Ġ" 3 " Ġto Ġ" C ", ĊĠĠĠĠĠĠĠ Ġ" 4 " Ġto Ġ" D " ĊĠĠĠ Ġ), ĊĠĠĠ Ġcategory Table Ġ= Ġmap Of ( ĊĠĠĠĠĠĠĠ Ġ" 1 " Ġto ĠlistOf ( Category (" Home work ", Ġ" 1 0 . 0 ", Ġ" 9 5 . 5 ", Ġ" A "), ĠCategory (" As sess ments ", Ġ" 5 0 . 0 ", Ġ" 9 2 . 3 ", Ġ" A - "), ĠCategory (" Pract ice Ġand ĠApplication ", Ġ" 4 0 . 0 ", Ġ" 9 4 . 8 ", Ġ" A ")), ĊĠĠĠĠĠĠĠ Ġ" 2 " Ġto ĠlistOf ( Category (" Home work ", Ġ" 1 0 . 0 ", Ġ" 9 6 . 1 ", Ġ" A "), ĠCategory (" As sess ments ", Ġ" 5 0 . 0 ", Ġ" 8 8 . 2 ", Ġ" B + "), ĠCategory (" Pract ice Ġand ĠApplication ", Ġ" 4 0 . 0 ", Ġ" 9 1 . 8 ", Ġ" A ")), ĊĠĠĠĠĠĠĠ Ġ" 3 " Ġto ĠlistOf ( Category (" Home work ", Ġ" 1 0 . 0 ", Ġ" 4 4 . 1 ", Ġ" F "), ĠCategory (" As sess ments ", Ġ" 5 0 . 0 ", Ġ" 8 6 . 4 ", Ġ" B "), ĠCategory (" Pract ice Ġand ĠApplication ", Ġ" 4 0 . 0 ", Ġ" 9 0 . 9 ", Ġ" A - ")), ĊĠĠĠĠĠĠĠ Ġ" 4 " Ġto ĠlistOf ( Category (" Home work ", Ġ" 1 0 . 0 ", Ġ" 7 6 . 1 ", Ġ" C "), ĠCategory (" As sess ments ", Ġ" 5 0 . 0 ", Ġ" 7 2 . 3 ", Ġ" C - "), ĠCategory (" Pract ice Ġand ĠApplication ", Ġ" 4 0 . 0 ", Ġ" 8 3 . 2 ", Ġ" B ")) ĊĠĠĠ Ġ), ĊĠĠĠ Ġassignments Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġassignment Response . copy ( id Ġ= Ġ" 0 ", Ġname Ġ= Ġ" Test Ġ 1 ", Ġcategory Ġ= Ġ" As sess ments ", Ġscore Ġ= Ġ" 3 2 . 0 ", Ġpossible Score Ġ= Ġ" 3 6 . 0 ", Ġcredit Ġ= Ġ" 8 8 . 9 %", Ġgrade Letter Ġ= Ġ" B + "), ĊĠĠĠĠĠĠĠ Ġassignment Response . copy ( id Ġ= Ġ" 1 ", Ġname Ġ= Ġ" Home work Ġ 2 / 4 ", Ġcategory Ġ= Ġ" Home work "), ĊĠĠĠĠĠĠĠ Ġassignment Response . copy ( id Ġ= Ġ" 2 ", Ġname Ġ= Ġ" Home work Ġ 2 / 5 ", Ġcategory Ġ= Ġ" Home work "), ĊĠĠĠĠĠĠĠ Ġassignment Response . copy ( id Ġ= Ġ" 3 ", Ġname Ġ= Ġ" Work sheet Ġ 2 / 5 ", Ġcategory Ġ= Ġ" Pract ice Ġand ĠApplication ") ĊĠĠĠ Ġ) Ċ ) Ċ Ċ private Ġval Ġcourse ListResponse Ġ= ĠCourse ListResponse ( ĊĠĠĠ Ġerrors Ġ= ĠError Response ( 0 , Ġnull , Ġnull ), ĊĠĠĠ Ġdata Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġcourse Response . copy ( id Ġ= Ġ" 0 ", Ġname Ġ= Ġ" English ", Ġteacher Ġ= Ġ" Be as ley , ĠFin lay ", Ġcurrent Term Grade Ġ= Ġ" 9 3 . 2 ĠA "), ĊĠĠĠĠĠĠĠ Ġcourse Response . copy ( id Ġ= Ġ" 1 ", Ġname Ġ= Ġ" Pre - Calcul us ", Ġteacher Ġ= Ġ" Michael son , ĠL ara ", Ġcurrent Term Grade Ġ= Ġ" 8 5 . 7 ĠB "), ĊĠĠĠĠĠĠĠ Ġcourse Response . copy ( id Ġ= Ġ" 2 ", Ġname Ġ= Ġ" Physics ", Ġteacher Ġ= Ġ" Se ab ro ok , ĠW yn ona ", Ġcurrent Term Grade Ġ= Ġ" 9 2 . 7 ĠA "), ĊĠĠĠĠĠĠĠ Ġcourse Response . copy ( id Ġ= Ġ" 3 ", Ġname Ġ= Ġ" History ", Ġteacher Ġ= Ġ" F idd ler , ĠS ash a ", Ġcurrent Term Grade Ġ= Ġ" 9 4 . 8 ĠA "), ĊĠĠĠĠĠĠĠ Ġcourse Response . copy ( id Ġ= Ġ" 4 ", Ġname Ġ= Ġ" F rench ", Ġteacher Ġ= Ġ" T ol lem ache , ĠL ou is ", Ġcurrent Term Grade Ġ= Ġ" 9 7 . 1 ĠA "), ĊĠĠĠĠĠĠĠ Ġcourse Response . copy ( id Ġ= Ġ" 5 ", Ġname Ġ= Ġ" Art ", Ġteacher Ġ= Ġ" Cor vi , ĠE ir ini ", Ġcurrent Term Grade Ġ= Ġ" 9 9 . 8 ĠA "), ĊĠĠĠĠĠĠĠ Ġcourse Response . copy ( id Ġ= Ġ" 6 ", Ġname Ġ= Ġ" P sy cho logy ", Ġteacher Ġ= Ġ" W ilk erson , ĠMar cus ", Ġcurrent Term Grade Ġ= Ġ" 8 4 . 6 ĠB ") ĊĠĠĠ Ġ), ĊĠĠĠ Ġas Of Ġ= Ġ 0 Ċ ) Ċ Ċ private Ġval Ġrecent Assignment Response Ġ= ĠRecent Assignment Response (" id ", Ġ" Assignment ", Ġ" Course ", Ġ" 4 ") Ċ Ċ private Ġval Ġrecent Response Ġ= ĠRecent Response ( ĊĠĠĠ Ġerrors Ġ= ĠError Response ( 0 , Ġnull , Ġnull ), ĊĠĠĠ Ġdata Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġrecent Assignment Response . copy ( id Ġ= Ġ" 0 ", Ġname Ġ= Ġ" Test Ġ 1 ", Ġcourse Ġ= Ġ" English ", Ġcredit Ġ= Ġ" 3 2 "), ĊĠĠĠĠĠĠĠ Ġrecent Assignment Response . copy ( id Ġ= Ġ" 1 ", Ġname Ġ= Ġ" Home work Ġ 2 / 4 ", Ġcourse Ġ= Ġ" Pre - Calcul us ", Ġcredit Ġ= Ġ" 5 "), ĊĠĠĠĠĠĠĠ Ġrecent Assignment Response . copy ( id Ġ= Ġ" 2 ", Ġname Ġ= Ġ" Home work Ġ 2 / 5 ", Ġcourse Ġ= Ġ" Physics ", Ġcredit Ġ= Ġ" A "), ĊĠĠĠĠĠĠĠ Ġrecent Assignment Response . copy ( id Ġ= Ġ" 3 ", Ġname Ġ= Ġ" Work sheet Ġ 2 / 5 ", Ġcourse Ġ= Ġ" History ", Ġcredit Ġ= Ġ" 5 ") ĊĠĠĠ Ġ), ĊĠĠĠ Ġas Of Ġ= Ġ 0 Ċ )