SubQuestion class
From Catglobe Wiki
More actions
SubQuestion
The sub question template
Parent class
Inherits from Array
Constructors
- (QuestionTemplate question "The question contains this sub question") - Create new sub question and add it into question
- (int id "Sub question id") - Fetch exist sub question template
Methods
- string ToString() - The string representation of the object.
- object this[] { get; }(int index "Index") - Backward-compatible indexer
- Empty this[] { get; }(int index "Index", object value "Value to set") - Backward-compatible indexer
Properties
- number Average { get; } - Average of the objects in the Array object. Can only use if all the elements are of type Number
- int GridNumber { get; } - Sub question gridNumber
- bool HasData { get; } - Check if this sub question contains data or not
- int Id { get; } - Sub question id
- number Max { get; } - Largest of all the objects in the Array object. Can only use if all the elements are of type Number
- number Min { get; } - Smallest of all the objects in the Array object. Can only use if all the elements are of type Number
- string ObjectTypeName { get; } - The name of the type of object.
- number Sum { get; } - Sum of all the objects in the Array object. Can only use if all the elements are of type Number
- LocalizedString Text { get; set; } - Sub question text
- TypeInformation TypeInformation { get; } - Get information about this class.
Examples
// new SubQuestion of a question
Questionnaire qnaire = new Questionnaire (17148177);
QuestionnaireTemplate qt = new QuestionnaireTemplate (qnaire.TemplateId);
QuestionTemplate q = qt.GetQuestion("Q2");
SubQuestion sq = new SubQuestion (q);
sq.Text = new LocalizedString ({"":"new Sub question"}, "");
qt.Save(true);