<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.catglobe.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cg+huyphong</id>
	<title>Catglobe Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.catglobe.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cg+huyphong"/>
	<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/Special:Contributions/Cg_huyphong"/>
	<updated>2026-04-20T03:33:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=24355</id>
		<title>CG0129inz - FÆRGEN A/S Kundepanel - Import email info to base questionnaire</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=24355"/>
		<updated>2012-07-03T08:13:38Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General information  ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;VerticalTable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt; &lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Site&amp;lt;br&amp;gt; &lt;br /&gt;
| inzights.catglobe.com&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Catinét project no&amp;lt;br&amp;gt; &lt;br /&gt;
| 0129inz&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Client&amp;lt;br&amp;gt; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== How to send out reminders  ==&lt;br /&gt;
&lt;br /&gt;
=== Goal  ===&lt;br /&gt;
&lt;br /&gt;
This is a standard setup to import the file which contains the email address to the base questionnaire then send the invitation to the imported email.&lt;br /&gt;
&lt;br /&gt;
=== How to do  ===&lt;br /&gt;
&lt;br /&gt;
The general solution is to execute the .exe program to upload the csv file. After it is uploaded, the workflow script will validate and import the uploaded info to the base questionnaire.&lt;br /&gt;
&lt;br /&gt;
==== Step 1&amp;amp;nbsp;: Create the list of email address  ====&lt;br /&gt;
&lt;br /&gt;
We create the &amp;quot;.csv&amp;quot; file containing the email address like&lt;br /&gt;
&lt;br /&gt;
[[Image:File_containing_the_email_address.jpg]] &lt;br /&gt;
&lt;br /&gt;
==== Step 2&amp;amp;nbsp;:Prepare the workflow script for solving the uploaded data ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
array a = Workflow_getParameters();&lt;br /&gt;
string csvData = a[0];&lt;br /&gt;
number importtype = convertToNumber(a[1]);&lt;br /&gt;
number DCSRid = 1497858; // DCS : used for filtering the email. The real value should be : 1497858&lt;br /&gt;
number PQRid = 1289245; // PQRid: used for the imported PQ. The real value should be :  1289245&lt;br /&gt;
number MailtemplateRid = 1497895; // MailtemplateRid: used for the mail template. The real value should be :  1497895&lt;br /&gt;
DCS_use(DCSRid); &lt;br /&gt;
DCS_rebuild();&lt;br /&gt;
&lt;br /&gt;
number InvitationBmRid = 0;&lt;br /&gt;
number  info_wfrid = 1293521; //CG0129inz - FÆRGEN A/S Kundepanel - get info from the record on csv file&lt;br /&gt;
number  Creategroup_wfrid = 1308275; //CG0129inz - FÆRGEN A/S Kundepanel - Create group of recipients&lt;br /&gt;
number validate_info_wfrid = 1497863; //CG0129inz - FÆRGEN A/S Kundepanel - Validate the email csv info&lt;br /&gt;
//number optimize_wfRid = 1497864; //CG0129inz - FÆRGEN A/S Kundepanel - Optimize the email csv record&lt;br /&gt;
number optimize_wfRid = 1605713; //CG0129inz - FÆRGEN A/S Kundepanel - Optimize the email csv record - ver 2&lt;br /&gt;
number createQAS_wfRid= 1497865; //CG0129inz - FÆRGEN A/S Kundepanel - create qas n base qnaire&lt;br /&gt;
number import_wfRid= 1497867; //CG0129inz - FÆRGEN A/S Kundepanel - Import email data&lt;br /&gt;
number Bulkmail_wfRid = 1541304; // CG0129inz - FÆRGEN A/S Kundepanel - Do the mailout for recipients&lt;br /&gt;
&lt;br /&gt;
// Create the new groups containing the respondent&lt;br /&gt;
number groupTemplateResourceId = 773261; // standard group&lt;br /&gt;
number parentResourceId =  1297798; // CG0129inz- Færgen KundeForum - group import&lt;br /&gt;
number EmailgroupRid = Workflow_call(Creategroup_wfrid, {&amp;quot;CG0129inz - Færgen KundeForum - Import email to Base qnaire&amp;quot;, parentResourceId , groupTemplateResourceId }); &lt;br /&gt;
&lt;br /&gt;
array currentdatetime = getCurrentDateTime(Timezone_Romance_Standard_Time);&lt;br /&gt;
number currentvalue = currentdatetime[DateTime_Year]*10000 + currentdatetime[DateTime_Month]*100 + currentdatetime[DateTime_Day];&lt;br /&gt;
&lt;br /&gt;
//start get the upload csv file&lt;br /&gt;
string empt = empty;&lt;br /&gt;
CsvReader csv = new CsvReader(csvData, true, &amp;quot;;&amp;quot;, &amp;quot;&#039;&amp;quot;, &amp;quot;\&amp;quot;&amp;quot;, empt, true, false);&lt;br /&gt;
number fieldCount = csv.FieldCount;&lt;br /&gt;
array addToSurvey;&lt;br /&gt;
array headers = csv.Headers;&lt;br /&gt;
while(csv.ReadNextRecord()) {&lt;br /&gt;
Dictionary csvinfo = Workflow_call(info_wfrid, {fieldCount, headers, csv});&lt;br /&gt;
if (Workflow_call(validate_info_wfrid, {csvinfo,DCSRid})== true)&lt;br /&gt;
 {&lt;br /&gt;
	  addToSurvey.Add(csvinfo);&lt;br /&gt;
 }&lt;br /&gt;
}&lt;br /&gt;
//addJournal(1497860,54,&amp;quot;Comment&amp;quot;,&amp;quot;before optimize_wfRid &amp;quot; + convertToString(addToSurvey));&lt;br /&gt;
if (isEmpty(addToSurvey) == false) &lt;br /&gt;
{&lt;br /&gt;
	//Remove the duplicate email&lt;br /&gt;
	addToSurvey = Workflow_call(optimize_wfRid,{addToSurvey});&lt;br /&gt;
	&lt;br /&gt;
	//create qas and import		&lt;br /&gt;
	addToSurvey  = Workflow_call(createQAS_wfRid,{PQRid,EmailgroupRid,addToSurvey});&lt;br /&gt;
	Workflow_call(import_wfRid,{addToSurvey,PQRid,importtype});&lt;br /&gt;
	//send bulkmail&lt;br /&gt;
	InvitationBmRid  = Workflow_call(Bulkmail_wfRid,{&amp;quot;CG0129inz - Færgen KundeForum - Email Import To Base Qnaire Invitation&amp;quot;,PQRid,MailtemplateRid,EmailgroupRid});	&lt;br /&gt;
&lt;br /&gt;
}		&lt;br /&gt;
addJournal(1497860,54,&amp;quot;Comment&amp;quot;,&amp;quot;Import for &amp;quot; + convertToString(currentvalue) + &amp;quot; is done. The bulkmailRid &amp;quot;+ convertToString(InvitationBmRid) + &amp;quot; was sent out.&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Step 3&amp;amp;nbsp;: Execute the program to upload the file  ====&lt;br /&gt;
&lt;br /&gt;
Open the command line, then Execute &amp;quot;SendFileToCatglobe.exe&amp;quot;. This program will need the params like below :&lt;br /&gt;
&lt;br /&gt;
* username : input the username for logging to the site where we input the workflow&lt;br /&gt;
* password : input the password for logging to the site where we input the workflow&lt;br /&gt;
* workflowrid : input the workflow resource id which we will execute when the file is uploaded&lt;br /&gt;
* url : the site URL where we input the workflow&lt;br /&gt;
* filename : the name of imported file. As usually, I always put the file in the same location with the program.&lt;br /&gt;
* import type : currently, we only support 2 types : &amp;quot;email&amp;quot; (value = 6) and &amp;quot;Aftale kunde&amp;quot; (value = 7)&lt;br /&gt;
Here is example : &lt;br /&gt;
&lt;br /&gt;
[[Image:The_program_executed.jpg]] &lt;br /&gt;
&lt;br /&gt;
 [[category:Production guidelines]]&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=24354</id>
		<title>CG0129inz - FÆRGEN A/S Kundepanel - Import email info to base questionnaire</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=24354"/>
		<updated>2012-07-03T08:12:04Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Step 3&amp;amp;nbsp;: Execute the program to upload the file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General information  ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;VerticalTable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt; &lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Site&amp;lt;br&amp;gt; &lt;br /&gt;
| inzights.catglobe.com&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Catinét project no&amp;lt;br&amp;gt; &lt;br /&gt;
| 0129inz&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Client&amp;lt;br&amp;gt; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== How to send out reminders  ==&lt;br /&gt;
&lt;br /&gt;
=== Goal  ===&lt;br /&gt;
&lt;br /&gt;
This is a standard setup to import the file which contains the email address to the base questionnaire then send the invitation to the imported email.&lt;br /&gt;
&lt;br /&gt;
=== How to do  ===&lt;br /&gt;
&lt;br /&gt;
The general solution is to execute the .exe program to upload the csv file. After it is uploaded, the workflow script will validate and import the uploaded info to the base questionnaire.&lt;br /&gt;
&lt;br /&gt;
==== Step 1&amp;amp;nbsp;: Create the list of email address  ====&lt;br /&gt;
&lt;br /&gt;
We create the &amp;quot;.csv&amp;quot; file containing the email address like&lt;br /&gt;
&lt;br /&gt;
[[Image:File_containing_the_email_address.jpg]] &lt;br /&gt;
&lt;br /&gt;
==== Step 2&amp;amp;nbsp;:Prepare the workflow script for solving the uploaded data ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
array a = Workflow_getParameters();&lt;br /&gt;
string csvData = a[0];&lt;br /&gt;
number importtype = convertToNumber(a[1]);&lt;br /&gt;
number DCSRid = 1497858; // DCS : used for filtering the email. The real value should be : 1497858&lt;br /&gt;
number PQRid = 1289245; // PQRid: used for the imported PQ. The real value should be :  1289245&lt;br /&gt;
number MailtemplateRid = 1497895; // MailtemplateRid: used for the mail template. The real value should be :  1497895&lt;br /&gt;
DCS_use(DCSRid); &lt;br /&gt;
DCS_rebuild();&lt;br /&gt;
&lt;br /&gt;
number InvitationBmRid = 0;&lt;br /&gt;
number  info_wfrid = 1293521; //CG0129inz - FÆRGEN A/S Kundepanel - get info from the record on csv file&lt;br /&gt;
number  Creategroup_wfrid = 1308275; //CG0129inz - FÆRGEN A/S Kundepanel - Create group of recipients&lt;br /&gt;
number validate_info_wfrid = 1497863; //CG0129inz - FÆRGEN A/S Kundepanel - Validate the email csv info&lt;br /&gt;
//number optimize_wfRid = 1497864; //CG0129inz - FÆRGEN A/S Kundepanel - Optimize the email csv record&lt;br /&gt;
number optimize_wfRid = 1605713; //CG0129inz - FÆRGEN A/S Kundepanel - Optimize the email csv record - ver 2&lt;br /&gt;
number createQAS_wfRid= 1497865; //CG0129inz - FÆRGEN A/S Kundepanel - create qas n base qnaire&lt;br /&gt;
number import_wfRid= 1497867; //CG0129inz - FÆRGEN A/S Kundepanel - Import email data&lt;br /&gt;
number Bulkmail_wfRid = 1541304; // CG0129inz - FÆRGEN A/S Kundepanel - Do the mailout for recipients&lt;br /&gt;
&lt;br /&gt;
// Create the new groups containing the respondent&lt;br /&gt;
number groupTemplateResourceId = 773261; // standard group&lt;br /&gt;
number parentResourceId =  1297798; // CG0129inz- Færgen KundeForum - group import&lt;br /&gt;
number EmailgroupRid = Workflow_call(Creategroup_wfrid, {&amp;quot;CG0129inz - Færgen KundeForum - Import email to Base qnaire&amp;quot;, parentResourceId , groupTemplateResourceId }); &lt;br /&gt;
&lt;br /&gt;
array currentdatetime = getCurrentDateTime(Timezone_Romance_Standard_Time);&lt;br /&gt;
number currentvalue = currentdatetime[DateTime_Year]*10000 + currentdatetime[DateTime_Month]*100 + currentdatetime[DateTime_Day];&lt;br /&gt;
&lt;br /&gt;
//start get the upload csv file&lt;br /&gt;
string empt = empty;&lt;br /&gt;
CsvReader csv = new CsvReader(csvData, true, &amp;quot;;&amp;quot;, &amp;quot;&#039;&amp;quot;, &amp;quot;\&amp;quot;&amp;quot;, empt, true, false);&lt;br /&gt;
number fieldCount = csv.FieldCount;&lt;br /&gt;
array addToSurvey;&lt;br /&gt;
array headers = csv.Headers;&lt;br /&gt;
while(csv.ReadNextRecord()) {&lt;br /&gt;
Dictionary csvinfo = Workflow_call(info_wfrid, {fieldCount, headers, csv});&lt;br /&gt;
if (Workflow_call(validate_info_wfrid, {csvinfo,DCSRid})== true)&lt;br /&gt;
 {&lt;br /&gt;
	  addToSurvey.Add(csvinfo);&lt;br /&gt;
 }&lt;br /&gt;
}&lt;br /&gt;
//addJournal(1497860,54,&amp;quot;Comment&amp;quot;,&amp;quot;before optimize_wfRid &amp;quot; + convertToString(addToSurvey));&lt;br /&gt;
if (isEmpty(addToSurvey) == false) &lt;br /&gt;
{&lt;br /&gt;
	//Remove the duplicate email&lt;br /&gt;
	addToSurvey = Workflow_call(optimize_wfRid,{addToSurvey});&lt;br /&gt;
	&lt;br /&gt;
	//create qas and import		&lt;br /&gt;
	addToSurvey  = Workflow_call(createQAS_wfRid,{PQRid,EmailgroupRid,addToSurvey});&lt;br /&gt;
	Workflow_call(import_wfRid,{addToSurvey,PQRid,importtype});&lt;br /&gt;
	//send bulkmail&lt;br /&gt;
	InvitationBmRid  = Workflow_call(Bulkmail_wfRid,{&amp;quot;CG0129inz - Færgen KundeForum - Email Import To Base Qnaire Invitation&amp;quot;,PQRid,MailtemplateRid,EmailgroupRid});	&lt;br /&gt;
&lt;br /&gt;
}		&lt;br /&gt;
addJournal(1497860,54,&amp;quot;Comment&amp;quot;,&amp;quot;Import for &amp;quot; + convertToString(currentvalue) + &amp;quot; is done. The bulkmailRid &amp;quot;+ convertToString(InvitationBmRid) + &amp;quot; was sent out.&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Step 3&amp;amp;nbsp;: Execute the program to upload the file  ====&lt;br /&gt;
&lt;br /&gt;
Open the command line, then Execute &amp;quot;SendFileToCatglobe.exe&amp;quot;. This program will need the params like below :&lt;br /&gt;
&lt;br /&gt;
* username : input the username for logging to the site where we input the workflow&lt;br /&gt;
* password : input the password for logging to the site where we input the workflow&lt;br /&gt;
* workflowrid : input the workflow resource id which we will execute when the file is uploaded&lt;br /&gt;
* url : the site URL where we input the workflow&lt;br /&gt;
* filename : the name of imported file. As usually, I always put the file in the same location with the program.&lt;br /&gt;
* import type : currently, we only support 2 types : &amp;quot;email&amp;quot; (value = 6) and &amp;quot;Aftale kunde&amp;quot; (value = 7)&lt;br /&gt;
Here is example : &lt;br /&gt;
&lt;br /&gt;
[[File:The_program_executed.jpg]]&lt;br /&gt;
&lt;br /&gt;
 [[category:Production guidelines]]&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=File:The_program_executed.jpg&amp;diff=24353</id>
		<title>File:The program executed.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=File:The_program_executed.jpg&amp;diff=24353"/>
		<updated>2012-07-03T08:10:52Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=24352</id>
		<title>CG0129inz - FÆRGEN A/S Kundepanel - Import email info to base questionnaire</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=24352"/>
		<updated>2012-07-03T08:07:46Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Step 3&amp;amp;nbsp;: Execute the program to upload the file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General information  ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;VerticalTable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt; &lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Site&amp;lt;br&amp;gt; &lt;br /&gt;
| inzights.catglobe.com&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Catinét project no&amp;lt;br&amp;gt; &lt;br /&gt;
| 0129inz&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Client&amp;lt;br&amp;gt; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== How to send out reminders  ==&lt;br /&gt;
&lt;br /&gt;
=== Goal  ===&lt;br /&gt;
&lt;br /&gt;
This is a standard setup to import the file which contains the email address to the base questionnaire then send the invitation to the imported email.&lt;br /&gt;
&lt;br /&gt;
=== How to do  ===&lt;br /&gt;
&lt;br /&gt;
The general solution is to execute the .exe program to upload the csv file. After it is uploaded, the workflow script will validate and import the uploaded info to the base questionnaire.&lt;br /&gt;
&lt;br /&gt;
==== Step 1&amp;amp;nbsp;: Create the list of email address  ====&lt;br /&gt;
&lt;br /&gt;
We create the &amp;quot;.csv&amp;quot; file containing the email address like&lt;br /&gt;
&lt;br /&gt;
[[Image:File_containing_the_email_address.jpg]] &lt;br /&gt;
&lt;br /&gt;
==== Step 2&amp;amp;nbsp;:Prepare the workflow script for solving the uploaded data ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
array a = Workflow_getParameters();&lt;br /&gt;
string csvData = a[0];&lt;br /&gt;
number importtype = convertToNumber(a[1]);&lt;br /&gt;
number DCSRid = 1497858; // DCS : used for filtering the email. The real value should be : 1497858&lt;br /&gt;
number PQRid = 1289245; // PQRid: used for the imported PQ. The real value should be :  1289245&lt;br /&gt;
number MailtemplateRid = 1497895; // MailtemplateRid: used for the mail template. The real value should be :  1497895&lt;br /&gt;
DCS_use(DCSRid); &lt;br /&gt;
DCS_rebuild();&lt;br /&gt;
&lt;br /&gt;
number InvitationBmRid = 0;&lt;br /&gt;
number  info_wfrid = 1293521; //CG0129inz - FÆRGEN A/S Kundepanel - get info from the record on csv file&lt;br /&gt;
number  Creategroup_wfrid = 1308275; //CG0129inz - FÆRGEN A/S Kundepanel - Create group of recipients&lt;br /&gt;
number validate_info_wfrid = 1497863; //CG0129inz - FÆRGEN A/S Kundepanel - Validate the email csv info&lt;br /&gt;
//number optimize_wfRid = 1497864; //CG0129inz - FÆRGEN A/S Kundepanel - Optimize the email csv record&lt;br /&gt;
number optimize_wfRid = 1605713; //CG0129inz - FÆRGEN A/S Kundepanel - Optimize the email csv record - ver 2&lt;br /&gt;
number createQAS_wfRid= 1497865; //CG0129inz - FÆRGEN A/S Kundepanel - create qas n base qnaire&lt;br /&gt;
number import_wfRid= 1497867; //CG0129inz - FÆRGEN A/S Kundepanel - Import email data&lt;br /&gt;
number Bulkmail_wfRid = 1541304; // CG0129inz - FÆRGEN A/S Kundepanel - Do the mailout for recipients&lt;br /&gt;
&lt;br /&gt;
// Create the new groups containing the respondent&lt;br /&gt;
number groupTemplateResourceId = 773261; // standard group&lt;br /&gt;
number parentResourceId =  1297798; // CG0129inz- Færgen KundeForum - group import&lt;br /&gt;
number EmailgroupRid = Workflow_call(Creategroup_wfrid, {&amp;quot;CG0129inz - Færgen KundeForum - Import email to Base qnaire&amp;quot;, parentResourceId , groupTemplateResourceId }); &lt;br /&gt;
&lt;br /&gt;
array currentdatetime = getCurrentDateTime(Timezone_Romance_Standard_Time);&lt;br /&gt;
number currentvalue = currentdatetime[DateTime_Year]*10000 + currentdatetime[DateTime_Month]*100 + currentdatetime[DateTime_Day];&lt;br /&gt;
&lt;br /&gt;
//start get the upload csv file&lt;br /&gt;
string empt = empty;&lt;br /&gt;
CsvReader csv = new CsvReader(csvData, true, &amp;quot;;&amp;quot;, &amp;quot;&#039;&amp;quot;, &amp;quot;\&amp;quot;&amp;quot;, empt, true, false);&lt;br /&gt;
number fieldCount = csv.FieldCount;&lt;br /&gt;
array addToSurvey;&lt;br /&gt;
array headers = csv.Headers;&lt;br /&gt;
while(csv.ReadNextRecord()) {&lt;br /&gt;
Dictionary csvinfo = Workflow_call(info_wfrid, {fieldCount, headers, csv});&lt;br /&gt;
if (Workflow_call(validate_info_wfrid, {csvinfo,DCSRid})== true)&lt;br /&gt;
 {&lt;br /&gt;
	  addToSurvey.Add(csvinfo);&lt;br /&gt;
 }&lt;br /&gt;
}&lt;br /&gt;
//addJournal(1497860,54,&amp;quot;Comment&amp;quot;,&amp;quot;before optimize_wfRid &amp;quot; + convertToString(addToSurvey));&lt;br /&gt;
if (isEmpty(addToSurvey) == false) &lt;br /&gt;
{&lt;br /&gt;
	//Remove the duplicate email&lt;br /&gt;
	addToSurvey = Workflow_call(optimize_wfRid,{addToSurvey});&lt;br /&gt;
	&lt;br /&gt;
	//create qas and import		&lt;br /&gt;
	addToSurvey  = Workflow_call(createQAS_wfRid,{PQRid,EmailgroupRid,addToSurvey});&lt;br /&gt;
	Workflow_call(import_wfRid,{addToSurvey,PQRid,importtype});&lt;br /&gt;
	//send bulkmail&lt;br /&gt;
	InvitationBmRid  = Workflow_call(Bulkmail_wfRid,{&amp;quot;CG0129inz - Færgen KundeForum - Email Import To Base Qnaire Invitation&amp;quot;,PQRid,MailtemplateRid,EmailgroupRid});	&lt;br /&gt;
&lt;br /&gt;
}		&lt;br /&gt;
addJournal(1497860,54,&amp;quot;Comment&amp;quot;,&amp;quot;Import for &amp;quot; + convertToString(currentvalue) + &amp;quot; is done. The bulkmailRid &amp;quot;+ convertToString(InvitationBmRid) + &amp;quot; was sent out.&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Step 3&amp;amp;nbsp;: Execute the program to upload the file  ====&lt;br /&gt;
&lt;br /&gt;
Open the command line, then Execute &amp;quot;SendFileToCatglobe.exe&amp;quot;. This program will need the params like below :&lt;br /&gt;
&lt;br /&gt;
* username : input the username for logging to the site where we input the workflow&lt;br /&gt;
* password : input the password for logging to the site where we input the workflow&lt;br /&gt;
* workflowrid : input the workflow resource id which we will execute when the file is uploaded&lt;br /&gt;
* url : the site URL where we input the workflow&lt;br /&gt;
* filename : the name of imported file. As usually, I always put the file in the same location with the program.&lt;br /&gt;
* import type : currently, we only support 2 types : &amp;quot;email&amp;quot; (value = 6) and &amp;quot;Aftale kunde&amp;quot; (value = 7)&lt;br /&gt;
Here is example : SendFileToCatglobe.exe administrator cg 1309940 http://heisenberg5801.catglobe.com 2011111Copy.csv 6&lt;br /&gt;
&lt;br /&gt;
 [[category:Production guidelines]]&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=24351</id>
		<title>CG0129inz - FÆRGEN A/S Kundepanel - Import email info to base questionnaire</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=24351"/>
		<updated>2012-07-03T07:55:51Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Step 2&amp;amp;nbsp;:Prepare the workflow script for solving the uploaded data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General information  ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;VerticalTable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt; &lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Site&amp;lt;br&amp;gt; &lt;br /&gt;
| inzights.catglobe.com&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Catinét project no&amp;lt;br&amp;gt; &lt;br /&gt;
| 0129inz&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Client&amp;lt;br&amp;gt; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== How to send out reminders  ==&lt;br /&gt;
&lt;br /&gt;
=== Goal  ===&lt;br /&gt;
&lt;br /&gt;
This is a standard setup to import the file which contains the email address to the base questionnaire then send the invitation to the imported email.&lt;br /&gt;
&lt;br /&gt;
=== How to do  ===&lt;br /&gt;
&lt;br /&gt;
The general solution is to execute the .exe program to upload the csv file. After it is uploaded, the workflow script will validate and import the uploaded info to the base questionnaire.&lt;br /&gt;
&lt;br /&gt;
==== Step 1&amp;amp;nbsp;: Create the list of email address  ====&lt;br /&gt;
&lt;br /&gt;
We create the &amp;quot;.csv&amp;quot; file containing the email address like&lt;br /&gt;
&lt;br /&gt;
[[Image:File_containing_the_email_address.jpg]] &lt;br /&gt;
&lt;br /&gt;
==== Step 2&amp;amp;nbsp;:Prepare the workflow script for solving the uploaded data ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
array a = Workflow_getParameters();&lt;br /&gt;
string csvData = a[0];&lt;br /&gt;
number importtype = convertToNumber(a[1]);&lt;br /&gt;
number DCSRid = 1497858; // DCS : used for filtering the email. The real value should be : 1497858&lt;br /&gt;
number PQRid = 1289245; // PQRid: used for the imported PQ. The real value should be :  1289245&lt;br /&gt;
number MailtemplateRid = 1497895; // MailtemplateRid: used for the mail template. The real value should be :  1497895&lt;br /&gt;
DCS_use(DCSRid); &lt;br /&gt;
DCS_rebuild();&lt;br /&gt;
&lt;br /&gt;
number InvitationBmRid = 0;&lt;br /&gt;
number  info_wfrid = 1293521; //CG0129inz - FÆRGEN A/S Kundepanel - get info from the record on csv file&lt;br /&gt;
number  Creategroup_wfrid = 1308275; //CG0129inz - FÆRGEN A/S Kundepanel - Create group of recipients&lt;br /&gt;
number validate_info_wfrid = 1497863; //CG0129inz - FÆRGEN A/S Kundepanel - Validate the email csv info&lt;br /&gt;
//number optimize_wfRid = 1497864; //CG0129inz - FÆRGEN A/S Kundepanel - Optimize the email csv record&lt;br /&gt;
number optimize_wfRid = 1605713; //CG0129inz - FÆRGEN A/S Kundepanel - Optimize the email csv record - ver 2&lt;br /&gt;
number createQAS_wfRid= 1497865; //CG0129inz - FÆRGEN A/S Kundepanel - create qas n base qnaire&lt;br /&gt;
number import_wfRid= 1497867; //CG0129inz - FÆRGEN A/S Kundepanel - Import email data&lt;br /&gt;
number Bulkmail_wfRid = 1541304; // CG0129inz - FÆRGEN A/S Kundepanel - Do the mailout for recipients&lt;br /&gt;
&lt;br /&gt;
// Create the new groups containing the respondent&lt;br /&gt;
number groupTemplateResourceId = 773261; // standard group&lt;br /&gt;
number parentResourceId =  1297798; // CG0129inz- Færgen KundeForum - group import&lt;br /&gt;
number EmailgroupRid = Workflow_call(Creategroup_wfrid, {&amp;quot;CG0129inz - Færgen KundeForum - Import email to Base qnaire&amp;quot;, parentResourceId , groupTemplateResourceId }); &lt;br /&gt;
&lt;br /&gt;
array currentdatetime = getCurrentDateTime(Timezone_Romance_Standard_Time);&lt;br /&gt;
number currentvalue = currentdatetime[DateTime_Year]*10000 + currentdatetime[DateTime_Month]*100 + currentdatetime[DateTime_Day];&lt;br /&gt;
&lt;br /&gt;
//start get the upload csv file&lt;br /&gt;
string empt = empty;&lt;br /&gt;
CsvReader csv = new CsvReader(csvData, true, &amp;quot;;&amp;quot;, &amp;quot;&#039;&amp;quot;, &amp;quot;\&amp;quot;&amp;quot;, empt, true, false);&lt;br /&gt;
number fieldCount = csv.FieldCount;&lt;br /&gt;
array addToSurvey;&lt;br /&gt;
array headers = csv.Headers;&lt;br /&gt;
while(csv.ReadNextRecord()) {&lt;br /&gt;
Dictionary csvinfo = Workflow_call(info_wfrid, {fieldCount, headers, csv});&lt;br /&gt;
if (Workflow_call(validate_info_wfrid, {csvinfo,DCSRid})== true)&lt;br /&gt;
 {&lt;br /&gt;
	  addToSurvey.Add(csvinfo);&lt;br /&gt;
 }&lt;br /&gt;
}&lt;br /&gt;
//addJournal(1497860,54,&amp;quot;Comment&amp;quot;,&amp;quot;before optimize_wfRid &amp;quot; + convertToString(addToSurvey));&lt;br /&gt;
if (isEmpty(addToSurvey) == false) &lt;br /&gt;
{&lt;br /&gt;
	//Remove the duplicate email&lt;br /&gt;
	addToSurvey = Workflow_call(optimize_wfRid,{addToSurvey});&lt;br /&gt;
	&lt;br /&gt;
	//create qas and import		&lt;br /&gt;
	addToSurvey  = Workflow_call(createQAS_wfRid,{PQRid,EmailgroupRid,addToSurvey});&lt;br /&gt;
	Workflow_call(import_wfRid,{addToSurvey,PQRid,importtype});&lt;br /&gt;
	//send bulkmail&lt;br /&gt;
	InvitationBmRid  = Workflow_call(Bulkmail_wfRid,{&amp;quot;CG0129inz - Færgen KundeForum - Email Import To Base Qnaire Invitation&amp;quot;,PQRid,MailtemplateRid,EmailgroupRid});	&lt;br /&gt;
&lt;br /&gt;
}		&lt;br /&gt;
addJournal(1497860,54,&amp;quot;Comment&amp;quot;,&amp;quot;Import for &amp;quot; + convertToString(currentvalue) + &amp;quot; is done. The bulkmailRid &amp;quot;+ convertToString(InvitationBmRid) + &amp;quot; was sent out.&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Step 3&amp;amp;nbsp;: Execute the program to upload the file  ====&lt;br /&gt;
&lt;br /&gt;
Open the command line, then Execute &amp;quot;SendFileToCatglobe.exe&amp;quot;. This program will need the params like below :&lt;br /&gt;
&lt;br /&gt;
* username : input the username for logging to the site where we input the workflow&lt;br /&gt;
* password : input the password for logging to the site where we input the workflow&lt;br /&gt;
* workflowrid : input the workflow resource id which we will execute when the file is uploaded&lt;br /&gt;
* url : the site URL where we input the workflow&lt;br /&gt;
* filename : the name of imported file. As usually, I always put the file in the same location with the program.&lt;br /&gt;
&lt;br /&gt;
Here is example : &lt;br /&gt;
&lt;br /&gt;
[[Image:Execute_the_program.jpg]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[category:Production guidelines]]&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Sms_send&amp;diff=24330</id>
		<title>Sms send</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Sms_send&amp;diff=24330"/>
		<updated>2012-04-17T04:05:15Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Sms_send */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{HelpFiles}} &lt;br /&gt;
&lt;br /&gt;
==== Sms_send  ====&lt;br /&gt;
&lt;br /&gt;
This function makes it possible to send SMS messages to users. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Sms_send(&#039;&#039;userResourceIds, smsoutprovidername, message, [fromresourceid]&#039;&#039;) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;userResourceId:&#039;&#039; array of resource ids of the users who are to receive the SMS &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;smsoutprovidername&#039;&#039;: the name of the provider which will be used to send the SMS. Look for the ones available in your lists of SMS providers and copy the exact name from there. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;message&#039;&#039;: the text that you want to send to the users. Should be a string of max 160 characters or it may get truncated. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;fromresourceid&#039;&#039;: (optional) used to determine the source resource, which is again used to determine which keywords to use in the mail template, and also determines which SENT box the message ends up in. Default is current user. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
An array of status codes will be returned as result of the function. There will exist one status for each user to which an SMS was sent. The status codes are: &lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;907&amp;quot; cellpadding=&amp;quot;2&amp;quot; border=&amp;quot;1&amp;quot; class=&amp;quot;tableintopic&amp;quot; style=&amp;quot;border-collapse: collapse; border: 1px solid #010101&amp;quot;&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;48&amp;quot; bgcolor=&amp;quot;#FACEAA&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
Code &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;288&amp;quot; bgcolor=&amp;quot;#FACEAA&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
Constant name &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;571&amp;quot; bgcolor=&amp;quot;#FACEAA&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
Description &lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;48&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
0 &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;288&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
SMS_STATUS_SUCCESSFUL &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;571&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
Sent successfully &lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;48&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
1 &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;288&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
SMS_STATUS_NO_VALID_PHONE_NUMBER &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;571&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
No valid phone number is found to receive the message or user does not have at least 1 phone number &lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;48&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
2 &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;288&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
SMS_STATUS_MESSAGE_TOO_LONG &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;571&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
The message length exceeds 160 characters &lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;48&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
3 &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;288&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
SMS_STATUS_NOT_USER_RESOURCE &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;571&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
The type of given resource is not type of user &lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;48&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
4 &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;288&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
SMS_STATUS_USER_DOES_NOT_EXIST &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;571&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
The given user does not exist &lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;48&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
5 &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;288&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
SMS_STATUS_USER_DELETED &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;571&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
This user has been deleted &lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;48&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
6 &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;288&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
SMS_STATUS_USER_DISABLED &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;571&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
This user has been disabled &lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;48&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
7 &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;288&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
SMS_STATUS_MISSING_RESOURCE_ACCESS &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;571&amp;quot; style=&amp;quot;border: 1px solid #010101&amp;quot; | &lt;br /&gt;
Current user does not have at least observer access to given user &amp;lt;!-- imported from file: 8073.htm--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Examples&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
array users = {1234567,1234568,1234569}; &lt;br /&gt;
&lt;br /&gt;
string smsprovidername = &amp;quot;TeleCo&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string msg = &amp;quot;The project has been completed&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
Sms_send(users,smsprovidername,msg); &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Version 5.8.1 __NOTOC__ &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:Email_and_SMS_Functions]]&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Questionnaire_-_Javascript_Fun_Tips&amp;diff=24040</id>
		<title>Questionnaire - Javascript Fun Tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Questionnaire_-_Javascript_Fun_Tips&amp;diff=24040"/>
		<updated>2012-02-15T04:50:36Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Examples list==&lt;br /&gt;
&lt;br /&gt;
[[Basic_Hints|Basic Hints]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Show more than one questions in the same page]] &lt;br /&gt;
&lt;br /&gt;
[[Showing Answer Option in tab]] &lt;br /&gt;
&lt;br /&gt;
[[Rotate answer options/sub questions]] &lt;br /&gt;
&lt;br /&gt;
[[Randomize answer options/sub questions]] &lt;br /&gt;
&lt;br /&gt;
[[Drag and drop answer option values]] &lt;br /&gt;
&lt;br /&gt;
[[Change Impsys mages]] &lt;br /&gt;
&lt;br /&gt;
[[Add an extra row before a sub question in a grid]] &lt;br /&gt;
&lt;br /&gt;
[[Hide sub question text column in a grid question]] &lt;br /&gt;
&lt;br /&gt;
[[Show a text grid and a single question in the same page|Show a text grid question and a single question in the same page]] &lt;br /&gt;
&lt;br /&gt;
[[Change stylesheet of an answer option column in a single grid question]] &lt;br /&gt;
&lt;br /&gt;
[[Add an extra column before an answer option column in single grid question]] &lt;br /&gt;
&lt;br /&gt;
[[Both horizontal and vertical single grid]] &lt;br /&gt;
&lt;br /&gt;
[[Disable sub questions in text grids]] &lt;br /&gt;
&lt;br /&gt;
[[Number grid]] &lt;br /&gt;
&lt;br /&gt;
[[Close to URL]] &lt;br /&gt;
&lt;br /&gt;
[[Double columns in text grids]] &lt;br /&gt;
&lt;br /&gt;
[[Count down with invisible counter]] &lt;br /&gt;
&lt;br /&gt;
[[Fold in/out texts in question text]] &lt;br /&gt;
&lt;br /&gt;
[[Force email address]] &lt;br /&gt;
&lt;br /&gt;
[[Force number of characters]] &lt;br /&gt;
&lt;br /&gt;
[[Change text box size]] &lt;br /&gt;
&lt;br /&gt;
[[Set focus on question text in the top]] &lt;br /&gt;
&lt;br /&gt;
[[Maximum text length]] &lt;br /&gt;
&lt;br /&gt;
[[Next button count down]] &lt;br /&gt;
&lt;br /&gt;
[[Mark answer option with keyboard]] &lt;br /&gt;
&lt;br /&gt;
[[Show flash movies on questionnaire viewer|Play a list of movies in questionnaire]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--[[Play a commercial and automatically go next when it is over in questionnaire]] : doesnt not work --&amp;gt;&lt;br /&gt;
[[Show a single question as a dropdown list inside another text grid question]] &lt;br /&gt;
&lt;br /&gt;
[[Hide Next button in n seconds]] &lt;br /&gt;
&lt;br /&gt;
[[Show datepicker in text/text grid questions]] &lt;br /&gt;
&lt;br /&gt;
[[Show column header in text grid question]] &lt;br /&gt;
&lt;br /&gt;
[[Prioritize sub questions in a text grid question]] &lt;br /&gt;
&lt;br /&gt;
[[Align min/max texts in scale grid questions]] &lt;br /&gt;
&lt;br /&gt;
[[Add text before answer option of single question]] &lt;br /&gt;
&lt;br /&gt;
[[Show single questions as dropdown lists in their own pages]] &lt;br /&gt;
&lt;br /&gt;
[[Show language selector page]] &lt;br /&gt;
&lt;br /&gt;
[[Reverse single grid between sub questions and answer options]] &lt;br /&gt;
&lt;br /&gt;
[[Insert a TextGrid question into a SingleGrid Question]] &lt;br /&gt;
&lt;br /&gt;
[[Script for making a text grid numerical summing to a specific value]] &lt;br /&gt;
&lt;br /&gt;
[[Convert closed question TextBox into TextArea]] &lt;br /&gt;
&lt;br /&gt;
[[Validate email specified as an open text of a single question]] &lt;br /&gt;
&lt;br /&gt;
[[Show more than one singe grid in the same page|Show more than one single grid in the same page]] &lt;br /&gt;
&lt;br /&gt;
[[Show more than one singe question in the same page|Show more than one single question in the same page]] &lt;br /&gt;
&lt;br /&gt;
[[Require only one check for grid question]] &lt;br /&gt;
&lt;br /&gt;
[[Change non-multi option in Multi question to Radio button]] &lt;br /&gt;
&lt;br /&gt;
[[Make whole cell clickable in single and multi grids]] &lt;br /&gt;
&lt;br /&gt;
[[AutoSum numerical text grid]]&lt;br /&gt;
&lt;br /&gt;
[[Show open textbox in a grid question]] &lt;br /&gt;
&lt;br /&gt;
[[Change progress bar images of questionnaire]] &lt;br /&gt;
&lt;br /&gt;
[[Add CKEditor to an Open question]] &lt;br /&gt;
&lt;br /&gt;
[[Upload images in questionnaire]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous]]&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Change_progress_bar_images_of_questionnaire&amp;diff=24038</id>
		<title>Change progress bar images of questionnaire</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Change_progress_bar_images_of_questionnaire&amp;diff=24038"/>
		<updated>2012-02-14T07:40:14Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Change progress bar images of questionnaire layout  ==&lt;br /&gt;
&lt;br /&gt;
We have 12 images used for progress bar in questionnaire layout. To change them, we will override the function quest.progress.getHTML(). &lt;br /&gt;
&lt;br /&gt;
@Note: The way I used below is only used in Questionnaire layout template because in &amp;quot;Questionnaire layout template&amp;quot; we can insert javascript inside HTML tab. &lt;br /&gt;
&lt;br /&gt;
Step 1: Upload 12 images in any folder, better if you store them in the Images tab of Questionnaire layout editor to handle easly in future. &lt;br /&gt;
&lt;br /&gt;
Step 2: Get their links and replace in the javascript below (in step 3). &lt;br /&gt;
&lt;br /&gt;
Step 3: Paste this code below (include open and close SCRIPT tag) into HTML tab of Questionnaire layout editor. &lt;br /&gt;
&lt;br /&gt;
Questionnaire on cg.catglobe.com site: &#039;&#039;&#039;Javascript demo 04&#039;&#039;&#039; (172339)&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;SCRIPT type=text/javascript&amp;gt;&lt;br /&gt;
if (typeof quest != &amp;quot;undefined&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
	//Replace your image links here&lt;br /&gt;
	quest.progress.images[0] = &amp;quot;/Images/GetImage.aspx?rid=5b9cb0ba-aec2-4dab-9e40-4f2c9b65f439&amp;quot;;&lt;br /&gt;
	quest.progress.images[1] = &amp;quot;/Images/GetImage.aspx?rid=b345753b-0421-4057-80b8-1a352381be39&amp;quot;;&lt;br /&gt;
	quest.progress.images[2] = &amp;quot;/Images/GetImage.aspx?rid=e53d9e52-0626-4e89-8585-6eda036b1404&amp;quot;;&lt;br /&gt;
	quest.progress.images[3] = &amp;quot;/Images/GetImage.aspx?rid=a5c7bc2f-295b-45c4-9b27-f4680fc09d26&amp;quot;;&lt;br /&gt;
	quest.progress.images[4] = &amp;quot;/Images/GetImage.aspx?rid=17e47887-4e55-45dc-b318-c6bd0649bab6&amp;quot;;&lt;br /&gt;
	quest.progress.images[5] = &amp;quot;/Images/GetImage.aspx?rid=17bcf8b5-ffd5-4242-ad35-86692c58024a&amp;quot;;&lt;br /&gt;
	quest.progress.images[6] = &amp;quot;/Images/GetImage.aspx?rid=3d6b6526-8731-4bc1-a40a-9dac1abe4f7f&amp;quot;;&lt;br /&gt;
	quest.progress.images[7] = &amp;quot;/Images/GetImage.aspx?rid=f8c61240-c39b-49b5-ab80-ade5e8a94ad0&amp;quot;;&lt;br /&gt;
	quest.progress.images[8] = &amp;quot;/Images/GetImage.aspx?rid=b52bf511-5bdc-4427-b750-bf4e757572a2&amp;quot;;&lt;br /&gt;
	quest.progress.images[9] = &amp;quot;/Images/GetImage.aspx?rid=575979f6-b780-45a6-adf4-cc1f564c8084&amp;quot;;&lt;br /&gt;
	quest.progress.images[10] = &amp;quot;/Images/GetImage.aspx?rid=2027ea23-b428-4a87-80ee-f180966beb8d&amp;quot;;&lt;br /&gt;
	quest.progress.images[11] = &amp;quot;/Images/GetImage.aspx?rid=5ce8fa51-e815-4007-a77e-c66e11f370e5&amp;quot;;&lt;br /&gt;
	&lt;br /&gt;
	quest.progress.getHTML = function()&lt;br /&gt;
	{&lt;br /&gt;
		 var i, j;&lt;br /&gt;
		 var sres = &amp;quot;&amp;quot;;&lt;br /&gt;
		 if (this.images.length &amp;gt; 0) this.step = 100 / this.images.length;&lt;br /&gt;
		 sres += &amp;quot;&amp;lt;table border=&amp;quot;+this.bordersize+&amp;quot;&amp;gt;&amp;quot;;&lt;br /&gt;
		 sres += &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot;;&lt;br /&gt;
		 sres += &amp;quot;&amp;lt;table border=0 cellspacing=0 cellpadding=0&amp;gt;&amp;quot;;&lt;br /&gt;
		 sres += &amp;quot;&amp;lt;tr&amp;gt;&amp;quot;;&lt;br /&gt;
		 if (this.type == 0) {&lt;br /&gt;
			j = 0;&lt;br /&gt;
			for (i = 0; i &amp;lt; this.pct; i += this.step) {&lt;br /&gt;
			sres += &amp;quot;&amp;lt;td&amp;gt;&amp;lt;img src=\&amp;quot;&amp;quot; + this.images[j++]+ &amp;quot;\&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;quot;;&lt;br /&gt;
			}&lt;br /&gt;
		 }&lt;br /&gt;
		 else {&lt;br /&gt;
			j = Math.floor(this.pct / this.step);&lt;br /&gt;
			if (j &amp;gt;= this.images.length &amp;amp;&amp;amp; j &amp;gt; 0) j = this.images.length - 1;&lt;br /&gt;
			sres += &amp;quot;&amp;lt;td&amp;gt;&amp;lt;img src=\&amp;quot;&amp;quot; + this.images[j]+&amp;quot;\&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;quot;;&lt;br /&gt;
		 }&lt;br /&gt;
		 sres += &amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;;&lt;br /&gt;
		 sres += &amp;quot;&amp;lt;/table&amp;gt;&amp;quot;;&lt;br /&gt;
		 sres += &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;;&lt;br /&gt;
		 sres += &amp;quot;&amp;lt;/table&amp;gt;&amp;quot;;&lt;br /&gt;
		 return sres;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Another solution to change the progress bar ==&lt;br /&gt;
&lt;br /&gt;
Open the js of the question, paste this below code and update the number of the progress you want like below : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
quest.progress.pct = 90;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_singe_question_in_the_same_page&amp;diff=24037</id>
		<title>Show more than one singe question in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_singe_question_in_the_same_page&amp;diff=24037"/>
		<updated>2012-02-14T07:19:58Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Challenge  ==&lt;br /&gt;
&lt;br /&gt;
In order to save time clicking Next&amp;lt;br&amp;gt;As a questionnaire creator&amp;lt;br&amp;gt;I want to show more than one single questions in the same page&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[Image:MultiSingleQuestions.png]] &lt;br /&gt;
&lt;br /&gt;
== Solution  ==&lt;br /&gt;
&lt;br /&gt;
Create a page question to put the questions on &lt;br /&gt;
&lt;br /&gt;
Set single questions to dummy questions &lt;br /&gt;
&lt;br /&gt;
Add javascript to the page question &lt;br /&gt;
&lt;br /&gt;
NOTICE: different languages have different texts, remember to add scripts for each language with corresponding texts &lt;br /&gt;
&lt;br /&gt;
== Code  ==&lt;br /&gt;
&lt;br /&gt;
There are 2 parts of script: &lt;br /&gt;
&lt;br /&gt;
*Common script for creating an HTML table for each single question: this part should be left &#039;&#039;&#039;unchanged&#039;&#039;&#039;, and could be added to either questionnaire&#039;s script property or the page question&#039;s script property. It is recommended to put in questionnaire&#039;s property so that it can be shared among different questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function Single(q)&lt;br /&gt;
{&lt;br /&gt;
	this.text = q.text;&lt;br /&gt;
	this.label = &amp;quot;QUESTION.&amp;quot; + q.label;&lt;br /&gt;
	this.shortLabel = q.label;&lt;br /&gt;
	this.aoValues = q.aoValues;&lt;br /&gt;
	this.aoTexts = q.aoTexts;&lt;br /&gt;
	this.selectedValue = q.selectedValue;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//initialise HTML for all single questions&lt;br /&gt;
Single.prototype.getHTML = function()&lt;br /&gt;
{&lt;br /&gt;
	//add outer table&lt;br /&gt;
	var outerTable = $(&amp;quot;&amp;lt;table&amp;gt;&amp;quot;).addClass(&amp;quot;question_outer&amp;quot;);&lt;br /&gt;
	&lt;br /&gt;
	//question text&lt;br /&gt;
	outerTable.append($(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;).append($(&amp;quot;&amp;lt;td id = &#039;question_text&#039;&amp;gt;&amp;quot;).append($(&amp;quot;&amp;lt;p&amp;gt;&amp;quot;).attr(&amp;quot;align&amp;quot;, &amp;quot;center&amp;quot;).text(this.text))));&lt;br /&gt;
	&lt;br /&gt;
	//option table&lt;br /&gt;
	var optionTable = $(&amp;quot;&amp;lt;table&amp;gt;&amp;quot;).addClass(&amp;quot;option_table&amp;quot;);&lt;br /&gt;
	outerTable.append($(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;).append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).append(optionTable)));&lt;br /&gt;
	&lt;br /&gt;
	var i;&lt;br /&gt;
	var n = this.aoValues.length;&lt;br /&gt;
	&lt;br /&gt;
	var tr;&lt;br /&gt;
	for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
	{&lt;br /&gt;
		tr = this.createRow(i);&lt;br /&gt;
		optionTable.append(tr);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	outerTable.append($(&amp;quot;&amp;lt;input type=&#039;hidden&#039;&amp;gt;&amp;quot;).attr(&amp;quot;name&amp;quot;, this.label).val(this.selectedValue));&lt;br /&gt;
	&lt;br /&gt;
	return outerTable;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//create row for each answer options&lt;br /&gt;
Single.prototype.createRow = function(i)&lt;br /&gt;
{&lt;br /&gt;
	var even;&lt;br /&gt;
	if(i % 2 == 0)&lt;br /&gt;
		even = &amp;quot;even&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		even = &amp;quot;odd&amp;quot;;&lt;br /&gt;
		&lt;br /&gt;
	var name = this.label;&lt;br /&gt;
	var ao = this.aoValues[i];&lt;br /&gt;
	var id = name + &amp;quot;_&amp;quot; + ao;&lt;br /&gt;
	&lt;br /&gt;
	var checked = &amp;quot;&amp;quot;;&lt;br /&gt;
	if(ao == this.selectedValue) checked = &amp;quot;checked&amp;quot;;&lt;br /&gt;
	&lt;br /&gt;
	var tr = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;).addClass(&amp;quot;option_row option_row_&amp;quot; + even);&lt;br /&gt;
	tr.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).addClass(&amp;quot;answer_option_cell&amp;quot;));&lt;br /&gt;
	tr.append($(&amp;quot;&amp;lt;table&amp;gt;&amp;quot;).append($(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;)));&lt;br /&gt;
	&lt;br /&gt;
	var radiob = $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).attr(&amp;quot;align&amp;quot;,&amp;quot;center&amp;quot;)&lt;br /&gt;
		.append($(&amp;quot;&amp;lt;input type=&#039;radio&#039; id=&#039;&amp;quot; + id + &amp;quot;&#039; name=&#039;&amp;quot; + this.shortLabel + &amp;quot;&#039; value=&#039;&amp;quot; + ao + &amp;quot;&#039; onclick=&#039;javascript:optclickcustom(\&amp;quot;&amp;quot; + name + &amp;quot;\&amp;quot;, &amp;quot; + ao + &amp;quot;, &amp;quot; + false + &amp;quot;);&#039;&amp;quot; + checked + &amp;quot;&amp;gt;&amp;quot;));&lt;br /&gt;
	var aotext = $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).attr(&amp;quot;align&amp;quot;,&amp;quot;left&amp;quot;)&lt;br /&gt;
		.append($(&amp;quot;&amp;lt;a class=&#039;option_link&#039; href=&#039;javascript:optclickcustom(\&amp;quot;&amp;quot; + name + &amp;quot;\&amp;quot;, &amp;quot; + ao + &amp;quot;, &amp;quot; + true + &amp;quot;);&#039;&amp;gt;&amp;quot;+this.aoTexts[i]+&amp;quot;&amp;lt;/a&amp;gt;&amp;quot;));&lt;br /&gt;
	tr.append(radiob).append(aotext);&lt;br /&gt;
	&lt;br /&gt;
	return tr;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Single.prototype.validate = function()&lt;br /&gt;
{&lt;br /&gt;
	var a = true;&lt;br /&gt;
	if ($(&amp;quot;input:hidden[name=&#039;&amp;quot; + this.label + &amp;quot;&#039;]&amp;quot;).val() == &amp;quot;&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		var a = false;&lt;br /&gt;
		showError(quest.requiredtext.replace(&amp;quot;.&amp;quot;,&amp;quot;: &amp;quot;) + this.text);&lt;br /&gt;
	}&lt;br /&gt;
	return a;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function showError(e)&lt;br /&gt;
{&lt;br /&gt;
	ErrorMessages.getInstance().showErrorMessage(e);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function optclickcustom(name, value, bool)&lt;br /&gt;
{&lt;br /&gt;
	var id = name + &amp;quot;_&amp;quot; + value;&lt;br /&gt;
	$(&amp;quot;input:hidden[name=&#039;&amp;quot; + name + &amp;quot;&#039;]&amp;quot;).val(value);&lt;br /&gt;
	if (bool)&lt;br /&gt;
	$(&amp;quot;input[id=&#039;&amp;quot; + id + &amp;quot;&#039;]&amp;quot;).attr(&amp;quot;checked&amp;quot;, true);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*The second script part needs to be &amp;lt;b&amp;gt;modified&amp;lt;/b&amp;gt; by the questionnaire creator to fit the real questionnaire. It must be added to the page question&#039;s javascript.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var qH1;&lt;br /&gt;
var qH2;&lt;br /&gt;
var qH3;&lt;br /&gt;
&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
   //------CONFIGURATION PART---------------&lt;br /&gt;
        var q1 = {&lt;br /&gt;
        &#039;label&#039;: &#039;Q1&#039;,//question&#039;s label&lt;br /&gt;
        &#039;text&#039;:&#039;Q1&#039;,//question&#039;s text&lt;br /&gt;
        &#039;aoTexts&#039;: [&#039;AO1&#039;, &#039;AO2&#039;],//answer options&#039; texts&lt;br /&gt;
        &#039;aoValues&#039;: [1,2],//answer options&#039; values&lt;br /&gt;
        &#039;selectedValue&#039;:&amp;quot;{{Q1.value}}&amp;quot;//previously selected value, please remember to use EXACT texts, do not use loops to generate values&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	var q2 = {&lt;br /&gt;
        &#039;label&#039;: &#039;Q2&#039;,&lt;br /&gt;
        &#039;text&#039;:&#039;Q2&#039;,&lt;br /&gt;
        &#039;aoTexts&#039;: [&#039;AO1&#039;, &#039;AO2&#039;, &#039;AO3&#039;],&lt;br /&gt;
        &#039;aoValues&#039;: [1,2,3],&lt;br /&gt;
        &#039;selectedValue&#039;:&amp;quot;{{Q2.value}}&amp;quot;&lt;br /&gt;
	}; &lt;br /&gt;
	&lt;br /&gt;
	var q3 = {&lt;br /&gt;
        &#039;label&#039;: &#039;Q3&#039;,&lt;br /&gt;
        &#039;text&#039;:&#039;Q3&#039;,&lt;br /&gt;
        &#039;aoTexts&#039;: [&#039;AO1&#039;, &#039;AO2&#039;, &#039;AO3&#039;, &#039;AO4&#039;],&lt;br /&gt;
        &#039;aoValues&#039;: [1,2,3,4],&lt;br /&gt;
        &#039;selectedValue&#039;:&amp;quot;{{Q3.value}}&amp;quot;&lt;br /&gt;
	}; &lt;br /&gt;
&lt;br /&gt;
	//create object to get HTML&lt;br /&gt;
	qH1 = new Single(q1);&lt;br /&gt;
	qH2 = new Single(q2);&lt;br /&gt;
	qH3 = new Single(q3);&lt;br /&gt;
&lt;br /&gt;
	var table = $(&amp;quot;&amp;lt;table cellspacing=&#039;10&#039;&amp;gt;&amp;quot;).attr(&amp;quot;align&amp;quot;,&amp;quot;center&amp;quot;);&lt;br /&gt;
   &lt;br /&gt;
	var tr = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
	tr.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).append(qH1.getHTML()));&lt;br /&gt;
	table.append(tr);&lt;br /&gt;
	&lt;br /&gt;
	var tr = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
	tr.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).append(qH2.getHTML()));&lt;br /&gt;
	table.append(tr);&lt;br /&gt;
	&lt;br /&gt;
	var tr = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
	tr.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).append(qH3.getHTML()));&lt;br /&gt;
	table.append(tr);&lt;br /&gt;
&lt;br /&gt;
	$(&amp;quot;#page_question_text&amp;quot;).append(table);   &lt;br /&gt;
	$(&amp;quot;.question_outer&amp;quot;).width(&amp;quot;100%&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//Check if all questions have values&lt;br /&gt;
questioncheck = function()&lt;br /&gt;
{&lt;br /&gt;
	ErrorMessages.getInstance().clearErrorMessages();&lt;br /&gt;
	return qH1.validate() &amp;amp;&amp;amp; qH2.validate() &amp;amp;&amp;amp; qH3.validate();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code sample ==&lt;br /&gt;
&lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;ShowMoreSingleQuestion&amp;quot;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_singe_grid_in_the_same_page&amp;diff=24036</id>
		<title>Show more than one singe grid in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_singe_grid_in_the_same_page&amp;diff=24036"/>
		<updated>2012-02-14T04:52:03Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Challenge  ==&lt;br /&gt;
&lt;br /&gt;
In order to save time clicking Next&amp;lt;br&amp;gt;As a questionnaire creator&amp;lt;br&amp;gt;I want to show more than one single grid questions in the same page&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Show 3 single grids in the same page.png]] &lt;br /&gt;
&lt;br /&gt;
== Solution  ==&lt;br /&gt;
&lt;br /&gt;
Create a page question to put the grid questions on &lt;br /&gt;
&lt;br /&gt;
Set grid questions to dummy questions &lt;br /&gt;
&lt;br /&gt;
Add javascript to the page question &lt;br /&gt;
&lt;br /&gt;
NOTICE: different languages have different texts, remember to add scripts for each language with corresponding texts&lt;br /&gt;
&lt;br /&gt;
== Code  ==&lt;br /&gt;
There are 2 parts of script:&lt;br /&gt;
*Common script for creating an HTML table for each single grid question: this part should be left &amp;lt;b&amp;gt;unchanged&amp;lt;/b&amp;gt;, and could be added to either questionnaire&#039;s script property or the page question&#039;s script property. It is recommended to put in questionnaire&#039;s property so that it can be shared among different questions.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function SingleGrid(q)&lt;br /&gt;
{&lt;br /&gt;
   this.text = q.text;&lt;br /&gt;
   this.label = &amp;quot;QUESTION.&amp;quot; + q.label;&lt;br /&gt;
   this.shortLabel = q.label;&lt;br /&gt;
   this.subQuestions = q.subQuestions;&lt;br /&gt;
   this.aoValues = q.aoValues;&lt;br /&gt;
   this.aoTexts = q.aoTexts;&lt;br /&gt;
   this.selectedValues = q.selectedValues;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
SingleGrid.prototype.getHTML = function()&lt;br /&gt;
{   &lt;br /&gt;
   var outerTable = $(&amp;quot;&amp;lt;table&amp;gt;&amp;quot;).addClass(&amp;quot;grid_outer&amp;quot;);&lt;br /&gt;
   &lt;br /&gt;
   //question text&lt;br /&gt;
   outerTable.append($(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;)&lt;br /&gt;
      .append($(&amp;quot;&amp;lt;td id=&#039;grid_question_text&#039;&amp;gt;&amp;quot;).append($(&amp;quot;&amp;lt;p&amp;gt;&amp;quot;).text(this.text)))&lt;br /&gt;
   );&lt;br /&gt;
   &lt;br /&gt;
   //inner table&lt;br /&gt;
   var innerTable = $(&amp;quot;&amp;lt;table&amp;gt;&amp;quot;).addClass(&amp;quot;grid_inner&amp;quot;);   &lt;br /&gt;
   outerTable.append($(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;).append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).append(innerTable)));&lt;br /&gt;
   &lt;br /&gt;
   //answer option header&lt;br /&gt;
   var aoheader = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   aoheader.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).addClass(&amp;quot;grid_empty_cell&amp;quot;));&lt;br /&gt;
   &lt;br /&gt;
   var i;&lt;br /&gt;
   var n = this.aoTexts.length;&lt;br /&gt;
   for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
   {&lt;br /&gt;
      aoheader.append($(&amp;quot;&amp;lt;td id=&#039;grid_answeroption_text_&amp;quot;+ (i+1) +&amp;quot;&#039;&amp;gt;&amp;quot;).addClass(&amp;quot;grid_answeroption_text&amp;quot;).text(this.aoTexts[i]));&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   innerTable.append(aoheader);&lt;br /&gt;
   &lt;br /&gt;
   //sub questions&lt;br /&gt;
   n = this.subQuestions.length;&lt;br /&gt;
   &lt;br /&gt;
   var tr;   &lt;br /&gt;
   &lt;br /&gt;
   for(i=0; i&amp;lt;n; i++)&lt;br /&gt;
   {     &lt;br /&gt;
      tr = this.createRow(i);&lt;br /&gt;
      innerTable.append(tr);&lt;br /&gt;
      outerTable.append($(&amp;quot;&amp;lt;input type=&#039;hidden&#039;&amp;gt;&amp;quot;).attr(&amp;quot;name&amp;quot;, this.label + &amp;quot;.&amp;quot; + i).val(this.selectedValues[i]));&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   return outerTable;   &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
SingleGrid.prototype.createRow = function(i)&lt;br /&gt;
{&lt;br /&gt;
   var even;&lt;br /&gt;
   if (i %2 == 0)&lt;br /&gt;
      even = &amp;quot;even&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      even = &amp;quot;odd&amp;quot;;&lt;br /&gt;
      &lt;br /&gt;
   var tr = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   tr.append($(&amp;quot;&amp;lt;td id=&#039;grid_subquestion_text_&amp;quot;+(i+1) + &amp;quot;&#039;&amp;gt;&amp;quot;).addClass(&amp;quot;grid_subquestion_text grid_subquestion_&amp;quot;+even).text(this.subQuestions[i]));&lt;br /&gt;
   &lt;br /&gt;
   for(j=0; j&amp;lt;this.aoValues.length;j++)&lt;br /&gt;
   {      &lt;br /&gt;
      tr.append(this.createCell(i,j));      &lt;br /&gt;
   }&lt;br /&gt;
   return tr;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
SingleGrid.prototype.createCell = function(sIndex, aoIndex)&lt;br /&gt;
{&lt;br /&gt;
   var even;&lt;br /&gt;
   if (sIndex %2==0)&lt;br /&gt;
      even = &amp;quot;even&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      even = &amp;quot;odd&amp;quot;;&lt;br /&gt;
   &lt;br /&gt;
   var ao = this.aoValues[aoIndex];&lt;br /&gt;
   var name = this.label + &amp;quot;.&amp;quot; + sIndex;&lt;br /&gt;
   &lt;br /&gt;
   var checked = &amp;quot;&amp;quot;;&lt;br /&gt;
   if (ao == this.selectedValues[sIndex])&lt;br /&gt;
      checked = &amp;quot;checked&amp;quot;;&lt;br /&gt;
   &lt;br /&gt;
   var result = $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;)&lt;br /&gt;
      .addClass(&amp;quot;grid_subquestion_&amp;quot; + even)&lt;br /&gt;
      .attr(&amp;quot;align&amp;quot;, &amp;quot;center&amp;quot;).attr(&amp;quot;valign&amp;quot;, &amp;quot;center&amp;quot;)            &lt;br /&gt;
      .append(&lt;br /&gt;
         $(&amp;quot;&amp;lt;input type=&#039;radio&#039; name=&#039;&amp;quot;+this.shortLabel + &amp;quot;.&amp;quot; + sIndex + &amp;quot;&#039; value=&#039;&amp;quot;+ ao +&amp;quot;&#039; onclick=&#039;javascript:optClick(\&amp;quot;&amp;quot;+name +&amp;quot;\&amp;quot;, &amp;quot;+ ao +&amp;quot;);&#039;&amp;quot;+checked +&amp;quot;&amp;gt;&amp;quot;) &lt;br /&gt;
      );&lt;br /&gt;
   &lt;br /&gt;
   return result;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
SingleGrid.prototype.validate = function()&lt;br /&gt;
{&lt;br /&gt;
   var i,n;&lt;br /&gt;
   n = this.subQuestions.length;&lt;br /&gt;
   var b = true;&lt;br /&gt;
   for(i=0; i&amp;lt;n; i++)&lt;br /&gt;
   {&lt;br /&gt;
      if ($(&amp;quot;input[name=&#039;&amp;quot;+this.label+&amp;quot;.&amp;quot; + i + &amp;quot;&#039;]&amp;quot;).val() == &amp;quot;&amp;quot;)&lt;br /&gt;
      {&lt;br /&gt;
         b = false;&lt;br /&gt;
         showError(quest.requiredtext.replace(&amp;quot;.&amp;quot;, &amp;quot;: &amp;quot;) + this.subQuestions[i]);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   return b;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function showError(e)&lt;br /&gt;
{&lt;br /&gt;
   ErrorMessages.getInstance().showErrorMessage(e);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function optClick(name, value)&lt;br /&gt;
{&lt;br /&gt;
   $(&amp;quot;input:hidden[name=&#039;&amp;quot;+name +&amp;quot;&#039;]&amp;quot;).val(value);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*The second script part needs to be &amp;lt;b&amp;gt;modified&amp;lt;/b&amp;gt; by the questionnaire creator to fit the real questionnaire. It must be added to the page question&#039;s javascript.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var qH1;&lt;br /&gt;
var qH2;&lt;br /&gt;
var qH3;&lt;br /&gt;
&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
   //------CONFIGURATION PART---------------&lt;br /&gt;
   // Instead of delcaring the param like below, we can use JSON&lt;br /&gt;
   var q1 = {&lt;br /&gt;
      &#039;label&#039;: &#039;Q1&#039;,//question&#039;s label&lt;br /&gt;
      &#039;text&#039;:&#039;Q1&#039;,//question&#039;s text&lt;br /&gt;
      &#039;subQuestions&#039;: [&#039;Q1 - 1&#039;, &#039;Q1 - 2&#039;],//sub questions&#039; texts&lt;br /&gt;
      &#039;aoTexts&#039;: [&#039;AO1&#039;, &#039;AO2&#039;],//answer options&#039; texts&lt;br /&gt;
      &#039;aoValues&#039;: [1,2],//answer options&#039; values&lt;br /&gt;
      &#039;selectedValues&#039;:[&amp;quot;{{Q1[0].Value}}&amp;quot;, &amp;quot;{{Q1[1].Value}}&amp;quot;]//previously selected value, please remember to use EXACT texts, do not use loops to generate values&lt;br /&gt;
   };      &lt;br /&gt;
   &lt;br /&gt;
   var q2 = {&lt;br /&gt;
      &#039;label&#039;: &#039;Q2&#039;,&lt;br /&gt;
      &#039;text&#039;:&#039;Q2&#039;,&lt;br /&gt;
      &#039;subQuestions&#039;: [&#039;Q2 - 1&#039;, &#039;Q2 - 2&#039;, &#039;Q2 - 3&#039;],&lt;br /&gt;
      &#039;aoTexts&#039;: [&#039;AO1&#039;, &#039;AO2&#039;],&lt;br /&gt;
      &#039;aoValues&#039;: [1,2],&lt;br /&gt;
      &#039;selectedValues&#039;:[&amp;quot;{{Q2[0].Value}}&amp;quot;, &amp;quot;{{Q2[1].Value}}&amp;quot;, &amp;quot;{{Q2[2].Value}}&amp;quot;]&lt;br /&gt;
   };      &lt;br /&gt;
   &lt;br /&gt;
   var q3 = {&lt;br /&gt;
      &#039;label&#039;: &#039;Q3&#039;,&lt;br /&gt;
      &#039;text&#039;:&#039;Q3&#039;,&lt;br /&gt;
      &#039;subQuestions&#039;: [&#039;Q3 - 1&#039;, &#039;Q3 - 2&#039;],&lt;br /&gt;
      &#039;aoTexts&#039;: [&#039;AO1&#039;, &#039;AO2&#039;, &#039;AO3&#039;],&lt;br /&gt;
      &#039;aoValues&#039;: [1,2,3],&lt;br /&gt;
      &#039;selectedValues&#039;:[&amp;quot;{{Q3[0].Value}}&amp;quot;, &amp;quot;{{Q3[1].Value}}&amp;quot;]&lt;br /&gt;
   };  &lt;br /&gt;
   //---------------------------------------------&lt;br /&gt;
&lt;br /&gt;
   //create wrapper object for grid questions so that we can get HTML out&lt;br /&gt;
   qH1 = new SingleGrid(q1);&lt;br /&gt;
   qH2 = new SingleGrid(q2);   &lt;br /&gt;
   qH3 = new SingleGrid(q3);&lt;br /&gt;
   &lt;br /&gt;
   var table = $(&amp;quot;&amp;lt;table cellspacing=&#039;10&#039;&amp;gt;&amp;quot;);&lt;br /&gt;
   &lt;br /&gt;
   var tr = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   tr.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).append(qH1.getHTML()));&lt;br /&gt;
   table.append(tr);&lt;br /&gt;
   &lt;br /&gt;
   tr = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   tr.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).append(qH2.getHTML()));&lt;br /&gt;
   table.append(tr);&lt;br /&gt;
   &lt;br /&gt;
   tr = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   tr.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).append(qH3.getHTML()));&lt;br /&gt;
   table.append(tr);&lt;br /&gt;
   &lt;br /&gt;
   $(&amp;quot;#page_question_text&amp;quot;).append(table);   &lt;br /&gt;
   $(&amp;quot;.grid_outer&amp;quot;).width(&amp;quot;100%&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//Check if all questions have values&lt;br /&gt;
questioncheck = function()&lt;br /&gt;
{&lt;br /&gt;
   ErrorMessages.getInstance().clearErrorMessages();&lt;br /&gt;
   return qH1.validate() &amp;amp;&amp;amp; qH2.validate() &amp;amp;&amp;amp; qH3.validate();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code sample ==&lt;br /&gt;
&lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;ShowSingleGridInPage&amp;quot;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_language_selector_page&amp;diff=24035</id>
		<title>Show language selector page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_language_selector_page&amp;diff=24035"/>
		<updated>2012-02-14T03:52:34Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In order to let the respondents choose a language to view the questionnaire&amp;lt;br/&amp;gt;&lt;br /&gt;
As a questionnaire creator&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a language selection page as below&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[Image:Language_selector.png]]&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
*Add a page question to show the flags, hide Next and Back button&lt;br /&gt;
*In order to use store the selected language for future reference, we need to create a single question D_CurrentLanguage with languages as options&lt;br /&gt;
*In order to change the language, we need to make a post request to server with parameters:&lt;br /&gt;
**dir = changelanguage&lt;br /&gt;
**languageselector = the selected language&#039;s ISO code&lt;br /&gt;
*In order to go Next after setting the language, we need to submit the form again with &amp;quot;next&amp;quot; as parameter &amp;quot;dir&amp;quot;&#039;s value&lt;br /&gt;
===HTML Code===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;table&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;img style=&amp;quot;border: 0&amp;quot; height=&amp;quot;50&amp;quot; width=&amp;quot;50&amp;quot; src=&amp;quot;../../Images/GetImage.aspx?rid=9e152350-ae1e-47c7-bf0d-0a6f07df3679&amp;quot; onclick=&amp;quot;Question.onLanguageSelect(1);&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            Welcome, please choose your language (United Kingdom)&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;img style=&amp;quot;border: 0&amp;quot; height=&amp;quot;50&amp;quot; width=&amp;quot;50&amp;quot; src=&amp;quot;../../Images/GetImage.aspx?rid=06ac1811-1aa5-4b19-9186-b46153d91106&amp;quot; onclick=&amp;quot;Question.onLanguageSelect(2);&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            Welcome, please choose your language (United States)&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;img style=&amp;quot;border: 0&amp;quot; height=&amp;quot;50&amp;quot; width=&amp;quot;50&amp;quot; src=&amp;quot;../../Images/GetImage.aspx?rid=a3dd8263-817b-4f11-bd87-defb13b7cf68&amp;quot; onclick=&amp;quot;Question.onLanguageSelect(3);&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            Bienvenue - Choisissez votre pays (France)&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;img style=&amp;quot;border: 0&amp;quot; height=&amp;quot;50&amp;quot; width=&amp;quot;50&amp;quot; src=&amp;quot;../../Images/GetImage.aspx?rid=e9e6fa0f-af1b-401b-89a1-5d5a9535e13c&amp;quot; onclick=&amp;quot;Question.onLanguageSelect(4);&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            Welcome, please choose your language (Deutschland)&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;img style=&amp;quot;border: 0&amp;quot; height=&amp;quot;50&amp;quot; width=&amp;quot;50&amp;quot; src=&amp;quot;../../Images/GetImage.aspx?rid=4057e800-0de6-43a1-b737-dbe0642cd414&amp;quot; onclick=&amp;quot;Question.onLanguageSelect(5);&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            Welcome, please choose your language (Nederland)&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;/table&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
===Javascript===&lt;br /&gt;
&amp;lt;source lang=javascript&amp;gt;&lt;br /&gt;
quest.myOnInit = function()&lt;br /&gt;
{&lt;br /&gt;
   $(&#039;img&#039;).css(&amp;quot;cursor&amp;quot;,&amp;quot;pointer&amp;quot;);&lt;br /&gt;
   $(&#039;&amp;lt;input type=&amp;quot;hidden&amp;quot;&amp;gt;&#039;)&lt;br /&gt;
   .attr(&#039;id&#039;, &#039;languageSelector&#039;)&lt;br /&gt;
   .attr(&#039;name&#039;, &#039;languageselector&#039;)&lt;br /&gt;
   .appendTo($(&#039;#page_question_text&#039;));   &lt;br /&gt;
   $(&#039;#page_question_text&#039;).append($(&amp;quot;&amp;lt;input type=&#039;hidden&#039;&amp;gt;&amp;quot;).attr(&#039;name&#039;,&#039;QUESTION.D_CurrentLanguage&#039;));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Question =&lt;br /&gt;
{&lt;br /&gt;
   &lt;br /&gt;
   onLanguageSelect: function(option)&lt;br /&gt;
   {&lt;br /&gt;
      $(&amp;quot;input[name=&#039;QUESTION.D_CurrentLanguage&#039;]&amp;quot;).val(option);&lt;br /&gt;
      var isoCode;&lt;br /&gt;
      switch(option)&lt;br /&gt;
      {&lt;br /&gt;
         case 1:&lt;br /&gt;
            isoCode = &amp;quot;en-UK&amp;quot;;&lt;br /&gt;
            break;&lt;br /&gt;
         case 2:&lt;br /&gt;
            isoCode = &amp;quot;en-US&amp;quot;;&lt;br /&gt;
            break;&lt;br /&gt;
         case 3:&lt;br /&gt;
            isoCode = &amp;quot;fr-FR&amp;quot;;&lt;br /&gt;
            break;&lt;br /&gt;
         case 4:&lt;br /&gt;
            isoCode = &amp;quot;de-DE&amp;quot;;&lt;br /&gt;
            break;&lt;br /&gt;
         case 5:&lt;br /&gt;
            isoCode = &amp;quot;nl-NL&amp;quot;;&lt;br /&gt;
            break;&lt;br /&gt;
         default:&lt;br /&gt;
            break;&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
      $(&#039;#languageSelector&#039;).val(isoCode);&lt;br /&gt;
   &lt;br /&gt;
      var myurl =  $(&amp;quot;form&amp;quot;).attr(&amp;quot;action&amp;quot;);&lt;br /&gt;
      var mydata = &amp;quot;dir=changelanguage&amp;amp;languageselector=&amp;quot;+isoCode;&lt;br /&gt;
      $.ajax({&lt;br /&gt;
         type: &amp;quot;POST&amp;quot;,&lt;br /&gt;
         url: myurl,&lt;br /&gt;
         data: mydata,&lt;br /&gt;
         success: function(msg)&lt;br /&gt;
         {&lt;br /&gt;
            document.query.dir.value = &amp;quot;next&amp;quot;;&lt;br /&gt;
            document.query.submit();&lt;br /&gt;
         },&lt;br /&gt;
         error:function(msg)&lt;br /&gt;
         {&lt;br /&gt;
         }&lt;br /&gt;
      });  &lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code sample==&lt;br /&gt;
&lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the setup of the Question &amp;quot;LanguageSelector&amp;quot;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_a_single_question_as_a_dropdown_list_inside_another_text_grid_question&amp;diff=24033</id>
		<title>Show a single question as a dropdown list inside another text grid question</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_a_single_question_as_a_dropdown_list_inside_another_text_grid_question&amp;diff=24033"/>
		<updated>2012-02-13T09:40:51Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Challenge  ==&lt;br /&gt;
In order to restrict the value entered in a text grid question &amp;lt;br/&amp;gt;&lt;br /&gt;
As a questionnaire creator&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a dropdown list inside the text grid&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[Image:QuestionnaireTips SingleQuestionAsDropdownList.png]]&lt;br /&gt;
&lt;br /&gt;
== Solution ==&lt;br /&gt;
*Create a text grid question (Q3)&lt;br /&gt;
*Create a dummy single question with the same answer options as we want to show inside the text grid question (Q3x)&lt;br /&gt;
*Add javascript code to the text grid question to include the single question inside&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function SingleQuestion(q, selectedValue, even)&lt;br /&gt;
{&lt;br /&gt;
   this.label = &amp;quot;QUESTION.&amp;quot; + q.label;&lt;br /&gt;
   this.text = q.text;&lt;br /&gt;
   this.aoValues = q.aoValues;&lt;br /&gt;
   this.aoTexts = q.aoTexts;		&lt;br /&gt;
   this.selectedValue = selectedValue;	&lt;br /&gt;
   this.even = even;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
SingleQuestion.prototype.getHTML =function()&lt;br /&gt;
{&lt;br /&gt;
   var n = this.aoValues.length;&lt;br /&gt;
   var list = $(&amp;quot;&amp;lt;select&amp;gt;&amp;quot;).width(&amp;quot;400px&amp;quot;);&lt;br /&gt;
   var selected=&amp;quot;&amp;quot;;&lt;br /&gt;
   for(var i=0; i&amp;lt;n; i++)&lt;br /&gt;
   {		&lt;br /&gt;
      if (this.aoValues[i] == this.selectedValue)&lt;br /&gt;
         selected = &amp;quot;true&amp;quot;;&lt;br /&gt;
      else&lt;br /&gt;
         selected = &amp;quot;&amp;quot;;&lt;br /&gt;
      list.append($(&amp;quot;&amp;lt;option&amp;gt;&amp;quot;)&lt;br /&gt;
         .val(this.aoValues[i])&lt;br /&gt;
         .text(this.aoTexts[i])&lt;br /&gt;
         .attr(&amp;quot;selected&amp;quot;, selected)&lt;br /&gt;
      );&lt;br /&gt;
   }&lt;br /&gt;
   //handle change event to change the value of the single question&lt;br /&gt;
   var s_label = this.label;&lt;br /&gt;
   list.change(&lt;br /&gt;
      function()&lt;br /&gt;
      {&lt;br /&gt;
         $(&amp;quot;input:hidden&amp;quot;).each(&lt;br /&gt;
            function(i)&lt;br /&gt;
            {                        &lt;br /&gt;
               if ($(this).attr(&amp;quot;name&amp;quot;) == s_label)&lt;br /&gt;
                  $(this).val(list.val());&lt;br /&gt;
                  &lt;br /&gt;
            }&lt;br /&gt;
         );&lt;br /&gt;
         &lt;br /&gt;
      }&lt;br /&gt;
   );&lt;br /&gt;
   var row = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   var s;&lt;br /&gt;
   &lt;br /&gt;
   if (this.even)&lt;br /&gt;
      s = &amp;quot;even&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      s = &amp;quot;odd&amp;quot;;&lt;br /&gt;
   row.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).text(this.text).addClass(&amp;quot;grid_subquestion_text grid_subquestion_&amp;quot;+s));&lt;br /&gt;
   row.append(&lt;br /&gt;
      $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).addClass(&amp;quot;grid_subquestion_&amp;quot;+ s)&lt;br /&gt;
      .append(list)&lt;br /&gt;
   )&lt;br /&gt;
   if (this.selectedValue == &amp;quot;&amp;quot;)&lt;br /&gt;
      this.selectedValue = this.aoValues[0];&lt;br /&gt;
   row.append($(&amp;quot;&amp;lt;input type = \&amp;quot;hidden\&amp;quot;&amp;gt;&amp;quot;).attr(&amp;quot;name&amp;quot;, this.label).val(this.selectedValue));&lt;br /&gt;
&lt;br /&gt;
   return row;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
   //question in JSON format&lt;br /&gt;
	var q3x = {&amp;quot;label&amp;quot;:&amp;quot;Q3x&amp;quot;,&amp;quot;text&amp;quot;:&amp;quot;Titel&amp;quot;,&amp;quot;aoValues&amp;quot;:[1,2,3],&amp;quot;aoTexts&amp;quot;:[&amp;quot;Ejer&amp;quot;,&amp;quot;Adm. direktør&amp;quot;,&amp;quot;Økonomichef&amp;quot;]};&lt;br /&gt;
&lt;br /&gt;
   //get the previous selected value&lt;br /&gt;
	var selectedValue = &amp;quot;{{Q3x.Value}}&amp;quot;;	&lt;br /&gt;
   var q = new SingleQuestion(q3x, selectedValue, true);&lt;br /&gt;
	//append the single question inside the grid&lt;br /&gt;
	$(&amp;quot;.grid_inner&amp;quot;).append(q.getHTML());&lt;br /&gt;
	&lt;br /&gt;
	$(&amp;quot;input:text&amp;quot;).width(&amp;quot;400px&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code sample ==&lt;br /&gt;
&lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the sub question &amp;quot;Q1[0]&amp;quot; on the text grid &amp;quot;Q1&amp;quot;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_flash_movies_on_questionnaire_viewer&amp;diff=24032</id>
		<title>Show flash movies on questionnaire viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_flash_movies_on_questionnaire_viewer&amp;diff=24032"/>
		<updated>2012-02-13T08:53:58Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Challenge  ==&lt;br /&gt;
&lt;br /&gt;
In order to view multiple&amp;amp;nbsp;flash&amp;amp;nbsp;movies in questionnaire viewer (which&amp;amp;nbsp;is similar to flash&amp;amp;nbsp;movies we&amp;amp;nbsp;already have in my portal, for&amp;amp;nbsp;further information please look at:&amp;amp;nbsp;[http://wiki.catglobe.com/index.php/Movie_player_element http://wiki.catglobe.com/index.php/Movie_player_element]) &lt;br /&gt;
&lt;br /&gt;
As a questionnaire creator &lt;br /&gt;
&lt;br /&gt;
I want to show a list of supported flash movies (.flv) by Catglobe &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
I have an single grid question&amp;amp;nbsp;like below &lt;br /&gt;
&lt;br /&gt;
[[Image:FlashPlayer.Jpeg]] &lt;br /&gt;
&lt;br /&gt;
== Solution  ==&lt;br /&gt;
&lt;br /&gt;
*Upload the new flash movies to the CG server (or any resource you want) and get their links&lt;br /&gt;
&lt;br /&gt;
*Create a new single grid question named&amp;lt;br&amp;gt;*Add&amp;amp;amp;nbsp;javascript to the question to show a list of flash movies on above of grid&lt;br /&gt;
&lt;br /&gt;
== Code  ==&lt;br /&gt;
&lt;br /&gt;
=== Create Movie clip viewer object  ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var MovieclipViewer3 =&lt;br /&gt;
{&lt;br /&gt;
	onInit: function(clip, element, linkText)&lt;br /&gt;
	{&lt;br /&gt;
		MovieclipViewer3.flash = CGFlashPlayers.initialize(&amp;quot;xpflash&amp;quot;, &amp;quot;http://fire.catglobe.com/Script/CGFlashPlayer/CGFlashPlayer.swf&amp;quot;, 298,265);&lt;br /&gt;
		$(element).html(MovieclipViewer3.flash.toString());&lt;br /&gt;
		MovieclipViewer3.flash.ParentDom = $(element);&lt;br /&gt;
		&lt;br /&gt;
		var p = $(&amp;quot;&amp;lt;p&amp;gt;&amp;quot;);&lt;br /&gt;
		$(p).append($(&amp;quot;&amp;lt;u&amp;gt;&amp;quot; + linkText + &amp;quot;&amp;lt;/u&amp;gt;&amp;quot;).css(&amp;quot;cursor&amp;quot;,&amp;quot;pointer&amp;quot;).css(&amp;quot;font-style&amp;quot;, &amp;quot;italic&amp;quot;).click(&lt;br /&gt;
				function()&lt;br /&gt;
				{&lt;br /&gt;
					getPlayList();&lt;br /&gt;
				}&lt;br /&gt;
			));&lt;br /&gt;
		$(element).append($(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;));&lt;br /&gt;
		$(element).append($(p));&lt;br /&gt;
		$(element).append($(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;));&lt;br /&gt;
		&lt;br /&gt;
		MovieclipViewer3.flash.visiblePlaylistButton(false);&lt;br /&gt;
		MovieclipViewer3.flash.visibleControlBar(false);&lt;br /&gt;
		MovieclipViewer3.flash.registerEvent(CGFlashPlayers.Events.OnPlayListReady, MovieclipViewer3.onPlayListReady);&lt;br /&gt;
		MovieclipViewer3.flash.registerEvent(CGFlashPlayers.Events.OnStop, MovieclipViewer3.onStop);&lt;br /&gt;
&lt;br /&gt;
 		// Prepare the play list&lt;br /&gt;
		MovieclipViewer3.flash.openPlayList(clip);&lt;br /&gt;
	},&lt;br /&gt;
 	onPlayListReady: function()	&lt;br /&gt;
	{&lt;br /&gt;
		MovieclipViewer3.flash.play();&lt;br /&gt;
	},&lt;br /&gt;
	onStop: function()	&lt;br /&gt;
	{&lt;br /&gt;
		getPlayList();	&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create movies list  ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayList()&lt;br /&gt;
 {&lt;br /&gt;
	var clipLinks = new Array();&lt;br /&gt;
//be careful when using the below links because you must ensure that the user who answers this answer sheet has resource access on these attachments.&lt;br /&gt;
	clipLinks[0] = &amp;quot;http://fire.catglobe.com/Attachments/GetAttachment.aspx?id=369842&amp;quot;;&lt;br /&gt;
	clipLinks[1] = &amp;quot;http://fire.catglobe.com/Attachments/GetAttachment.aspx?id=369843&amp;quot;;&lt;br /&gt;
	clipLinks[2] = &amp;quot;http://fire.catglobe.com/Attachments/GetAttachment.aspx?id=369844&amp;quot;;&lt;br /&gt;
	clipLinks[3] = &amp;quot;http://fire.catglobe.com/Attachments/GetAttachment.aspx?id=369845&amp;quot;;&lt;br /&gt;
	clipLinks[4] = &amp;quot;http://fire.catglobe.com/Attachments/GetAttachment.aspx?id=369846&amp;quot;;&lt;br /&gt;
 	var clipNames = new Array();&lt;br /&gt;
	clipNames[0] = &amp;quot;Clip 1&amp;quot;;&lt;br /&gt;
	clipNames[1] = &amp;quot;Clip 2&amp;quot;;&lt;br /&gt;
	clipNames[2] = &amp;quot;Clip 3&amp;quot;;&lt;br /&gt;
	clipNames[3] = &amp;quot;Clip 4&amp;quot;;&lt;br /&gt;
	clipNames[4] = &amp;quot;Clip 5&amp;quot;;&lt;br /&gt;
	var content = $(&amp;quot;.playlist&amp;quot;);&lt;br /&gt;
	$(content).html(&amp;quot;&amp;quot;);&lt;br /&gt;
	var p = $(&amp;quot;&amp;lt;p&amp;gt;&amp;quot;).css(&amp;quot;padding-bottom&amp;quot;, &amp;quot;5&amp;quot;);&lt;br /&gt;
	var ul = $(&amp;quot;&amp;lt;ul&amp;gt;&amp;quot;);&lt;br /&gt;
 	$(content).append($(p));&lt;br /&gt;
	$(p).append($(ul));&lt;br /&gt;
 	for(var i= 0; i&amp;lt;clipLinks.length; i++)	&lt;br /&gt;
	{&lt;br /&gt;
		$(ul).append($(&amp;quot;&amp;lt;li&amp;gt;&amp;quot;).text(clipNames[i]).css(&amp;quot;cursor&amp;quot;,&amp;quot;pointer&amp;quot;).css(&amp;quot;font-style&amp;quot;, &amp;quot;italic&amp;quot;).val(i)&lt;br /&gt;
			.click(&lt;br /&gt;
				function()&lt;br /&gt;
				{&lt;br /&gt;
					MovieclipViewer3.onInit(clipLinks[this.value],content, &amp;quot;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt; Back to main list&amp;quot;);				&lt;br /&gt;
				}&lt;br /&gt;
			)&lt;br /&gt;
		)&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a div storing movies list  ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
 {&lt;br /&gt;
	if (document.createElement &amp;amp;&amp;amp; document.getElementsByTagName) {&lt;br /&gt;
		var head = document.getElementsByTagName(&#039;head&#039;)[0];&lt;br /&gt;
&lt;br /&gt;
		var script = document.createElement(&#039;script&#039;);&lt;br /&gt;
		script.setAttribute(&#039;type&#039;, &#039;text/javascript&#039;);&lt;br /&gt;
		script.setAttribute(&#039;src&#039;,&#039;http://fire.catglobe.com/Script/CGFlashPlayer/CGFlashPlayer.js&#039;);&lt;br /&gt;
&lt;br /&gt;
		head.appendChild(script);&lt;br /&gt;
	} else {&lt;br /&gt;
		alert(&#039;Your browser can\&#039;t deal with the DOM standard. That means it\&#039;s old. Go fix it!&#039;);&lt;br /&gt;
	}&lt;br /&gt;
	//alert(quest.getHTML());&lt;br /&gt;
	$(&amp;quot;.grid_outer&amp;quot;).before(&lt;br /&gt;
		$(&amp;quot;&amp;lt;table&amp;gt;&amp;quot;).width(&amp;quot;100%&amp;quot;).attr(&amp;quot;align&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
			.append(&lt;br /&gt;
				$(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;).css(&amp;quot;background-color&amp;quot;, &amp;quot;white&amp;quot;)&lt;br /&gt;
					.append(&lt;br /&gt;
						$(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).attr(&amp;quot;align&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
							.append(&lt;br /&gt;
								$(&amp;quot;&amp;lt;div&amp;gt;&amp;quot;)&lt;br /&gt;
									.addClass(&amp;quot;playlist&amp;quot;)&lt;br /&gt;
								)&lt;br /&gt;
						)	&lt;br /&gt;
				)&lt;br /&gt;
		)&lt;br /&gt;
	getPlayList();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code sample==&lt;br /&gt;
&lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q_singlegridplayer&amp;quot;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_flash_movies_on_questionnaire_viewer&amp;diff=24031</id>
		<title>Show flash movies on questionnaire viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_flash_movies_on_questionnaire_viewer&amp;diff=24031"/>
		<updated>2012-02-13T08:52:03Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Challenge  ==&lt;br /&gt;
&lt;br /&gt;
In order to view multiple&amp;amp;nbsp;flash&amp;amp;nbsp;movies in questionnaire viewer (which&amp;amp;nbsp;is similar to flash&amp;amp;nbsp;movies we&amp;amp;nbsp;already have in my portal, for&amp;amp;nbsp;further information please look at:&amp;amp;nbsp;[http://wiki.catglobe.com/index.php/Movie_player_element http://wiki.catglobe.com/index.php/Movie_player_element]) &lt;br /&gt;
&lt;br /&gt;
As a questionnaire creator &lt;br /&gt;
&lt;br /&gt;
I want to show a list of supported flash movies ( .flv )by Catglobe &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
I have an single grid question&amp;amp;nbsp;like below &lt;br /&gt;
&lt;br /&gt;
[[Image:FlashPlayer.Jpeg]] &lt;br /&gt;
&lt;br /&gt;
== Solution  ==&lt;br /&gt;
&lt;br /&gt;
*Upload the new flash movies to the CG server (or any resource you want) and get their links&lt;br /&gt;
&lt;br /&gt;
*Create a new single grid question named&amp;lt;br&amp;gt;*Add&amp;amp;amp;nbsp;javascript to the question to show a list of flash movies on above of grid&lt;br /&gt;
&lt;br /&gt;
== Code  ==&lt;br /&gt;
&lt;br /&gt;
=== Create Movie clip viewer object  ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var MovieclipViewer3 =&lt;br /&gt;
{&lt;br /&gt;
	onInit: function(clip, element, linkText)&lt;br /&gt;
	{&lt;br /&gt;
		MovieclipViewer3.flash = CGFlashPlayers.initialize(&amp;quot;xpflash&amp;quot;, &amp;quot;http://fire.catglobe.com/Script/CGFlashPlayer/CGFlashPlayer.swf&amp;quot;, 298,265);&lt;br /&gt;
		$(element).html(MovieclipViewer3.flash.toString());&lt;br /&gt;
		MovieclipViewer3.flash.ParentDom = $(element);&lt;br /&gt;
		&lt;br /&gt;
		var p = $(&amp;quot;&amp;lt;p&amp;gt;&amp;quot;);&lt;br /&gt;
		$(p).append($(&amp;quot;&amp;lt;u&amp;gt;&amp;quot; + linkText + &amp;quot;&amp;lt;/u&amp;gt;&amp;quot;).css(&amp;quot;cursor&amp;quot;,&amp;quot;pointer&amp;quot;).css(&amp;quot;font-style&amp;quot;, &amp;quot;italic&amp;quot;).click(&lt;br /&gt;
				function()&lt;br /&gt;
				{&lt;br /&gt;
					getPlayList();&lt;br /&gt;
				}&lt;br /&gt;
			));&lt;br /&gt;
		$(element).append($(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;));&lt;br /&gt;
		$(element).append($(p));&lt;br /&gt;
		$(element).append($(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;));&lt;br /&gt;
		&lt;br /&gt;
		MovieclipViewer3.flash.visiblePlaylistButton(false);&lt;br /&gt;
		MovieclipViewer3.flash.visibleControlBar(false);&lt;br /&gt;
		MovieclipViewer3.flash.registerEvent(CGFlashPlayers.Events.OnPlayListReady, MovieclipViewer3.onPlayListReady);&lt;br /&gt;
		MovieclipViewer3.flash.registerEvent(CGFlashPlayers.Events.OnStop, MovieclipViewer3.onStop);&lt;br /&gt;
&lt;br /&gt;
 		// Prepare the play list&lt;br /&gt;
		MovieclipViewer3.flash.openPlayList(clip);&lt;br /&gt;
	},&lt;br /&gt;
 	onPlayListReady: function()	&lt;br /&gt;
	{&lt;br /&gt;
		MovieclipViewer3.flash.play();&lt;br /&gt;
	},&lt;br /&gt;
	onStop: function()	&lt;br /&gt;
	{&lt;br /&gt;
		getPlayList();	&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create movies list  ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayList()&lt;br /&gt;
 {&lt;br /&gt;
	var clipLinks = new Array();&lt;br /&gt;
	clipLinks[0] = &amp;quot;http://fire.catglobe.com/Attachments/GetAttachment.aspx?id=369842&amp;quot;;&lt;br /&gt;
	clipLinks[1] = &amp;quot;http://fire.catglobe.com/Attachments/GetAttachment.aspx?id=369843&amp;quot;;&lt;br /&gt;
	clipLinks[2] = &amp;quot;http://fire.catglobe.com/Attachments/GetAttachment.aspx?id=369844&amp;quot;;&lt;br /&gt;
	clipLinks[3] = &amp;quot;http://fire.catglobe.com/Attachments/GetAttachment.aspx?id=369845&amp;quot;;&lt;br /&gt;
	clipLinks[4] = &amp;quot;http://fire.catglobe.com/Attachments/GetAttachment.aspx?id=369846&amp;quot;;&lt;br /&gt;
 	var clipNames = new Array();&lt;br /&gt;
	clipNames[0] = &amp;quot;Clip 1&amp;quot;;&lt;br /&gt;
	clipNames[1] = &amp;quot;Clip 2&amp;quot;;&lt;br /&gt;
	clipNames[2] = &amp;quot;Clip 3&amp;quot;;&lt;br /&gt;
	clipNames[3] = &amp;quot;Clip 4&amp;quot;;&lt;br /&gt;
	clipNames[4] = &amp;quot;Clip 5&amp;quot;;&lt;br /&gt;
	var content = $(&amp;quot;.playlist&amp;quot;);&lt;br /&gt;
	$(content).html(&amp;quot;&amp;quot;);&lt;br /&gt;
	var p = $(&amp;quot;&amp;lt;p&amp;gt;&amp;quot;).css(&amp;quot;padding-bottom&amp;quot;, &amp;quot;5&amp;quot;);&lt;br /&gt;
	var ul = $(&amp;quot;&amp;lt;ul&amp;gt;&amp;quot;);&lt;br /&gt;
 	$(content).append($(p));&lt;br /&gt;
	$(p).append($(ul));&lt;br /&gt;
 	for(var i= 0; i&amp;lt;clipLinks.length; i++)	&lt;br /&gt;
	{&lt;br /&gt;
		$(ul).append($(&amp;quot;&amp;lt;li&amp;gt;&amp;quot;).text(clipNames[i]).css(&amp;quot;cursor&amp;quot;,&amp;quot;pointer&amp;quot;).css(&amp;quot;font-style&amp;quot;, &amp;quot;italic&amp;quot;).val(i)&lt;br /&gt;
			.click(&lt;br /&gt;
				function()&lt;br /&gt;
				{&lt;br /&gt;
					MovieclipViewer3.onInit(clipLinks[this.value],content, &amp;quot;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt; Back to main list&amp;quot;);				&lt;br /&gt;
				}&lt;br /&gt;
			)&lt;br /&gt;
		)&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a div storing movies list  ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
 {&lt;br /&gt;
	if (document.createElement &amp;amp;&amp;amp; document.getElementsByTagName) {&lt;br /&gt;
		var head = document.getElementsByTagName(&#039;head&#039;)[0];&lt;br /&gt;
&lt;br /&gt;
		var script = document.createElement(&#039;script&#039;);&lt;br /&gt;
		script.setAttribute(&#039;type&#039;, &#039;text/javascript&#039;);&lt;br /&gt;
		script.setAttribute(&#039;src&#039;,&#039;http://fire.catglobe.com/Script/CGFlashPlayer/CGFlashPlayer.js&#039;);&lt;br /&gt;
&lt;br /&gt;
		head.appendChild(script);&lt;br /&gt;
	} else {&lt;br /&gt;
		alert(&#039;Your browser can\&#039;t deal with the DOM standard. That means it\&#039;s old. Go fix it!&#039;);&lt;br /&gt;
	}&lt;br /&gt;
	//alert(quest.getHTML());&lt;br /&gt;
	$(&amp;quot;.grid_outer&amp;quot;).before(&lt;br /&gt;
		$(&amp;quot;&amp;lt;table&amp;gt;&amp;quot;).width(&amp;quot;100%&amp;quot;).attr(&amp;quot;align&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
			.append(&lt;br /&gt;
				$(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;).css(&amp;quot;background-color&amp;quot;, &amp;quot;white&amp;quot;)&lt;br /&gt;
					.append(&lt;br /&gt;
						$(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).attr(&amp;quot;align&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
							.append(&lt;br /&gt;
								$(&amp;quot;&amp;lt;div&amp;gt;&amp;quot;)&lt;br /&gt;
									.addClass(&amp;quot;playlist&amp;quot;)&lt;br /&gt;
								)&lt;br /&gt;
						)	&lt;br /&gt;
				)&lt;br /&gt;
		)&lt;br /&gt;
	getPlayList();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code sample==&lt;br /&gt;
&lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q_singlegridplayer&amp;quot;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Set_focus_on_question_text_in_the_top&amp;diff=24028</id>
		<title>Set focus on question text in the top</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Set_focus_on_question_text_in_the_top&amp;diff=24028"/>
		<updated>2012-02-10T08:21:51Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Challenge  ==&lt;br /&gt;
&lt;br /&gt;
If the question text is to big or answer option is long then the respondent can not see the begining of the question text.&lt;br /&gt;
&lt;br /&gt;
== Solution  ==&lt;br /&gt;
&lt;br /&gt;
*In questionnaire template editor, choose the question you want edit and then go to the Properties - Edit question properties - Language dependent - Select javascript property&lt;br /&gt;
&lt;br /&gt;
== Code  ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
quest.init = function(){&lt;br /&gt;
   $(&amp;quot;input[name$=&#039;Q_LongQuestionText_new&#039;]&amp;quot;).focus();&lt;br /&gt;
   //$(&amp;quot;#page_question_text&amp;quot;).scrollTop(0); -&amp;gt; applied for page question&lt;br /&gt;
   this.onInit();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code sample==&lt;br /&gt;
&lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q_LongQuestionText_new&amp;quot;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Hide_sub_question_text_column_in_a_grid_question&amp;diff=24027</id>
		<title>Hide sub question text column in a grid question</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Hide_sub_question_text_column_in_a_grid_question&amp;diff=24027"/>
		<updated>2012-02-10T04:41:29Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Challenge  ==&lt;br /&gt;
&lt;br /&gt;
In order not to show sub question texts in a grid question &lt;br /&gt;
&lt;br /&gt;
As a questionnaire creator &lt;br /&gt;
&lt;br /&gt;
I want to hide the sub question text column &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
When creating a scale grid question, its sub question text is displayed as a column in the grid. &lt;br /&gt;
&lt;br /&gt;
[[Image:QuestionTips HideText 1.jpg]] &lt;br /&gt;
&lt;br /&gt;
I want to hide that column because it has no use in my context. &lt;br /&gt;
&lt;br /&gt;
[[Image:QuestionTips HideText 2.jpg]]&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
== Solution ==&lt;br /&gt;
&lt;br /&gt;
The style sheet applied to sub question text cells is&amp;amp;nbsp;grid_subquestion_text, therefore we need to search all the elements using that style sheet class and hide them.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
	$(&amp;quot;.grid_subquestion_text&amp;quot;).hide();		&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code sample ==&lt;br /&gt;
&lt;br /&gt;
Open the qnaire template of the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q_ScaleGrid&amp;quot;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_a_text_grid_and_a_single_question_in_the_same_page&amp;diff=24024</id>
		<title>Show a text grid and a single question in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_a_text_grid_and_a_single_question_in_the_same_page&amp;diff=24024"/>
		<updated>2012-02-10T03:39:23Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Challenge  ==&lt;br /&gt;
&lt;br /&gt;
In order to allow the respondent to skip a text grid question &lt;br /&gt;
&lt;br /&gt;
As a questionnaire creator &lt;br /&gt;
&lt;br /&gt;
I want to show several options at the end of a text grid question, on which the respondents can click to skip the text grid question. &lt;br /&gt;
&lt;br /&gt;
(This is quite&amp;amp;nbsp;similar to question of Open type) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When there is no checkbox checked, the text boxes in the grid are enabled so that we can enter the texts. &lt;br /&gt;
&lt;br /&gt;
[[Image:QuestionTips TextGrid Enabled.jpg]]&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
When a checkbox is checked, the textboxes are disabled. &lt;br /&gt;
&lt;br /&gt;
[[Image:QuestionTips TextGrid Disabled.jpg]]&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
== Solution  ==&lt;br /&gt;
&lt;br /&gt;
*Create 2 questions: TextGrid and Single &lt;br /&gt;
*Single is set as a dummy question &lt;br /&gt;
*Add javascript to TextGrid to include Single&#039;s HTML to the question&#039;s HTML &lt;br /&gt;
*Make sure when clicking a checkbox, other checkboxes are unchecked and the textboxes are disabled &lt;br /&gt;
*Check if there is an option selected or no textbox is left empty when clicking Next &lt;br /&gt;
*Load the saved value when loading the question &lt;br /&gt;
*Save the value entered to the two questions&lt;br /&gt;
&lt;br /&gt;
== Code  ==&lt;br /&gt;
&lt;br /&gt;
===== We should create a SingleQuestion object containing functions to generate its own HTML and handle its checkbox click events.  =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
var SingleQuestion = {&lt;br /&gt;
	onInit: function(_label, _answerOptionValues, _answerOptionTexts)&lt;br /&gt;
	{&lt;br /&gt;
		this.label = &amp;quot;QUESTION.&amp;quot; + _label;&lt;br /&gt;
		this.aoValues = _answerOptionValues;&lt;br /&gt;
		this.aoTexts = _answerOptionTexts;		&lt;br /&gt;
		this.selectedValue = &amp;quot;&amp;quot;;		&lt;br /&gt;
	},&lt;br /&gt;
	optClick: function(value)&lt;br /&gt;
	{&lt;br /&gt;
		if (this.selectedValue == value)//click the checkbox twice =&amp;gt; unchecked&lt;br /&gt;
		{&lt;br /&gt;
			this.selectedValue = &amp;quot;&amp;quot;;&lt;br /&gt;
			$(&amp;quot;input:text&amp;quot;).attr(&amp;quot;disabled&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
			$(&amp;quot;input:checkbox&amp;quot;).attr(&amp;quot;checked&amp;quot;, &amp;quot;&amp;quot;);			&lt;br /&gt;
		}		&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			//disable all other inputs&lt;br /&gt;
			this.selectedValue = value;&lt;br /&gt;
			$(&amp;quot;input:text&amp;quot;).attr(&amp;quot;disabled&amp;quot;, &amp;quot;disabled&amp;quot;);&lt;br /&gt;
			&lt;br /&gt;
			$(&amp;quot;input:checkbox&amp;quot;).each(&lt;br /&gt;
				function(i)&lt;br /&gt;
				{&lt;br /&gt;
					if ($(this).val() == value)&lt;br /&gt;
						$(this).attr(&amp;quot;checked&amp;quot;, &amp;quot;checked&amp;quot;);														&lt;br /&gt;
					else					&lt;br /&gt;
						$(this).attr(&amp;quot;checked&amp;quot;, &amp;quot;&amp;quot;);						&lt;br /&gt;
				}&lt;br /&gt;
			);&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	getHTML: function()&lt;br /&gt;
	{&lt;br /&gt;
		var t = $(&amp;quot;&amp;lt;table&amp;gt;&amp;quot;);&lt;br /&gt;
		var n = this.aoValues.length;&lt;br /&gt;
		for (var i = 0; i&amp;lt;n; i++)&lt;br /&gt;
		{&lt;br /&gt;
			t.append(this.getHTML_AO(i));&lt;br /&gt;
		}&lt;br /&gt;
		t.append($(&amp;quot;&amp;lt;input type = \&amp;quot;hidden\&amp;quot;&amp;gt;&amp;quot;).attr(&amp;quot;name&amp;quot;, this.label).val(&amp;quot;&amp;quot;));&lt;br /&gt;
		return t;&lt;br /&gt;
	},&lt;br /&gt;
	getHTML_AO: function(index)&lt;br /&gt;
	{&lt;br /&gt;
		var value = this.aoValues[index];&lt;br /&gt;
		var text = this.aoTexts[index];&lt;br /&gt;
		return $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;)		&lt;br /&gt;
			.append(&lt;br /&gt;
				$(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).width(&amp;quot;16px&amp;quot;).attr(&amp;quot;valign&amp;quot;, &amp;quot;top&amp;quot;)&lt;br /&gt;
					.append(&lt;br /&gt;
						$(&amp;quot;&amp;lt;input type=\&amp;quot;checkbox\&amp;quot;&amp;gt;&amp;quot;).attr(&amp;quot;name&amp;quot;, this.label).val(value).click(&lt;br /&gt;
							function()&lt;br /&gt;
							{&lt;br /&gt;
								SingleQuestion.optClick(value);&lt;br /&gt;
							}&lt;br /&gt;
						)&lt;br /&gt;
					)&lt;br /&gt;
			)&lt;br /&gt;
			.append(&lt;br /&gt;
				$(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).append($(&amp;quot;&amp;lt;a class=\&amp;quot;option_link\&amp;quot; href=\&amp;quot;javascript:SingleQuestion.optClick(&amp;quot; + value + &amp;quot;);\&amp;quot;&amp;gt;&amp;quot; + text + &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;))&lt;br /&gt;
			);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== TextGridQuestion object is created, storing the code of validating its value before clicking Next  =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
var TextGridQuestion = &lt;br /&gt;
{&lt;br /&gt;
	onInit: function(_quest)&lt;br /&gt;
	{&lt;br /&gt;
		this.quest = _quest;&lt;br /&gt;
	},&lt;br /&gt;
	questionCheck: function()&lt;br /&gt;
	{&lt;br /&gt;
		acont = new Array();&lt;br /&gt;
	    msg = &amp;quot;&amp;quot;;&lt;br /&gt;
	    cont = true;&lt;br /&gt;
&lt;br /&gt;
		for (i=0; i &amp;lt; this.quest.questions.length; i++)&lt;br /&gt;
			acont[i] = (trim(document[&amp;quot;query&amp;quot;][this.quest.questions[i].label].value) != &amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		msg = this.quest.ingridrequiredtext+&amp;quot;\n&amp;quot;;&lt;br /&gt;
		for (i = 0; i &amp;lt; this.quest.questions.length; i++)&lt;br /&gt;
		{&lt;br /&gt;
			// If the sub question is not visible or answering this&lt;br /&gt;
			// sub question is not answered and not required to be&lt;br /&gt;
			// then we continue with the next sub question&lt;br /&gt;
			if(!this.quest.questions[i].visible || (!this.quest.questions[i].required &amp;amp;&amp;amp; !acont[i]))&lt;br /&gt;
				continue;&lt;br /&gt;
&lt;br /&gt;
			if(this.quest.questions[i].required &amp;amp;&amp;amp; !acont[i])&lt;br /&gt;
			{&lt;br /&gt;
				tmp = this.quest.questions[i].text;&lt;br /&gt;
				tmp = tmp.replace(/(&amp;lt;!\-\-|\-\-&amp;gt;)/ig, &amp;quot;&amp;quot;);&lt;br /&gt;
				tmp = tmp.replace(/&amp;amp;nbsp;/ig, &amp;quot; &amp;quot;);&lt;br /&gt;
				msg += &amp;quot; - &#039;&amp;quot;+trim(tmp.replace(/&amp;lt;[^&amp;gt;]*&amp;gt;/ig, &amp;quot;&amp;quot;))+&amp;quot;&#039;\n&amp;quot;;&lt;br /&gt;
				cont = false;&lt;br /&gt;
				continue;&lt;br /&gt;
			}			&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!cont)&lt;br /&gt;
		{	&lt;br /&gt;
			ErrorMessages.getInstance().showErrorMessage(msg);&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== We also need to override questioncheck function in order not to use the default check of questionnaire viewer, which will give an error when no sub question in the text grid is answered, which is not correct in our case  =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
this.questioncheck = function()&lt;br /&gt;
{&lt;br /&gt;
	ErrorMessages.getInstance().clearErrorMessages();&lt;br /&gt;
	if (SingleQuestion.selectedValue != &amp;quot;&amp;quot;)&lt;br /&gt;
		return true;&lt;br /&gt;
	&lt;br /&gt;
	return TextGridQuestion.questionCheck();	&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Finally, we need to override quest.onInit function to execute the changes  =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
	var single = &amp;quot;{{Single.Value}}&amp;quot;;&lt;br /&gt;
	var aoV = new Array();&lt;br /&gt;
	aoV[0] = 1;&lt;br /&gt;
	aoV[1] = 2;&lt;br /&gt;
	var aoT = new Array();&lt;br /&gt;
	aoT[0] = &amp;quot;I do not want to give those information&amp;quot;;&lt;br /&gt;
	aoT[1] = &amp;quot;I do not have time for this&amp;quot;&lt;br /&gt;
	SingleQuestion.onInit(&amp;quot;Single&amp;quot;, aoV, aoT);&lt;br /&gt;
		&lt;br /&gt;
	//look for the outer grid&lt;br /&gt;
	$(&amp;quot;.grid_outer&amp;quot;).append(&lt;br /&gt;
		$(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;).css(&amp;quot;background-color&amp;quot;, &amp;quot;white&amp;quot;).append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).append(SingleQuestion.getHTML()))	&lt;br /&gt;
	);&lt;br /&gt;
	&lt;br /&gt;
	if (single != &amp;quot;&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		SingleQuestion.optClick(single);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	TextGridQuestion.onInit(this);&lt;br /&gt;
	$(&amp;quot;input:text&amp;quot;).width(&amp;quot;200px&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code sample ==&lt;br /&gt;
&lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q_TextGrid&amp;quot;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23985</id>
		<title>Show more than one questions in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23985"/>
		<updated>2012-02-09T07:22:37Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Code example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
There is a common need of showing more than one questions in the same page, but unfortunately it is not supported by the current editor (we hope it will be possible with the new viewer in a near future)&lt;br /&gt;
&lt;br /&gt;
In the mean time, we need to have some work-arround tips to make it work.&lt;br /&gt;
&lt;br /&gt;
= Solution 1 : (old setup and not in use any longer) =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, there must be an input element added to that page&#039;s html with name following a specific format: non grid question should have name as QUESTION.question_label, grid questions use names as QUESTION.question_label.grid_index.&amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
Multi/Multi grid questions are special cases, it is not good enough if we only add checkboxes with the right name format, we also need to add one hidden input for each multi/multi grid&#039;s sub questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I want to show my single question labeled Q1 in another question with radio buttons, I need to make sure the HTML contains the following code for each answer option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option text 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 2:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a single grid question label Q1 in another question, I need to make sure the HTML contains the following code for each answer option and each sub question. Q1 has 2 answer options&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;2&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 3:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a multi question label Q1 in another question, Q1 has 2 answer options, I need to make sure the HTML contains the following code for each answer option. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore, we need to add an hidden input element like this.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are basically 3 ways of changing a question&#039;s HTML.&lt;br /&gt;
&lt;br /&gt;
== Use HTML ==&lt;br /&gt;
This one is obvious, you can use HTML Editor to edit a question&#039;s text to include other questions.&amp;lt;br/&amp;gt;&lt;br /&gt;
Due to the fact that non-page questions have specific generated HTML code based on their answer options, it is usually hard to inject other questions and to make it look nice enough. &amp;lt;br/&amp;gt;&lt;br /&gt;
This method is usualy used when using a page question to display other questions, and it is convenient to use when the requirements are complex and the texts are not likely to change much. This one is the fastest solution among 3&amp;lt;br/&amp;gt;&lt;br /&gt;
The disadvantage of this method is that it is difficult to modify if the HTML is too complex.&lt;br /&gt;
&lt;br /&gt;
== quest.onInit ==&lt;br /&gt;
This function is called after the HTML of the question is generated, therefore it is the best to use JQuery to insert the elements added to the HTML.&amp;lt;br/&amp;gt;&lt;br /&gt;
It would be useful to use tools like Firebug to know the ids/names of the elements where we want to insert.&amp;lt;br/&amp;gt;&lt;br /&gt;
This solution should be used when there is not much to change the existing HTML of the question, for example: we want to show a text grid question in another text grid question which has the same set of sub question texts.&lt;br /&gt;
&lt;br /&gt;
== quest.getHTML ==&lt;br /&gt;
This method is to override the HTML generated by the system. This is similar to the first solution, but different in several things: this can be used with any question types; it might be more difficult to start with and not as obvious; it is effective when there are lots of elements that should be generated are similar to each others (use loops)&lt;br /&gt;
&lt;br /&gt;
== Code sample == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Showhtmlcode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Solution 2 : =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, we will use 1 dummy question to store all question text, answer option text that we need to put and input them as JSON format. After that, we will load the value on this question via jquery to initialize the questions. &amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For e.g, I will add the text grid question for validating the email into another text grid question :&lt;br /&gt;
== Step 1 : Create a dummy text grid question for storing the email value==&lt;br /&gt;
&lt;br /&gt;
[[File:Text_grid_question.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Step 2 : Create a dummy text question for storing the JSON ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
string language = Context_getSelectedLanguage();&lt;br /&gt;
string label;&lt;br /&gt;
number i;&lt;br /&gt;
number n;&lt;br /&gt;
string result = &amp;quot;var q = {&amp;quot;;&lt;br /&gt;
string js;&lt;br /&gt;
array q;&lt;br /&gt;
//-------GENERATE JSON FOR Email QUESTION ----------&lt;br /&gt;
q = Question_getQuestion(&amp;quot;D_Email&amp;quot;, language);&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.0\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][0][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email0\\\&amp;quot;:&amp;quot; + js + &amp;quot;,&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.1\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][1][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email1\\\&amp;quot;:&amp;quot; + js ;&lt;br /&gt;
result = result + &amp;quot;}&amp;quot;;&lt;br /&gt;
D_InitializeJSON = result;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3 : Load the JSON on the destination question ==&lt;br /&gt;
On the destination question , open its JS tab and input the code like below : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
eval(&amp;quot;{{D_InitializeJSON}}&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
function TextQuestion(q, selectedValue)&lt;br /&gt;
{&lt;br /&gt;
   if (q.label.indexOf(&amp;quot;QUESTION.&amp;quot;) != -1)&lt;br /&gt;
      this.label = q.label;&lt;br /&gt;
   else&lt;br /&gt;
      this.label = &amp;quot;QUESTION.&amp;quot; + q.label;&lt;br /&gt;
   &lt;br /&gt;
   this.selectedValue = selectedValue;	   &lt;br /&gt;
   this.text = q.text;&lt;br /&gt;
   $(&amp;quot;input[name=&#039;&amp;quot; + this.label + &amp;quot;&#039;]&amp;quot;).val(selectedValue);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
TextQuestion.prototype.getHTML_Row = function(even)&lt;br /&gt;
{&lt;br /&gt;
   var row = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   var s;&lt;br /&gt;
   &lt;br /&gt;
   if (even)&lt;br /&gt;
      s = &amp;quot;even&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      s = &amp;quot;odd&amp;quot;;&lt;br /&gt;
   row.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).text(this.text).addClass(&amp;quot;grid_subquestion_text grid_subquestion_&amp;quot;+s));&lt;br /&gt;
   var input = $(&amp;quot;&amp;lt;input type = &#039;text&#039;&amp;gt;&amp;quot;);&lt;br /&gt;
   input.attr(&amp;quot;name&amp;quot;, this.label).val(this.selectedValue);&lt;br /&gt;
   row.append(&lt;br /&gt;
      $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).addClass(&amp;quot;grid_subquestion_&amp;quot;+ s)&lt;br /&gt;
      .append(input)&lt;br /&gt;
   );&lt;br /&gt;
&lt;br /&gt;
   return row;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email0, &amp;quot;{{D_Email[0].Value}}&amp;quot;).getHTML_Row(true));&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email1, &amp;quot;{{D_Email[1].Value}}&amp;quot;).getHTML_Row(false));      &lt;br /&gt;
&lt;br /&gt;
    $(&amp;quot;input:text&amp;quot;).width(&amp;quot;400px&amp;quot;);&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).find(&amp;quot;tr&amp;quot;).each(&lt;br /&gt;
      function(i)&lt;br /&gt;
      {&lt;br /&gt;
         if(i&amp;gt;3) i+=1;&lt;br /&gt;
         if(i%2==0)&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_odd&amp;quot;).addClass(&amp;quot;grid_subquestion_even&amp;quot;);&lt;br /&gt;
         else&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_even&amp;quot;).addClass(&amp;quot;grid_subquestion_odd&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
   ); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var defaultQuestionCheck = questioncheck;&lt;br /&gt;
var questioncheck = function()&lt;br /&gt;
{&lt;br /&gt;
   ErrorMessages.getInstance().clearErrorMessages();&lt;br /&gt;
   var b =true;&lt;br /&gt;
   if (!defaultQuestionCheck())&lt;br /&gt;
      return false;&lt;br /&gt;
     var email = $(&amp;quot;input[name$=&#039;QUESTION.D_Email.0&#039;]&amp;quot;).val();   &lt;br /&gt;
     if (!validateEmail(email))&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_InvalidEmailFormat);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     if ($(&amp;quot;input[name$=&#039;QUESTION.D_Email.1&#039;]&amp;quot;).val() != email)&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_EmailNotMatch);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
   return b;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code sample == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Remember to always test your work on these following cases:&lt;br /&gt;
*Display correctly as expected&lt;br /&gt;
*Save the right value in the right place&lt;br /&gt;
*Display previously saved values&lt;br /&gt;
*Validate inputs&lt;br /&gt;
*Update previously saved values&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23984</id>
		<title>Show more than one questions in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23984"/>
		<updated>2012-02-09T07:22:18Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Code example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
There is a common need of showing more than one questions in the same page, but unfortunately it is not supported by the current editor (we hope it will be possible with the new viewer in a near future)&lt;br /&gt;
&lt;br /&gt;
In the mean time, we need to have some work-arround tips to make it work.&lt;br /&gt;
&lt;br /&gt;
= Solution 1 : (old setup and not in use any longer) =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, there must be an input element added to that page&#039;s html with name following a specific format: non grid question should have name as QUESTION.question_label, grid questions use names as QUESTION.question_label.grid_index.&amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
Multi/Multi grid questions are special cases, it is not good enough if we only add checkboxes with the right name format, we also need to add one hidden input for each multi/multi grid&#039;s sub questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I want to show my single question labeled Q1 in another question with radio buttons, I need to make sure the HTML contains the following code for each answer option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option text 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 2:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a single grid question label Q1 in another question, I need to make sure the HTML contains the following code for each answer option and each sub question. Q1 has 2 answer options&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;2&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 3:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a multi question label Q1 in another question, Q1 has 2 answer options, I need to make sure the HTML contains the following code for each answer option. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore, we need to add an hidden input element like this.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are basically 3 ways of changing a question&#039;s HTML.&lt;br /&gt;
&lt;br /&gt;
== Use HTML ==&lt;br /&gt;
This one is obvious, you can use HTML Editor to edit a question&#039;s text to include other questions.&amp;lt;br/&amp;gt;&lt;br /&gt;
Due to the fact that non-page questions have specific generated HTML code based on their answer options, it is usually hard to inject other questions and to make it look nice enough. &amp;lt;br/&amp;gt;&lt;br /&gt;
This method is usualy used when using a page question to display other questions, and it is convenient to use when the requirements are complex and the texts are not likely to change much. This one is the fastest solution among 3&amp;lt;br/&amp;gt;&lt;br /&gt;
The disadvantage of this method is that it is difficult to modify if the HTML is too complex.&lt;br /&gt;
&lt;br /&gt;
== quest.onInit ==&lt;br /&gt;
This function is called after the HTML of the question is generated, therefore it is the best to use JQuery to insert the elements added to the HTML.&amp;lt;br/&amp;gt;&lt;br /&gt;
It would be useful to use tools like Firebug to know the ids/names of the elements where we want to insert.&amp;lt;br/&amp;gt;&lt;br /&gt;
This solution should be used when there is not much to change the existing HTML of the question, for example: we want to show a text grid question in another text grid question which has the same set of sub question texts.&lt;br /&gt;
&lt;br /&gt;
== quest.getHTML ==&lt;br /&gt;
This method is to override the HTML generated by the system. This is similar to the first solution, but different in several things: this can be used with any question types; it might be more difficult to start with and not as obvious; it is effective when there are lots of elements that should be generated are similar to each others (use loops)&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Showhtmlcode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Solution 2 : =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, we will use 1 dummy question to store all question text, answer option text that we need to put and input them as JSON format. After that, we will load the value on this question via jquery to initialize the questions. &amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For e.g, I will add the text grid question for validating the email into another text grid question :&lt;br /&gt;
== Step 1 : Create a dummy text grid question for storing the email value==&lt;br /&gt;
&lt;br /&gt;
[[File:Text_grid_question.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Step 2 : Create a dummy text question for storing the JSON ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
string language = Context_getSelectedLanguage();&lt;br /&gt;
string label;&lt;br /&gt;
number i;&lt;br /&gt;
number n;&lt;br /&gt;
string result = &amp;quot;var q = {&amp;quot;;&lt;br /&gt;
string js;&lt;br /&gt;
array q;&lt;br /&gt;
//-------GENERATE JSON FOR Email QUESTION ----------&lt;br /&gt;
q = Question_getQuestion(&amp;quot;D_Email&amp;quot;, language);&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.0\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][0][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email0\\\&amp;quot;:&amp;quot; + js + &amp;quot;,&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.1\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][1][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email1\\\&amp;quot;:&amp;quot; + js ;&lt;br /&gt;
result = result + &amp;quot;}&amp;quot;;&lt;br /&gt;
D_InitializeJSON = result;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3 : Load the JSON on the destination question ==&lt;br /&gt;
On the destination question , open its JS tab and input the code like below : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
eval(&amp;quot;{{D_InitializeJSON}}&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
function TextQuestion(q, selectedValue)&lt;br /&gt;
{&lt;br /&gt;
   if (q.label.indexOf(&amp;quot;QUESTION.&amp;quot;) != -1)&lt;br /&gt;
      this.label = q.label;&lt;br /&gt;
   else&lt;br /&gt;
      this.label = &amp;quot;QUESTION.&amp;quot; + q.label;&lt;br /&gt;
   &lt;br /&gt;
   this.selectedValue = selectedValue;	   &lt;br /&gt;
   this.text = q.text;&lt;br /&gt;
   $(&amp;quot;input[name=&#039;&amp;quot; + this.label + &amp;quot;&#039;]&amp;quot;).val(selectedValue);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
TextQuestion.prototype.getHTML_Row = function(even)&lt;br /&gt;
{&lt;br /&gt;
   var row = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   var s;&lt;br /&gt;
   &lt;br /&gt;
   if (even)&lt;br /&gt;
      s = &amp;quot;even&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      s = &amp;quot;odd&amp;quot;;&lt;br /&gt;
   row.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).text(this.text).addClass(&amp;quot;grid_subquestion_text grid_subquestion_&amp;quot;+s));&lt;br /&gt;
   var input = $(&amp;quot;&amp;lt;input type = &#039;text&#039;&amp;gt;&amp;quot;);&lt;br /&gt;
   input.attr(&amp;quot;name&amp;quot;, this.label).val(this.selectedValue);&lt;br /&gt;
   row.append(&lt;br /&gt;
      $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).addClass(&amp;quot;grid_subquestion_&amp;quot;+ s)&lt;br /&gt;
      .append(input)&lt;br /&gt;
   );&lt;br /&gt;
&lt;br /&gt;
   return row;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email0, &amp;quot;{{D_Email[0].Value}}&amp;quot;).getHTML_Row(true));&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email1, &amp;quot;{{D_Email[1].Value}}&amp;quot;).getHTML_Row(false));      &lt;br /&gt;
&lt;br /&gt;
    $(&amp;quot;input:text&amp;quot;).width(&amp;quot;400px&amp;quot;);&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).find(&amp;quot;tr&amp;quot;).each(&lt;br /&gt;
      function(i)&lt;br /&gt;
      {&lt;br /&gt;
         if(i&amp;gt;3) i+=1;&lt;br /&gt;
         if(i%2==0)&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_odd&amp;quot;).addClass(&amp;quot;grid_subquestion_even&amp;quot;);&lt;br /&gt;
         else&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_even&amp;quot;).addClass(&amp;quot;grid_subquestion_odd&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
   ); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var defaultQuestionCheck = questioncheck;&lt;br /&gt;
var questioncheck = function()&lt;br /&gt;
{&lt;br /&gt;
   ErrorMessages.getInstance().clearErrorMessages();&lt;br /&gt;
   var b =true;&lt;br /&gt;
   if (!defaultQuestionCheck())&lt;br /&gt;
      return false;&lt;br /&gt;
     var email = $(&amp;quot;input[name$=&#039;QUESTION.D_Email.0&#039;]&amp;quot;).val();   &lt;br /&gt;
     if (!validateEmail(email))&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_InvalidEmailFormat);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     if ($(&amp;quot;input[name$=&#039;QUESTION.D_Email.1&#039;]&amp;quot;).val() != email)&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_EmailNotMatch);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
   return b;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code sample == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Remember to always test your work on these following cases:&lt;br /&gt;
*Display correctly as expected&lt;br /&gt;
*Save the right value in the right place&lt;br /&gt;
*Display previously saved values&lt;br /&gt;
*Validate inputs&lt;br /&gt;
*Update previously saved values&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23983</id>
		<title>Show more than one questions in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23983"/>
		<updated>2012-02-09T07:21:40Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Code example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
There is a common need of showing more than one questions in the same page, but unfortunately it is not supported by the current editor (we hope it will be possible with the new viewer in a near future)&lt;br /&gt;
&lt;br /&gt;
In the mean time, we need to have some work-arround tips to make it work.&lt;br /&gt;
&lt;br /&gt;
= Solution 1 : (old setup and not in use any longer) =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, there must be an input element added to that page&#039;s html with name following a specific format: non grid question should have name as QUESTION.question_label, grid questions use names as QUESTION.question_label.grid_index.&amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
Multi/Multi grid questions are special cases, it is not good enough if we only add checkboxes with the right name format, we also need to add one hidden input for each multi/multi grid&#039;s sub questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I want to show my single question labeled Q1 in another question with radio buttons, I need to make sure the HTML contains the following code for each answer option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option text 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 2:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a single grid question label Q1 in another question, I need to make sure the HTML contains the following code for each answer option and each sub question. Q1 has 2 answer options&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;2&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 3:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a multi question label Q1 in another question, Q1 has 2 answer options, I need to make sure the HTML contains the following code for each answer option. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore, we need to add an hidden input element like this.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are basically 3 ways of changing a question&#039;s HTML.&lt;br /&gt;
&lt;br /&gt;
== Use HTML ==&lt;br /&gt;
This one is obvious, you can use HTML Editor to edit a question&#039;s text to include other questions.&amp;lt;br/&amp;gt;&lt;br /&gt;
Due to the fact that non-page questions have specific generated HTML code based on their answer options, it is usually hard to inject other questions and to make it look nice enough. &amp;lt;br/&amp;gt;&lt;br /&gt;
This method is usualy used when using a page question to display other questions, and it is convenient to use when the requirements are complex and the texts are not likely to change much. This one is the fastest solution among 3&amp;lt;br/&amp;gt;&lt;br /&gt;
The disadvantage of this method is that it is difficult to modify if the HTML is too complex.&lt;br /&gt;
&lt;br /&gt;
== quest.onInit ==&lt;br /&gt;
This function is called after the HTML of the question is generated, therefore it is the best to use JQuery to insert the elements added to the HTML.&amp;lt;br/&amp;gt;&lt;br /&gt;
It would be useful to use tools like Firebug to know the ids/names of the elements where we want to insert.&amp;lt;br/&amp;gt;&lt;br /&gt;
This solution should be used when there is not much to change the existing HTML of the question, for example: we want to show a text grid question in another text grid question which has the same set of sub question texts.&lt;br /&gt;
&lt;br /&gt;
== quest.getHTML ==&lt;br /&gt;
This method is to override the HTML generated by the system. This is similar to the first solution, but different in several things: this can be used with any question types; it might be more difficult to start with and not as obvious; it is effective when there are lots of elements that should be generated are similar to each others (use loops)&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - some js samples&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Showhtmlcode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Solution 2 : =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, we will use 1 dummy question to store all question text, answer option text that we need to put and input them as JSON format. After that, we will load the value on this question via jquery to initialize the questions. &amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For e.g, I will add the text grid question for validating the email into another text grid question :&lt;br /&gt;
== Step 1 : Create a dummy text grid question for storing the email value==&lt;br /&gt;
&lt;br /&gt;
[[File:Text_grid_question.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Step 2 : Create a dummy text question for storing the JSON ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
string language = Context_getSelectedLanguage();&lt;br /&gt;
string label;&lt;br /&gt;
number i;&lt;br /&gt;
number n;&lt;br /&gt;
string result = &amp;quot;var q = {&amp;quot;;&lt;br /&gt;
string js;&lt;br /&gt;
array q;&lt;br /&gt;
//-------GENERATE JSON FOR Email QUESTION ----------&lt;br /&gt;
q = Question_getQuestion(&amp;quot;D_Email&amp;quot;, language);&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.0\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][0][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email0\\\&amp;quot;:&amp;quot; + js + &amp;quot;,&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.1\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][1][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email1\\\&amp;quot;:&amp;quot; + js ;&lt;br /&gt;
result = result + &amp;quot;}&amp;quot;;&lt;br /&gt;
D_InitializeJSON = result;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3 : Load the JSON on the destination question ==&lt;br /&gt;
On the destination question , open its JS tab and input the code like below : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
eval(&amp;quot;{{D_InitializeJSON}}&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
function TextQuestion(q, selectedValue)&lt;br /&gt;
{&lt;br /&gt;
   if (q.label.indexOf(&amp;quot;QUESTION.&amp;quot;) != -1)&lt;br /&gt;
      this.label = q.label;&lt;br /&gt;
   else&lt;br /&gt;
      this.label = &amp;quot;QUESTION.&amp;quot; + q.label;&lt;br /&gt;
   &lt;br /&gt;
   this.selectedValue = selectedValue;	   &lt;br /&gt;
   this.text = q.text;&lt;br /&gt;
   $(&amp;quot;input[name=&#039;&amp;quot; + this.label + &amp;quot;&#039;]&amp;quot;).val(selectedValue);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
TextQuestion.prototype.getHTML_Row = function(even)&lt;br /&gt;
{&lt;br /&gt;
   var row = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   var s;&lt;br /&gt;
   &lt;br /&gt;
   if (even)&lt;br /&gt;
      s = &amp;quot;even&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      s = &amp;quot;odd&amp;quot;;&lt;br /&gt;
   row.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).text(this.text).addClass(&amp;quot;grid_subquestion_text grid_subquestion_&amp;quot;+s));&lt;br /&gt;
   var input = $(&amp;quot;&amp;lt;input type = &#039;text&#039;&amp;gt;&amp;quot;);&lt;br /&gt;
   input.attr(&amp;quot;name&amp;quot;, this.label).val(this.selectedValue);&lt;br /&gt;
   row.append(&lt;br /&gt;
      $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).addClass(&amp;quot;grid_subquestion_&amp;quot;+ s)&lt;br /&gt;
      .append(input)&lt;br /&gt;
   );&lt;br /&gt;
&lt;br /&gt;
   return row;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email0, &amp;quot;{{D_Email[0].Value}}&amp;quot;).getHTML_Row(true));&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email1, &amp;quot;{{D_Email[1].Value}}&amp;quot;).getHTML_Row(false));      &lt;br /&gt;
&lt;br /&gt;
    $(&amp;quot;input:text&amp;quot;).width(&amp;quot;400px&amp;quot;);&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).find(&amp;quot;tr&amp;quot;).each(&lt;br /&gt;
      function(i)&lt;br /&gt;
      {&lt;br /&gt;
         if(i&amp;gt;3) i+=1;&lt;br /&gt;
         if(i%2==0)&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_odd&amp;quot;).addClass(&amp;quot;grid_subquestion_even&amp;quot;);&lt;br /&gt;
         else&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_even&amp;quot;).addClass(&amp;quot;grid_subquestion_odd&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
   ); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var defaultQuestionCheck = questioncheck;&lt;br /&gt;
var questioncheck = function()&lt;br /&gt;
{&lt;br /&gt;
   ErrorMessages.getInstance().clearErrorMessages();&lt;br /&gt;
   var b =true;&lt;br /&gt;
   if (!defaultQuestionCheck())&lt;br /&gt;
      return false;&lt;br /&gt;
     var email = $(&amp;quot;input[name$=&#039;QUESTION.D_Email.0&#039;]&amp;quot;).val();   &lt;br /&gt;
     if (!validateEmail(email))&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_InvalidEmailFormat);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     if ($(&amp;quot;input[name$=&#039;QUESTION.D_Email.1&#039;]&amp;quot;).val() != email)&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_EmailNotMatch);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
   return b;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - Show more than one questions in the same page&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Remember to always test your work on these following cases:&lt;br /&gt;
*Display correctly as expected&lt;br /&gt;
*Save the right value in the right place&lt;br /&gt;
*Display previously saved values&lt;br /&gt;
*Validate inputs&lt;br /&gt;
*Update previously saved values&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=23870</id>
		<title>CG0129inz - FÆRGEN A/S Kundepanel - Import email info to base questionnaire</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=23870"/>
		<updated>2012-02-06T07:14:32Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General information  ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;VerticalTable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt; &lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Site&amp;lt;br&amp;gt; &lt;br /&gt;
| inzights.catglobe.com&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Catinét project no&amp;lt;br&amp;gt; &lt;br /&gt;
| 0129inz&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Client&amp;lt;br&amp;gt; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== How to send out reminders  ==&lt;br /&gt;
&lt;br /&gt;
=== Goal  ===&lt;br /&gt;
&lt;br /&gt;
This is a standard setup to import the file which contains the email address to the base questionnaire then send the invitation to the imported email.&lt;br /&gt;
&lt;br /&gt;
=== How to do  ===&lt;br /&gt;
&lt;br /&gt;
The general solution is to execute the .exe program to upload the csv file. After it is uploaded, the workflow script will validate and import the uploaded info to the base questionnaire.&lt;br /&gt;
&lt;br /&gt;
==== Step 1&amp;amp;nbsp;: Create the list of email address  ====&lt;br /&gt;
&lt;br /&gt;
We create the &amp;quot;.csv&amp;quot; file containing the email address like&lt;br /&gt;
&lt;br /&gt;
[[Image:File_containing_the_email_address.jpg]] &lt;br /&gt;
&lt;br /&gt;
==== Step 2&amp;amp;nbsp;:Prepare the workflow script for solving the uploaded data ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
array a = Workflow_getParameters();&lt;br /&gt;
string csvData = a[0];&lt;br /&gt;
&lt;br /&gt;
number DCSRid = 1497859; // DCS : used for filtering the email. The real value should be : 1497858&lt;br /&gt;
number EmailgroupRid = 1497862; // EmailgroupRid : used for contatining the import Email.&lt;br /&gt;
number PQRid = 1497857; // PQRid: used for the imported PQ. The real value should be :  1289245&lt;br /&gt;
number bulkmailId = 1548; // bulkmailId : used for sending the invitation. The real value should be : 1549&lt;br /&gt;
DCS_use(DCSRid); &lt;br /&gt;
DCS_rebuild();&lt;br /&gt;
//Sub workflows for data resolve&lt;br /&gt;
number  info_wfrid = 1293521; //CG0129inz - FÆRGEN A/S Kundepanel - get info from the record on csv file&lt;br /&gt;
number validate_info_wfrid = 1497863; //CG0129inz - FÆRGEN A/S Kundepanel - Validate the email csv info&lt;br /&gt;
number optimize_wfRid = 1497864; //CG0129inz - FÆRGEN A/S Kundepanel - Optimize the email csv record&lt;br /&gt;
number createQAS_wfRid= 1497865; //CG0129inz - FÆRGEN A/S Kundepanel - create qas n base qnaire&lt;br /&gt;
number import_wfRid= 1497867; //CG0129inz - FÆRGEN A/S Kundepanel - Import email data&lt;br /&gt;
&lt;br /&gt;
array currentdatetime = getCurrentDateTime(Timezone_Romance_Standard_Time);&lt;br /&gt;
number currentvalue = currentdatetime[DateTime_Year]*10000 + currentdatetime[DateTime_Month]*100 + currentdatetime[DateTime_Day];&lt;br /&gt;
&lt;br /&gt;
//start get the upload csv file&lt;br /&gt;
string empt = empty;&lt;br /&gt;
CsvReader csv = new CsvReader(csvData, true, &amp;quot;;&amp;quot;, &amp;quot;&#039;&amp;quot;, &amp;quot;\&amp;quot;&amp;quot;, empt, true, false);&lt;br /&gt;
number fieldCount = csv.FieldCount;&lt;br /&gt;
array addToSurvey;&lt;br /&gt;
array headers = csv.Headers;&lt;br /&gt;
while(csv.ReadNextRecord()) {&lt;br /&gt;
Dictionary csvinfo = Workflow_call(info_wfrid, {fieldCount, headers, csv});&lt;br /&gt;
if (Workflow_call(validate_info_wfrid, {csvinfo,DCSRid})== true)&lt;br /&gt;
 {&lt;br /&gt;
	  addToSurvey.Add(csvinfo);&lt;br /&gt;
 }&lt;br /&gt;
}&lt;br /&gt;
if (isEmpty(addToSurvey) == false) &lt;br /&gt;
{&lt;br /&gt;
	//Remove the duplicate email&lt;br /&gt;
	addToSurvey = Workflow_call(optimize_wfRid,{addToSurvey});&lt;br /&gt;
	//create qas and import		&lt;br /&gt;
	addToSurvey  = Workflow_call(createQAS_wfRid,{PQRid,EmailgroupRid,addToSurvey});&lt;br /&gt;
	Workflow_call(import_wfRid,{addToSurvey,PQRid});&lt;br /&gt;
	//send bulkmail&lt;br /&gt;
	string guid = getResourceGuid(Resource_Type_BulkMail , bulkmailId);&lt;br /&gt;
	number bulkmailRid = getResourceUniqueIdFromGuid(guid);&lt;br /&gt;
	BulkMail_send(bulkmailRid);&lt;br /&gt;
}		&lt;br /&gt;
addJournal(1497860,54,&amp;quot;Comment&amp;quot;,&amp;quot;Import for &amp;quot; + convertToString(currentvalue) + &amp;quot; is done&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Step 3&amp;amp;nbsp;: Execute the program to upload the file  ====&lt;br /&gt;
&lt;br /&gt;
Open the command line, then Execute &amp;quot;SendFileToCatglobe.exe&amp;quot;. This program will need the params like below :&lt;br /&gt;
&lt;br /&gt;
* username : input the username for logging to the site where we input the workflow&lt;br /&gt;
* password : input the password for logging to the site where we input the workflow&lt;br /&gt;
* workflowrid : input the workflow resource id which we will execute when the file is uploaded&lt;br /&gt;
* url : the site URL where we input the workflow&lt;br /&gt;
* filename : the name of imported file. As usually, I always put the file in the same location with the program.&lt;br /&gt;
&lt;br /&gt;
Here is example : &lt;br /&gt;
&lt;br /&gt;
[[Image:Execute_the_program.jpg]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[category:Production guidelines]]&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=File:Execute_the_program.jpg&amp;diff=23868</id>
		<title>File:Execute the program.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=File:Execute_the_program.jpg&amp;diff=23868"/>
		<updated>2012-02-06T07:14:05Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=23865</id>
		<title>CG0129inz - FÆRGEN A/S Kundepanel - Import email info to base questionnaire</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=CG0129inz_-_F%C3%86RGEN_A/S_Kundepanel_-_Import_email_info_to_base_questionnaire&amp;diff=23865"/>
		<updated>2012-02-06T07:05:56Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: Created page with &amp;quot;== General information  ==  {| border=&amp;quot;1&amp;quot; class=&amp;quot;VerticalTable&amp;quot; |- ! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt;  ! style=&amp;quot;background-color: rgb(244,...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General information  ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;VerticalTable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt; &lt;br /&gt;
! style=&amp;quot;background-color: rgb(244, 219, 165); text-align: center;&amp;quot; | &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Site&amp;lt;br&amp;gt; &lt;br /&gt;
| inzights.catglobe.com&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Catinét project no&amp;lt;br&amp;gt; &lt;br /&gt;
| 0129inz&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Client&amp;lt;br&amp;gt; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== How to send out reminders  ==&lt;br /&gt;
&lt;br /&gt;
=== Goal  ===&lt;br /&gt;
&lt;br /&gt;
This is a standard setup to import the file which contains the email address to the base questionnaire then send the invitation to the imported email.&lt;br /&gt;
&lt;br /&gt;
=== How to do  ===&lt;br /&gt;
&lt;br /&gt;
The general solution is to execute the .exe program to upload the csv file. After it is uploaded, the workflow script will validate and import the uploaded info to the base questionnaire.&lt;br /&gt;
&lt;br /&gt;
==== Step 1&amp;amp;nbsp;: Create the list of email address  ====&lt;br /&gt;
&lt;br /&gt;
We create the &amp;quot;.csv&amp;quot; file containing the email address like&lt;br /&gt;
&lt;br /&gt;
[[Image:File_containing_the_email_address.jpg]] &lt;br /&gt;
&lt;br /&gt;
==== Step 2&amp;amp;nbsp;:Prepare the workflow script for solving the uploaded data ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
array a = Workflow_getParameters();&lt;br /&gt;
string csvData = a[0];&lt;br /&gt;
&lt;br /&gt;
number DCSRid = 1497859; // DCS : used for filtering the email. The real value should be : 1497858&lt;br /&gt;
number EmailgroupRid = 1497862; // EmailgroupRid : used for contatining the import Email.&lt;br /&gt;
number PQRid = 1497857; // PQRid: used for the imported PQ. The real value should be :  1289245&lt;br /&gt;
number bulkmailId = 1548; // bulkmailId : used for sending the invitation. The real value should be : 1549&lt;br /&gt;
DCS_use(DCSRid); &lt;br /&gt;
DCS_rebuild();&lt;br /&gt;
//Sub workflows for data resolve&lt;br /&gt;
number  info_wfrid = 1293521; //CG0129inz - FÆRGEN A/S Kundepanel - get info from the record on csv file&lt;br /&gt;
number validate_info_wfrid = 1497863; //CG0129inz - FÆRGEN A/S Kundepanel - Validate the email csv info&lt;br /&gt;
number optimize_wfRid = 1497864; //CG0129inz - FÆRGEN A/S Kundepanel - Optimize the email csv record&lt;br /&gt;
number createQAS_wfRid= 1497865; //CG0129inz - FÆRGEN A/S Kundepanel - create qas n base qnaire&lt;br /&gt;
number import_wfRid= 1497867; //CG0129inz - FÆRGEN A/S Kundepanel - Import email data&lt;br /&gt;
&lt;br /&gt;
array currentdatetime = getCurrentDateTime(Timezone_Romance_Standard_Time);&lt;br /&gt;
number currentvalue = currentdatetime[DateTime_Year]*10000 + currentdatetime[DateTime_Month]*100 + currentdatetime[DateTime_Day];&lt;br /&gt;
&lt;br /&gt;
//start get the upload csv file&lt;br /&gt;
string empt = empty;&lt;br /&gt;
CsvReader csv = new CsvReader(csvData, true, &amp;quot;;&amp;quot;, &amp;quot;&#039;&amp;quot;, &amp;quot;\&amp;quot;&amp;quot;, empt, true, false);&lt;br /&gt;
number fieldCount = csv.FieldCount;&lt;br /&gt;
array addToSurvey;&lt;br /&gt;
array headers = csv.Headers;&lt;br /&gt;
while(csv.ReadNextRecord()) {&lt;br /&gt;
Dictionary csvinfo = Workflow_call(info_wfrid, {fieldCount, headers, csv});&lt;br /&gt;
if (Workflow_call(validate_info_wfrid, {csvinfo,DCSRid})== true)&lt;br /&gt;
 {&lt;br /&gt;
	  addToSurvey.Add(csvinfo);&lt;br /&gt;
 }&lt;br /&gt;
}&lt;br /&gt;
if (isEmpty(addToSurvey) == false) &lt;br /&gt;
{&lt;br /&gt;
	//Remove the duplicate email&lt;br /&gt;
	addToSurvey = Workflow_call(optimize_wfRid,{addToSurvey});&lt;br /&gt;
	//create qas and import		&lt;br /&gt;
	addToSurvey  = Workflow_call(createQAS_wfRid,{PQRid,EmailgroupRid,addToSurvey});&lt;br /&gt;
	Workflow_call(import_wfRid,{addToSurvey,PQRid});&lt;br /&gt;
	//send bulkmail&lt;br /&gt;
	string guid = getResourceGuid(Resource_Type_BulkMail , bulkmailId);&lt;br /&gt;
	number bulkmailRid = getResourceUniqueIdFromGuid(guid);&lt;br /&gt;
	BulkMail_send(bulkmailRid);&lt;br /&gt;
}		&lt;br /&gt;
addJournal(1497860,54,&amp;quot;Comment&amp;quot;,&amp;quot;Import for &amp;quot; + convertToString(currentvalue) + &amp;quot; is done&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [[category:Production guidelines]]&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=File:File_containing_the_email_address.jpg&amp;diff=23859</id>
		<title>File:File containing the email address.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=File:File_containing_the_email_address.jpg&amp;diff=23859"/>
		<updated>2012-02-06T06:58:33Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=SendEmail&amp;diff=23834</id>
		<title>SendEmail</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=SendEmail&amp;diff=23834"/>
		<updated>2012-02-03T09:32:20Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* sendEmail */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Email_and_SMS_Functions]]&lt;br /&gt;
﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====sendEmail====&lt;br /&gt;
&lt;br /&gt;
Sends an email to another user. If the email has merge fields, it will be merged before sending.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(Note: all emails can be tracked in the communicator module)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
sendEmail(&#039;&#039;email, alias, subject, body[,fromemail]&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;email:&#039;&#039; Is an expression of string type. It is the receiver’s email address.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;alias:&#039;&#039; Is an expression of string type. It is the receiver’s alias name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;subject:&#039;&#039; Is an expression of string type. This is the email’s subject.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;body:&#039;&#039; Is an expression of string type. This is the email’s content.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;fromemail:&#039;&#039; Is an expression of string type. This is the From email’s address.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Examples&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
sendEmail(“some_email@somemail.com”, &amp;quot;somebody&amp;quot;, &amp;quot;test&amp;quot;, &amp;quot;This is a test&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
sendEmail(&amp;quot;some_email@somemail.com&amp;quot;, &amp;quot;somebody&amp;quot;, &amp;quot;test&amp;quot;, &amp;quot;This is a test&amp;quot;,&amp;quot;phong@maysunshine.vn&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 4.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 575.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23467</id>
		<title>Show more than one questions in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23467"/>
		<updated>2012-01-16T04:57:54Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Solutions 2 : */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
There is a common need of showing more than one questions in the same page, but unfortunately it is not supported by the current editor (we hope it will be possible with the new viewer in a near future)&lt;br /&gt;
&lt;br /&gt;
In the mean time, we need to have some work-arround tips to make it work.&lt;br /&gt;
&lt;br /&gt;
= Solution 1 : (old setup and not in use any longer) =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, there must be an input element added to that page&#039;s html with name following a specific format: non grid question should have name as QUESTION.question_label, grid questions use names as QUESTION.question_label.grid_index.&amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
Multi/Multi grid questions are special cases, it is not good enough if we only add checkboxes with the right name format, we also need to add one hidden input for each multi/multi grid&#039;s sub questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I want to show my single question labeled Q1 in another question with radio buttons, I need to make sure the HTML contains the following code for each answer option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option text 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 2:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a single grid question label Q1 in another question, I need to make sure the HTML contains the following code for each answer option and each sub question. Q1 has 2 answer options&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;2&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 3:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a multi question label Q1 in another question, Q1 has 2 answer options, I need to make sure the HTML contains the following code for each answer option. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore, we need to add an hidden input element like this.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are basically 3 ways of changing a question&#039;s HTML.&lt;br /&gt;
&lt;br /&gt;
== Use HTML ==&lt;br /&gt;
This one is obvious, you can use HTML Editor to edit a question&#039;s text to include other questions.&amp;lt;br/&amp;gt;&lt;br /&gt;
Due to the fact that non-page questions have specific generated HTML code based on their answer options, it is usually hard to inject other questions and to make it look nice enough. &amp;lt;br/&amp;gt;&lt;br /&gt;
This method is usualy used when using a page question to display other questions, and it is convenient to use when the requirements are complex and the texts are not likely to change much. This one is the fastest solution among 3&amp;lt;br/&amp;gt;&lt;br /&gt;
The disadvantage of this method is that it is difficult to modify if the HTML is too complex.&lt;br /&gt;
&lt;br /&gt;
== quest.onInit ==&lt;br /&gt;
This function is called after the HTML of the question is generated, therefore it is the best to use JQuery to insert the elements added to the HTML.&amp;lt;br/&amp;gt;&lt;br /&gt;
It would be useful to use tools like Firebug to know the ids/names of the elements where we want to insert.&amp;lt;br/&amp;gt;&lt;br /&gt;
This solution should be used when there is not much to change the existing HTML of the question, for example: we want to show a text grid question in another text grid question which has the same set of sub question texts.&lt;br /&gt;
&lt;br /&gt;
== quest.getHTML ==&lt;br /&gt;
This method is to override the HTML generated by the system. This is similar to the first solution, but different in several things: this can be used with any question types; it might be more difficult to start with and not as obvious; it is effective when there are lots of elements that should be generated are similar to each others (use loops)&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - Show more than one questions in the same page&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Showhtmlcode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Solution 2 : =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, we will use 1 dummy question to store all question text, answer option text that we need to put and input them as JSON format. After that, we will load the value on this question via jquery to initialize the questions. &amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For e.g, I will add the text grid question for validating the email into another text grid question :&lt;br /&gt;
== Step 1 : Create a dummy text grid question for storing the email value==&lt;br /&gt;
&lt;br /&gt;
[[File:Text_grid_question.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Step 2 : Create a dummy text question for storing the JSON ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
string language = Context_getSelectedLanguage();&lt;br /&gt;
string label;&lt;br /&gt;
number i;&lt;br /&gt;
number n;&lt;br /&gt;
string result = &amp;quot;var q = {&amp;quot;;&lt;br /&gt;
string js;&lt;br /&gt;
array q;&lt;br /&gt;
//-------GENERATE JSON FOR Email QUESTION ----------&lt;br /&gt;
q = Question_getQuestion(&amp;quot;D_Email&amp;quot;, language);&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.0\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][0][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email0\\\&amp;quot;:&amp;quot; + js + &amp;quot;,&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.1\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][1][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email1\\\&amp;quot;:&amp;quot; + js ;&lt;br /&gt;
result = result + &amp;quot;}&amp;quot;;&lt;br /&gt;
D_InitializeJSON = result;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3 : Load the JSON on the destination question ==&lt;br /&gt;
On the destination question , open its JS tab and input the code like below : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
eval(&amp;quot;{{D_InitializeJSON}}&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
function TextQuestion(q, selectedValue)&lt;br /&gt;
{&lt;br /&gt;
   if (q.label.indexOf(&amp;quot;QUESTION.&amp;quot;) != -1)&lt;br /&gt;
      this.label = q.label;&lt;br /&gt;
   else&lt;br /&gt;
      this.label = &amp;quot;QUESTION.&amp;quot; + q.label;&lt;br /&gt;
   &lt;br /&gt;
   this.selectedValue = selectedValue;	   &lt;br /&gt;
   this.text = q.text;&lt;br /&gt;
   $(&amp;quot;input[name=&#039;&amp;quot; + this.label + &amp;quot;&#039;]&amp;quot;).val(selectedValue);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
TextQuestion.prototype.getHTML_Row = function(even)&lt;br /&gt;
{&lt;br /&gt;
   var row = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   var s;&lt;br /&gt;
   &lt;br /&gt;
   if (even)&lt;br /&gt;
      s = &amp;quot;even&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      s = &amp;quot;odd&amp;quot;;&lt;br /&gt;
   row.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).text(this.text).addClass(&amp;quot;grid_subquestion_text grid_subquestion_&amp;quot;+s));&lt;br /&gt;
   var input = $(&amp;quot;&amp;lt;input type = &#039;text&#039;&amp;gt;&amp;quot;);&lt;br /&gt;
   input.attr(&amp;quot;name&amp;quot;, this.label).val(this.selectedValue);&lt;br /&gt;
   row.append(&lt;br /&gt;
      $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).addClass(&amp;quot;grid_subquestion_&amp;quot;+ s)&lt;br /&gt;
      .append(input)&lt;br /&gt;
   );&lt;br /&gt;
&lt;br /&gt;
   return row;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email0, &amp;quot;{{D_Email[0].Value}}&amp;quot;).getHTML_Row(true));&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email1, &amp;quot;{{D_Email[1].Value}}&amp;quot;).getHTML_Row(false));      &lt;br /&gt;
&lt;br /&gt;
    $(&amp;quot;input:text&amp;quot;).width(&amp;quot;400px&amp;quot;);&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).find(&amp;quot;tr&amp;quot;).each(&lt;br /&gt;
      function(i)&lt;br /&gt;
      {&lt;br /&gt;
         if(i&amp;gt;3) i+=1;&lt;br /&gt;
         if(i%2==0)&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_odd&amp;quot;).addClass(&amp;quot;grid_subquestion_even&amp;quot;);&lt;br /&gt;
         else&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_even&amp;quot;).addClass(&amp;quot;grid_subquestion_odd&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
   ); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var defaultQuestionCheck = questioncheck;&lt;br /&gt;
var questioncheck = function()&lt;br /&gt;
{&lt;br /&gt;
   ErrorMessages.getInstance().clearErrorMessages();&lt;br /&gt;
   var b =true;&lt;br /&gt;
   if (!defaultQuestionCheck())&lt;br /&gt;
      return false;&lt;br /&gt;
     var email = $(&amp;quot;input[name$=&#039;QUESTION.D_Email.0&#039;]&amp;quot;).val();   &lt;br /&gt;
     if (!validateEmail(email))&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_InvalidEmailFormat);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     if ($(&amp;quot;input[name$=&#039;QUESTION.D_Email.1&#039;]&amp;quot;).val() != email)&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_EmailNotMatch);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
   return b;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - Show more than one questions in the same page&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Remember to always test your work on these following cases:&lt;br /&gt;
*Display correctly as expected&lt;br /&gt;
*Save the right value in the right place&lt;br /&gt;
*Display previously saved values&lt;br /&gt;
*Validate inputs&lt;br /&gt;
*Update previously saved values&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23466</id>
		<title>Show more than one questions in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23466"/>
		<updated>2012-01-16T04:55:49Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Solutions 1 : (old setup and not in use any longer) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
There is a common need of showing more than one questions in the same page, but unfortunately it is not supported by the current editor (we hope it will be possible with the new viewer in a near future)&lt;br /&gt;
&lt;br /&gt;
In the mean time, we need to have some work-arround tips to make it work.&lt;br /&gt;
&lt;br /&gt;
= Solution 1 : (old setup and not in use any longer) =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, there must be an input element added to that page&#039;s html with name following a specific format: non grid question should have name as QUESTION.question_label, grid questions use names as QUESTION.question_label.grid_index.&amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
Multi/Multi grid questions are special cases, it is not good enough if we only add checkboxes with the right name format, we also need to add one hidden input for each multi/multi grid&#039;s sub questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I want to show my single question labeled Q1 in another question with radio buttons, I need to make sure the HTML contains the following code for each answer option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option text 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 2:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a single grid question label Q1 in another question, I need to make sure the HTML contains the following code for each answer option and each sub question. Q1 has 2 answer options&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;2&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 3:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a multi question label Q1 in another question, Q1 has 2 answer options, I need to make sure the HTML contains the following code for each answer option. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore, we need to add an hidden input element like this.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are basically 3 ways of changing a question&#039;s HTML.&lt;br /&gt;
&lt;br /&gt;
== Use HTML ==&lt;br /&gt;
This one is obvious, you can use HTML Editor to edit a question&#039;s text to include other questions.&amp;lt;br/&amp;gt;&lt;br /&gt;
Due to the fact that non-page questions have specific generated HTML code based on their answer options, it is usually hard to inject other questions and to make it look nice enough. &amp;lt;br/&amp;gt;&lt;br /&gt;
This method is usualy used when using a page question to display other questions, and it is convenient to use when the requirements are complex and the texts are not likely to change much. This one is the fastest solution among 3&amp;lt;br/&amp;gt;&lt;br /&gt;
The disadvantage of this method is that it is difficult to modify if the HTML is too complex.&lt;br /&gt;
&lt;br /&gt;
== quest.onInit ==&lt;br /&gt;
This function is called after the HTML of the question is generated, therefore it is the best to use JQuery to insert the elements added to the HTML.&amp;lt;br/&amp;gt;&lt;br /&gt;
It would be useful to use tools like Firebug to know the ids/names of the elements where we want to insert.&amp;lt;br/&amp;gt;&lt;br /&gt;
This solution should be used when there is not much to change the existing HTML of the question, for example: we want to show a text grid question in another text grid question which has the same set of sub question texts.&lt;br /&gt;
&lt;br /&gt;
== quest.getHTML ==&lt;br /&gt;
This method is to override the HTML generated by the system. This is similar to the first solution, but different in several things: this can be used with any question types; it might be more difficult to start with and not as obvious; it is effective when there are lots of elements that should be generated are similar to each others (use loops)&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - Show more than one questions in the same page&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Showhtmlcode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Solutions 2 : =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, we will use 1 dummy question to store all question text, answer option text that we need to put and input them as JSON format. After that, we will load the value on this question via jquery to initialize the questions. &amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For e.g, I will add the text grid question for validating the email into another text grid question :&lt;br /&gt;
== Step 1 : Create a dummy text grid question for storing the email value==&lt;br /&gt;
&lt;br /&gt;
[[File:Text_grid_question.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Step 2 : Create a dummy text question for storing the JSON ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
string language = Context_getSelectedLanguage();&lt;br /&gt;
string label;&lt;br /&gt;
number i;&lt;br /&gt;
number n;&lt;br /&gt;
string result = &amp;quot;var q = {&amp;quot;;&lt;br /&gt;
string js;&lt;br /&gt;
array q;&lt;br /&gt;
//-------GENERATE JSON FOR Email QUESTION ----------&lt;br /&gt;
q = Question_getQuestion(&amp;quot;D_Email&amp;quot;, language);&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.0\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][0][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email0\\\&amp;quot;:&amp;quot; + js + &amp;quot;,&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.1\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][1][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email1\\\&amp;quot;:&amp;quot; + js ;&lt;br /&gt;
result = result + &amp;quot;}&amp;quot;;&lt;br /&gt;
D_InitializeJSON = result;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3 : Load the JSON on the destination question ==&lt;br /&gt;
On the destination question , open its JS tab and input the code like below : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
eval(&amp;quot;{{D_InitializeJSON}}&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
function TextQuestion(q, selectedValue)&lt;br /&gt;
{&lt;br /&gt;
   if (q.label.indexOf(&amp;quot;QUESTION.&amp;quot;) != -1)&lt;br /&gt;
      this.label = q.label;&lt;br /&gt;
   else&lt;br /&gt;
      this.label = &amp;quot;QUESTION.&amp;quot; + q.label;&lt;br /&gt;
   &lt;br /&gt;
   this.selectedValue = selectedValue;	   &lt;br /&gt;
   this.text = q.text;&lt;br /&gt;
   $(&amp;quot;input[name=&#039;&amp;quot; + this.label + &amp;quot;&#039;]&amp;quot;).val(selectedValue);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
TextQuestion.prototype.getHTML_Row = function(even)&lt;br /&gt;
{&lt;br /&gt;
   var row = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   var s;&lt;br /&gt;
   &lt;br /&gt;
   if (even)&lt;br /&gt;
      s = &amp;quot;even&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      s = &amp;quot;odd&amp;quot;;&lt;br /&gt;
   row.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).text(this.text).addClass(&amp;quot;grid_subquestion_text grid_subquestion_&amp;quot;+s));&lt;br /&gt;
   var input = $(&amp;quot;&amp;lt;input type = &#039;text&#039;&amp;gt;&amp;quot;);&lt;br /&gt;
   input.attr(&amp;quot;name&amp;quot;, this.label).val(this.selectedValue);&lt;br /&gt;
   row.append(&lt;br /&gt;
      $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).addClass(&amp;quot;grid_subquestion_&amp;quot;+ s)&lt;br /&gt;
      .append(input)&lt;br /&gt;
   );&lt;br /&gt;
&lt;br /&gt;
   return row;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email0, &amp;quot;{{D_Email[0].Value}}&amp;quot;).getHTML_Row(true));&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email1, &amp;quot;{{D_Email[1].Value}}&amp;quot;).getHTML_Row(false));      &lt;br /&gt;
&lt;br /&gt;
    $(&amp;quot;input:text&amp;quot;).width(&amp;quot;400px&amp;quot;);&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).find(&amp;quot;tr&amp;quot;).each(&lt;br /&gt;
      function(i)&lt;br /&gt;
      {&lt;br /&gt;
         if(i&amp;gt;3) i+=1;&lt;br /&gt;
         if(i%2==0)&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_odd&amp;quot;).addClass(&amp;quot;grid_subquestion_even&amp;quot;);&lt;br /&gt;
         else&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_even&amp;quot;).addClass(&amp;quot;grid_subquestion_odd&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
   ); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var defaultQuestionCheck = questioncheck;&lt;br /&gt;
var questioncheck = function()&lt;br /&gt;
{&lt;br /&gt;
   ErrorMessages.getInstance().clearErrorMessages();&lt;br /&gt;
   var b =true;&lt;br /&gt;
   if (!defaultQuestionCheck())&lt;br /&gt;
      return false;&lt;br /&gt;
     var email = $(&amp;quot;input[name$=&#039;QUESTION.D_Email.0&#039;]&amp;quot;).val();   &lt;br /&gt;
     if (!validateEmail(email))&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_InvalidEmailFormat);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     if ($(&amp;quot;input[name$=&#039;QUESTION.D_Email.1&#039;]&amp;quot;).val() != email)&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_EmailNotMatch);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
   return b;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - Show more than one questions in the same page&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Remember to always test your work on these following cases:&lt;br /&gt;
*Display correctly as expected&lt;br /&gt;
*Save the right value in the right place&lt;br /&gt;
*Display previously saved values&lt;br /&gt;
*Validate inputs&lt;br /&gt;
*Update previously saved values&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23465</id>
		<title>Show more than one questions in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23465"/>
		<updated>2012-01-16T04:28:33Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Solutions 2 : */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
There is a common need of showing more than one questions in the same page, but unfortunately it is not supported by the current editor (we hope it will be possible with the new viewer in a near future)&lt;br /&gt;
&lt;br /&gt;
In the mean time, we need to have some work-arround tips to make it work.&lt;br /&gt;
&lt;br /&gt;
= Solutions 1 : (old setup and not in use any longer) =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, there must be an input element added to that page&#039;s html with name following a specific format: non grid question should have name as QUESTION.question_label, grid questions use names as QUESTION.question_label.grid_index.&amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
Multi/Multi grid questions are special cases, it is not good enough if we only add checkboxes with the right name format, we also need to add one hidden input for each multi/multi grid&#039;s sub questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I want to show my single question labeled Q1 in another question with radio buttons, I need to make sure the HTML contains the following code for each answer option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option text 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 2:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a single grid question label Q1 in another question, I need to make sure the HTML contains the following code for each answer option and each sub question. Q1 has 2 answer options&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;2&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 3:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a multi question label Q1 in another question, Q1 has 2 answer options, I need to make sure the HTML contains the following code for each answer option. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore, we need to add an hidden input element like this.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are basically 3 ways of changing a question&#039;s HTML.&lt;br /&gt;
&lt;br /&gt;
== Use HTML ==&lt;br /&gt;
This one is obvious, you can use HTML Editor to edit a question&#039;s text to include other questions.&amp;lt;br/&amp;gt;&lt;br /&gt;
Due to the fact that non-page questions have specific generated HTML code based on their answer options, it is usually hard to inject other questions and to make it look nice enough. &amp;lt;br/&amp;gt;&lt;br /&gt;
This method is usualy used when using a page question to display other questions, and it is convenient to use when the requirements are complex and the texts are not likely to change much. This one is the fastest solution among 3&amp;lt;br/&amp;gt;&lt;br /&gt;
The disadvantage of this method is that it is difficult to modify if the HTML is too complex.&lt;br /&gt;
&lt;br /&gt;
== quest.onInit ==&lt;br /&gt;
This function is called after the HTML of the question is generated, therefore it is the best to use JQuery to insert the elements added to the HTML.&amp;lt;br/&amp;gt;&lt;br /&gt;
It would be useful to use tools like Firebug to know the ids/names of the elements where we want to insert.&amp;lt;br/&amp;gt;&lt;br /&gt;
This solution should be used when there is not much to change the existing HTML of the question, for example: we want to show a text grid question in another text grid question which has the same set of sub question texts.&lt;br /&gt;
&lt;br /&gt;
== quest.getHTML ==&lt;br /&gt;
This method is to override the HTML generated by the system. This is similar to the first solution, but different in several things: this can be used with any question types; it might be more difficult to start with and not as obvious; it is effective when there are lots of elements that should be generated are similar to each others (use loops)&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - Show more than one questions in the same page&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Showhtmlcode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Solutions 2 : =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, we will use 1 dummy question to store all question text, answer option text that we need to put and input them as JSON format. After that, we will load the value on this question via jquery to initialize the questions. &amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For e.g, I will add the text grid question for validating the email into another text grid question :&lt;br /&gt;
== Step 1 : Create a dummy text grid question for storing the email value==&lt;br /&gt;
&lt;br /&gt;
[[File:Text_grid_question.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Step 2 : Create a dummy text question for storing the JSON ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
string language = Context_getSelectedLanguage();&lt;br /&gt;
string label;&lt;br /&gt;
number i;&lt;br /&gt;
number n;&lt;br /&gt;
string result = &amp;quot;var q = {&amp;quot;;&lt;br /&gt;
string js;&lt;br /&gt;
array q;&lt;br /&gt;
//-------GENERATE JSON FOR Email QUESTION ----------&lt;br /&gt;
q = Question_getQuestion(&amp;quot;D_Email&amp;quot;, language);&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.0\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][0][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email0\\\&amp;quot;:&amp;quot; + js + &amp;quot;,&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.1\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][1][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email1\\\&amp;quot;:&amp;quot; + js ;&lt;br /&gt;
result = result + &amp;quot;}&amp;quot;;&lt;br /&gt;
D_InitializeJSON = result;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3 : Load the JSON on the destination question ==&lt;br /&gt;
On the destination question , open its JS tab and input the code like below : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
eval(&amp;quot;{{D_InitializeJSON}}&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
function TextQuestion(q, selectedValue)&lt;br /&gt;
{&lt;br /&gt;
   if (q.label.indexOf(&amp;quot;QUESTION.&amp;quot;) != -1)&lt;br /&gt;
      this.label = q.label;&lt;br /&gt;
   else&lt;br /&gt;
      this.label = &amp;quot;QUESTION.&amp;quot; + q.label;&lt;br /&gt;
   &lt;br /&gt;
   this.selectedValue = selectedValue;	   &lt;br /&gt;
   this.text = q.text;&lt;br /&gt;
   $(&amp;quot;input[name=&#039;&amp;quot; + this.label + &amp;quot;&#039;]&amp;quot;).val(selectedValue);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
TextQuestion.prototype.getHTML_Row = function(even)&lt;br /&gt;
{&lt;br /&gt;
   var row = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   var s;&lt;br /&gt;
   &lt;br /&gt;
   if (even)&lt;br /&gt;
      s = &amp;quot;even&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      s = &amp;quot;odd&amp;quot;;&lt;br /&gt;
   row.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).text(this.text).addClass(&amp;quot;grid_subquestion_text grid_subquestion_&amp;quot;+s));&lt;br /&gt;
   var input = $(&amp;quot;&amp;lt;input type = &#039;text&#039;&amp;gt;&amp;quot;);&lt;br /&gt;
   input.attr(&amp;quot;name&amp;quot;, this.label).val(this.selectedValue);&lt;br /&gt;
   row.append(&lt;br /&gt;
      $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).addClass(&amp;quot;grid_subquestion_&amp;quot;+ s)&lt;br /&gt;
      .append(input)&lt;br /&gt;
   );&lt;br /&gt;
&lt;br /&gt;
   return row;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email0, &amp;quot;{{D_Email[0].Value}}&amp;quot;).getHTML_Row(true));&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email1, &amp;quot;{{D_Email[1].Value}}&amp;quot;).getHTML_Row(false));      &lt;br /&gt;
&lt;br /&gt;
    $(&amp;quot;input:text&amp;quot;).width(&amp;quot;400px&amp;quot;);&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).find(&amp;quot;tr&amp;quot;).each(&lt;br /&gt;
      function(i)&lt;br /&gt;
      {&lt;br /&gt;
         if(i&amp;gt;3) i+=1;&lt;br /&gt;
         if(i%2==0)&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_odd&amp;quot;).addClass(&amp;quot;grid_subquestion_even&amp;quot;);&lt;br /&gt;
         else&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_even&amp;quot;).addClass(&amp;quot;grid_subquestion_odd&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
   ); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var defaultQuestionCheck = questioncheck;&lt;br /&gt;
var questioncheck = function()&lt;br /&gt;
{&lt;br /&gt;
   ErrorMessages.getInstance().clearErrorMessages();&lt;br /&gt;
   var b =true;&lt;br /&gt;
   if (!defaultQuestionCheck())&lt;br /&gt;
      return false;&lt;br /&gt;
     var email = $(&amp;quot;input[name$=&#039;QUESTION.D_Email.0&#039;]&amp;quot;).val();   &lt;br /&gt;
     if (!validateEmail(email))&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_InvalidEmailFormat);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     if ($(&amp;quot;input[name$=&#039;QUESTION.D_Email.1&#039;]&amp;quot;).val() != email)&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_EmailNotMatch);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
   return b;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - Show more than one questions in the same page&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Q1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Remember to always test your work on these following cases:&lt;br /&gt;
*Display correctly as expected&lt;br /&gt;
*Save the right value in the right place&lt;br /&gt;
*Display previously saved values&lt;br /&gt;
*Validate inputs&lt;br /&gt;
*Update previously saved values&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23464</id>
		<title>Show more than one questions in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23464"/>
		<updated>2012-01-16T04:22:25Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Solutions 2 : */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
There is a common need of showing more than one questions in the same page, but unfortunately it is not supported by the current editor (we hope it will be possible with the new viewer in a near future)&lt;br /&gt;
&lt;br /&gt;
In the mean time, we need to have some work-arround tips to make it work.&lt;br /&gt;
&lt;br /&gt;
= Solutions 1 : (old setup and not in use any longer) =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, there must be an input element added to that page&#039;s html with name following a specific format: non grid question should have name as QUESTION.question_label, grid questions use names as QUESTION.question_label.grid_index.&amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
Multi/Multi grid questions are special cases, it is not good enough if we only add checkboxes with the right name format, we also need to add one hidden input for each multi/multi grid&#039;s sub questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I want to show my single question labeled Q1 in another question with radio buttons, I need to make sure the HTML contains the following code for each answer option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option text 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 2:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a single grid question label Q1 in another question, I need to make sure the HTML contains the following code for each answer option and each sub question. Q1 has 2 answer options&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;2&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 3:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a multi question label Q1 in another question, Q1 has 2 answer options, I need to make sure the HTML contains the following code for each answer option. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore, we need to add an hidden input element like this.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are basically 3 ways of changing a question&#039;s HTML.&lt;br /&gt;
&lt;br /&gt;
== Use HTML ==&lt;br /&gt;
This one is obvious, you can use HTML Editor to edit a question&#039;s text to include other questions.&amp;lt;br/&amp;gt;&lt;br /&gt;
Due to the fact that non-page questions have specific generated HTML code based on their answer options, it is usually hard to inject other questions and to make it look nice enough. &amp;lt;br/&amp;gt;&lt;br /&gt;
This method is usualy used when using a page question to display other questions, and it is convenient to use when the requirements are complex and the texts are not likely to change much. This one is the fastest solution among 3&amp;lt;br/&amp;gt;&lt;br /&gt;
The disadvantage of this method is that it is difficult to modify if the HTML is too complex.&lt;br /&gt;
&lt;br /&gt;
== quest.onInit ==&lt;br /&gt;
This function is called after the HTML of the question is generated, therefore it is the best to use JQuery to insert the elements added to the HTML.&amp;lt;br/&amp;gt;&lt;br /&gt;
It would be useful to use tools like Firebug to know the ids/names of the elements where we want to insert.&amp;lt;br/&amp;gt;&lt;br /&gt;
This solution should be used when there is not much to change the existing HTML of the question, for example: we want to show a text grid question in another text grid question which has the same set of sub question texts.&lt;br /&gt;
&lt;br /&gt;
== quest.getHTML ==&lt;br /&gt;
This method is to override the HTML generated by the system. This is similar to the first solution, but different in several things: this can be used with any question types; it might be more difficult to start with and not as obvious; it is effective when there are lots of elements that should be generated are similar to each others (use loops)&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - Show more than one questions in the same page&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Showhtmlcode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Solutions 2 : =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, we will use 1 dummy question to store all question text, answer option text that we need to put and input them as JSON format. After that, we will load the value on this question via jquery to initialize the questions. &amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For e.g, I will add the text grid question for validating the email into another text grid question :&lt;br /&gt;
== Step 1 : Create a dummy text grid question for storing the email value==&lt;br /&gt;
&lt;br /&gt;
[[File:Text_grid_question.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Step 2 : Create a dummy text question for storing the JSON ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
string language = Context_getSelectedLanguage();&lt;br /&gt;
string label;&lt;br /&gt;
number i;&lt;br /&gt;
number n;&lt;br /&gt;
string result = &amp;quot;var q = {&amp;quot;;&lt;br /&gt;
string js;&lt;br /&gt;
array q;&lt;br /&gt;
//-------GENERATE JSON FOR Email QUESTION ----------&lt;br /&gt;
q = Question_getQuestion(&amp;quot;D_Email&amp;quot;, language);&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.0\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][0][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email0\\\&amp;quot;:&amp;quot; + js + &amp;quot;,&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
js = &amp;quot;{&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;label\\\&amp;quot;:\\\&amp;quot;D_Email.1\\\&amp;quot;,&amp;quot;&lt;br /&gt;
 + &amp;quot;\\\&amp;quot;text\\\&amp;quot;:\\\&amp;quot;&amp;quot; + decodeHtmlEntities(stripHtml(q[QUESTION_SUB_QUESTIONS][1][SUBQUESTION_TEXT])) + &amp;quot;\\\&amp;quot;&amp;quot;&lt;br /&gt;
 + &amp;quot;}&amp;quot;;&lt;br /&gt;
result = result + &amp;quot;\\\&amp;quot;email1\\\&amp;quot;:&amp;quot; + js ;&lt;br /&gt;
result = result + &amp;quot;}&amp;quot;;&lt;br /&gt;
D_InitializeJSON = result;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3 : Load the JSON on the destination question ==&lt;br /&gt;
On the destination question , open its JS tab and input the code like below : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
eval(&amp;quot;{{D_InitializeJSON}}&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
function TextQuestion(q, selectedValue)&lt;br /&gt;
{&lt;br /&gt;
   if (q.label.indexOf(&amp;quot;QUESTION.&amp;quot;) != -1)&lt;br /&gt;
      this.label = q.label;&lt;br /&gt;
   else&lt;br /&gt;
      this.label = &amp;quot;QUESTION.&amp;quot; + q.label;&lt;br /&gt;
   &lt;br /&gt;
   this.selectedValue = selectedValue;	   &lt;br /&gt;
   this.text = q.text;&lt;br /&gt;
   $(&amp;quot;input[name=&#039;&amp;quot; + this.label + &amp;quot;&#039;]&amp;quot;).val(selectedValue);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
TextQuestion.prototype.getHTML_Row = function(even)&lt;br /&gt;
{&lt;br /&gt;
   var row = $(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);&lt;br /&gt;
   var s;&lt;br /&gt;
   &lt;br /&gt;
   if (even)&lt;br /&gt;
      s = &amp;quot;even&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      s = &amp;quot;odd&amp;quot;;&lt;br /&gt;
   row.append($(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).text(this.text).addClass(&amp;quot;grid_subquestion_text grid_subquestion_&amp;quot;+s));&lt;br /&gt;
   var input = $(&amp;quot;&amp;lt;input type = &#039;text&#039;&amp;gt;&amp;quot;);&lt;br /&gt;
   input.attr(&amp;quot;name&amp;quot;, this.label).val(this.selectedValue);&lt;br /&gt;
   row.append(&lt;br /&gt;
      $(&amp;quot;&amp;lt;td&amp;gt;&amp;quot;).addClass(&amp;quot;grid_subquestion_&amp;quot;+ s)&lt;br /&gt;
      .append(input)&lt;br /&gt;
   );&lt;br /&gt;
&lt;br /&gt;
   return row;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
quest.onInit = function()&lt;br /&gt;
{&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email0, &amp;quot;{{D_Email[0].Value}}&amp;quot;).getHTML_Row(true));&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).append(new TextQuestion(q.email1, &amp;quot;{{D_Email[1].Value}}&amp;quot;).getHTML_Row(false));      &lt;br /&gt;
&lt;br /&gt;
    $(&amp;quot;input:text&amp;quot;).width(&amp;quot;400px&amp;quot;);&lt;br /&gt;
    $(&amp;quot;.grid_inner&amp;quot;).find(&amp;quot;tr&amp;quot;).each(&lt;br /&gt;
      function(i)&lt;br /&gt;
      {&lt;br /&gt;
         if(i&amp;gt;3) i+=1;&lt;br /&gt;
         if(i%2==0)&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_odd&amp;quot;).addClass(&amp;quot;grid_subquestion_even&amp;quot;);&lt;br /&gt;
         else&lt;br /&gt;
            $(this).children().removeClass(&amp;quot;grid_subquestion_even&amp;quot;).addClass(&amp;quot;grid_subquestion_odd&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
   ); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var defaultQuestionCheck = questioncheck;&lt;br /&gt;
var questioncheck = function()&lt;br /&gt;
{&lt;br /&gt;
   ErrorMessages.getInstance().clearErrorMessages();&lt;br /&gt;
   var b =true;&lt;br /&gt;
   if (!defaultQuestionCheck())&lt;br /&gt;
      return false;&lt;br /&gt;
     var email = $(&amp;quot;input[name$=&#039;QUESTION.D_Email.0&#039;]&amp;quot;).val();   &lt;br /&gt;
     if (!validateEmail(email))&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_InvalidEmailFormat);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     if ($(&amp;quot;input[name$=&#039;QUESTION.D_Email.1&#039;]&amp;quot;).val() != email)&lt;br /&gt;
     {&lt;br /&gt;
        ErrorMessages.getInstance().showErrorMessage(ErrorMessage_EmailNotMatch);&lt;br /&gt;
        b= false;&lt;br /&gt;
     }&lt;br /&gt;
   return b;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Remember to always test your work on these following cases:&lt;br /&gt;
*Display correctly as expected&lt;br /&gt;
*Save the right value in the right place&lt;br /&gt;
*Display previously saved values&lt;br /&gt;
*Validate inputs&lt;br /&gt;
*Update previously saved values&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=File:Text_grid_question.jpg&amp;diff=23463</id>
		<title>File:Text grid question.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=File:Text_grid_question.jpg&amp;diff=23463"/>
		<updated>2012-01-16T04:11:13Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23462</id>
		<title>Show more than one questions in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23462"/>
		<updated>2012-01-13T07:50:40Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
There is a common need of showing more than one questions in the same page, but unfortunately it is not supported by the current editor (we hope it will be possible with the new viewer in a near future)&lt;br /&gt;
&lt;br /&gt;
In the mean time, we need to have some work-arround tips to make it work.&lt;br /&gt;
&lt;br /&gt;
= Solutions 1 : (old setup and not in use any longer) =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, there must be an input element added to that page&#039;s html with name following a specific format: non grid question should have name as QUESTION.question_label, grid questions use names as QUESTION.question_label.grid_index.&amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
Multi/Multi grid questions are special cases, it is not good enough if we only add checkboxes with the right name format, we also need to add one hidden input for each multi/multi grid&#039;s sub questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I want to show my single question labeled Q1 in another question with radio buttons, I need to make sure the HTML contains the following code for each answer option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option text 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 2:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a single grid question label Q1 in another question, I need to make sure the HTML contains the following code for each answer option and each sub question. Q1 has 2 answer options&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;2&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 3:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a multi question label Q1 in another question, Q1 has 2 answer options, I need to make sure the HTML contains the following code for each answer option. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore, we need to add an hidden input element like this.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are basically 3 ways of changing a question&#039;s HTML.&lt;br /&gt;
&lt;br /&gt;
== Use HTML ==&lt;br /&gt;
This one is obvious, you can use HTML Editor to edit a question&#039;s text to include other questions.&amp;lt;br/&amp;gt;&lt;br /&gt;
Due to the fact that non-page questions have specific generated HTML code based on their answer options, it is usually hard to inject other questions and to make it look nice enough. &amp;lt;br/&amp;gt;&lt;br /&gt;
This method is usualy used when using a page question to display other questions, and it is convenient to use when the requirements are complex and the texts are not likely to change much. This one is the fastest solution among 3&amp;lt;br/&amp;gt;&lt;br /&gt;
The disadvantage of this method is that it is difficult to modify if the HTML is too complex.&lt;br /&gt;
&lt;br /&gt;
== quest.onInit ==&lt;br /&gt;
This function is called after the HTML of the question is generated, therefore it is the best to use JQuery to insert the elements added to the HTML.&amp;lt;br/&amp;gt;&lt;br /&gt;
It would be useful to use tools like Firebug to know the ids/names of the elements where we want to insert.&amp;lt;br/&amp;gt;&lt;br /&gt;
This solution should be used when there is not much to change the existing HTML of the question, for example: we want to show a text grid question in another text grid question which has the same set of sub question texts.&lt;br /&gt;
&lt;br /&gt;
== quest.getHTML ==&lt;br /&gt;
This method is to override the HTML generated by the system. This is similar to the first solution, but different in several things: this can be used with any question types; it might be more difficult to start with and not as obvious; it is effective when there are lots of elements that should be generated are similar to each others (use loops)&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - Show more than one questions in the same page&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Showhtmlcode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= Solutions 2 : =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, we will use 1 dummy question to store all question text, answer option text that we need to put and input them as JSON format. After that, we will load the value on this question via jquery to initialize the questions. &amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
update...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
update...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use HTML ==&lt;br /&gt;
update...&lt;br /&gt;
&lt;br /&gt;
== quest.onInit ==&lt;br /&gt;
update...&lt;br /&gt;
&lt;br /&gt;
== quest.getHTML ==&lt;br /&gt;
update...&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
update...&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Remember to always test your work on these following cases:&lt;br /&gt;
*Display correctly as expected&lt;br /&gt;
*Save the right value in the right place&lt;br /&gt;
*Display previously saved values&lt;br /&gt;
*Validate inputs&lt;br /&gt;
*Update previously saved values&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23461</id>
		<title>Show more than one questions in the same page</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Show_more_than_one_questions_in_the_same_page&amp;diff=23461"/>
		<updated>2012-01-13T07:33:49Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: /* Solutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
There is a common need of showing more than one questions in the same page, but unfortunately it is not supported by the current editor (we hope it will be possible with the new viewer in a near future)&lt;br /&gt;
&lt;br /&gt;
In the mean time, we need to have some work-arround tips to make it work.&lt;br /&gt;
&lt;br /&gt;
= Solutions 1 : (old setup and not in use any longer) =&lt;br /&gt;
&lt;br /&gt;
The main idea is that when&amp;amp;nbsp;we want to display a question not in its own page, there must be an input element added to that page&#039;s html with name following a specific format: non grid question should have name as QUESTION.question_label, grid questions use names as QUESTION.question_label.grid_index.&amp;lt;br/&amp;gt;&lt;br /&gt;
It is very important that questions to be displayed in other pages must be made as DUMMY.&amp;lt;br/&amp;gt;&lt;br /&gt;
Multi/Multi grid questions are special cases, it is not good enough if we only add checkboxes with the right name format, we also need to add one hidden input for each multi/multi grid&#039;s sub questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I want to show my single question labeled Q1 in another question with radio buttons, I need to make sure the HTML contains the following code for each answer option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option text 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 2:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a single grid question label Q1 in another question, I need to make sure the HTML contains the following code for each answer option and each sub question. Q1 has 2 answer options&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;2&amp;quot; name=&amp;quot;QUESTION.Q1.0&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 3:&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
I want to show a multi question label Q1 in another question, Q1 has 2 answer options, I need to make sure the HTML contains the following code for each answer option. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;lt;td width=&amp;quot;16px&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      Answer option 1&lt;br /&gt;
   &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore, we need to add an hidden input element like this.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;QUESTION.Q1&amp;quot;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are basically 3 ways of changing a question&#039;s HTML.&lt;br /&gt;
&lt;br /&gt;
== Use HTML ==&lt;br /&gt;
This one is obvious, you can use HTML Editor to edit a question&#039;s text to include other questions.&amp;lt;br/&amp;gt;&lt;br /&gt;
Due to the fact that non-page questions have specific generated HTML code based on their answer options, it is usually hard to inject other questions and to make it look nice enough. &amp;lt;br/&amp;gt;&lt;br /&gt;
This method is usualy used when using a page question to display other questions, and it is convenient to use when the requirements are complex and the texts are not likely to change much. This one is the fastest solution among 3&amp;lt;br/&amp;gt;&lt;br /&gt;
The disadvantage of this method is that it is difficult to modify if the HTML is too complex.&lt;br /&gt;
&lt;br /&gt;
== quest.onInit ==&lt;br /&gt;
This function is called after the HTML of the question is generated, therefore it is the best to use JQuery to insert the elements added to the HTML.&amp;lt;br/&amp;gt;&lt;br /&gt;
It would be useful to use tools like Firebug to know the ids/names of the elements where we want to insert.&amp;lt;br/&amp;gt;&lt;br /&gt;
This solution should be used when there is not much to change the existing HTML of the question, for example: we want to show a text grid question in another text grid question which has the same set of sub question texts.&lt;br /&gt;
&lt;br /&gt;
== quest.getHTML ==&lt;br /&gt;
This method is to override the HTML generated by the system. This is similar to the first solution, but different in several things: this can be used with any question types; it might be more difficult to start with and not as obvious; it is effective when there are lots of elements that should be generated are similar to each others (use loops)&lt;br /&gt;
&lt;br /&gt;
== Code example == &lt;br /&gt;
Open the qnaire &amp;quot;Js demo - Show more than one questions in the same page&amp;quot; (Resource Id: 159684). View the Question &amp;quot;Showhtmlcode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Remember to always test your work on these following cases:&lt;br /&gt;
*Display correctly as expected&lt;br /&gt;
*Save the right value in the right place&lt;br /&gt;
*Display previously saved values&lt;br /&gt;
*Validate inputs&lt;br /&gt;
*Update previously saved values&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=TopAnswers&amp;diff=23224</id>
		<title>TopAnswers</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=TopAnswers&amp;diff=23224"/>
		<updated>2012-01-04T04:58:03Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Question_getTopSelectedAnswers====&lt;br /&gt;
&lt;br /&gt;
Returns an array of answers using an existing multi question, where the returned array will be a subset of the original question values filtered using a position and length parameter.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Question_getTopSelectedAnswers(&#039;&#039;questionName,position,length[,index]&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;questionName&#039;&#039;: String - An existing multi question label or multi grid question label in the context questionnaire.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;position&#039;&#039;: Number from 0 and up. Defines the first answer that will be included in the new array from the original data.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;length: &#039;&#039;Number from 1 and up. Defines the number of answers to be included in the new array as starting from the position in the original data.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;index&#039;&#039;: A sub question index to be used for multi grid questions. If omitted, we will get array returned from all sub questions of the multi grid question.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Examples&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Question_getTopSelectedAnswers(originalmulti,1,1)&lt;br /&gt;
&lt;br /&gt;
// given that the &#039;&#039;originalmulti&#039;&#039; question is Multi question&lt;br /&gt;
&lt;br /&gt;
... [1,2,3,4,5] then returned array becomes [2]&lt;br /&gt;
&lt;br /&gt;
... [5,4,3,2,1] then returned array becomes [4]&lt;br /&gt;
&lt;br /&gt;
... [1,2,3] then returned array becomes [2]&lt;br /&gt;
&lt;br /&gt;
... [5,4,3] then returned array becomes [4]&lt;br /&gt;
&lt;br /&gt;
... [1,2] then returned array becomes [2]&lt;br /&gt;
&lt;br /&gt;
... [2] then returned array becomes []&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.6&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 5887.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=SetRPQStatus&amp;diff=23207</id>
		<title>SetRPQStatus</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=SetRPQStatus&amp;diff=23207"/>
		<updated>2012-01-04T04:12:37Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====setRPQStatus====&lt;br /&gt;
&lt;br /&gt;
Sets the status for the current questionnaire answer sheet context.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
setRPQStatus(&#039;&#039;new_status&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;new_status&#039;&#039;: Is a numeric (non-decimal) expression. It can be a built-in constant:&lt;br /&gt;
&lt;br /&gt;
RPQ_Status_Normal = 1,&lt;br /&gt;
&lt;br /&gt;
RPQ_Status_QuotaFull = 2,&lt;br /&gt;
&lt;br /&gt;
RPQ_Status_OutsideTarget = 3,&lt;br /&gt;
&lt;br /&gt;
RPQ_Status_InterviewFailed = 4,&lt;br /&gt;
&lt;br /&gt;
RPQ_Status_InterviewSucceeded = 5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
setRPQStatus(RPQ_Status_QuotaFull);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.0&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 632.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=SetProjectQuestionnaireStatus&amp;diff=23206</id>
		<title>SetProjectQuestionnaireStatus</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=SetProjectQuestionnaireStatus&amp;diff=23206"/>
		<updated>2012-01-03T11:16:53Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====setProjectQuestionnaireStatus====&lt;br /&gt;
&lt;br /&gt;
Set the status of the current questionnaire. The project questionnaire context is required&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
setProjectQuestionnaireStatus(&#039;&#039;status&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;status&#039;&#039;: is a number expression. It should be one of the pre-defined enumerations:&lt;br /&gt;
&lt;br /&gt;
ProjectQuestionnaire_Status_NotSet : 0&lt;br /&gt;
&lt;br /&gt;
ProjectQuestionnaire_Status_Closed : 1&lt;br /&gt;
&lt;br /&gt;
ProjectQuestionnaire_Status_Paused : 2&lt;br /&gt;
&lt;br /&gt;
ProjectQuestionnaire_Status_Open : 3&lt;br /&gt;
&lt;br /&gt;
ProjectQuestionnaire_Status_OpenForTest : 4&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
setProjectQuestionnaireStatus(ProjectQuestionnaire_Status_Open);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.2&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 652.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=ReturnFromGoto&amp;diff=23205</id>
		<title>ReturnFromGoto</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=ReturnFromGoto&amp;diff=23205"/>
		<updated>2012-01-03T10:53:40Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
=returnFromGoto=&lt;br /&gt;
&lt;br /&gt;
Go back to the context that call the gotoQuestionnaire or gotoQuestion functions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
returnFromGoto()&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_updateQuotaForAllQASs&amp;diff=23204</id>
		<title>Quota updateQuotaForAllQASs</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_updateQuotaForAllQASs&amp;diff=23204"/>
		<updated>2012-01-03T10:43:25Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Quota_updateQuotaForAllQASs====&lt;br /&gt;
&lt;br /&gt;
To update specified quota through all QASs of questionnaire..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty Quota_updateQuotaForAllQASs(string quotaName[,number PQResourceId]);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- quotaName : the name of quota.&lt;br /&gt;
&lt;br /&gt;
- PQResourceId : Resource Id of questionnaire to which quota belongs. If it is empty, the project questionnaire context is required&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Quota_updateQuotaForAllQASs(&amp;quot;male&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8029.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_updateQuota&amp;diff=23203</id>
		<title>Quota updateQuota</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_updateQuota&amp;diff=23203"/>
		<updated>2012-01-03T10:39:27Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Quota_updateQuota====&lt;br /&gt;
&lt;br /&gt;
To update the specified quota through the specified QAS. This function requires the project questionnaire context&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty Quota_updateQuota(string quotaName).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
quotaName : the name of quota.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
setRPQId(28428305);//RPQId of questionnaire &amp;quot;hquest108&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Quota_updateQuota(&amp;quot;female&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8027.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_updateAllQuotas&amp;diff=23201</id>
		<title>Quota updateAllQuotas</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_updateAllQuotas&amp;diff=23201"/>
		<updated>2012-01-03T10:25:24Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Quota_updateAllQuotas====&lt;br /&gt;
&lt;br /&gt;
To update all quotas of questionnaire through the specified QAS. This function requires the project questionnaire context&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty Quota_updateAllQuotas()&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
setRPQId(28428305);//RPQId of questionnaire &amp;quot;hquest108&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Quota_updateAllQuotas();&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8028.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_targetReached&amp;diff=23195</id>
		<title>Quota targetReached</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_targetReached&amp;diff=23195"/>
		<updated>2012-01-03T10:16:40Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Quota_targetReached====&lt;br /&gt;
&lt;br /&gt;
To check whether one quota of a questionnaire reaches its target..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
bool Quota_targetReached(string quotaName[, number PQResourceId])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- quotaName : the name of quota.&lt;br /&gt;
&lt;br /&gt;
- PQResourceId : Resource id of questionnaire to which quota belongs.If it is empty, the project questionnaire context is required&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
bool&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
bool a= Quota_targetReached(&amp;quot;male&amp;quot;,34806989);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8025.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_new&amp;diff=23186</id>
		<title>Quota new</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_new&amp;diff=23186"/>
		<updated>2012-01-03T09:57:42Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;﻿﻿{{HelpFiles}} &lt;br /&gt;
&lt;br /&gt;
==== Quota_new  ====&lt;br /&gt;
&lt;br /&gt;
To create a new quota object. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
array Quota_new(string quotaName, number quotaTarget, string quotaExpression[, number PQResourceId]) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
- quotaName&amp;amp;nbsp;: the name of new quota. &lt;br /&gt;
&lt;br /&gt;
- quotaTarget&amp;amp;nbsp;: the target of quota. &lt;br /&gt;
&lt;br /&gt;
- quotaExpression&amp;amp;nbsp;: the expression of quota. &lt;br /&gt;
&lt;br /&gt;
- PQResourceId&amp;amp;nbsp;: Resource Id of questionnaire to which quota belongs. If it&#039;s empty, the project questionnaire context is needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
array &lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;651&amp;quot; class=&amp;quot;tableintopic&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1); border-collapse: collapse;&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; bgcolor=&amp;quot;#bfbfbf&amp;quot; | &lt;br /&gt;
&#039;&#039;&#039;Index&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; bgcolor=&amp;quot;#bfbfbf&amp;quot; | &lt;br /&gt;
&#039;&#039;&#039;Data type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; bgcolor=&amp;quot;#bfbfbf&amp;quot; | &lt;br /&gt;
&#039;&#039;&#039;Initial value&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[OBJECT_TYPE]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
number&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
Quota object&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[QUOTA_ID]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
number&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
0&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[QUOTA_NAME]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
string&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
Entered value&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[QUOTA_TARGET]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
number&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
Entered value&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[QUOTA_EXPRESSION]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
string&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
Entered value&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[QUOTA_QUESTIONNAIRE_RESOURCE_ID]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
number&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
Entered value ( current PQ resource id if no entered value)&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[QUOTA_DESCRIPTION]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
string&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
empty string&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[QUOTA_PRESTRATIFICATION]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
bool&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
FALSE&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[QUOTA_DISABLED]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
bool&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
FALSE&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[QUOTA_CURRENT]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
number (read only)&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
0&lt;br /&gt;
&lt;br /&gt;
|- align=&amp;quot;left&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| width=&amp;quot;318&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
[QUOTA_ONGOING]&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;116&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
number (read only)&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;217&amp;quot; style=&amp;quot;border: 1px solid rgb(1, 1, 1);&amp;quot; | &lt;br /&gt;
0&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
array a = Quota_new(&amp;quot;Arkitekt&amp;quot;,5,&amp;quot;Q3 == [1-5]&amp;quot;,5310088); &lt;br /&gt;
&lt;br /&gt;
print(a);&lt;br /&gt;
&lt;br /&gt;
OR &lt;br /&gt;
&lt;br /&gt;
array a = Quota_new(&amp;quot;Arkitekt&amp;quot;,5,&amp;quot;Q3 == [1-5]&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
print(a);&lt;br /&gt;
&lt;br /&gt;
//{26,0,Arkitekt,5,Q3 == [1-5],5310088,,False,False,0,0}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Version 5.8 &lt;br /&gt;
&lt;br /&gt;
[[Category:Questionnaire_Functions]]&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_getQuotaByName&amp;diff=23183</id>
		<title>Quota getQuotaByName</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_getQuotaByName&amp;diff=23183"/>
		<updated>2012-01-03T09:34:33Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Quota_getQuotaByName====&lt;br /&gt;
&lt;br /&gt;
To get information of quota by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array Quota_getQuotaByName(string quotaName[, number PQResourceId])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- quotaName : the name of new quota.&lt;br /&gt;
&lt;br /&gt;
- PQResourceId : Resource Id of questionnaire to which quota belongs. If it is empty, the project questionnaire context is needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array a = Quota_getQuotaByName(&amp;quot;Arkitekt, textilindustri&amp;quot;,5310088);&lt;br /&gt;
&lt;br /&gt;
print(a);&lt;br /&gt;
&lt;br /&gt;
//{26,5915,Arkitekt, textilindustri,1000,Q3 == [5] ,5310088,,False,False,9,1}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8021.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_getAllQuotas&amp;diff=23180</id>
		<title>Quota getAllQuotas</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_getAllQuotas&amp;diff=23180"/>
		<updated>2012-01-03T09:23:28Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Quota_getAllQuotas====&lt;br /&gt;
&lt;br /&gt;
To get information of all quotas in questionnaire. ( view Quota_new)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array Quota_getAllQuotas([number PQResourceId])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
PQResourceId : Resource Id of questionnaire to which quotas belong. If it is empty, the project questionnaire context is needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array a= Quota_getAllQuotas(34806989);&lt;br /&gt;
&lt;br /&gt;
print(a);&lt;br /&gt;
&lt;br /&gt;
//{{26,5915,Arkitekt, textilindustri,1000,Q3 == [5] ,5310088,,False,False,9,1},{26,5912,Bank, Egendomsmäklare och advokat,1000,Q3 == [2] ,5310088,,False,False,12,0},{26,5913,Bilhandlare och –uthyrare, möbler,1000,Q3 == [3] ,5310088,,False,False,9,0},{26,5914,Frisör, galleri, modebutik,1000,Q3 == [4] ,5310088,,False,False,3,0},{26,5830,GNF,1000,GNF_Dummy == [1] ,5310088,,False,False,26,0},{26,5911,Turism, hotell och restaurang,1000, Q3  ==  [1] ,5310088,,False,False,5,0}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8022.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_deleteQuota&amp;diff=23178</id>
		<title>Quota deleteQuota</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_deleteQuota&amp;diff=23178"/>
		<updated>2012-01-03T09:13:02Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Quota_deleteQuota====&lt;br /&gt;
&lt;br /&gt;
To delete a quota.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty Quota_deleteQuota(string quotaName[, number PQResourceId])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- quotaName : the name of quota.&lt;br /&gt;
&lt;br /&gt;
- PQResourceId : Resource Id of questionnaire to which quotas belong.If it&#039;s empty, the project questionnaire context is needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Quota_deleteQuota(&amp;quot;male&amp;quot;,34806989);&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
Quota_deleteQuota(&amp;quot;male&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8023.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_deleteAllQuotas&amp;diff=23177</id>
		<title>Quota deleteAllQuotas</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_deleteAllQuotas&amp;diff=23177"/>
		<updated>2012-01-03T09:05:31Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Quota_deleteAllQuotas====&lt;br /&gt;
&lt;br /&gt;
To delete all quotas in questionnaire.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty Quota_deleteAllQuotas([ number PQResourceId]);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
PQResourceId : Resource Id of the questionnaire to which quotas belong. If it is empty, the project questionnaire context needs to be specified&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Quota_deleteAllQuotas(34806989);&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
Quota_deleteAllQuotas();&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8024.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_deleteAllQuotas&amp;diff=23176</id>
		<title>Quota deleteAllQuotas</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_deleteAllQuotas&amp;diff=23176"/>
		<updated>2012-01-03T09:04:57Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Quota_deleteAllQuotas====&lt;br /&gt;
&lt;br /&gt;
To delete all quotas in questionnaire.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty Quota_deleteAllQuotas([ number PQResourceId]);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
PQResourceId : Resource Id of the questionnaire to which quotas belong. If it is empty, the project questionnaire context needs to be specified&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Quota_deleteAllQuotas([34806989]);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8024.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Quota_deleteAllQuotas&amp;diff=23174</id>
		<title>Quota deleteAllQuotas</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Quota_deleteAllQuotas&amp;diff=23174"/>
		<updated>2012-01-03T08:57:46Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Quota_deleteAllQuotas====&lt;br /&gt;
&lt;br /&gt;
To delete all quotas in questionnaire.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty Quota_deleteAllQuotas([ number PQResourceId]);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
PQResourceId : Resource Id of the questionnaire to which quotas belong. If it is empty, you will next project &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Quota_deleteAllQuotas([34806989]);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8024.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=QuestionnaireAnswerSheetExists&amp;diff=23164</id>
		<title>QuestionnaireAnswerSheetExists</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=QuestionnaireAnswerSheetExists&amp;diff=23164"/>
		<updated>2012-01-03T08:22:35Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====questionnaireAnswerSheetExists====&lt;br /&gt;
&lt;br /&gt;
Checks if a answer sheet exists by its user id and questionnaire id.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
questionnaireAnswerSheetExists (&#039;&#039;pqId, userId&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
or when we know the user context:&lt;br /&gt;
&lt;br /&gt;
questionnaireAnswerSheetExists (&#039;&#039;pqId&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pqId: number. Is the project questionnaire id which is being checked if the user has an answer sheet.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;userId: number. Is the user id which is being checked in regards to finding whether he has an answer sheet for the questionnaire.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
bool&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Examples&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
bool b = questionnaireAnswerSheetExists(1234,345678);&lt;br /&gt;
&lt;br /&gt;
print(b);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.5&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 5379.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Questionnaire_save&amp;diff=23160</id>
		<title>Questionnaire save</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Questionnaire_save&amp;diff=23160"/>
		<updated>2012-01-03T04:47:29Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Questionnaire_save====&lt;br /&gt;
&lt;br /&gt;
To save a new questionnaire or update information of an old questionnaire.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
empty Questionnaire_save(array questionnaire)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
questionnaire : the questionnaire object&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array a= Questionnaire_new(&amp;quot;new questionnaire&amp;quot;,34409965, 34822447,34779240,34775455);&lt;br /&gt;
&lt;br /&gt;
Questionnaire_save(a);&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
array a= Questionnaire_getQuestionnaireByResourceId(34806989 );&lt;br /&gt;
&lt;br /&gt;
a[QUESTIONNAIRE_NAME] = &amp;quot;New name for questionnaire&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Questionnaire_save(a);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8031.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
	<entry>
		<id>https://wiki.catglobe.com/index.php?title=Questionnaire_getQuestionnaireByResourceId&amp;diff=23150</id>
		<title>Questionnaire getQuestionnaireByResourceId</title>
		<link rel="alternate" type="text/html" href="https://wiki.catglobe.com/index.php?title=Questionnaire_getQuestionnaireByResourceId&amp;diff=23150"/>
		<updated>2012-01-03T04:27:35Z</updated>

		<summary type="html">&lt;p&gt;Cg huyphong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Questionnaire_Functions]]&lt;br /&gt;
﻿﻿{{HelpFiles}}&lt;br /&gt;
&lt;br /&gt;
====Questionnaire_getQuestionnaireByResourceId====&lt;br /&gt;
&lt;br /&gt;
To get information of a questionnaire by resource id. (view the questionnaire object on Questionnaire_new)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Syntax&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array Questionnaire_getQuestionnaireByResourceId (number questionnaireResourceId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Arguments&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
questionnaireResourceId : resource id of questionnaire.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Return type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
array a= Questionnaire_getQuestionnaireByResourceId(34806989);&lt;br /&gt;
&lt;br /&gt;
print (a);&lt;br /&gt;
&lt;br /&gt;
//{11,34806989,phong questionnaire 2,34409965,37246022,37257113,True,False,False,True,,36784747,,3,0,B2B CSN 01,{1,1,1,0,0,0,0,1,40},{1,1,1,0,0,0,0,1,40},{9999,12,31,23,59,59,999,52,40},{9999,12,31,23,59,59,999,52,40},0,phong questionnaire 2}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Availability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Version 5.8&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;!-- imported from file: 8033.htm--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cg huyphong</name></author>
	</entry>
</feed>