Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 11    Views: 113

CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
10/02/13 10:48 PM (12 years ago)

Easy quiz plugin

In the interactive quiz it shows I can pull questions from a backend file.I have the json but how would I write the php script? Details of interactive quiz: If you provide questions data from a remote file there is no childItems array in the screen definition in the BT_config.txt file. Instead, the quiz questions are pulled from a remote file. { "itemId":"1111", "itemType":"BT_screen_quiz", "navBarTitleText":"My cool quiz", "dataURL":"http://www.domain.com/theQuizQuestions.php" } screen data tab of interactive quiz plugin: Use Merge Fields to append device information to the end of the Data URL. This advanced approach allows a backend script to capture device information before outputting the screens data. If you use merge fields you will need a backend .php script to process the request. Available Merge Fields [buzztouchAppId] This is the App Id in your buzztouch control panel [buzztouchAPIKey] This is the app API Key in your buzztouch control panel [screenId] The unique id of the current screen (useful for determing the app context) [userId] The Unique Id of a logged in user (if the app uses login screens) [userEmail] The email address of a logged in user [deviceId] A globally unique string value assigned to the device. [deviceModel] A string value controlled by the device manufacturer. [deviceLatitude] A latitude coordinate value (if the device is reporting it's location). [deviceLongitude] A longitude coordinate value (if the device is reporting it's location). If you used this URL... http://www.mysite.com/localrestaurants.php?deviceLatitude=[deviceLatitude]&deviceLongitude=[deviceLongitude]&userId=[userId] The device would request.... http://www.mysite.com/localrestaurants.php?latitude=38.4456&longitude=-102.3444&userId=00000
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
10/02/13 10:58 PM (12 years ago)
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
10/03/13 05:43 AM (12 years ago)
I would be interested in this too. Please post what you find.
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
10/03/13 06:11 AM (12 years ago)
Are you sure you need a php script. You should be able to just put the json quiz data file on your hosting account then put the url for that file in the dataURL field. Ex: mysite.com/myQuizData.txt (this is a json formated text file) or mysite.com/myQuizData.json That should be all you need to pull the quiz data remotely. No php needed.
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
10/03/13 06:22 AM (12 years ago)
@dusko will do. @nadthevlad yes thanks thats what the thread I posted suggested.I will keep yall updated
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
10/03/13 06:48 AM (12 years ago)
Agreed with @nadthevlad, you don't need php. Just use child items, like in dropbox like I do. LA
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
10/03/13 06:50 AM (12 years ago)
@LA cool thanks
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
10/03/13 04:06 PM (12 years ago)
@la I couldnt get it to work with dropbox.can you guide me a little more in the best way
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
10/03/13 04:12 PM (12 years ago)
and I tried to use my hosting account like nadthevlad said but it just keeps loading then freezes up
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
10/03/13 04:12 PM (12 years ago)
Yes I still cant get it to work heres an example of my json { "childItems": [ { "questionText": "Where can you find the calibration utility on an Android device?", "correctAnswerText": "Settings>General>Calibration", "incorrectText1": "Setting>Display", "incorrectText2": "Setting>Calibration", "incorrectText3": "Setting>Advanced>Display" }, { "questionText": "To kill a process in Windows 7 from the command line,use which of the following commands?", "correctAnswerText": "TASKKILL", "incorrectText1": "KILLTASK", "incorrectText2": "END_TASK", "incorrectText3": "TASKLIST" }, { "questionText": "Which of the following tools can be run from the command line in Windows 7 to help repair startup issues?", "correctAnswerText": "BOOTREC", "incorrectText1": "BOOTNEW", "incorrectText2": "REBOOT", "incorrectText3": "CMDBOOT" }, { "questionText": "Which of the following components should you buy to protect your computer from high voltages?", "correctAnswerText": "Surge Suppressor", "incorrectText1": "Loop Back Plug", "incorrectText2": "UPS", "incorrectText3": "Ground Fault interrupter" } ] }
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
10/03/13 04:28 PM (12 years ago)
hey i got it to work .On my url I had it https instead of http.I do need to make https anyways though.Everything is good!!
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
10/04/13 08:44 AM (12 years ago)
Awesome! LA
 

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.