Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nzatsepilov/985e04bd4f8fa4d9c8426d8b641a1822 to your computer and use it in GitHub Desktop.
Save nzatsepilov/985e04bd4f8fa4d9c8426d8b641a1822 to your computer and use it in GitHub Desktop.
Scores
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