Models

Description of format of Survey and User Models

Survey

Survey is defined by (express) express/models/Survey.jsand (Angular) src/app/Survey.ts

Old Format (Depreciated)

{ _id: string publish: boolean name: string range: Enum(7,9,11) cols: Integer[] statements: string[] users: User[] }

New Format (v3)

{ _id: string publish: boolean name: string range: Enum(7,9,11) cols: Integer[] register: string[] // NEW - For registration page fields questionnaire: string[] // New - For questionnaire page fields statements: string[] users: User[] }

*WIP: Currently in angular, cols[] is referred to as grid[] in the template, this may be changed in future for consistency.

Description

_id A identification string generated by MongoDB

publish A flag that is set to indicate that the Survey is in read-only mode after being published (no editing of data allowed)

name The name of the survey

range The horizontal-x range of the survey's Q-sort table

cols An array holding a statement/cell count for each column of the Q-Sort table display.

Grid display is [ cellcount, ... ]
  i.e. [2, 3, 4, 3, 4, 3, 2] =>
        _ _ _ _ _ _ _
        _ _ _ _ _ _ _
          _ _ _ _ _
            _   _

statements An array of statement strings

users An array of UserData objects

register A string array holding data related to the fields of the registration page, i.e. 'age', 'gender', 'nationality', 'language', etc.

questionnaire A string array holding data related to the fields of the end of survey questionnaire page, i.e. ['q1', 'q2', 'q3'], etc.

Validation

  • name must be under the survey name limit (100)

  • each statement in statements must be under the statement string limit (350).

  • statements must not exceed statement max count limit (80).

  • range and cols must correspond to values that are within horizontal-x range limits. i.e. range=[7,9,11] cols.length=[7,9,11]

**Planned/WIP**

  • users must not exceed a maximum user count to be determined

  • Total statements in database must not exceed a maximum survey count to be determined

User

User is defined by (express) express/models/User.jsand (Angular) *WIP: need to define in angular

Old Format (Depreciated)

{ _id:string age: Integer gender: Enum(Male, Female, Other) main_lang: string other_lang: string progress: Enum(0, 1, 2, 3) question_ans: string[] sort_agree: Integer[] sort_neutral: Integer[] sort_disagree: Integer[] matrix: Integer[][] // [col][cell] }

New Format

{ register_ans: String[]; // [field1ans, field2ans ...] question_ans: String[5] progress: Enum(0, 1, 2, 3) sort_agree: Integer[] sort_neutral: Integer[] sort_disagree: Integer[] matrix: Integer[][] // [col][cell] }

Description

_id A identification string generated by MongoDB

age Reported age of participant

gender Reported gender of participant

main_lang Reported Main Language of participant

other_lang Reported Other Languages of participant

register_ans String Array holding response data for the registration page. I.e. first element = respondent's age, second element = respondent's gender, etc.

question_ans An array of length 5 holding end questionnaire response strings

sort_agree sort_disagree sort_neutral Arrays of index values that correspond to the parent statements object's statements array. Represent the 3 containers in the initial sorting phase (agree, disagree, neutral).

matrix A matrix that represents Q-Sort Table response data, in the form of index values that correspond to the parent statement object's statements array.

Grid display is [ cellcount, ... ]
  i.e. [2, 3, 4, 3, 4, 3, 2] =>
        _ _ _ _ _ _ _
        _ _ _ _ _ _ _
          _ 9 _ _ _
            _   _
Grid data is represented as [col][cell], 
i.e. matrix[3][2] = 9 means that the 2nd cell of the 3rd column holds statement 9.

Last updated