Difference between revisions of "QuestionnaireHasData class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=QuestionnaireHasData |Description=Information about wheter or not a question has existing data or not. |Constructors= {{CGscriptConstructors_Tem...")
 
Line 21: Line 21:
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
 
}}
 
}}
 +
 +
=== <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>

Revision as of 11:18, 15 December 2016

QuestionnaireHasData



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

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)
  • string ToString() - The string representation of the object.

Properties

  • string ObjectTypeName { get; } - The name of the type of 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