Comments (4)
APIS:
- String authenticate( String username, String password )
method takes in a username and password and returns a String token to be used for other apis. - Integer getScore( String token, String username )
takes in the current token and username and returns the current score
< score will be set only by server based on answer to question. so no setScore api for client ) > - String getNextQuestion( String token, String username )
Returns a json object that has details like questionID, link to image,list of options, hints invoked - String getQuestionWithHintApplied( String token, String username, Integer questionID, Integer hintID )
Returns a json question object with the appropriate hint applied - boolean answerQuestion( String token, String username, Integer questionKey, Integer answerID )
submits the answer to the question. Returns true or false depending on correct/incorrect answer.
This does not return the score, an additional call will be made to get the score( proposing to keep these distinct , just seems cleaner but we can discuss ).
from ammasandra.
//
Firebase
Places [1000]
Paris
..
..
PUT /Game ==> Create a new game
// firebase: game123:[paris, nyc, ...]
=> return [game_id: 123]
***Think we should use POST here instead of PUT as that seems to be standard - but lets discuss this.**
get game details
GET /Game/:123/
=> static metadata
=> collection<Questions+Img+Options>
=> progress (current_score, current_question)
check answer
POST /Game/:123/questions/:56?
params: user_action: "ANSWER_QUESTION"
selection_option: "B"
return => updated Game_progress Game: [id:123, curr_q:8, curr_score_:120, pass/fail]
get hints: a) remove 2 incorrect b) show +1 pic c) TBD..
POST /Game/:123/questions/:56?
params: user_action: "REVEAL_HINT:SHOW_ANOTHER_PIC"
get user stats
GET /users/:id
-> profile / statistics..
from ammasandra.
- create game
POST /game
sample response: returns the gameid in json format:
{
"gameID": 51
} - get game details
GET /game//
sample response:
{
"nextQuestionId": 0,
"questions": [
{
"imageLink": "http://cdn.history.com/sites/2/2013/12/new-york-city-H.jpeg",
"options": [
"mumbai",
"paris",
"new york city",
"rome"
],
"questionId": 0,
"questionKey": 2
},
{
"imageLink": "http://cache.graphicslib.viator.com/graphicslib/thumbs674x446/2050/SITours/eiffel-tower-paris-moulin-rouge-show-and-seine-river-cruise-in-paris-150305.jpg",
"options": [
"rome",
"paris",
" london",
"new york city"
],
"questionId": 1,
"questionKey": 1
}
],
"score": 0,
"userId": "sau"
} - check answer
POST /Game//questions/?
//server code currently does not take this user_action param ==> needs to be integrated.
params: user_action: "ANSWER_QUESTION"
sample json response:
{
"isAnswerCorrect": true,
"score": 100
}
other responses still need to be implemented ( hints and user details )
from ammasandra.
I merged your changes in server/app.py, and deleted your original py file.
from ammasandra.
Related Issues (9)
- Read up angularjs docs
- set up github repo & initial commit HOT 2
- research how authentication(OAuth) & sessions will be managed HOT 3
- Decide on platform / language for the backend server
- Hello world apk using ionic
- mockups (UI) showing navigation flow
- prototype angular using dummy json 'response' files
- firebase design
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ammasandra.