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