QScript Question

From Q
Jump to: navigation, search


A question from one of the data files in your project, corresponding to a question in Q. A question is made up of one or more variables.


Gets the DataFile object that this question is part of.


Gets the DataReduction object for this question.


Deletes this question.


Duplicates this question and its variables. This is the same as using "Copy and Paste Question(s) | Exact" in Q.
nameThe name for the new question.
Returns:The new Question object.


Whether two objects are the same.
objThe object to compare against.
Returns:true or false


Get the question's internal unique identifier.


Returns true if this question is a banner, false otherwise. Banner questions and their variables cannot be modified directly, as they are simply a combination of their input questions.


Gets/sets whether this question can be used as a filter in crosstabs, etc.


Gets/sets whether this question is hidden, and thus cannot be used in crosstabs, etc.


Returns true is this question is valid, false otherwise. A question will be invalid if any of its variables are invalid, or it is a Grid type and Q cannot determine the 2D structure in the variable labels.


Gets/sets whether this question can be used as a weight in crosstabs, etc.


Gets the DataReduction object for this question, but may return old data if the underlying variables are out of date. This makes it safe to call from R GUI JavaScript code. Will return null if we have no data reduction stored for this Question or for banner questions. This may happen if the data reduction is in its default state (in which case the categories can be found using variable.knownValues and variable.valueAttributes). It may also happen if the data reduction is Reverted by the user, or the variables constituting the Question change. The data reduction returned can only be used for read operations.


Get/set the question's name.


A flag that determines whether a Pick Any question has had its Values to Count checked or not. Set to false to remove the CHECK status from a newly created Pick Any Question.


Deprecated for Displayr - see variableSetStructure. Get or set the Question's type. This can be one of 'Text', 'Number', 'Pick One', 'Text - Multi', 'Number - Multi', 'Pick Any', 'Pick One - Multi', 'Pick Any - Compact', 'Pick Any - Grid', 'Number - Grid', 'Experiment', 'Ranking', 'Date' (date/time).


Returns 'Question'.


Returns the unique source values found in this question, as an array. The values in the array are sorted in ascending order, with any missing data (NaN) first. The values are source values (prior to any Value Attributes or Recode Rules being applied).


Gets the ValueAttributes object for a question. Typically you use this to adjust the values to count (for Pick Any questions), category names, or to remap values.


Gets an array of all the Variable objects that constitute this question.


Get the Question's type as used in Displayr, which is a combination of questionType and (for Pick One questions) its variable types. This can be one of 'Text', 'Numeric', 'Nominal', 'Ordinal', 'Text - Multi', 'Numeric - Multi', 'Binary - Multi', 'Nominal - Multi', 'Ordinal - Multi', 'Binary - Multi (Compact)', 'Binary - Grid', 'Numeric - Grid', 'Experiment', 'Ranking', 'Date/Time'.