Permalink
Browse files

Fixed issue #13999: Incorrect translation in Logic File

  • Loading branch information...
dominikvitt committed Sep 12, 2018
1 parent 6edf17b commit 826b6fe9448f81a3fa853fec9b8383d93922ceb1
@@ -95,6 +95,7 @@ function quoteText($sText, $sEscapeMode = 'html')
*
* @param string $SelectedCode Value of the Question Type (defaults to "T")
* @param string $ReturnType Type of output from this function (defaults to selector)
* @param string $language Language for translation
*
* @return array|string depending on $ReturnType param, returns a straight "array" of question types, or an <option></option> list
*
@@ -105,10 +106,10 @@ function quoteText($sText, $sEscapeMode = 'html')
* answerscales : 0= Does not need answers x=Number of answer scales (usually 1, but e.g. for dual scale question set to 2)
* assessable : 0=Does not support assessment values when editing answerd 1=Support assessment values
*/
function getQuestionTypeList($SelectedCode = "T", $ReturnType = "selector")
function getQuestionTypeList($SelectedCode = "T", $ReturnType = "selector", $sLanguage='')
{
$qtypes = Question::typeList();
$qtypes = Question::typeList($sLanguage);
if ($ReturnType == "array") {
return $qtypes;
@@ -9431,7 +9431,7 @@ static public function ShowSurveyLogicFile($sid, $gid=NULL, $qid=NULL,$LEMdebugL
$moveResult = LimeExpressionManager::NavigateForwards();
}
$qtypes=getQuestionTypeList('','array');
$qtypes=getQuestionTypeList('','array',Yii::app()->session["adminlang"]);
if (is_null($moveResult) || is_null($LEM->currentQset) || count($LEM->currentQset) == 0) {
return array(
@@ -449,6 +449,7 @@ public function getTypedesc()
/**
* This function contains the question type definitions.
* @param string $language Language for translation
* @return array The question type definitions
*
* Explanation of questiontype array:
@@ -458,11 +459,11 @@ public function getTypedesc()
* answerscales : 0= Does not need answers x=Number of answer scales (usually 1, but e.g. for dual scale question set to 2)
* assessable : 0=Does not support assessment values when editing answerd 1=Support assessment values
*/
public static function typeList()
public static function typeList($language = '')
{
$questionTypes = array(
"1" => array(
'description' => gT("Array dual scale"),
'description' => gT("Array dual scale", "html", $language),
'group' => gT('Arrays'),
'subquestions' => 1,
'assessable' => 1,
@@ -471,7 +472,7 @@ public static function typeList()
'class' => 'array-flexible-duel-scale',
),
"5" => array(
'description' => gT("5 Point Choice"),
'description' => gT("5 Point Choice", "html", $language),
'group' => gT("Single choice questions"),
'subquestions' => 0,
'hasdefaultvalues' => 0,
@@ -480,7 +481,7 @@ public static function typeList()
'class' => "choice-5-pt-radio"
),
"A" => array(
'description' => gT("Array (5 Point Choice)"),
'description' => gT("Array (5 Point Choice)", "html", $language),
'group' => gT('Arrays'),
'subquestions' => 1,
'hasdefaultvalues' => 0,
@@ -489,7 +490,7 @@ public static function typeList()
'class' => 'array-5-pt'
),
"B" => array(
'description' => gT("Array (10 Point Choice)"),
'description' => gT("Array (10 Point Choice)", "html", $language),
'group' => gT('Arrays'),
'subquestions' => 1,
'hasdefaultvalues' => 0,
@@ -498,7 +499,7 @@ public static function typeList()
'class' => 'array-10-pt'
),
"C" => array(
'description' => gT("Array (Yes/No/Uncertain)"),
'description' => gT("Array (Yes/No/Uncertain)", "html", $language),
'group' => gT('Arrays'),
'subquestions' => 1,
'hasdefaultvalues' => 0,
@@ -507,7 +508,7 @@ public static function typeList()
'class' => 'array-yes-uncertain-no'
),
"D" => array(
'description' => gT("Date/Time"),
'description' => gT("Date/Time", "html", $language),
'group' => gT("Mask questions"),
'subquestions' => 0,
'hasdefaultvalues' => 1,
@@ -516,7 +517,7 @@ public static function typeList()
'class' => 'date'
),
"E" => array(
'description' => gT("Array (Increase/Same/Decrease)"),
'description' => gT("Array (Increase/Same/Decrease)", "html", $language),
'group' => gT('Arrays'),
'subquestions' => 1,
'hasdefaultvalues' => 0,
@@ -525,7 +526,7 @@ public static function typeList()
'class' => 'array-increase-same-decrease'
),
"F" => array(
'description' => gT("Array"),
'description' => gT("Array", "html", $language),
'group' => gT('Arrays'),
'subquestions' => 1,
'hasdefaultvalues' => 0,
@@ -534,7 +535,7 @@ public static function typeList()
'class' => 'array-flexible-row'
),
"G" => array(
'description' => gT("Gender"),
'description' => gT("Gender", "html", $language),
'group' => gT("Mask questions"),
'subquestions' => 0,
'hasdefaultvalues' => 0,
@@ -543,7 +544,7 @@ public static function typeList()
'class' => 'gender'
),
"H" => array(
'description' => gT("Array by column"),
'description' => gT("Array by column", "html", $language),
'group' => gT('Arrays'),
'hasdefaultvalues' => 0,
'subquestions' => 1,
@@ -552,7 +553,7 @@ public static function typeList()
'class' => 'array-flexible-column'
),
"I" => array(
'description' => gT("Language Switch"),
'description' => gT("Language Switch", "html", $language),
'group' => gT("Mask questions"),
'hasdefaultvalues' => 0,
'subquestions' => 0,
@@ -561,7 +562,7 @@ public static function typeList()
'class' => 'language'
),
"K" => array(
'description' => gT("Multiple Numerical Input"),
'description' => gT("Multiple Numerical Input", "html", $language),
'group' => gT("Mask questions"),
'hasdefaultvalues' => 1,
'subquestions' => 1,
@@ -570,7 +571,7 @@ public static function typeList()
'class' => 'numeric-multi'
),
"L" => array(
'description' => gT("List (Radio)"),
'description' => gT("List (Radio)", "html", $language),
'group' => gT("Single choice questions"),
'subquestions' => 0,
'hasdefaultvalues' => 1,
@@ -579,7 +580,7 @@ public static function typeList()
'class' => 'list-radio'
),
"M" => array(
'description' => gT("Multiple choice"),
'description' => gT("Multiple choice", "html", $language),
'group' => gT("Multiple choice questions"),
'subquestions' => 1,
'hasdefaultvalues' => 1,
@@ -588,7 +589,7 @@ public static function typeList()
'class' => 'multiple-opt'
),
"N" => array(
'description' => gT("Numerical Input"),
'description' => gT("Numerical Input", "html", $language),
'group' => gT("Mask questions"),
'subquestions' => 0,
'hasdefaultvalues' => 1,
@@ -597,7 +598,7 @@ public static function typeList()
'class' => 'numeric'
),
"O" => array(
'description' => gT("List with comment"),
'description' => gT("List with comment", "html", $language),
'group' => gT("Single choice questions"),
'subquestions' => 0,
'hasdefaultvalues' => 1,
@@ -606,7 +607,7 @@ public static function typeList()
'class' => 'list-with-comment'
),
"P" => array(
'description' => gT("Multiple choice with comments"),
'description' => gT("Multiple choice with comments", "html", $language),
'group' => gT("Multiple choice questions"),
'subquestions' => 1,
'hasdefaultvalues' => 1,
@@ -615,7 +616,7 @@ public static function typeList()
'class' => 'multiple-opt-comments'
),
"Q" => array(
'description' => gT("Multiple Short Text"),
'description' => gT("Multiple Short Text", "html", $language),
'group' => gT("Text questions"),
'subquestions' => 1,
'hasdefaultvalues' => 1,
@@ -624,7 +625,7 @@ public static function typeList()
'class' => 'multiple-short-txt'
),
"R" => array(
'description' => gT("Ranking"),
'description' => gT("Ranking", "html", $language),
'group' => gT("Mask questions"),
'subquestions' => 0,
'hasdefaultvalues' => 0,
@@ -633,7 +634,7 @@ public static function typeList()
'class' => 'ranking'
),
"S" => array(
'description' => gT("Short Free Text"),
'description' => gT("Short Free Text", "html", $language),
'group' => gT("Text questions"),
'subquestions' => 0,
'hasdefaultvalues' => 1,
@@ -642,7 +643,7 @@ public static function typeList()
'class' => 'text-short'
),
"T" => array(
'description' => gT("Long Free Text"),
'description' => gT("Long Free Text", "html", $language),
'group' => gT("Text questions"),
'subquestions' => 0,
'hasdefaultvalues' => 1,
@@ -651,7 +652,7 @@ public static function typeList()
'class' => 'text-long'
),
"U" => array(
'description' => gT("Huge Free Text"),
'description' => gT("Huge Free Text", "html", $language),
'group' => gT("Text questions"),
'subquestions' => 0,
'hasdefaultvalues' => 1,
@@ -660,7 +661,7 @@ public static function typeList()
'class' => 'text-huge'
),
"X" => array(
'description' => gT("Text display"),
'description' => gT("Text display", "html", $language),
'group' => gT("Mask questions"),
'subquestions' => 0,
'hasdefaultvalues' => 0,
@@ -669,7 +670,7 @@ public static function typeList()
'class' => 'boilerplate'
),
"Y" => array(
'description' => gT("Yes/No"),
'description' => gT("Yes/No", "html", $language),
'group' => gT("Mask questions"),
'subquestions' => 0,
'hasdefaultvalues' => 1,
@@ -678,7 +679,7 @@ public static function typeList()
'class' => 'yes-no'
),
"!" => array(
'description' => gT("List (Dropdown)"),
'description' => gT("List (Dropdown)", "html", $language),
'group' => gT("Single choice questions"),
'subquestions' => 0,
'hasdefaultvalues' => 1,
@@ -687,7 +688,7 @@ public static function typeList()
'class' => 'list-dropdown'
),
":" => array(
'description' => gT("Array (Numbers)"),
'description' => gT("Array (Numbers)", "html", $language),
'group' => gT('Arrays'),
'subquestions' => 2,
'hasdefaultvalues' => 0,
@@ -696,7 +697,7 @@ public static function typeList()
'class' => 'array-multi-flexi'
),
";" => array(
'description' => gT("Array (Texts)"),
'description' => gT("Array (Texts)", "html", $language),
'group' => gT('Arrays'),
'subquestions' => 2,
'hasdefaultvalues' => 0,
@@ -705,7 +706,7 @@ public static function typeList()
'class' => 'array-multi-flexi-text'
),
"|" => array(
'description' => gT("File upload"),
'description' => gT("File upload", "html", $language),
'group' => gT("Mask questions"),
'subquestions' => 0,
'hasdefaultvalues' => 0,
@@ -714,7 +715,7 @@ public static function typeList()
'class' => 'upload-files'
),
"*" => array(
'description' => gT("Equation"),
'description' => gT("Equation", "html", $language),
'group' => gT("Mask questions"),
'subquestions' => 0,
'hasdefaultvalues' => 0,

0 comments on commit 826b6fe

Please sign in to comment.