Created
June 14, 2017 11:44
-
-
Save nzatsepilov/985e04bd4f8fa4d9c8426d8b641a1822 to your computer and use it in GitHub Desktop.
Scores
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static NSInteger const kTextAndImageSlideScore = 5; | |
static NSInteger const kVideoSlideScore = 10; | |
static NSInteger const kQuizSlideScore = 5; | |
static NSInteger const kQuizAnsweredSlideScore = 5; | |
static NSInteger const kBadgeEarnedScore = 1; | |
+ (instancetype)scoreForViewingTheSlide:(Slide *)slide { | |
Score *score = [[Score alloc] init]; | |
switch (slide.type) { | |
case 5: | |
score.value = kVideoSlideScore; | |
break; | |
case 6: | |
case 13: | |
score.value = kQuizSlideScore; | |
break; | |
default: | |
score.value = kTextAndImageSlideScore; | |
break; | |
} | |
score.slideId = slide.slideId; | |
score.dateCreated = [NSDate sqliteStringFromDate:[NSDate date]]; | |
return score; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment