QuestionProperty class
Revision as of 10:43, 25 April 2022 by Administrator (talk | contribs)
QuestionProperty
The question property.
Parent class
Inherits from object
Constructors
- (PropertyType constant type "Property type. Use constant named Question_Property_xxx", QuestionTemplate question "Question template contains this property") - Create new property and add it to question properties
- (PropertyType constant type "Property type. Use constant named Question_Property_xxx", int gridNumber "Index of sub question that this property belong to", QuestionTemplate question "Question template contains this property") - Create new property and add it to question properties
Methods
- (From object) string ToString() - The string representation of the object.
Properties
- int GridNumber { get; set; } - Get/Set Index of sub question that this property belong to
- bool HasText { get; } - [OBSOLETE] Get HasText of the question property
- int Id { get; } - Get id of the question property
- bool IsLocalize { get; } - Check value type of property should be use as LocalizedString
- bool IsSpecialText { get; } - Get IsSpecialText of the question property that marked by system
- string Name { get; set; } - Get or set Name of the this property.
- string ObjectTypeName { get; } - The name of the type of object.
- PropertyType constant PropertyType { get; } - Get constant of the property's type
- string PropertyTypeAsString { get; } - Get PropertyType as string
- int QuestionID { get; } - [OBSOLETE] Get QuestionID of the question property
- Dictionary QuestionPropertyLanguages { get; } - [OBSOLETE] Get QuestionPropertyLanguages of the question property. Only valid when HasText is true
- LocalizedString QuestionPropertyLanguagesLocalized { get; } - [OBSOLETE] Same as QuestionPropertyLanguages, just different container
- int QuestionPropertyType { get; } - [OBSOLETE] Get QuestionPropertyType of the question property
- string QuestionPropertyTypeAsString { get; } - [OBSOLETE] Get QuestionPropertyType as string of the question property
- (From object) TypeInformation TypeInformation { get; } - Get information about this class.
- string TypeValue { get; set; } - Get or set TypeValue of this property
- object Value { get; set; } - Get or set value of the this property. Base on IsLocalize, it can be a String or LocalizedString
Examples
// Example to get Export/Report label on "Q7"
string questionName = "Q7";
number qnaireRId = 15644863;
array questionProperty = getQuestionProperties(questionName, qnaireRId);
for(number i = 0; i < questionProperty.Count; i++)
{
QuestionProperty qp = questionProperty[i];
print(qp.QuestionPropertyType);//97
print(qp.QuestionPropertyLanguages);//{"da-DK": Export Report label in DK, "en-GB": Export Report label in UK}
print(qp.QuestionPropertyLanguagesLocalized.GetTranslationForLoggedInUser());//Export Report label in UK
print(qp.QuestionPropertyLanguagesLocalized.GetSpecificTranslation("da-DK"));//Export Report label in DK
}