Discussion Forums  >  Uncategorized

Replies: 19    Views: 922

MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
06/17/11 11:13 PM (14 years ago)

Quiz Scoreboard Example?

Can someone please give me a sample php file I can use as a template to build a scoreboard for a quiz? I don't like the way the default scoreboard displays and can't figure out how to modify the output. Any help or direction here would be greatly appreciated. BTW - got my first BuzzTouch app approved today. Two more in review. Thanks for a great service here.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/18/11 03:40 AM (14 years ago)
Hi in Gold River...fond memories of my Rancho Cordova / Folsom days ;-) The scoreboard php file doesn't have to do with the way the scoreboard looks in the mobile app. The .php file simply accepts the results, stores them somewhere, then outputs the most recent scores. The output is in a JSON format to drive the menu-list. This means if you don't want the menu-list as the scoreboard, and want something different, you'll need to figure out / code some kind of solution. Maybe give a little more detail about what you're trying to do and I'll try to recommend something?
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
06/18/11 08:40 AM (14 years ago)
Thanks David. Two things specifically I'd like to change. First is the time format, and second if I could just get a <br> inserted between the time and the score, it would make the appearance much better. Right now, the way results post on my iphone at least, the score is split over two lines like this: Sat, 18 Jun 2011 15:34:12 -0700 20 points in 55 sec. iPhone I'd like it to output: Sat, Jun 18, 2011 8:34:12 am 20 points in 55 sec. iPhone Any ideas on this? Thanks. BTW-We really like the area here, but this California economy has been really tough. My business is so slow, hence my focusing on developing apps. Once again, awesome platform you've created here. Very much appreciated.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/20/11 02:57 AM (14 years ago)
Long weekend, catching up on tons of posts. The output changes you're mentioning are easy if you can run your own scoreboard script. Tough if you can't. The reason the output for the date is like that is because there are soooooo many international folks that use this software to run their apps. Almost everyone sets up their own script to power scoreboards. We've tried to get an option in the control panel so you could change the date format but never did get it done. The results are split over two lines by iOS, there is no line break anywhere and this is iPhones what of formatting the data. Let me know if you can run a .PHP script to power your scoreboard (on your website). If you can't, we'll got to plan B ;-)
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
06/20/11 08:21 AM (14 years ago)
I can put the script on my server. No problem. I'm hosting quiz data now. I'm just not sure what the script should look like. If I can get a basic script as a template, I have no problem modifying php -- I'm just not a programmer to develop the program in the first place. Thanks for the help!
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
06/27/11 10:17 PM (14 years ago)
Still trying to find a solution here. Has anyone put together a php for displaying the scoreboard? Willing to share? I could use some help. Thanks.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/27/11 11:50 PM (14 years ago)
Ah...crap, fogot all about this! Went to Vegas last last week and kinda checked-out on this one ;-) I just wrote the sample script and put a link to it in the Quiz ScoreBoard URL section in the Quiz Screen advanced settings. See if you can make us of it. Re-post if it's over-your-head or if you can't get it to work ;-)
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
06/28/11 06:59 AM (14 years ago)
Thanks, David. Really appreciate this. I understand most of the logic in the php, although I have a couple of questions. Also, it is not working for me. I get an error There was a problem downloading some data. Check your internet connection then try again. I set up the database and have uploaded the php scoreboard.php at ncaa.jc-evans.com/appdata Quiz Scoreboard url is set to http://ncaa.jc-evans.com/appdata/scoreboard.php?command=getQuizScoreboardData&appGuid=[buzztouchAppId]&apiKey=[buzztouchAPIKey]&screenId=[screenId]&deviceModel=[deviceModel]&deviceLatitude=[deviceLatitude]&deviceLongitude=[deviceLongitude] Not sure what to do to fix this. The app is Penn State Nittany Lions. In the php you say to set the Screen Data url to http://ncaa.jc-evans.com/appdata/sample-scoreboard.php?command=getQuizScoreboardData&appGuid=[buzztouchAppId]&apiKey=[buzztouchAPIKey]&screenId=[screenId] Not sure why I would do that. If I do, it overrides the questions within the app. Also, I like to use that to feed the questions into the trivia app. I've done this for several other apps. Last question is regarding date format. I see you've commented out a line and inserted a different one: //$quizDate = gmdate(m-d-Y\ H:i:s, strtotime($row[dateStampUTC])) . (gmt); $quizDate = date(DATE_RFC2822, strtotime($row[dateStampUTC])); When I get this running, I'd prefer a time format like date(F j, Y, g:i a); Is that okay? Thanks for the advice and help on this.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/28/11 08:37 AM (14 years ago)
a) Error, check your internet connection: Is this on the buzztouch control panel? I visited your football quiz and 'saved' - no errors? Not sure what this is, a little details maybe on what screen it's on? b) Quiz Data URL. You're right, the sample should not mention the questions URL, duh, it was late! c) Dates: Sure, you can format this howevever you need, lots of ways to format dates. I don't remember all the date format flags, the one's your using look fine. Check them here: http://php.net/manual/en/function.date.php
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
06/28/11 10:08 AM (14 years ago)
Thanks. Sorry, should have been more clear. I'm getting the internet connection error from the app on my iphone when I click on show scoreboard following a quiz. No problems with similar apps that direct to the buzztouch hosted scoreboard, so it's probably a problem with the php on my server. Any suggestions? I tried to manually trigger the php using this in the address bar of the browser, but only get a blank screen. I'll continue to play with it. http://ncaa.jc-evans.com/appdata/sample-scoreboard.php?command=getQuizScoreboardData&appGuid=[buzztouchAppId]&apiKey=[buzztouchAPIKey]&screenId=[screenId] Also, got my second app approved by iTunes today!!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/28/11 10:53 AM (14 years ago)
2nd app - how cool is that. Awesome. There was a problem downloading some data. Check your internet connection then try again: See if the output console in Xcode gives any clues. It should show the URL it's trying to fetch? About the scoreboard script. In thinkgking, it's probably a good idea to throw together a quick HTML page with a FORM that includes elements for each of the expected values. The FORM on this page could POST to the URL you're using for the scoreboard. Doing this would make it much easier to test. The idea would be that you would visit this quick-n-dirty HTML page in your browser, enter the values (like score, elapsed seconds, etc) then SUBMIT. This would simulate the behavior of the mobile app but allow you to debug the script with some simple echo statements. This HTML test form would include a form element for each item the app uses. All the field names it looks for when building the appVars array. Like this: $appVars['appVersion'] = ''; $appVars['command'] = ''; $appVars['appGuid'] = ''; For each of these elements, like a dozen or so, your form would do: <form action='url to your scoreboard script.php'> <input type='text' id='appVersion' name='appVersion' value=''/> <input type='text' id='command' name='command' value=''/> <input type='text' id='appGuid' name='appGuid' value=''/> ..... ..... .....one for each element in the appVars array in the script, named exactly the same, case sensitive. <input type='submit' value='submit'/> </form> Just a bunch of text boxes allowing you to enter some fake results. When submitted, your scoreboard script should take your values, add them to your database, grab the latest results then output the JSON data expected by the app. This means you'll see the JSON on the screen when you submit. Hope this make sense.
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
06/28/11 10:55 AM (14 years ago)
Great idea. I had done something similar testing a different program. I'll let you know.
 
Miereter
Apple Fan
Profile
Posts: 154
Reg: Feb 21, 2011
USA
1,540
like
07/11/11 05:57 AM (14 years ago)
Hi guys, my scoreboard no longer appears. I am using standard BT options with BT 1.5 app. Any ideas. The quiz runs through, then after the last question just stops. App is called haiku. Thanks
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
07/14/11 08:31 AM (14 years ago)
@ MGoBlue You have an example live i iTunes of new scoreboard? Would love to see it. Cheers.
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
07/14/11 11:08 AM (14 years ago)
I gave up on the scoreboard for the time being. Kept getting the internet connection error no matter how I configured things. @David, If you wouldn't mind having a look, I've put the console report on my server with the relevant info. You'll see it's trying to call the proper url, but it's getting a 400 error. Not sure why. The file is on the site. I tried chmod at various settings as well. No luck. The console text is here: http://georgia.jc-evans.com/trivia/console.txt.zip
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/14/11 10:12 PM (14 years ago)
@Miereter: The latest releases quiz screen was broken and was fixed. It was not showing any options when the quiz finished. It's been updated (see change log) and you should be OK after you get the latest source-code for your project. @MGoBlue: This URL, http://georgia.jc-evans.com/trivia/scores.php?command....... is being called when the quiz ends and shows the scoreboard. The entire URL, after the variables are merged in the appropriate places looks great. It contains the scores, device info, screen info, etc. This means pasting it in a browser should produce the JSON data to power the scoreboard list - it's not. When I past it in a browser, I don't get 404 missing page, I get a blank page. You could email me the .php script you're using and I can have a look. Or...you could do a bit of hijacking an use echo statements in .PHP on a line-by-line basis to see where the script is failing?
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
07/14/11 10:32 PM (14 years ago)
@David: I'll email you the file. I just copy/pasted the sample.
 
Miereter
Apple Fan
Profile
Posts: 154
Reg: Feb 21, 2011
USA
1,540
like
07/15/11 10:32 AM (14 years ago)
@David, thanks much, it works fine with the new source. Regards, @Miereter.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/16/11 10:34 AM (14 years ago)
@MGoBlue: Yikes, this script: http://www.buzztouch.com/docs/v1.5/sample-scoreboard.txt was very VERY broken. Not sure how anyone's been able to use it. I did some testing and could not get it to work at all. Two errors in the code were preventing it from even loading, let alone doing what we wanted. So, I fixed it and tested it and it does work. Re-grab it, make sure to 'refresh' your browser when you download it so you're sure to have the latest copy (text files sometimes don't refresh). Plop in on the server then user the URL you see in the console output, the one you posted the other day. Using your regular browser to make the request will allow you to see the results. I think you'll be fine.
 
rdrye2000
Code is Art
Profile
Posts: 24
Reg: Jan 08, 2012
Atlanta
240
like
04/30/12 05:29 PM (13 years ago)
MGoBlue: did you ever get it to work?
 

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.