Skip to content

Commit

Permalink
Update IHWDownloadScheduleViewController.m
Browse files Browse the repository at this point in the history
Fixed Middle School Wrong Campus Error
  • Loading branch information
aa4145 committed Apr 15, 2015
1 parent 78189d6 commit d845eb7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions iHW-iOS/iHW/iHW/IHWDownloadScheduleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,15 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
//Break the list into components by day
NSArray *lastPeriodComponents = [lastPeriodList componentsSeparatedByString:@"."];
if (lastPeriodComponents.count != [IHWCurriculum currentCurriculum].campus) {
if([[lastPeriodComponents firstObject] isEqual: @"A"]&&[lastPeriodComponents count]==5) {
//Middle Schoolers who enroll in sports like football have a five day cycle for the sport. This is a workaround.
lastPeriodComponents=[lastPeriodComponents arrayByAddingObject:@"A"];
}
else{
//The course period list doesn't have the same number of days as the campus the user chose earlier.
[[[UIAlertView alloc] initWithTitle:@"Wrong Campus!" message:@"You chose the wrong campus during the setup. Please start again." delegate:self cancelButtonTitle:@"Back" otherButtonTitles:nil] show];
return;
}
}
//Create the course object once we have a course code, name, and period list
IHWCourse *c = parseCourse(lastCode, lastName, lastPeriodComponents);
Expand Down

0 comments on commit d845eb7

Please sign in to comment.