annotate QuestionnaireViewController.m @ 14:6a9191f5b269

Questionnaire view started function basic
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Wed, 16 Jan 2013 19:03:51 +0000
parents
children e45c3e631d20
rev   line source
rt300@14 1 //
rt300@14 2 // QuestionnaireViewController.m
rt300@14 3 // oscSenderExample
rt300@14 4 //
rt300@14 5 // Created by Robert Tubb on 16/01/2013.
rt300@14 6 //
rt300@14 7 //
rt300@14 8
rt300@14 9 #import "QuestionnaireViewController.h"
rt300@14 10
rt300@14 11 @interface QuestionnaireViewController ()
rt300@14 12 // the "model" is an array of questions
rt300@14 13 @property (strong, nonatomic) NSArray * questionArray;
rt300@14 14 @property (strong, nonatomic) NSArray * answerArray;
rt300@14 15 @property (nonatomic) NSInteger currentQuestionIndex;
rt300@14 16 /*
rt300@14 17 @"I am familiar with music software and synthesisers."
rt300@14 18 @"The best way to get a feel for the possibilities of the synth was with:"
rt300@14 19 @"Interesting sounds could be discovered more quickly as a result of using:"
rt300@14 20 @"A sound could be fine tuned more easily using:"
rt300@14 21 @"The correspondence between the sliders and the grid was understandable."
rt300@14 22 @"The interface that felt more familiar was:"
rt300@14 23 @"Scrolling a greater distance the zoom grid seemed to correspond to larger difference in the sound."
rt300@14 24 @"The ability to see other presets on the grid was useful."
rt300@14 25 @"The range of sounds was too limited to be able to judge the eventual usefulness of the interface."
rt300@14 26 @"The interface better for generating new ideas was"
rt300@14 27 @"The interface better for live performance would be:"
rt300@14 28 @"A specific type of sound could be found more quickly using:"
rt300@14 29 @"I felt more in control when using:"
rt300@14 30 @"The Zoomer was an improvement on just using the randomiser."
rt300@14 31 @"The combination of Zoomer and Sliders was more useful than either individually."
rt300@14 32 @"Overall, I preferred using:"
rt300@14 33
rt300@14 34 */
rt300@14 35
rt300@14 36 @end
rt300@14 37
rt300@14 38 @implementation QuestionnaireViewController
rt300@14 39
rt300@14 40 //----------------------------------------------------------------
rt300@14 41 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
rt300@14 42 {
rt300@14 43 self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
rt300@14 44 if (self) {
rt300@14 45 // Custom initialization
rt300@14 46
rt300@14 47 [self populateQuestionArray ];
rt300@14 48
rt300@14 49
rt300@14 50 }
rt300@14 51 return self;
rt300@14 52 }
rt300@14 53 //----------------------------------------------------------------
rt300@14 54 - (void)viewDidLoad
rt300@14 55 {
rt300@14 56 [super viewDidLoad];
rt300@14 57 // Do any additional setup after loading the view from its nib.
rt300@14 58 self.currentQuestionIndex = 0;
rt300@14 59 // load question 1
rt300@14 60 [self loadQuestion:self.currentQuestionIndex];
rt300@14 61 }
rt300@14 62 //----------------------------------------------------------------
rt300@14 63 - (void)didReceiveMemoryWarning
rt300@14 64 {
rt300@14 65 [super didReceiveMemoryWarning];
rt300@14 66 // Dispose of any resources that can be recreated.
rt300@14 67 }
rt300@14 68 //----------------------------------------------------------------
rt300@14 69 - (void)dealloc {
rt300@14 70 [_answerPressed release];
rt300@14 71 [_questionText release];
rt300@14 72 [super dealloc];
rt300@14 73 }
rt300@14 74 //----------------------------------------------------------------
rt300@14 75 - (void)viewDidUnload {
rt300@14 76 [self setAnswerPressed:nil];
rt300@14 77 [self setQuestionText:nil];
rt300@14 78 [super viewDidUnload];
rt300@14 79 }
rt300@14 80 //----------------------------------------------------------------
rt300@14 81 - (IBAction)answerWasSelected:(id)sender {
rt300@14 82 // look at property?
rt300@14 83
rt300@14 84 }
rt300@14 85
rt300@14 86 //----------------------------------------------------------------
rt300@14 87 -(IBAction)hide:(id)sender{
rt300@14 88 self.view.hidden = YES;
rt300@14 89 }
rt300@14 90 //----------------------------------------------------------------
rt300@14 91 -(IBAction)show:(id)sender{
rt300@14 92 self.view.hidden = NO;
rt300@14 93 }
rt300@14 94 //----------------------------------------------------------------
rt300@14 95
rt300@14 96 - (IBAction)nextQuestionPressed:(id)sender {
rt300@14 97 // save answer ? no button did that hopefully
rt300@14 98 // if last question show thanks
rt300@14 99
rt300@14 100 // else go to next
rt300@14 101 self.currentQuestionIndex++;
rt300@14 102 [self loadQuestion:self.currentQuestionIndex];
rt300@14 103 }
rt300@14 104 //----------------------------------------------------------------
rt300@14 105 - (void)loadQuestion:(NSInteger)questionIndex {
rt300@14 106 // populate text fields with question
rt300@14 107 self.questionText.text = [self.questionArray objectAtIndex:questionIndex];
rt300@14 108
rt300@14 109 }
rt300@14 110 //----------------------------------------------------------------
rt300@14 111 - (void)populateQuestionArray{
rt300@14 112 self.questionArray = [[NSArray alloc] initWithObjects:@"one", @"two", @"buckle", nil];
rt300@14 113 }
rt300@14 114 //----------------------------------------------------------------
rt300@14 115
rt300@14 116 @end // end implementation