Skip to content

qunm00/web-quiz-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-quiz-engine

Project Description:

Hyperskill - Web Quiz Engine

Cloud Deployment:

https://web-quiz-engine.azurewebsites.net/

User:

{
  "email": "[email protected]",
  "password": "secret"
}

Quiz:

{  
  "title": "The Java Logo",  
  "text": "What is depicted on the Java logo?",  
  "options": ["Robot","Tea leaf","Cup of coffee","Bug"]  
  "answer" : [2]
}

Routes:

GET /api/quizzes  
GET /api/quizzes/{id}  
GET /api/quizzes/completed  

POST /api/register
POST /api/quizzes  
POST /api/quizzes/{id}/solve  

DELETE /api/quizzes/{id}

Sample requests:

curl -X POST https://web-quiz-engine.azurewebsites.net/api/register \
     -H 'Content-Type: application/json' \
     -d '{
          "email": "[email protected]",
          "password": "12345"
        }'

curl -X POST https://web-quiz-engine.azurewebsites.net/api/quizzes \
     -H 'Content-Type: application/json' \
     -u '[email protected]:12345' \
     -d '{
           "title": "The Java Logo",
           "text": "What is depicted on the Java logo?",
           "options": ["Robot","Tea leaf","Cup of coffee","Bug"],
           "answer": [2]
         }'

curl -X GET https://web-quiz-engine.azurewebsites.net/api/quizzes \
     -u '[email protected]:12345'
     
curl -X GET https://web-quiz-engine.azurewebsites.net/api/quizzes/?page=0&pageSize=5 \
     -u '[email protected]:12345'     

curl -X GET https://web-quiz-engine.azurewebsites.net/api/quizzes/1 \
     -u '[email protected]:12345'

curl -X POST https://web-quiz-engine.azurewebsites.net/api/quizzes/1/solve \
     -H 'Content-Type: application/json' \
     -u '[email protected]:12345' \
     -d '{
           "answer": [2]
         }'

curl -X GET https://web-quiz-engine.azurewebsites.net/api/quizzes/completed \
     -u '[email protected]:12345'
     
curl -X GET https://web-quiz-engine.azurewebsites.net/api/quizzes/completed?page=0&pageSize=2 \
     -u '[email protected]:12345'     

curl -X DELETE https://web-quiz-engine.azurewebsites.net/api/quizzes/1 \
     -u '[email protected]:12345'

Needs Improvement:

  • Quiz's type check exception. Currently using handleHttpMessageNotReadable.
  • Quiz's answer validation. Answer integer isn't in the range of answer's options.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages