Toggle menu
913
3.8K
30.2K
279.2K
Catglobe Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

SubQuestion class

From Catglobe Wiki
Revision as of 03:56, 29 May 2026 by [email protected] (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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);