Skip to content

Commit d845eb7

Browse files
committed
Update IHWDownloadScheduleViewController.m
Fixed Middle School Wrong Campus Error
1 parent 78189d6 commit d845eb7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

iHW-iOS/iHW/iHW/IHWDownloadScheduleViewController.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,15 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
182182
//Break the list into components by day
183183
NSArray *lastPeriodComponents = [lastPeriodList componentsSeparatedByString:@"."];
184184
if (lastPeriodComponents.count != [IHWCurriculum currentCurriculum].campus) {
185+
if([[lastPeriodComponents firstObject] isEqual: @"A"]&&[lastPeriodComponents count]==5) {
186+
//Middle Schoolers who enroll in sports like football have a five day cycle for the sport. This is a workaround.
187+
lastPeriodComponents=[lastPeriodComponents arrayByAddingObject:@"A"];
188+
}
189+
else{
185190
//The course period list doesn't have the same number of days as the campus the user chose earlier.
186191
[[[UIAlertView alloc] initWithTitle:@"Wrong Campus!" message:@"You chose the wrong campus during the setup. Please start again." delegate:self cancelButtonTitle:@"Back" otherButtonTitles:nil] show];
187192
return;
193+
}
188194
}
189195
//Create the course object once we have a course code, name, and period list
190196
IHWCourse *c = parseCourse(lastCode, lastName, lastPeriodComponents);

0 commit comments

Comments
 (0)