Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 1    Views: 52

cpmilez
Aspiring developer
Profile
Posts: 63
Reg: Jan 03, 2012
Ipswich, UK
6,030
04/10/13 02:57 AM (12 years ago)

Quiz - Continue where left.

First time at putting a quiz in an app... I would like to know if it's possible or if anyone has made the quiz "restorable" so if you navigate elsewhere to another page and then go back to the quick you can continue from the question where you left it? I don't mind altering the code but would need a good heads up on where to get started :-) The idea would be to run the quiz from a tabbed layout. The app's main purpose is a treasure hunt, however they also need to answer quiz questions as they take part in the course, so would need to switch between map and quiz ideally. The 2nd issue I have which I have read from searches in the forum other people have experience when the 4th answer in the quiz is hidden by the footer due to the tab layout. I understand its not possible to hide the tabs when a screen is set to "home" screen for that tab. However my alternative solution would be to hide the footer bar for the quiz screen if possible? I am not using the quiz timer so can't see why the footer bar would be needed? Can anyone point me in the direction of where abouts in the code I can remove this footer bar?
 
cpmilez
Aspiring developer
Profile
Posts: 63
Reg: Jan 03, 2012
Ipswich, UK
6,030
like
04/14/13 02:30 PM (12 years ago)
Managed to get the quiz to continue where left by changing 2 lines of code in the viewDidApear method. See below code where I have commented "CM Changed". I have commented the existing calls to startQuiz and quizEnded and called transitionQuestion method instead, seems to do the job I am looking for from basic tests. //we must be coming back from another screen, trigger quiz ended method if //we have already taken the quiz. If we have not taken a quiz yet, do nothing if(self.quizDidEnd > 0){ [BT_debugger showIt:self theMessage:@"viewDidAppear: quiz ended"]; //CM Changed //[self quizEnded]; [self transitionQuestion]; }else{ [BT_debugger showIt:self theMessage:@"viewDidAppear: start new quiz"]; //CM Changed //[self startQuiz]; [self transitionQuestion]; } For my other issue I removed the footer bar section by firstly decreasing the size of the questionBoxHeight to give more room for the answers. int questionBoxHeight = 130; //changed from 150. Then I commented out the quizToolbar. ( I didn't need the timer in the footer ) //quizToolbar //CM Changed commented to not show toolbar in footer. //quizToolbar = [BT_viewUtilities getQuizToolBarForScreen:self theScreenData:[self screenData]]; //[self.view addSubview:quizToolbar]; Hope this helps some one as I thought i'd never be able to do it and found it quite easy in the end with only a few code changes.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.