Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 77

Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
07/08/12 05:05 PM (13 years ago)

Android Quiz 2.0 Self Hosted question #'s

I am trying to convert 2 quiz apps that I have into Android apps. This is the first time I have tried the new quiz plugin in Android. I got past the "there is no questions" issue but now everything works fine except it does not stop at 10 questions like it does in iOS? I see in the quiz code where it looks for the JSON data for the number of quiz questions, and the default is 0, so I changed the default to 10 hoping that would work, but no go? Can I pull out that string and hard code 10 questions? I am guessing I could, but I do not know how to without breaking the code. I don't plan on changing the # so I am not worried about that.
 
TraceCampbellBSNRN
buzztouch Evangelist
Profile
Posts: 233
Reg: Dec 16, 2011
Forney
3,680
like
07/08/12 08:46 PM (13 years ago)
Im not sure if you can do that it would be nice but I never any luck I just had to do it one by one by one by one maybe someone else knows how
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/09/12 12:14 AM (13 years ago)
I would try to change that code anyway. Just change it, make note of exactly what you did so you can reverse it if needed (or make a copy of the unchanged file first), and then test it! If it works, you're good. If it breaks things, then just reverse your changes (or replace the changed file with the copied one), and you should be back to your original starting point. That's a great way to figure out how things really work! Mark
 
Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
like
07/09/12 06:12 AM (13 years ago)
I gave up for the night after a while, I am going to look at it again tonight when I get home. I tried pulling out the string and just entering the number I wanted and it did not throw any errors, but still did not work. I also tied changing the default 0 to 10 in all the spots it is entered, but still no luck. There must be another spot somewhere that I am missing. I looked aver the delegate file as well, but did not find anything. I'll keep hacking away...
 
Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
like
07/09/12 07:16 PM (13 years ago)
finally figured this out. This is what I changed to get it to stop at 10 questions This was changed in the BT_Screen_Quiz.java file Changed this - //quiz may be over if(currentQuestion >= childItems.size()){ To this- //quiz may be over if(currentQuestion >= 10){ Also had to change this in the alert so it showed the # questions in the # correct alert. Changed this- //show alert String tmpResults = "\nAnswers: " + numberRight + " / " + childItems.size(); To this- //show alert String tmpResults = "\nAnswers: " + numberRight + " / " + 10;
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
07/10/12 06:34 AM (13 years ago)
thanks for the tips, working on a 2.0 Android quiz currently for an app. thanks for doing some exterminating of bugs :) have you made any other mods to it? I was playing with the buttomn size and trying to chnage the button text in iOS. I was able to mod it a bit, but there are some variables in there I mucked up. I'm DYING for T/F functionality in the quiz plug-in....
 
Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
like
07/10/12 09:41 AM (13 years ago)
I have not chopped it up to much yet. Right now I am trying to tear into each of the plugins to find out better how each one works. I published the app I am working on last night in Google Play, and am waiting for the review by apple for iOS. https://play.google.com/store/apps/details?id=com.baseballtrivia&feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5iYXNlYmFsbHRyaXZpYSJd I am using the same control panel for both apps, so I didn't want to mess with things too much while my Apple version is waiting for review. Jim
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/10/12 09:58 AM (13 years ago)
Give Buzzcast 3 a listen...it has info on how to make a T/F quiz: http://idevdepot.com/category/podcast/buzzcast/ Mark
 

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.