//
//  riskass_question.m
//  EC145
//
//  Created by KulanaMac on 5/26/14.
//
//

#import "riskass_question.h"

@implementation riskass_question

@synthesize Question;
@synthesize answers;



-(id) initWithQuestion:(NSString*)theQuestion;
{
    Question=theQuestion;
    answers=[[NSMutableArray alloc]init];
    return self;
}

- (id) initWithCoder: (NSCoder *)coder
{
    if (self = [super init])
    {
    	self.Question = [coder decodeObjectForKey:@"Question"];
    	self.answers = [coder decodeObjectForKey:@"answers"];
    }
    return self;
}

- (void) encodeWithCoder: (NSCoder *)coder
{
    [coder encodeObject:Question forKey:@"Question"];
    [coder encodeObject:answers forKey:@"answers"];
    
}

-(void) setAnswers:(NSMutableArray *)theAnswers {
    answers =[NSMutableArray arrayWithArray:theAnswers];
}

-(void) addAnswer:(riskass_answer *)ans {
    [answers addObject:ans];
}

-(riskass_answer *) getAnswer:(int)i {
    return [answers objectAtIndex:i];
}

@end
