Skip to main content

Question Content Type Data Model

COTQuestionContentType

Description

Surveys are made up of questions and each question is represented by a form component. In a question's data model (COTQuestions), the form component type is indicated by the Question Content Type.

note

The COTQuestionContentType is also used on survey answers within the COTAnswerData model.

graph LR; S[COTSurvey] --> C1[COTSurveyChat #1] S --> C2[COTSurveyChat #2] S --> C3[COTSurveryChat #3] C1 --> Q1T[COTQuestion - Field Label] C1 --> Q1I[COTQuestion - Input Settings] C2 --> Q2T[COTQuestion - Field Label] C2 --> Q2I[COTQuestion - Input Settings] C3 --> Q3[COTQuestion - Label & Input] Q1T --> QC1[COTQuestionContentType] Q1I --> QC2[COTQuestionContentType] Q2T --> QC3[COTQuestionContentType] Q2I --> QC4[COTQuestionContentType] Q3 --> QC5[COTQuestionContentType]

Content Types

info

On each content type card displayed below, a content type code, data type, and description are indicated.

  • Content Type Code: Corresponds to the system code used to indicate the question content type.
  • Answer Data Type: Indicates the input type and format the question field handles. For example, the Text Number content type used for rating components processes number values. Submitted answers are found in the answers.data.process field.
  • Description: Indicates the related survey component and other uses.

Text

Content Type Code: application/vnd.cotalker.survey+text
Description: Used for text components and COTQuestions that represent the field labels displayed in the survey form.
Answer Data Type: Any characters. Example: Hello world!


Text Input

Content Type Code: application/vnd.cotalker.survey+textinput
Description: Indicates a written answer component.
Answer Data Type: Any characters. Example: Hello world!

  • QR or NFC inputs can be used with the text input content type. In those cases, the following fields are used in the COTQuestion model:

QR & NFC Fields

FieldDescriptionTypeRequiredNotes
codeCode depends on the content type. Below is the code for scanning QR & NFC in surveys.string[ ]RequiredObjects within the array must be written in string format.
code[index].scanobjectRequired
code[index].scan.enabledtrue activates the feature.booleanRequired
code[index].scan.sourceIndicates the input source.string[ ]RequiredValid options: qr and/or nfc.
code[index].scan.forcetrue allows only QR Code or NFC input. false permits manual text input, also.booleanRequired
contentTypeIndicates how the system should interpret the data.stringRequiredMust be set to: application/vnd.cotalker.survey+textinput
identifierUnique identification namestringRequiredMaximum 60 characters; only lowercase letters, numbers, and underscore allowed; must be unique.

JSON Sample

Text Input with QR and NFC inputs:

{
"code": [
"{\"scan\":{\"enabled\":true,\"source\":[\"qr\",\"nfc\"],\"force\":true}}"
],
"identifier": "qr_test",
"contentType": "application/vnd.cotalker.survey+textinput",
...
}

Text Number

Content Type Code: application/vnd.cotalker.survey+textnumber
Description: Used on rating components for evaluating with a five-star system.
Answer Data Type: Number. Example: 5


Date Time

Content Type Code: application/vnd.cotalker.survey+datetime
Description: Indicates the date and time component used to choose a date and time from a pop-up calendar and clock.
Answer Data Type: Number in Unix Epoch time format. Example: 1654895560


List Question

Content Type Code: application/vnd.cotalker.survey+listquestion
Description: Indicates the multiple choice component item list type used to choose items from a list made during survey setup.
Answer Data Type: Array of "values" of the selected options, i.e., the value assigned to the item. See the list of items type for further details. Example: ["value1", "value2"]


Property

Content Type Code: application/vnd.cotalker.survey+property
Description: Corresponds to a multiple choice component collection type used to provide the elements of the indicated collection as options.
Answer Data Type: ObjectId<COTProperty> array. Example: ["6185cfe1ef46d0aee4c2b653", "6185cfe8b420610501b280d8"]


Person

Content Type Code: application/vnd.cotalker.survey+person
Description: Indicates the multiple choice component users type to choose among users.
Answer Data Type: ObjectId<COTUsers> array. Example: ["611a7d2f174df70491261623", "611a7d54f13f3d03e631f990"]


API

Content Type Code: application/vnd.cotalker.survey+api
Description: Indicates the multiple choice component API type that permits gathering data through API request.
Answer Data Type: Varies.


GPS

Content Type Code: application/vnd.cotalker.survey+gps
Description: Refers to the location component that returns GPS coordinates displayed on an embedded Google Map.
Answer Data Type: Latitud and longitude array. Example: ["-33.0419355", "-71.4323595"]

When this content type is used, the following fields are used in COTQuestion model:

Fields

FieldDescriptionTypeRequiredNotes
codeContains special component detailsstring[ ]RequiredObjects within the array must be written in string format.
code[x].typeIndicates the map type.stringRequiredAvailable options: currentLocation, freeLocation
displayIndicates the map button label within the survey form.string[ ]Required
contentTypeSets the form component type. For maps, it must be set to application/vnd.cotalker.survey+gps.stringRequired
identifierIndicates the components identification code.stringRequiredCan only contain lowercase letters, underscores, and numbers. Must begin with a letter.

JSON Sample

{
"display": [
"Choose Map Location"
],
"code": [
"{\"type\":\"freeLocation\"}"
],
"contentType": "application/vnd.cotalker.survey+gps",
...
}

Image

Content Type Code: application/vnd.cotalker.survey+image
Description: Refers to the camera component to get photos from a device's camera or gallery.
Answer Data Type: URL of file uploaded to Cotalker server.


Signature

Content Type Code: application/vnd.cotalker.survey+signature
Description: Indicates a signature component to capture a hand or mouse written drawing.
Answer Data Type: Captured signature image code.


File

Content Type Code: application/vnd.cotalker.survey+file
Description: Used to indicate the attachment component when sharing files or notes.
Answer Data Type: URL of uploaded file or note.


Survey

Content Type Code: application/vnd.cotalker.survey+survey
Description: The survey component is used when embedding a survey into the survey.
Answer Data Type: Object which includes answer.uuid, survey._id, and survey.code. The data within the object must be in string format. Example: "{\"uuids\":[\"62a4730d71d581cb11c5197c\"],\"survey\":\"62a473166e323e750390b2de\",\"code\":\"location_list_00\"}"