diff --git a/application/controllers/admin/printablesurvey.php b/application/controllers/admin/printablesurvey.php index 7336e9a6905..cb372cf7fc4 100644 --- a/application/controllers/admin/printablesurvey.php +++ b/application/controllers/admin/printablesurvey.php @@ -647,7 +647,7 @@ function index($surveyid, $lang = null) ,'QUESTION_MANDATORY' => '' // translated 'mandatory' identifier ,'QUESTION_ID' => $deqrow['qid'] // id to be added to wrapping question div ,'QUESTION_CLASS' => getQuestionClass( $deqrow['type']) // classes to be added to wrapping question div - ,'QUESTION_TYPE_HELP' => $qinfo['prettyValidTip'] // '' // instructions on how to complete the question + ,'QUESTION_TYPE_HELP' => $qinfo['validTip'] // '' // instructions on how to complete the question // prettyValidTip is too verbose; assuming printable surveys will use static values ,'QUESTION_MAN_MESSAGE' => '' // (not sure if this is used) mandatory error ,'QUESTION_VALID_MESSAGE' => '' // (not sure if this is used) validation error ,'QUESTION_FILE_VALID_MESSAGE' => ''// (not sure if this is used) file validation error diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php index 903b369fac8..c5f2279aef7 100644 --- a/application/helpers/expressions/em_manager_helper.php +++ b/application/helpers/expressions/em_manager_helper.php @@ -1531,76 +1531,97 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL) // Put these in the order you with them to appear in messages. $qtips=array(); - // min/max answers + // min/max answers if ($min_answers!='' || $max_answers!='') { - if ($min_answers!='' && $max_answers!='') - { - $qtips['num_answers']=sprintf($this->ngT("Please select between %s and %s answer.","Please select between %s and %s answers.",$max_answers),'{fixnum('.$min_answers.')}','{fixnum('.$max_answers.')}'); - } - else if ($min_answers!='') - { - $qtips['num_answers']=sprintf($this->ngT("Please select at least %s answer.","Please select at least %s answers.",$min_answers),'{fixnum('.$min_answers.')}'); - - } - else if ($max_answers!='') - { - $qtips['num_answers']=sprintf($this->ngT("Please select at most %s answer.","Please select at most %s answers.",$max_answers),'{fixnum('.$max_answers.')}'); - } + $_minA = (($min_answers == '') ? "''" : $min_answers); + $_maxA = (($max_answers == '') ? "''" : $max_answers ); + $qtips['num_answers']= + "{if((is_empty($_minA) && is_empty($_maxA)),". + "'',". + "if(is_empty($_maxA),". + "if(($_minA)==1,". + "'".$this->gT("Please select at least one answer")."',". + "sprintf('".$this->gT("Please select at least %s answers")."',fixnum($_minA))". + "),". + "if(is_empty($_minA),". + "if(($_maxA)==1,". + "'".$this->gT("Please select at most one answer")."',". + "sprintf('".$this->gT("Please select at most %s answers")."',fixnum($_maxA))". + "),". + "if(($_minA)==($_maxA),". + "if(($_minA)==1,". + "'".$this->gT("Please select one answer")."',". + "sprintf('".$this->gT("Please select %s answers")."',fixnum($_minA))". + "),". + "sprintf('".$this->gT("Please select between %s and %s answers")."',fixnum($_minA),fixnum($_maxA))". + ")". + ")". + ")". + ")}"; } // min/max value for each numeric entry if ($min_num_value_n!='' || $max_num_value_n!='') { - if ($min_num_value_n!='' && $max_num_value_n!='') - { - $qtips['value_range']=sprintf($this->gT("Each answer must be between %s and %s."),'{fixnum('.$min_num_value_n.')}','{fixnum('.$max_num_value_n.')}'); - } - else if ($min_num_value_n!='') - { - $qtips['value_range']=sprintf($this->gT("Each answer must be at least %s."),'{fixnum('.$min_num_value_n.')}'); - - } - else if ($max_num_value_n!='') - { - $qtips['value_range']=sprintf($this->gT("Each answer must be at most %s."),'{fixnum('.$max_num_value_n.')}'); - } + $_minV = (($min_num_value_n == '') ? "''" : $min_num_value_n); + $_maxV = (($max_num_value_n == '') ? "''" : $max_num_value_n); + $qtips['value_range']= + "{if((is_empty($_minV) && is_empty($_maxV)),". + "'',". + "if(is_empty($_maxV),". + "sprintf('".$this->gT("Each answer must be at least %s")."',fixnum($_minV)),". + "if(is_empty($_minV),". + "sprintf('".$this->gT("Each answer must be at most %s")."',fixnum($_maxV)),". + "if(($_minV)==($_maxV),". + "sprintf('".$this->gT("Each answer must be %s")."',fixnum($_minV)),". + "sprintf('".$this->gT("Each answer must be between %s and %s")."',fixnum($_minV),fixnum($_maxV))". + ")". + ")". + ")". + ")}"; } // min/max value for each numeric entry - for multi-flexible question type if ($multiflexible_min!='' || $multiflexible_max!='') { - if ($multiflexible_min!='' && $multiflexible_max!='') - { - $qtips['value_range']=sprintf($this->gT("Each answer must be between %s and %s."),'{fixnum('.$multiflexible_min.')}','{fixnum('.$multiflexible_max.')}'); - } - else if ($multiflexible_min!='') - { - $qtips['value_range']=sprintf($this->gT("Each answer must be at least %s."),'{fixnum('.$multiflexible_min.')}'); - - } - else if ($multiflexible_max!='') - { - $qtips['value_range']=sprintf($this->gT("Each answer must be at most %s."),'{fixnum('.$multiflexible_max.')}'); - } + $_minV = (($multiflexible_min == '') ? "''" : $multiflexible_min); + $_maxV = (($multiflexible_max == '') ? "''" : $multiflexible_max); + $qtips['value_range']= + "{if((is_empty($_minV) && is_empty($_maxV)),". + "'',". + "if(is_empty($_maxV),". + "sprintf('".$this->gT("Each answer must be at least %s")."',fixnum($_minV)),". + "if(is_empty($_minV),". + "sprintf('".$this->gT("Each answer must be at most %s")."',fixnum($_maxV)),". + "if(($_minV)==($_maxV),". + "sprintf('".$this->gT("Each answer must be %s")."',fixnum($_minV)),". + "sprintf('".$this->gT("Each answer must be between %s and %s")."',fixnum($_minV),fixnum($_maxV))". + ")". + ")". + ")". + ")}"; } // min/max sum value if ($min_num_value!='' || $max_num_value!='') { - if ($min_num_value!='' && $max_num_value!='') - { - $qtips['sum_range']=sprintf($this->gT("The sum must be between %s and %s"),'{fixnum('.$min_num_value.')}','{fixnum('.$max_num_value.')}'); - } - else if ($min_num_value!='') - { - $qtips['sum_range']=sprintf($this->gT("The sum must be at least %s."),'{fixnum('.$min_num_value.')}'); - - } - else if ($max_num_value!='') - { - $qtips['sum_range']=sprintf($this->gT("The sum must be at most %s."),'{fixnum('.$max_num_value.')}'); - } + $_minV = (($min_num_value == '') ? "''" : $min_num_value); + $_maxV = (($max_num_value == '') ? "''" : $max_num_value); + $qtips['sum_range']= + "{if((is_empty($_minV) && is_empty($_maxV)),". + "'',". + "if(is_empty($_maxV),". + "sprintf('".$this->gT("The sum must be at least %s")."',fixnum($_minV)),". + "if(is_empty($_minV),". + "sprintf('".$this->gT("The sum must be at most %s")."',fixnum($_maxV)),". + "if(($_minV)==($_maxV),". + "sprintf('".$this->gT("The sum must equal %s")."',fixnum($_minV)),". + "sprintf('".$this->gT("The sum must be between %s and %s")."',fixnum($_minV),fixnum($_maxV))". + ")". + ")". + ")". + ")}"; } // equals_num_value diff --git a/docs/demosurveys/ls2_plurals_test.lss b/docs/demosurveys/ls2_plurals_test.lss new file mode 100644 index 00000000000..3008f4f656d --- /dev/null +++ b/docs/demosurveys/ls2_plurals_test.lss @@ -0,0 +1,2248 @@ + + + Survey + 155 + + en + + + + qid + specialtype + scale_id + sqid + language + defaultvalue + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gid + sid + group_name + group_order + description + language + randomization_group + grelevance + + + + + + + + + + + + + + + + + + + + + + + + + + + qid + parent_qid + sid + gid + type + title + question + preg + help + other + mandatory + question_order + language + scale_id + same_default + relevance + + + + + + + + + <![CDATA[minSelect]]> + fewest options you want to be able to select?]]> + + + + + + + + + + + + + + + + + <![CDATA[maxSelect]]> + maximum number of options you want to be able to select?]]> + + + + + + + + + + + + + + + + + <![CDATA[minVal]]> + minimum allowable value?]]> + + + + + + + + + + + + + + + + + <![CDATA[maxVal]]> + maximum allowable value?]]> + + + + + + + + + + + + + + + + + <![CDATA[afSrcFilter]]> + + + + + + + + + + + + + + + + + + <![CDATA[array1]]> + + + + + + + + + + + + + + + + + + <![CDATA[array2]]> + + + + + + + + + + + + + + + + + + <![CDATA[array3]]> + + + + + + + + + + + + + + + + + + <![CDATA[array4]]> + + + + + + + + + + + + + + + + + + <![CDATA[marray1]]> + + + + + + + + + + + + + + + + qid + parent_qid + sid + gid + type + title + question + preg + help + other + mandatory + question_order + language + scale_id + same_default + relevance + + + + + + + + + <![CDATA[sq1]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq2]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq3]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq4]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq5]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq1]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq2]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq3]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq4]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq5]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq1]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq2]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq3]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq4]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq5]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq1]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq2]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq3]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq4]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq5]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq1]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq2]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq3]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq4]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq5]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq1]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq2]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq3]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq4]]> + + + + + + + + + + + + + + + + + + <![CDATA[sq5]]> + + + + + + + + + + + + + + + + + + <![CDATA[1]]> + + + + + + + + + + + + + + + + + + <![CDATA[2]]> + + + + + + + + + + + + + + + + + + <![CDATA[3]]> + + + + + + + + + + + + + + + + qid + attribute + value + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sid + admin + expires + startdate + adminemail + anonymized + faxto + format + savetimings + template + language + additional_languages + datestamp + usecookie + allowregister + allowsave + autonumber_start + autoredirect + allowprev + printanswers + ipaddr + refurl + publicstatistics + publicgraphs + listpublic + htmlemail + tokenanswerspersistence + assessments + usecaptcha + usetokens + bounce_email + attributedescriptions + emailresponseto + emailnotificationto + tokenlength + showxquestions + showgroupinfo + shownoanswer + showqnumcode + bouncetime + bounceprocessing + bounceaccounttype + bounceaccounthost + bounceaccountpass + bounceaccountencryption + bounceaccountuser + showwelcome + showprogress + allowjumps + navigationdelay + nokeyboard + alloweditaftercompletion + googleanalyticsstyle + googleanalyticsapikey + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + surveyls_survey_id + surveyls_language + surveyls_title + surveyls_description + surveyls_welcometext + surveyls_endtext + surveyls_url + surveyls_urldescription + surveyls_email_invite_subj + surveyls_email_invite + surveyls_email_remind_subj + surveyls_email_remind + surveyls_email_register_subj + surveyls_email_register + surveyls_email_confirm_subj + surveyls_email_confirm + surveyls_dateformat + email_admin_notification_subj + email_admin_notification + email_admin_responses_subj + email_admin_responses + surveyls_numberformat + + + + + + + + + + + + +
you have been invited to participate in a survey.

The survey is titled:
"{SURVEYNAME}"

"{SURVEYDESCRIPTION}"

To participate, please click on the link below.

Sincerely,

{ADMINNAME} ({ADMINEMAIL})

----------------------------------------------
Click here to do the survey:
{SURVEYURL}

If you do not want to participate in this survey and don't want to receive any more invitations please click the following link:
{OPTOUTURL}]]>
+ +
Recently we invited you to participate in a survey.

We note that you have not yet completed the survey, and wish to remind you that the survey is still available should you wish to take part.

The survey is titled:
"{SURVEYNAME}"

"{SURVEYDESCRIPTION}"

To participate, please click on the link below.

Sincerely,

{ADMINNAME} ({ADMINEMAIL})

----------------------------------------------
Click here to do the survey:
{SURVEYURL}

If you do not want to participate in this survey and don't want to receive any more invitations please click the following link:
{OPTOUTURL}]]>
+ +
You, or someone using your email address, have registered to participate in an online survey titled {SURVEYNAME}.

To complete this survey, click on the following URL:

{SURVEYURL}

If you have any questions about this survey, or if you did not register to participate and believe this email is in error, please contact {ADMINNAME} at {ADMINEMAIL}.]]>
+ +
this email is to confirm that you have completed the survey titled {SURVEYNAME} and your response has been saved. Thank you for participating.

If you have any further questions about this email, please contact {ADMINNAME} on {ADMINEMAIL}.

Sincerely,

{ADMINNAME}]]>
+ + +
A new response was submitted for your survey '{SURVEYNAME}'.

Click the following link to reload the survey:
{RELOADURL}

Click the following link to see the individual response:
{VIEWRESPONSEURL}

Click the following link to edit the individual response:
{EDITRESPONSEURL}

View statistics by clicking here:
{STATISTICSURL}]]>
+ + + .printouttable { + margin:1em auto; + } + .printouttable th { + text-align: center; + } + .printouttable td { + border-color: #ddf #ddf #ddf #ddf; + border-style: solid; + border-width: 1px; + padding:0.1em 1em 0.1em 0.5em; + } + + .printouttable td:first-child { + font-weight: 700; + text-align: right; + padding-right: 5px; + padding-left: 5px; + + } + .printouttable .printanswersquestion td{ + background-color:#F7F8FF; + } + + .printouttable .printanswersquestionhead td{ + text-align: left; + background-color:#ddf; + } + + .printouttable .printanswersgroup td{ + text-align: center; + font-weight:bold; + padding-top:1em; + } + Hello,

A new response was submitted for your survey '{SURVEYNAME}'.

Click the following link to reload the survey:
{RELOADURL}

Click the following link to see the individual response:
{VIEWRESPONSEURL}

Click the following link to edit the individual response:
{EDITRESPONSEURL}

View statistics by clicking here:
{STATISTICSURL}


The following answers were given by the participant:
{ANSWERTABLE}]]>
+ +
+
+
+