Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 8    Views: 80

SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
02/17/13 08:10 PM (12 years ago)

Quiz Fix for Android local files.

Recent discussions and activities have prompted me to take a look at the Quiz Plugin. I need something similar for an upcoming project, so getting acquainted now or later, it's going to have to happen. Lest I digress... One of our biggest challenges has been getting the quiz to accept a local file. It works flawless on Macintosh/iPhone, not so on Android. Here is a quick fix to the android code. On line 360-367 of your BT_screen_quiz.java file you get this area, where the file is finally grabbed and parsed. It's a choice between a dataURL, or the childItems in the config.txt file, if any. This is displayed in this image: https://dl.dropbox.com/u/115208762/quiz_filegrab.png So, the secret is to replace the "childItem" parsing, and grab the data from the BT_Docs directory. This is provided for in this file: https://dl.dropbox.com/u/115208762/quizfix.txt In a nutshell, what it does is, look at the dataURL string, nab the filename, grab it from the BT_Docs, and copies it to the cache folder, where the quiz can find it. If there is no filename, it will assume the questions are in the config.txt file, and will continue on normally. Hope this helps! Cheers! -- Smug Slightly edited from Original.
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
02/17/13 08:14 PM (12 years ago)
Bookmarked and thanks. Was on my todo list.
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
02/18/13 02:22 AM (12 years ago)
good fix!! Thanks for posting
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
02/18/13 02:24 AM (12 years ago)
urr..double post...
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
02/18/13 07:09 AM (12 years ago)
Hey @Smug, I'm a little confused on what you are trying to do here? You shouldn't have to do that to make a file local in Android. LA
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
02/18/13 09:26 AM (12 years ago)
How do you do this on an iPhone?
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
02/18/13 11:03 AM (12 years ago)
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
02/18/13 11:36 AM (12 years ago)
Perfect. Thanks.
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
02/18/13 12:29 PM (12 years ago)
Hey LA, Its just to get the plugin to read the data off the local file. As it stands now the the plugin can read from inside the BT_config.text and off a remotely stored file. But not locally.
 

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.