Skip to content

Commit

Permalink
Dev: fixed submit subquestions with scale
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jan 13, 2016
1 parent 48da2b3 commit 8adf174
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
10 changes: 9 additions & 1 deletion application/controllers/admin/database.php
Expand Up @@ -280,14 +280,22 @@ function index($sa = null)
$oSubQuestion=Question::model()->find("qid=:qid AND language=:language",array(":qid"=>$subquestionkey,':language'=>$sLanguage));

$oSubQuestion->question_order=$iPosition+1;

if($aCodes[$iScaleID][$iPosition]===null)
{
var_dump($subquestionkey); die();
}

$oSubQuestion->title=$aCodes[$iScaleID][$iPosition];


$oSubQuestion->question=$subquestionvalue;
$oSubQuestion->scale_id=$iScaleID;
//dual matrix, text/number matrix: subQ relevance per line not per scale, so ScaleID is always 0
$oSubQuestion->relevance=$aRelevance[0][$iPosition];
}
else // new record
{
{
if (!isset($aInsertQID[$iScaleID][$iPosition])) //new record: first (default) language
{
$oSubQuestion=new Question;
Expand Down
Expand Up @@ -50,7 +50,6 @@
<?php endforeach;?>
</ul>
<?php
$first=true;
$sortorderids='';
$codeids='';
?>
Expand Down Expand Up @@ -90,7 +89,6 @@
<?php echo sprintf(gT("Answer scale %s"),$scale_id+1); ?>
</div>
<?php endif; ?>

<?php endif; ?>

<!-- Answers/Subquestions Table -->
Expand Down Expand Up @@ -388,12 +386,14 @@ class='answer form-control input-lg'
<?php endif; ?>

</div>
<?php $position=sprintf("%05d", $position); $first=false; ?>
<?php $position=sprintf("%05d", $position); ?>
<?php endfor;?>
</div>
<?php $first=false; ?>
<?php endforeach; ?>



<!-- Bootstrap modals -->

<!-- quickaddModal -->
Expand Down
Expand Up @@ -172,7 +172,6 @@ class="highlight"
</div>

<?php }

$first=false; ?>
</div>
<?php } ?>
Expand Down

0 comments on commit 8adf174

Please sign in to comment.