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

#import "riskass_category.h"

@implementation riskass_category

@synthesize Title;
@synthesize questions;



-(id) initWithTitle:(NSString*)theTitle;
{
    Title=theTitle;
    questions=[[NSMutableArray alloc] init];
    return self;
}

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

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

-(void) setQuestions:(NSMutableArray *)theQuestions {
    questions =[NSMutableArray arrayWithArray:theQuestions];
}

-(void) addQuestion:(riskass_question *)quest {
    [questions addObject:quest];
}

-(riskass_question *) getQuestion:(int)i {
    return [questions objectAtIndex:i];
}

@end
