Skip to content

Commit

Permalink
Dev Fixed some obsolete code
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9519 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Nov 22, 2010
1 parent ba4045d commit 50589f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 29 deletions.
4 changes: 2 additions & 2 deletions admin/integritycheck.php
Expand Up @@ -414,7 +414,7 @@
//1: Get list of "old_survey" tables and extract the survey id
//2: Check if that survey id still exists
//3: If it doesn't offer it for deletion
$tables=$connect->MetaTables(false, false, "{$dbprefix}%old%survey%");
$tables=$connect->MetaTables(false, false, "{$dbprefix}old_survey%");
$oldsids=array();
$sids=array();
foreach($tables as $table)
Expand Down Expand Up @@ -478,7 +478,7 @@
//1: Get list of "old_token" tables and extract the survey id
//2: Check if that survey id still exists
//3: If it doesn't offer it for deletion
$tables=$connect->MetaTables(false, false, "{$dbprefix}old%token%");
$tables=$connect->MetaTables(false, false, "{$dbprefix}old_token%");
$oldtsids=array();
$tsids=array();
$folloldtsids=array();
Expand Down
19 changes: 0 additions & 19 deletions common.php
Expand Up @@ -3443,25 +3443,6 @@ function getQuestionAttributes($qid, $type='')
return $qid_attributes;
}

/**
*
* Returns the questionAttribtue value set or '' if not set
* @author: lemeur
* @param $questionAttributeArray
* @param $attributeName
* @return string
*/
function getQuestionAttributeValue($questionAttributeArray, $attributeName)
{
if (isset($questionAttributeArray[$attributeName]))
{
return $questionAttributeArray[$attributeName];
}
else
{
return '';
}
}

/**
* Returns array of question type chars with attributes
Expand Down
15 changes: 7 additions & 8 deletions qanda.php
Expand Up @@ -1998,7 +1998,7 @@ function do_list_dropdown($ia)
}

$checkotherscript = "";
if (isset($other) && $other == 'Y' && getQuestionAttributeValue($qidattributes,'other_comment_mandatory')==1)
if (isset($other) && $other == 'Y' && $qidattributes['other_comment_mandatory']==1)
{
$checkotherscript = "\n<script type='text/javascript'>\n"
. "\t<!--\n"
Expand Down Expand Up @@ -2256,7 +2256,7 @@ function do_list_radio($ia)

$checkotherscript = "";

if (isset($other) && $other == 'Y' && getQuestionAttributeValue($qidattributes,'other_comment_mandatory')==1)
if (isset($other) && $other == 'Y' && $qidattributes['other_comment_mandatory']==1)
{
$checkotherscript = "<script type='text/javascript'>\n"
. "\t<!--\n"
Expand Down Expand Up @@ -3013,7 +3013,7 @@ function excludeAllOthers$ia[1](value, doconditioncheck)
// even if the -other- input field is still empty
// This will be differetn for the minansw script
// ==> hence the 1==2
if (1==2 || getQuestionAttributeValue($qidattributes,'other_comment_mandatory')==1)
if (1==2 || $qidattributes['other_comment_mandatory']==1)
{
$maxanswscript .= "\tif (document.getElementById('answer".$myfname."').value != '' && document.getElementById('answer".$myfname."cbox').checked ) { count += 1; }\n";
}
Expand All @@ -3029,7 +3029,7 @@ function excludeAllOthers$ia[1](value, doconditioncheck)
// so in fact I need to assume that other_comment_mandatory is set to true
// We only count the -other- as valid if both the cbox and the other text is filled
// ==> hence the 1==1
if (1==1 || getQuestionAttributeValue($qidattributes,'other_comment_mandatory')==1)
if (1==1 || $qidattributes['other_comment_mandatory']==1)
{
$minanswscript .= "\tif (document.getElementById('answer".$myfname."').value != '' && document.getElementById('answer".$myfname."cbox').checked ) { count += 1; }\n";
}
Expand Down Expand Up @@ -3349,7 +3349,7 @@ function do_multiplechoice_withcomments($ia)

if ($maxansw > 0)
{
if (getQuestionAttributeValue($qidattributes,'other_comment_mandatory')==1)
if ($qidattributes['other_comment_mandatory']==1)
{
$maxanswscript .= "\tif (document.getElementById('answer".$myfname."').value != '' && document.getElementById('answer".$myfname2."').value != '') { count += 1; }\n";
}
Expand All @@ -3361,7 +3361,7 @@ function do_multiplechoice_withcomments($ia)

if ($minansw > 0)
{
if (getQuestionAttributeValue($qidattributes,'other_comment_mandatory')==1)
if ($qidattributes['other_comment_mandatory']==1)
{
$minanswscript .= "\tif (document.getElementById('answer".$myfname."').value != '' && document.getElementById('answer".$myfname2."').value != '') { count += 1; }\n";
}
Expand Down Expand Up @@ -3425,10 +3425,9 @@ function do_multiplechoice_withcomments($ia)
//$answer = $minanswscript . $answer;
}

//getQuestionAttributeValue($questionAttributeArray, $attributeName)
$checkotherscript = "";
//if ($other == 'Y' && $qidattributes['other_comment_mandatory']==1) //TIBO
if ($other == 'Y' && getQuestionAttributeValue($qidattributes,'other_comment_mandatory')==1) //TIBO
if ($other == 'Y' && $qidattributes['other_comment_mandatory']==1) //TIBO
{
// Multiple options with 'other' is a specific case as the checkbox isn't recorded into DB
// this means that if it is cehcked We must force the end-user to enter text in the input
Expand Down

0 comments on commit 50589f1

Please sign in to comment.