Discussion Forums  >  Uncategorized

Replies: 3    Views: 148

fusionmtx
Android Fan
Profile
Posts: 178
Reg: Jun 15, 2011
Orlando
2,180
09/11/11 08:56 PM (12 years ago)

Quiz issue 1.5 iOS

I use the Quiz function for Trivia, and something I've noticed and when i or a user starts the trivia, its the same 10 questions every time. Only after do i hit try again while in the app it will randomize them. Once I exit the App and then go back in it will be the orginal same questions. My question for anyone out there is, is there anyway to make the questions random from the start Since i have about 80 questions on the App. Thanks :)
 
baywebnz
Aspiring developer
Profile
Posts: 92
Reg: Oct 25, 2010
location unknow...
920
like
09/12/11 02:26 AM (12 years ago)
I have a method which will prob fix this for you, but i'm just off to bed (in new zealand!) if no one has answered you by time i log in in the morning, i'll dig it out and post it.
 
baywebnz
Aspiring developer
Profile
Posts: 92
Reg: Oct 25, 2010
location unknow...
920
like
09/12/11 11:08 PM (12 years ago)
Sorry it took me a while to get back! Try this: In BT_screen_quiz.m Find: //randomize questions if quizRandomizeQuestions Replace this line: NSUInteger randomIndex = random() % [self.quizQuestions count]; with this line: NSUInteger randomIndex = arc4random() % [self.quizQuestions count]; Clean Targets -> Build & Run And that should solve it for you!!!
 
fusionmtx
Android Fan
Profile
Posts: 178
Reg: Jun 15, 2011
Orlando
2,180
like
09/16/11 07:01 PM (12 years ago)
Woot Woot. Thanks a Billion! :)
 

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.