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

QuestionnaireHasData class: Difference between revisions

From Catglobe Wiki
Nguyenduyan (talk | contribs)
Created page with "{{CGscriptClass_Template |Name=QuestionnaireHasData |Description=Information about wheter or not a question has existing data or not. |Constructors= {{CGscriptConstructors_Tem..."
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{CGscriptClass_Template
{{CGscriptClass_Template
|Name=QuestionnaireHasData
|Name=<nowiki>QuestionnaireHasData</nowiki>
|Description=Information about wheter or not a question has existing data or not.
|Description=<nowiki>Information about wheter or not a question has existing data or not.</nowiki>
|Constructors=
|InheritsFrom=object|Constructors=
{{CGscriptConstructors_Template|Parameters=
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=int|Name=qResourceId|Description=ResourceId of a questionnaire.}}
{{CGscriptParameters_Template|Type=int|Name=<nowiki>qResourceId</nowiki>|Description=<nowiki>ResourceId of a questionnaire.</nowiki>}}
|Description=Constructor to take many questionnaires}}
|Description=<nowiki>Constructor to take many questionnaires</nowiki>}}
|Methods=
|Methods=
{{CGscriptMethods_Template|ReturnType=bool|Name=AnswerOptionHasData|Parameters=
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>AnswerOptionHasData</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=string|Name=label|Description=Question label|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=value|Description=Answer option value}}
{{CGscriptParameters_Template|Type=string|Name=<nowiki>label</nowiki>|Description=<nowiki>Question label</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>value</nowiki>|Description=<nowiki>Answer option value</nowiki>}}
|Description=True if an answeropen has data, and is thus undeleteable (unless all existing data is converted to test data)}}
|Description=<nowiki>True if an answeropen has data, and is thus undeleteable (unless all existing data is converted to test data)</nowiki>}}
{{CGscriptMethods_Template|ReturnType=bool|Name=QuestionHasData|Parameters=
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>QuestionHasData</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=string|Name=label|Description=Question label}}
{{CGscriptParameters_Template|Type=string|Name=<nowiki>label</nowiki>|Description=<nowiki>Question label</nowiki>}}
|Description=True if a question has data, and is thus undeleteable (unless all existing data is converted to test data)}}
|Description=<nowiki>True if a question has data, and is thus undeleteable (unless all existing data is converted to test data)</nowiki>}}
{{CGscriptMethods_Template|ReturnType=bool|Name=SubQuestionHasData|Parameters=
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>SubQuestionHasData</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=string|Name=label|Description=Question label|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=gridnumber|Description=Sub question grid number}}
{{CGscriptParameters_Template|Type=string|Name=<nowiki>label</nowiki>|Description=<nowiki>Question label</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>gridnumber</nowiki>|Description=<nowiki>Sub question grid number</nowiki>}}
|Description=True if a subquestion has data, and is thus undeleteable (unless all existing data is converted to test data)}}
|Description=<nowiki>True if a subquestion has data, and is thus undeleteable (unless all existing data is converted to test data)</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}}
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
|Properties=
|Properties=
{{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
}}
}}
=== <span style="color:#DF8621">'''Examples'''</span> ===
<source lang="javascript">
QuestionnaireHasData q = new QuestionnaireHasData (15548249);
q.QuestionHasData("Q1");//False
q.AnswerOptionHasData ("Q2",1);//True
q.SubQuestionHasData("Q7",0);//True
</source>

Latest revision as of 05:10, 2 July 2020

QuestionnaireHasData



Information about wheter or not a question has existing data or not.

Parent class

Inherits from object

Constructors

  • (int qResourceId "ResourceId of a questionnaire.") - Constructor to take many questionnaires

Methods

  • bool AnswerOptionHasData(string label "Question label", int value "Answer option value") - True if an answeropen has data, and is thus undeleteable (unless all existing data is converted to test data)
  • bool QuestionHasData(string label "Question label") - True if a question has data, and is thus undeleteable (unless all existing data is converted to test data)
  • bool SubQuestionHasData(string label "Question label", int gridnumber "Sub question grid number") - True if a subquestion has data, and is thus undeleteable (unless all existing data is converted to test data)
  • (From object) string ToString() - The string representation of the object.

Properties

  • string ObjectTypeName { get; } - The name of the type of object.
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.


Examples

QuestionnaireHasData q = new QuestionnaireHasData (15548249);
q.QuestionHasData("Q1");//False
q.AnswerOptionHasData ("Q2",1);//True
q.SubQuestionHasData("Q7",0);//True