Mercurial > hg > soniczoomios
comparison QuestionnaireViewController.m @ 15:e45c3e631d20
View fiddling
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Jan 2013 13:01:19 +0000 |
parents | 6a9191f5b269 |
children |
comparison
equal
deleted
inserted
replaced
14:6a9191f5b269 | 15:e45c3e631d20 |
---|---|
12 // the "model" is an array of questions | 12 // the "model" is an array of questions |
13 @property (strong, nonatomic) NSArray * questionArray; | 13 @property (strong, nonatomic) NSArray * questionArray; |
14 @property (strong, nonatomic) NSArray * answerArray; | 14 @property (strong, nonatomic) NSArray * answerArray; |
15 @property (nonatomic) NSInteger currentQuestionIndex; | 15 @property (nonatomic) NSInteger currentQuestionIndex; |
16 /* | 16 /* |
17 @"I am familiar with music software and synthesisers." | 17 |
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 | 18 |
34 */ | 19 */ |
35 | 20 |
36 @end | 21 @end |
37 | 22 |
65 [super didReceiveMemoryWarning]; | 50 [super didReceiveMemoryWarning]; |
66 // Dispose of any resources that can be recreated. | 51 // Dispose of any resources that can be recreated. |
67 } | 52 } |
68 //---------------------------------------------------------------- | 53 //---------------------------------------------------------------- |
69 - (void)dealloc { | 54 - (void)dealloc { |
70 [_answerPressed release]; | 55 |
71 [_questionText release]; | 56 [_questionText release]; |
57 [_titleText release]; | |
72 [super dealloc]; | 58 [super dealloc]; |
73 } | 59 } |
74 //---------------------------------------------------------------- | 60 //---------------------------------------------------------------- |
75 - (void)viewDidUnload { | 61 - (void)viewDidUnload { |
76 [self setAnswerPressed:nil]; | 62 [self setAnswerPressed:nil]; |
77 [self setQuestionText:nil]; | 63 [self setQuestionText:nil]; |
64 [self setTitleText:nil]; | |
78 [super viewDidUnload]; | 65 [super viewDidUnload]; |
79 } | 66 } |
80 //---------------------------------------------------------------- | 67 //---------------------------------------------------------------- |
81 - (IBAction)answerWasSelected:(id)sender { | 68 - (IBAction)answerWasSelected:(id)sender { |
82 // look at property? | 69 // look at property? |
93 } | 80 } |
94 //---------------------------------------------------------------- | 81 //---------------------------------------------------------------- |
95 | 82 |
96 - (IBAction)nextQuestionPressed:(id)sender { | 83 - (IBAction)nextQuestionPressed:(id)sender { |
97 // save answer ? no button did that hopefully | 84 // save answer ? no button did that hopefully |
85 | |
98 // if last question show thanks | 86 // if last question show thanks |
99 | |
100 // else go to next | 87 // else go to next |
101 self.currentQuestionIndex++; | 88 self.currentQuestionIndex++; |
89 if(self.currentQuestionIndex >= [self.questionArray count]){ | |
90 [self showThanks]; | |
91 }else{ | |
92 [self loadQuestion:self.currentQuestionIndex]; | |
93 | |
94 } | |
95 } | |
96 | |
97 - (IBAction)previousQuestionPressed:(id)sender { | |
98 self.currentQuestionIndex--; | |
99 if(self.currentQuestionIndex < 0){ | |
100 // nothing | |
101 self.currentQuestionIndex = 0; | |
102 }else{ | |
103 [self loadQuestion:self.currentQuestionIndex]; | |
104 } | |
105 } | |
106 //---------------------------------------------------------------- | |
107 | |
108 - (void)showThanks{ | |
109 // hide next question button | |
110 // hide selector | |
111 self.titleText.text = @"Thank you!"; | |
112 | |
113 self.questionText.text = @"Thanks for helping science help you. Visit the study website to keep abreast of exciting events."; | |
114 } | |
115 /* | |
116 - (IBAction)previousQuestionPressed:(id)sender { | |
117 self.currentQuestionIndex--; | |
118 if(self.currentQuestionIndex > [self.questionArray count]){ | |
119 [self showThanks]; | |
120 } | |
102 [self loadQuestion:self.currentQuestionIndex]; | 121 [self loadQuestion:self.currentQuestionIndex]; |
103 } | 122 } |
123 */ | |
104 //---------------------------------------------------------------- | 124 //---------------------------------------------------------------- |
105 - (void)loadQuestion:(NSInteger)questionIndex { | 125 - (void)loadQuestion:(NSInteger)questionIndex { |
106 // populate text fields with question | 126 // populate text fields with question |
127 NSString *qtitle; | |
128 qtitle = [@"Question " stringByAppendingFormat:@"%d",questionIndex+1]; | |
129 self.titleText.text = qtitle; | |
130 | |
107 self.questionText.text = [self.questionArray objectAtIndex:questionIndex]; | 131 self.questionText.text = [self.questionArray objectAtIndex:questionIndex]; |
108 | 132 |
133 // if question already answered show that | |
109 } | 134 } |
110 //---------------------------------------------------------------- | 135 //---------------------------------------------------------------- |
111 - (void)populateQuestionArray{ | 136 - (void)populateQuestionArray{ |
112 self.questionArray = [[NSArray alloc] initWithObjects:@"one", @"two", @"buckle", nil]; | 137 self.questionArray = [[NSArray alloc] initWithObjects: |
138 @"I am familiar with music software and synthesisers.", | |
139 @"The best way to get a feel for the possibilities of the synth was with:", | |
140 @"Interesting sounds could be discovered more quickly as a result of using:", | |
141 @"A sound could be fine tuned more easily using:", | |
142 @"The correspondence between the sliders and the grid was understandable.", | |
143 @"The interface that felt more familiar was:", | |
144 @"Scrolling a greater distance the zoom grid seemed to correspond to larger difference in the sound.", | |
145 @"The ability to see other presets on the grid was useful.", | |
146 @"The range of sounds was too limited to be able to judge the eventual usefulness of the interface.", | |
147 @"The interface better for generating new ideas was", | |
148 @"The interface better for live performance would be:", | |
149 @"A specific type of sound could be found more quickly using:", | |
150 @"I felt more in control when using:", | |
151 @"The Zoomer was an improvement on just using a randomiser.", | |
152 @"The combination of Zoomer and Sliders was more useful than either individually.", | |
153 @"Overall, I preferred using:", | |
154 nil]; | |
113 } | 155 } |
114 //---------------------------------------------------------------- | 156 //---------------------------------------------------------------- |
115 | 157 |
116 @end // end implementation | 158 @end // end implementation |