Application that uses Laravel and React to make a hackerrank like platform.
After cloning project run the following
composer installnpm install- in the project directory run the following:
php artisan serve
-
/questions-POSTCreates new question for a specific quizquiz_id-
Body:
{ "question": "What is the capital of USA?", "description": "USA have a lot of cities, but only one of the is the capital.", "quiz_id": "2", "type": "text", "score": 3.0, "answer": ["Washington"] }
-
-
/quizzes-POSTCreates new quiz- Body:
{ "title": "Frontend developers placement test", "description": "Test for frontend developers", }
- Body:
-
/api/submissions/{id}-GETGet submission details byid- Response:
{ "id": 1, "email": "nader.ikladious@gmail.com", "answers": "{\"1\":\"Second\",\"2\":\"First\",\"result-2\":0,\"result-1\":0}", "score": "0.0", "submitted": "1", "quiz_id": "1", "created_at": "2019-04-06 13:52:49", "updated_at": "2019-04-06 20:00:22", "quiz": { "id": 1, "title": "First case study", "description": "Lorem ipsum", "created_at": null, "updated_at": null, "questions": [...] } }
- Response:
-
/quizzes-GETList all available quizzes- Response:
[ { "id": 1, "title": "First case study", "description": "Lorem ipsum", "created_at": null, "updated_at": null, "questions_count": "4" }, { "id": 2, "title": "Second case study", "description": "Lorem ipsum", "created_at": null, "updated_at": null, "questions_count": "2" } ]
- Response:
-
/quizzes/{id}-GETGet a quiz details byid- Response:
{ "id": 1, "title": "First case study", "description": "Lorem ipsum", "created_at": null, "updated_at": null, "questions": [...] }
- Response:
-
/questions/validate-POSTGet the score for questions answer- Body:
{ "id": 2, "answer": "Paris" } - Response
2.0
- Body:
-
/submissions/{id}-PUTUpdate submission with answer and submitted flag- Body:
{ "submitted": 1, "answers": {...} }