Skip to content

Edit Concept map

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

Edit Concept Map

This endpoint allows an authenticated user to update a concept map. Accepts PUT requests. If an authenticated user with rol "Student" tries to edit a base concept map the endpoint rejects the operation. The request must provide the following fields:

  • Concept Map id: This parameter is passed by URL.
  • 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.

CAUTION

An empty concepts or propositions array, currently deletes ALL previous information of the concept map.

URL /api/cpt-map/<concept_map_id>
Method PUT
URL Params concept_map_id
Data Params
{"concepts": [array],  "propositons": [array]}
Success Response
Code: 204
None
Error Response
Code: 400
{"Error": "Invalid ConceptMap id"}
Error Response
Code: 401
{"Error": "Student cannot access 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]
}

Clone this wiki locally