fnitu / edu-hospice

Application developed for SIIT Challenge Accepted – CODVIDHACK 2020
https://edu-hospice.herokuapp.com
2 stars 2 forks source link

Admin quiz create question #20

Closed fnitu closed 3 years ago

fnitu commented 4 years ago

In the "New quiz page" we should have a section that allow the creation of multiple questions: Fields:

  1. question - input / name in model
  2. question type: single choice (radio/select), multiple choice(checkbox group) - 3 types, enum: radio/select/checkbox
  3. Define possible options (list of option names + Boolean attribute to mark the correct ones):
[
 {
  name: "question text"
  type: "radio/select/checkboxes"
  options: 
   [ { option: "first option", valid: true},  { option: "second option", valid: false } ]
 }
]

The order of the questions and question options will be given by the order of the array.

A validation (BE/FE) should be done when selecting the question type to have at least one option.

Drag and drop - to be handled in a separate ticket

fnitu commented 3 years ago

To be checked with the server endpoint.

fnitu commented 3 years ago

We need to save first the quiz details. The new question card will not be displayed before.

After saving the quiz details, a new request has to be done to the server using the received quiz id from the previous call. This request will create a question. e.g. (quiz//create-question)

The response will contain the id of the question that will be set in the new quiz question card.

The new question card will contain a save button, that will be used for updating. When saving the question, the question id + the question details will be sent.

When clicking the "Add question", a save action will be performed, followed on success by a new request to the quiz//create-question URL.

fnitu commented 3 years ago

After further analysis, in order to make it more similar with the course content creation, the following will apply:

We need to save first the quiz details (/api/admin/quizzes). We will receive and store the quiz id. The new question card will not be displayed before the quiz save action.

Initially, it will not have any questions. In this case, a new card is shown: "You have no questions assigned." + a button "Add question"

When this is clicked, a default question + default options will be sent as a POST request to /api/admin/quizzes/{quizId}/questions This request should contain as a reply the question id. (already implemented on server)

Each question card will also contain a save button, that will make a PUT request to update the current question. (not yet implemented on server)

razvantudorache commented 3 years ago
fnitu commented 3 years ago

Hi @razvantudorache ,

Please update the "Save" button on the questionnaire details to use the green color, same as for questions.

Please move the "Add question" and "Delete" buttons to the left side of the question card. On the right hand side, only the "Save" button should remain.

razvantudorache commented 3 years ago

Modifications from the last comment have been applied. Waiting for server integration:

razvantudorache commented 3 years ago

Hi,

All new quiz APIs have been integrated.

A new end-point is requested for deleting a question.

fnitu commented 3 years ago

Hi,

Please change the routes to admin/quiz-list/quiz and admin/quiz-list/quiz/:id. The routes should be parent/child with quiz-list.

razvantudorache commented 3 years ago

Hi,

The route has been modified as requested (quiz-list/quiz and quiz-list/quiz/:id) but without the relation parent - child with quiz-list. In order to have that relation a new page must be created that will contain another router-outlet.

From my opinion this relation is not needed because these two pages (quiz-list and quiz) don't have common elements to require a router-outlet (in order to refresh just a part of the page).