Mercurial > hg > soniczoomios
view Question.m @ 27:ae4d2c3ce5e0
Details. Zoom trailing finger move sorted. Qs rephrased.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Wed, 13 Feb 2013 17:03:56 +0000 |
parents | a4908ad8c78e |
children | fabb3a5cdfc9 |
line wrap: on
line source
// // Question.m // sonicZoom // // Created by Robert Tubb on 21/01/2013. // // #import "Question.h" @implementation Question @synthesize questionText = _questionText; @synthesize questionType = _questionType; @synthesize answer = _answer; static int theCount = 0; -(id)initWithTextAndType:(NSString *)text:(QuestionType)type{ self = [super init]; if(self){ self.questionText = text; self.questionType = type; self.answer = 0; } return self; } //// - (id)init { return [self initWithTextAndType:@"Quo Vadis?":AGREE_DISAGREE]; } + (int) count { return theCount; } + (void) setCount:(int)c { theCount = c; } +(NSArray *)answersWithType:(QuestionType)type{ // get the set of answers depending on what type the q was // pseudo static variable if(type == AGREE_DISAGREE){ [Question setCount:NUM_CHOICES]; return [[NSArray alloc] initWithObjects: @"Strongly agree",@"Agree", @"Neither agree nor disagree", @"Disagree",@"Strongly disagree", nil]; }else if(type == SLIDERS_ZOOMER){ [Question setCount:NUM_CHOICES]; return [[NSArray alloc] initWithObjects: @"definitely the Sliders", @"maybe the Sliders", @"neither", @"maybe the Zoomer", @"definitely the Zoomer", nil]; }else{ return nil; } } /// @end