Represents Matrix Question object (Single Answer Matrix or Multiple Answer Matrix)
Properties:
Name | Type | Description |
---|---|---|
transposed | Boolean | Indicates whether matrix is transposed or not. |
Extends
- Question
Methods
(inner)get()→ {Array.<Answer>}
- Returns array of respondent's answers.
- See:
- Answer
Returns:
- Type
- Array.<Answer>
Example
// get answers from the question with code "q3" var answersArray = q.q3.get(); var length = answersArray.length; for (i = 0; i <length; i++){ var answer = answersArray[i]; // suppose we have column with "c2" code // check if answer's code contains "c2" var index_of = answer.code.search("c2"); if (index_of!=-1){ //do somthing } }
(inner)getMatrixAlternativesX()→ {Array.<Alternative>}
- Returns an array of X matrix dimension alternatives.
Returns:
- Type
- Array.<Alternative>
(inner)getMatrixAlternativesY()→ {Array.<Alternative>}
- Returns an array of Y matrix dimension alternatives.
Returns:
- Type
- Array.<Alternative>
(inner)hideColumn()
- Hides matrix column
(inner)hideRow()
- Hides matrix row
(inner)set(rowCode, colCode, value)
- Sets answer for matrix question
Parameters:
Name Type Description rowCode
String Row alternative code colCode
String Column alternative code value
Boolean | String (Optional) Value to set (can be true, false or any text for open ended cell, true by default) Example
//set checked c1,r1 cell q.q1.set('r1','c1'); //clear c1,r1 cell q.q1.set('r1','c1',false); //set text to c1,r1 cell q.q1.set('r1','c1','some text');
(inner)showColumn()
- Shows matrix column
(inner)showRow()
- Shows matrix row
(inner)toggleColumn()
- Shows|hides matrix column
Example
// hide "c2" column q.q4.toggleColumn('c2', false);
(inner)toggleRow()
- Shows|hides matrix row
Example
// hide "r2" row q.q4.toggleRow('c2', false);