java - Android/PHP/MySQL project assistance - keeping server & phone app synced -


i'm working on solo project, using aforementioned technologies. aim create quiz game android. questions created "quiz master" online beforehand , submitted mysql database. retrieved android application. have set link between phone & server using php, data sent on in json format.

i want each question have pre-allocated time user has answer , once has elapsed, android app prevent question being answered. time chosen quiz master , submitted database along rest of quiz information.

as not might retrieve quiz server onto phone @ same time, there problems regards making sure doesn't longer answer question other. far possible, want keep in sync. it'll difficult make sure has exactly same time, i'd settle having people not being able delay retrieving quiz , getting full 30 seconds (or whatever). fair, countdown needs start once quiz has been started quiz master.

i'm struggling think of way overcome problem. have basic client-server system set , can't think of way have server keep track of "time left" , send number phone, indicating amount of time left.

sorry essay, hope out there has idea! appreciated!! :)

all best,

j

perhaps have each users device keep track of how fast answered question , compare response time after answer submitted. example: server sends phone question , tells there 30 second time limit. user views question, timer starts on phone. took them... 14.79 seconds answer correctly. phone send info saying how long each user took compare them see answered question first , answered within time limit. technique may not keep quiz game in sync across connected devices, should keep game fair.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -