Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test the backend implementation of course content endpoint #122

Open
Adrian-Moldovan opened this issue Apr 28, 2022 · 3 comments
Open

Test the backend implementation of course content endpoint #122

Adrian-Moldovan opened this issue Apr 28, 2022 · 3 comments
Assignees
Labels

Comments

@Adrian-Moldovan
Copy link
Collaborator

The BE issue link: https://github.com/danutchindris/edu-hospice-api/issues/251

The BE specification are as follows:

The course contents will require the specified parameteres:

  • name
  • type
  • visible

All the other parameters will not be mandatory, but if sent, will have to be restricted to one of the following types

  • QUIZ_TEMPLATE_ID
  • URL
  • DESCRIPTION
  • DATETIME
    All these parameters should be send in the payload on the settings JSON property

The types will be defined as an ENUM type in the course_content_settings table for the "name" column. Each parameter will have to be checked for validation.

The request payload should have the JSON format:

{
"name": "Content 10 quiz",
"type": "QUIZ",
"settings": {
"QUIZ_TEMPLATE_ID": "1",
"URL": "test url",
"DATETIME" : "2017-12-03T10:15:30"
},
"visible": true
}

  • The settings properties MUST be sent using uppercase
  • The example does not contain a real data payload (the quiz should not have the DATETIME property)
  • The timestamp is required as ISO format

Also, when providing the course content data, on endpoint: https://edu-hospice-api.herokuapp.com/api/admin/courses/41/sections-details the provided information should be for each element of the adminContentDetails property:

  • id
  • name
  • type
  • visible
  • index
  • resourceSummary
  • courseContentSettings
@Adrian-Moldovan
Copy link
Collaborator Author

Adrian-Moldovan commented Apr 28, 2022

Please wait for a confirmation of deployment from the Back-end team.

@madalin18, please let us know when the features are deployed. Thanks (for everything)!

@madalin18
Copy link
Collaborator

The following endpoints are updated to use the implementation with content settings table:

POST
/api/admin/courses/sections/{sectionId}/contents
Create a content unit for a section (course-controller)

PUT
/api/admin/courses/sections/contents/{contentId}/update
Update an existing content (course-controller)

GET
/api/admin/courses/{courseId}/sections-details
Get all the details related to a course sections, course contents and content resources. (course-controller)

GET
/api/courses/content/{contentId}
Retrieve a course content for a user (user-course-controller)

The Front-end team should check where these endpoints are used and change the implementation to use the new request/response body

Every content which has a valid URL should be updated so that URL will be moved to the settings table
URL field is still present in content table (will be deleted with a future database reset) but is not used anymore.

Please let me know if something is not clear or is not working and I will try to be present in the next meeting.

@fnitu
Copy link
Owner

fnitu commented May 10, 2022

@DanNerghes can you please investigate if code changes are needed on FE?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants