Discussion Forums  >  Crashes, Memory Warnings

Replies: 2    Views: 203

nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
06/21/13 01:42 PM (10 years ago)

Bug in NAD Advanced Quiz

This one is causing a lot of problems for people. Leaving question text blank will crash the app which it shouldn't. It will require a little bit of cut and paste but it should be fairly easy to fix. Line 2728-2738 looks like this constraint = [NSLayoutConstraint constraintWithItem:_qOuterLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:_questionView attribute:NSLayoutAttributeCenterX multiplier:1.0f constant:0.0f]; [self.view addConstraint:constraint]; Your going to want to wrap this code in an if statement: like so: if(_qOuterLabel.superview != nil){ constraint = [NSLayoutConstraint constraintWithItem:_qOuterLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:_questionView attribute:NSLayoutAttributeCenterX multiplier:1.0f constant:0.0f]; [self.view addConstraint:constraint]; }
 
BuzzingSteve
Aspiring developer
Profile
Posts: 526
Reg: Jun 24, 2011
Vancouver, Cana...
11,660
like
06/22/13 11:53 AM (10 years ago)
Nice catch :-)
 
bfoutty
Code is Art
Profile
Posts: 185
Reg: Jun 12, 2011
Youngstown, OH
12,650
like
07/10/13 07:28 AM (10 years ago)
I am using your plugin to put a weekly quiz into the app I use in my classroom. I had previously seen a modification for the BT quiz plugin that allowed the score to be calculated as total points - time by doing this: //figure out totalPoints totalPoints = (totalPoints + pointsPerRight); simply change that line so that it look like this - //figure out totalPoints totalPoints = ((totalPoints + pointsPerRight) - totalSeconds); I attempted to modify your plugin by doing this: //figure out totalPoints _totalPoints = ((_numberCorrect * _quizPointsPerAnswer)- totalSeconds); on lines 1851 & 1852. However, it did not change the total scores. It was still calculated as (_numberCorrect*_quizPointsPerAnswer). Any ideas as to how I might modify the scoring to achieve total points - total seconds. Any thoughts you would have would be appreciated. Thank you for your time and effort. Brian
 

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.