//
//  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;
// WRONG
-(id)initWithTextAndType:(NSString *)text:(QuestionType)type{
    self = [super init];
    if(self){
        self.questionText = text;
        self.questionType = type;
        self.answer = -1;
    }
    
    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];
        
        // potential leak
        return [[NSArray alloc] initWithObjects:
                     @"Strongly agree",@"Agree", @"Neither agree nor disagree",
                     @"Disagree",@"Strongly disagree", nil];
        
        
    }else if(type == SLIDERS_ZOOMER){
        [Question setCount:NUM_CHOICES];
        // potential leak
        return [[NSArray alloc] initWithObjects:
                 @"definitely the Sliders", @"maybe the Sliders", @"Neither/Both equal",
                @"maybe the Zoomer", @"definitely the Zoomer", nil];
    }else{
        return nil;
    }
}
///
@end
