Skip to content

molotochok/SurveyChallenge

Repository files navigation

Url

https://surveychallenge20190227065421.azurewebsites.net/

Database structure

code-first migration was used

image

Routes description

Api

  • Surveys
Method Route Description
GET /api/surveys get list of surveys
GET /api/survey/{id} get survey by {id}
POST /api/survey add new survey
PUT /api/survey/{id} update survey by {id}
DELETE /api/survey/{id} delete survey by {id}
  • Questions
Method Route Description
GET /api/questions get list of questions
GET /api/question/{id} get question by {id}
POST /api/question add new question
PUT /api/question/{id} update question by {id}
DELETE /api/question/{id} delete question by {id}
  • SurveyQuestions (uses SurveyQuestions table in db to work with questions specific survey)
Method Route Description
POST /api/survey/{id} Add new question to survey
GET /api/surveyquestions/{surveyId} Get all questions of survey by {surveyId}
DELETE /api/surveyquestions/{surveyId} Removes all questions from survey by {surveyId}
  • QuestionAnswers (uses QuestionAnswers table in db to work with answers with specific question)
Method Route Description
POST /api/question/{id} Add new answer to a question
POST /api/question/multiple/{id} Add list of answers to a question
GET /api/questionanswers/{questionId} Get all ansers of a question

MVC

Route Description
/surveys/index shows list of surveys
/surveys/detail/{id} shows detail about survey with id = {id}
/questions/new/{id} allows user to create new question for survey with id = {id}
/surveys/new allows user to create new survey

What you can do

You can see all surveys image By clicking 'Create new survey' button you can create new survey image image If you don't fill data into all fields you won't create a survey (there is validation) image After creating a survey you can see it in list of surveys image You can check details of the specific survey by choosing it image Details of specific survey image You can create questions for survey by clicking 'Add new question' button image Form for creating new question image As well there is validation image You have to create at least one answer image You can create new answer by entering text into available field and clicking add button image After clicking 'Save' button question will be created image Some more examples image image As you can see there is viewCount which looks like an eye. It's value increments each time someone enters survey detail page image

Unit testing

xUnit is used to create unit tests for api. There is additional DbContext (called: TestApplicationContext) created for testing. It has the same schema as the main context image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published