Skip to content

Commit

Permalink
Dev Fixed some minor notices
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9501 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Nov 18, 2010
1 parent 6750b95 commit 40155e1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions admin/html.php
Expand Up @@ -1641,6 +1641,7 @@

$sQuery = "SELECT type FROM ".db_table_name('questions')." WHERE qid={$qid} AND language='{$baselang}'";
$sQuestiontype=$connect->GetOne($sQuery);
if (is_null($sQuestiontype) || $sQuestiontype==false) die('Couldn\'t get question type to edit subquestions');
$aQuestiontypeInfo=getqtypelist($sQuestiontype,'array');
$iScaleCount=$aQuestiontypeInfo[$sQuestiontype]['subquestions'];

Expand Down
11 changes: 10 additions & 1 deletion admin/importsurvey.php
Expand Up @@ -38,7 +38,10 @@
{
$aImportResults=XMLImportSurvey('',$copysurveydata,$sNewSurveyName);
}

else
{
$bImportFailed=true;
}

// Create old fieldnames

Expand Down Expand Up @@ -105,6 +108,12 @@
unlink($sFullFilepath);
}
}
elseif (isset($bImportFailed) && $bImportFailed==true)
{
echo "\n".$clang->gT("Error")."\n\n";
echo $clang->gT("Import failed. You specified an invalid file.")."\n";

}
else
{
echo "\n".$clang->gT("Success")."\n\n";
Expand Down
12 changes: 10 additions & 2 deletions admin/templates.php
Expand Up @@ -1089,10 +1089,18 @@ function textarea_encode($html_code)
return $html_code;
}

//Load this editfile
//Load this editfile
function filetext($templatename,$templatefile) {
global $templates;
return file_get_contents($templates[$templatename].'/'.$templatefile);
$sFileName=$templates[$templatename].'/'.$templatefile;
if (file_exists($sFileName))
{
return file_get_contents($sFileName);
}
else
{
return '';
}
}

function makegraph($currentstep, $total)
Expand Down
8 changes: 5 additions & 3 deletions qanda.php
Expand Up @@ -2701,6 +2701,8 @@ function do_multiplechoice($ia)
// based on value of attribute. This could be array_filter and array_filter_exclude

$attribute_ref=false;
$inputnames=array();

$qaquery = "SELECT qid,attribute FROM ".db_table_name('question_attributes')." WHERE value LIKE '".strtolower($ia[2])."' and (attribute='array_filter' or attribute='array_filter_exclude')";
$qaresult = db_execute_assoc($qaquery); //Checked
while($qarow = $qaresult->FetchRow())
Expand Down Expand Up @@ -3668,7 +3670,7 @@ function do_multiplenumeric($ia)
$numbersonlyonblur[]='calculateValue'.$ia[1].'(3)';
$calculateValue[]=3;
}
elseif (trim($qidattributes['num_value_equals_sgqa'])!='')
elseif (trim($qidattributes['num_value_equals_sgqa'])!='' && isset($_SESSION[$qidattributes['num_value_equals_sgqa']]))
{
$equals_num_value=$_SESSION[$qidattributes['num_value_equals_sgqa']];
$numbersonlyonblur[]='calculateValue'.$ia[1].'(3)';
Expand All @@ -3685,7 +3687,7 @@ function do_multiplenumeric($ia)
$numbersonlyonblur[]='calculateValue'.$ia[1].'(2)';
$calculateValue[]=2;
}
elseif (trim($qidattributes['min_num_value_sgqa'])!=''){
elseif (trim($qidattributes['min_num_value_sgqa'])!='' && isset($_SESSION[$qidattributes['min_num_value_sgqa']])){
$min_num_value=$_SESSION[$qidattributes['min_num_value_sgqa']];
$numbersonlyonblur[]='calculateValue'.$ia[1].'(2)';
$calculateValue[]=2;
Expand All @@ -3701,7 +3703,7 @@ function do_multiplenumeric($ia)
$numbersonlyonblur[]='calculateValue'.$ia[1].'(1)';
$calculateValue[]=1;
}
elseif (trim($qidattributes['max_num_value_sgqa'])!=''){
elseif (trim($qidattributes['max_num_value_sgqa'])!='' && isset($_SESSION[$qidattributes['max_num_value_sgqa']])){
$max_num_value = $_SESSION[$qidattributes['max_num_value_sgqa']];
$numbersonlyonblur[]='calculateValue'.$ia[1].'(1)';
$calculateValue[]=1;
Expand Down

0 comments on commit 40155e1

Please sign in to comment.