annotate Question.m @ 24:a4908ad8c78e

Top and bottom toolbars. Intro page.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 01 Feb 2013 11:16:56 +0000
parents
children ae4d2c3ce5e0
rev   line source
rt300@24 1 //
rt300@24 2 // Question.m
rt300@24 3 // sonicZoom
rt300@24 4 //
rt300@24 5 // Created by Robert Tubb on 21/01/2013.
rt300@24 6 //
rt300@24 7 //
rt300@24 8
rt300@24 9 #import "Question.h"
rt300@24 10
rt300@24 11 @implementation Question
rt300@24 12
rt300@24 13 @synthesize questionText = _questionText;
rt300@24 14 @synthesize questionType = _questionType;
rt300@24 15 @synthesize answer = _answer;
rt300@24 16
rt300@24 17 static int theCount = 0;
rt300@24 18
rt300@24 19 -(id)initWithTextAndType:(NSString *)text:(QuestionType)type{
rt300@24 20 self = [super init];
rt300@24 21 if(self){
rt300@24 22 self.questionText = text;
rt300@24 23 self.questionType = type;
rt300@24 24 self.answer = 0;
rt300@24 25 }
rt300@24 26
rt300@24 27 return self;
rt300@24 28
rt300@24 29 }
rt300@24 30 ////
rt300@24 31 - (id)init
rt300@24 32 {
rt300@24 33 return [self initWithTextAndType:@"Quo Vadis?":AGREE_DISAGREE];
rt300@24 34 }
rt300@24 35
rt300@24 36 + (int) count { return theCount; }
rt300@24 37 + (void) setCount:(int)c { theCount = c; }
rt300@24 38
rt300@24 39
rt300@24 40
rt300@24 41 +(NSArray *)answersWithType:(QuestionType)type{
rt300@24 42 // get the set of answers depending on what type the q was
rt300@24 43 // pseudo static variable
rt300@24 44 if(type == AGREE_DISAGREE){
rt300@24 45 [Question setCount:6];
rt300@24 46 return [[NSArray alloc] initWithObjects:
rt300@24 47 @" ", @"Strongly disagree", @"Disagree", @"Neither",
rt300@24 48 @"Agree", @"Strongly agree", nil];
rt300@24 49
rt300@24 50
rt300@24 51 }else if(type == SLIDERS_ZOOMER){
rt300@24 52 [Question setCount:6];
rt300@24 53 return [[NSArray alloc] initWithObjects:
rt300@24 54 @" ", @"Definitely Sliders", @"Maybe Sliders", @"Neither",
rt300@24 55 @"Maybe Zoomer", @"Definitely Zoomer", nil];
rt300@24 56 }else{
rt300@24 57 return nil;
rt300@24 58 }
rt300@24 59 }
rt300@24 60 ///
rt300@24 61 @end