Skip to content

Create Concept map

David Alejandro Molano Vásquez edited this page Feb 11, 2020 · 2 revisions

Create Concept Map

To create a concept map a POST request most be send to this endpoint. The body of the request must provide the following fields:

  • Title: The title of the concept map to be created. This will be shown to the user when querying concept maps. The field is mandatory.
  • Is Base: A boolean that indicated if the concept map is a base map. Only users with "Teacher" rol are allowed to create base concept maps. The field is mandatory.
  • Concepts: An array containing the concepts of the concept map. More details on structure are displayed below. The field is optional.
  • Propositions: An array containing the propositions of the concept map. More details on structure are displayed below. The field is optional.
URL /api/cpt-map
Method POST
URL Params None
Data Params
{  "isBase": [boolean],  "title": [string],  "concepts": [array],  "propositons": [array]}
Success Response
Code: 201
{"id":[id_of_created_cm]}
Error Response
Code: 400
{"Error": "Request is missing required fields"}
Error Response
Code: 400
{"Error": "Invalid field"}
Error Response
Code: 401
{"Error": "Student cannot create base concept map"}
Error Response
Code: 500
{"Error": "Something went wrong"}

Concept array entry

Each entry on the concepts array has the following fields:

  • Text: The text of the concept
  • x: The x coordinate of the concept in the concept map. This is for reloading purposes.
  • y: The y coordinate of the concept in the concept map. This is for reloading purposes.
  • id: Identifier of the concept, in order to store its relations with propositions and other concepts.
{
   "text": [string],
   "x": [number],
   "y": [number],
   "id": [string]
}

Proposition array entry

Each entry on the propositions array has the following fields:

  • Text: The text of the proposition.
  • frm: The identifier of the concept from where the proposition starts.
  • to: The identifier of the concept from where the proposition goes.
{
   "text": [string],
   "frm": [string],
   "to": [string]
}