# HG changeset patch # User Robert Tubb # Date 1358427679 0 # Node ID e45c3e631d20ffe3d88754e3810459239bc9bbba # Parent 6a9191f5b2695f1c063f17edeab39f278d1682d7 View fiddling diff -r 6a9191f5b269 -r e45c3e631d20 QuestionnaireViewController.h --- a/QuestionnaireViewController.h Wed Jan 16 19:03:51 2013 +0000 +++ b/QuestionnaireViewController.h Thu Jan 17 13:01:19 2013 +0000 @@ -9,8 +9,9 @@ #import @interface QuestionnaireViewController : UIViewController -@property (retain, nonatomic) IBOutlet UISegmentedControl *answerPressed; + @property (retain, nonatomic) IBOutlet UILabel *questionText; +@property (retain, nonatomic) IBOutlet UILabel *titleText; //---------------------------------------------------------------- -(IBAction)hide:(id)sender; @@ -18,6 +19,7 @@ -(IBAction)show:(id)sender; //---------------------------------------------------------------- - (IBAction)nextQuestionPressed:(id)sender; +- (IBAction)previousQuestionPressed:(id)sender; -(void)populateQuestionArray; @end diff -r 6a9191f5b269 -r e45c3e631d20 QuestionnaireViewController.m --- a/QuestionnaireViewController.m Wed Jan 16 19:03:51 2013 +0000 +++ b/QuestionnaireViewController.m Thu Jan 17 13:01:19 2013 +0000 @@ -14,22 +14,7 @@ @property (strong, nonatomic) NSArray * answerArray; @property (nonatomic) NSInteger currentQuestionIndex; /* -@"I am familiar with music software and synthesisers." -@"The best way to get a feel for the possibilities of the synth was with:" -@"Interesting sounds could be discovered more quickly as a result of using:" -@"A sound could be fine tuned more easily using:" -@"The correspondence between the sliders and the grid was understandable." -@"The interface that felt more familiar was:" -@"Scrolling a greater distance the zoom grid seemed to correspond to larger difference in the sound." -@"The ability to see other presets on the grid was useful." -@"The range of sounds was too limited to be able to judge the eventual usefulness of the interface." -@"The interface better for generating new ideas was" -@"The interface better for live performance would be:" - @"A specific type of sound could be found more quickly using:" - @"I felt more in control when using:" -@"The Zoomer was an improvement on just using the randomiser." -@"The combination of Zoomer and Sliders was more useful than either individually." -@"Overall, I preferred using:" + */ @@ -67,14 +52,16 @@ } //---------------------------------------------------------------- - (void)dealloc { - [_answerPressed release]; + [_questionText release]; + [_titleText release]; [super dealloc]; } //---------------------------------------------------------------- - (void)viewDidUnload { [self setAnswerPressed:nil]; [self setQuestionText:nil]; + [self setTitleText:nil]; [super viewDidUnload]; } //---------------------------------------------------------------- @@ -95,21 +82,76 @@ - (IBAction)nextQuestionPressed:(id)sender { // save answer ? no button did that hopefully + // if last question show thanks - // else go to next self.currentQuestionIndex++; + if(self.currentQuestionIndex >= [self.questionArray count]){ + [self showThanks]; + }else{ + [self loadQuestion:self.currentQuestionIndex]; + + } +} + +- (IBAction)previousQuestionPressed:(id)sender { + self.currentQuestionIndex--; + if(self.currentQuestionIndex < 0){ + // nothing + self.currentQuestionIndex = 0; + }else{ + [self loadQuestion:self.currentQuestionIndex]; + } +} +//---------------------------------------------------------------- + +- (void)showThanks{ + // hide next question button + // hide selector + self.titleText.text = @"Thank you!"; + + self.questionText.text = @"Thanks for helping science help you. Visit the study website to keep abreast of exciting events."; +} +/* +- (IBAction)previousQuestionPressed:(id)sender { + self.currentQuestionIndex--; + if(self.currentQuestionIndex > [self.questionArray count]){ + [self showThanks]; + } [self loadQuestion:self.currentQuestionIndex]; } + */ //---------------------------------------------------------------- - (void)loadQuestion:(NSInteger)questionIndex { // populate text fields with question + NSString *qtitle; + qtitle = [@"Question " stringByAppendingFormat:@"%d",questionIndex+1]; + self.titleText.text = qtitle; + self.questionText.text = [self.questionArray objectAtIndex:questionIndex]; + // if question already answered show that } //---------------------------------------------------------------- - (void)populateQuestionArray{ - self.questionArray = [[NSArray alloc] initWithObjects:@"one", @"two", @"buckle", nil]; + self.questionArray = [[NSArray alloc] initWithObjects: + @"I am familiar with music software and synthesisers.", + @"The best way to get a feel for the possibilities of the synth was with:", + @"Interesting sounds could be discovered more quickly as a result of using:", + @"A sound could be fine tuned more easily using:", + @"The correspondence between the sliders and the grid was understandable.", + @"The interface that felt more familiar was:", + @"Scrolling a greater distance the zoom grid seemed to correspond to larger difference in the sound.", + @"The ability to see other presets on the grid was useful.", + @"The range of sounds was too limited to be able to judge the eventual usefulness of the interface.", + @"The interface better for generating new ideas was", + @"The interface better for live performance would be:", + @"A specific type of sound could be found more quickly using:", + @"I felt more in control when using:", + @"The Zoomer was an improvement on just using a randomiser.", + @"The combination of Zoomer and Sliders was more useful than either individually.", + @"Overall, I preferred using:", + nil]; } //---------------------------------------------------------------- diff -r 6a9191f5b269 -r e45c3e631d20 QuestionnaireViewController.xib --- a/QuestionnaireViewController.xib Wed Jan 16 19:03:51 2013 +0000 +++ b/QuestionnaireViewController.xib Thu Jan 17 13:01:19 2013 +0000 @@ -11,7 +11,6 @@ 1930 - IBNSLayoutConstraint IBProxyObject IBUIButton IBUILabel @@ -51,27 +50,24 @@ 7 NO IBIPadFramework - YES - - Question 1 - - - 1 - MCAwIDAAA - darkTextColor - - - Helvetica - 25 - 16 - - - - - + Question 1 + + 1 + MCAwLjg3MTEwNjY5ODMgMQA 0 + + Helvetica + Helvetica + 0 + 27 + + + Helvetica + 27 + 16 + NO @@ -88,7 +84,10 @@ NO IBIPadFramework What did you think about all this crazy stuff that happened when you were using the thing that was going on before? - + + 1 + MCAwLjg3MTEwNjY5ODMgMQA + 0 3 @@ -169,18 +168,18 @@ {{118, 347}, {533, 44}} - + _NS:9 NO IBIPadFramework 5 0 - No - Disagree - Neither - Agree - Well Agree + 1 + 2 + 3 + 4 + 5 @@ -233,21 +232,168 @@ + + + 292 + {{118, 398}, {106, 49}} + + + + _NS:9 + NO + YES + 7 + NO + IBIPadFramework + Strongly disagree + + 1 + MCAwIDAAA + darkTextColor + + + 0 + 2 + 1 + + 1 + 17 + + + Helvetica + 17 + 16 + + NO + 106 + + + + 292 + {{224, 398}, {106, 49}} + + + + _NS:9 + NO + YES + 7 + NO + IBIPadFramework + Strongly disagree + + + 0 + 2 + 1 + + + NO + 106 + + + + 292 + {{331, 398}, {106, 49}} + + + + _NS:9 + NO + YES + 7 + NO + IBIPadFramework + Strongly disagree + + + 0 + 2 + 1 + + + NO + 106 + + + + 292 + {{438, 398}, {106, 49}} + + + + _NS:9 + NO + YES + 7 + NO + IBIPadFramework + Strongly disagree + + + 0 + 2 + 1 + + + NO + 106 + + + + 292 + {{537, 398}, {106, 49}} + + + + _NS:9 + NO + YES + 7 + NO + IBIPadFramework + Strongly disagree + + + 0 + 2 + 1 + + + NO + 106 + - {{0, 20}, {768, 1004}} + {1024, 768} - 3 - MQA - - 2 + 1 + MCAwIDAAA + + NO + NO + + 3 + 3 + + + IBUIScreenMetrics + + YES + + + + + + {768, 1024} + {1024, 768} + - - NO - - 2 + IBIPadFramework + iPad Full Screen + 1 IBIPadFramework @@ -271,6 +417,14 @@ 41 + + titleText + + + + 42 + + nextQuestionPressed: @@ -281,6 +435,15 @@ + previousQuestionPressed: + + + 7 + + 50 + + + hide: @@ -312,338 +475,36 @@ 2 - - - 4 - 0 - - 4 - 1 - - 64 - - 1000 - - 3 - 9 - 3 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 3 - 1 - - 482 - - 1000 - - 3 - 9 - 3 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 3 - 1 - - 347 - - 1000 - - 3 - 9 - 3 - - - - 9 - 0 - - 9 - 1 - - 0.0 - - 1000 - - 5 - 22 - 2 - - - - 3 - 0 - - 3 - 1 - - 178 - - 1000 - - 3 - 9 - 3 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 3 - 1 - - 96 - - 1000 - - 3 - 9 - 3 - + + + + + 4 - - - - 7 - 0 - - 0 - 1 - - 137 - - 1000 - - 3 - 9 - 1 - - - - 8 - 0 - - 0 - 1 - - 53 - - 1000 - - 3 - 9 - 1 - - + 5 - - - - 7 - 0 - - 0 - 1 - - 533 - - 1000 - - 3 - 9 - 1 - - - - 8 - 0 - - 0 - 1 - - 124 - - 1000 - - 3 - 9 - 1 - - + 6 - - - - 7 - 0 - - 0 - 1 - - 121 - - 1000 - - 3 - 9 - 1 - - + @@ -662,98 +523,28 @@ - 10 - - - - - 11 - - - - - 12 - - - - - 13 - - - - - 14 - - - - - 16 - + 45 + - 18 - + 46 + - 19 - + 47 + - 20 - + 48 + - 21 - - - - - 24 - - - - - 26 - - - - - 29 - - - - - 30 - - - - - 31 - - - - - 32 - - - - - 33 - - - - - 34 - - - - - 35 - + 49 + @@ -763,97 +554,38 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - - - - - - - - - - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - 41 + 50 - NSLayoutConstraint - NSObject - - IBProjectSource - ./Classes/NSLayoutConstraint.h - - - QuestionnaireViewController UIViewController - id id id + id id - - answerWasSelected: - id - hide: id @@ -862,24 +594,28 @@ nextQuestionPressed: id + + previousQuestionPressed: + id + show: id - UISegmentedControl UILabel + UILabel - - answerPressed - UISegmentedControl - questionText UILabel + + titleText + UILabel + IBProjectSource @@ -892,7 +628,6 @@ IBIPadFramework YES 3 - YES 1930 diff -r 6a9191f5b269 -r e45c3e631d20 eventLogger.h --- a/eventLogger.h Wed Jan 16 19:03:51 2013 +0000 +++ b/eventLogger.h Thu Jan 17 13:01:19 2013 +0000 @@ -66,6 +66,8 @@ sliderID = jevt["sliderID"].asInt(); eventTime = jevt["eventTime"].asLargestInt(); + // TODO what happens if we try to read one that isn't there? + } Json::Value eventToJson(){ Json::Value jevt; diff -r 6a9191f5b269 -r e45c3e631d20 iViewController.mm --- a/iViewController.mm Wed Jan 16 19:03:51 2013 +0000 +++ b/iViewController.mm Thu Jan 17 13:01:19 2013 +0000 @@ -87,6 +87,7 @@ } + - (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView { UITextField *textField = [alertView textFieldAtIndex:0]; diff -r 6a9191f5b269 -r e45c3e631d20 testApp.mm --- a/testApp.mm Wed Jan 16 19:03:51 2013 +0000 +++ b/testApp.mm Thu Jan 17 13:01:19 2013 +0000 @@ -60,8 +60,8 @@ ofxiPhoneDeviceType device = ofxiPhoneGetDeviceType(); cout << "Device: " << device << '\n'; - ofxiPhoneSetOrientation( OF_ORIENTATION_DEFAULT ); // TODO orientation CRAP - + //ofxiPhoneSetOrientation( OF_ORIENTATION_DEFAULT ); // TODO orientation CRAP + ofxiPhoneSetOrientation( OF_ORIENTATION_90_RIGHT ); //NSString * q = @"Why the hell did you do that? Are you mad?"; //[iViewController showQuestionPrompt:q]; @@ -550,14 +550,15 @@ //-------------------------------------------------------------- void testApp::deviceOrientationChanged(int newOrientation){ + /* cout << "orientation: " << newOrientation; - //keyboard->updateOrientation(); // takes ages , only applies to text box + if(newOrientation == 4){ ofxiPhoneSetOrientation( OF_ORIENTATION_90_RIGHT ); }else if(newOrientation == 3){ ofxiPhoneSetOrientation( OF_ORIENTATION_90_LEFT ); } - + */ }