Skip to content

Instantly share code, notes, and snippets.

@pbrewczynski
Created August 19, 2013 14:11
Show Gist options
  • Save pbrewczynski/6269558 to your computer and use it in GitHub Desktop.
Save pbrewczynski/6269558 to your computer and use it in GitHub Desktop.
- (void)nextQuizItem
{
if (self.quizIndex == 999) {
self.quizIndex = 0;
self.statusLabel.text = @"";
} else if ((self.quiz.quizCount-1) > self.quizIndex) {
self.quizIndex++;
} else {
self.quizIndex = 0;
self.statusLabel.text = @"";
}
if (self.quiz.quizCount >= self.quizIndex + 1) {
[self.quiz nextQuestion:self.quizIndex];
self.questionLabel.text = self.quiz.quote;
self.answer1Label.text = self.quiz.ans1;
self.answer2Label.text = self.quiz.ans2;
self.answer3Label.text = self.quiz.ans3;
} else {
self.quizIndex = 0;
[self quizDone];
}
// reset fields for next question
self.answer1Label.backgroundColor = [UIColor colorWithRed:51/255.0 green:133/255.0 blue:238/255.0 alpha:1.0];
self.answer2Label.backgroundColor = [UIColor colorWithRed:51/255.0 green:133/255.0 blue:238/255.0 alpha:1.0];
self.answer3Label.backgroundColor = [UIColor colorWithRed:51/255.0 green:133/255.0 blue:238/255.0 alpha:1.0];
self.answer1Button.hidden = NO;
self.answer2Button.hidden = NO;
self.answer3Button.hidden = NO;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment