Originally this was a project of the Full stack nano degree offered by udacity.
Udacity : https://udacity.com/.
I would recommend trying their Nano Degree as it would add a lot to your experience.
I will leave their intro as it is ;)
Udacity is invested in creating bonding experiences for its employees and students. A bunch of team members got the idea to hold trivia on a regular basis and created a webpage to manage the trivia app and play the game, but their API experience is limited and still needs to be built out.
That's where you come in! Help them finish the trivia app so they can start holding trivia and seeing who's the most knowledgeable of the bunch. The application must:
- Display questions - both all questions and by category. Questions should show the question, category and difficulty rating by default and can show/hide the answer. {Done}
- Delete questions. {Done}
- Add questions and require that they include question and answer text. {Done}
- Search for questions based on a text query string. {Done}
- Play the quiz game, randomizing either all questions or within a specific category. {Done}
- Css Changed!
- "Next Question" button's text changes after answering the last question to "Result?" QuizView.js line 151.
- Fixed Regex. QuizView.js line 47.
- Added missing alt attr to img tags.
- Fixed the Logo.
- Added an alert after adding a new question.
- React Compiled successfully! No warnings.
- Added Icons next to categories "Play mode".
Required dependancies & to Start the project:-
Kindly refer to a relative link which contains a completed Flask and SQLAlchemy server.
Kindly refer to a relative link which contains a complete React frontend to consume the data from the Flask server.
Based on: REST principles! each endpoint returns a JSON metadata.
Base Uri: "Your_local_Host:Port/".
GET: Retrieves resources POST: Creates resources DELETE: Deletes resources
GET '/categories' GET '/questions' GET'/categories/category_id/questions' POST '/questions/searchTerm' POST 'questions/new' POST '/quizzes/next' DELETE '/questions/id'
- Fetches a dictionary of categories in which the keys are the ids and the value is the corresponding string of the category
- Request Arguments: None
- Returns: An object with a single key, categories, that contains a object of id: category_string key:value pairs. {'1' : "Science", '2' : "Art", '3' : "Geography", '4' : "History", '5' : "Entertainment", '6' : "Sports"}
- Fetches a dictionary of categories in which the keys are the ids and the value is the corresponding string of the category, A list of dictionaries of Questions in which the keys are the ids, answer and difficulty and category and the value is self explanatory, A list of Integers of the current categories ids, total questions which is an int.
- Request Arguments: None
- Returns: An object just like the example below. { categories: {1: "Science", 2: "Art", 3: "Geography", 4: "History", 5: "Entertainment", 6: "Sports"} current_category: (4) [3, 4, 5, 6] questions: (10) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] success: true total_questions: 22 }
- Fetches a dictionary of questions based on the category id.
- Request Arguments: None
- Returns: An object just like the example below. { questions: (3) [{…}, {…}, {…}] success: true }
Obj.questions[1] = { answer: "Apollo 13", category: 5, difficulty: 4, id: 2, question: "What movie earned Tom Hanks his third.." }
-Takes a string "SearchTerm" and returns a list of dictionaries of questions.
- Request Arguments: String
- Returns: An object just like the example below. { questions: [{…}], success: true }
Obj.questions[1] = { answer: "Apollo 13", category: 5, difficulty: 4, id: 2, question: "What movie earned Tom Hanks his third.." }
- Sends a request to add a new question.
- Request Arguments: a dictionary just like the example below "SAME KEYS". { answer: "Apollo 13", category: 5, difficulty: 4, id: 2, question: "What movie earned Tom Hanks his third.." }
- Returns: None
- Sends a request to get the next question during the play mode.
- Request Arguments: an object just like the example below "SAME KEYS". { 'previous_questions': [22, 29, 27], 'quiz_category': {'type': 'Science', 'id': '1'} }
- Returns: an object that contains a random question just like the example below { question: { answer: "Alexan....", category: 1, difficulty: 3, id: 21, question: "Who discovered..." }, success: true }
- Sends a delete request using a question's id.
- Request Arguments: integer "Valid question id".
- Returns: None.
I enjoyed working on this project and I've learnt a lot too. I left all the TODOS so that anyone can try his luck.
#Thanks Udacity!