diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Question.m	Fri Feb 01 11:16:56 2013 +0000
@@ -0,0 +1,61 @@
+//
+//  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:6];
+        return [[NSArray alloc] initWithObjects:
+                    @" ", @"Strongly disagree", @"Disagree", @"Neither",
+                    @"Agree", @"Strongly agree", nil];
+        
+        
+    }else if(type == SLIDERS_ZOOMER){
+        [Question setCount:6];
+        return [[NSArray alloc] initWithObjects:
+                @" ", @"Definitely Sliders", @"Maybe Sliders", @"Neither",
+                @"Maybe Zoomer", @"Definitely Zoomer", nil];
+    }else{
+        return nil;
+    }
+}
+///
+@end