Skip to content

Commit

Permalink
Dev: subquestion display (nicole report)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Dec 11, 2015
1 parent ad661f4 commit 6d49a3f
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions application/views/admin/survey/Question/subQuestion_view.php
Expand Up @@ -81,9 +81,10 @@
$result = $results[$anslang][$scale_id];
$anscount = count($result);
?>
<table class='answertable' id='answertable_<?php echo $anslang; ?>_<?php echo $scale_id; ?>'>
<table class='answertable table' id='answertable_<?php echo $anslang; ?>_<?php echo $scale_id; ?>'>
<thead>
<tr><th>&nbsp;</th>
<tr>
<th><?php eT("Position");?></th>
<th><?php eT("Code"); ?></th>
<th><?php eT("Subquestion"); ?></th>
<?php if ($activated != 'Y' && $first)
Expand Down Expand Up @@ -120,35 +121,40 @@ class="highlight"
$alternate=true;
}
?>
><td>
><td style="vertical-align: middle;">

<?php if ($activated == 'Y' ) // if activated
{ ?>
&nbsp;</td><td><input type='hidden' name='code_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' value="<?php echo $row->title; ?>" maxlength='20' size='5'
&nbsp;</td><td style="vertical-align: middle;"><input type='hidden' name='code_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' value="<?php echo $row->title; ?>" maxlength='20' size='5'
/><?php echo $row->title; ?>
<?php }
elseif ($activated != 'Y' && $first) // If survey is not activated and first language
{ ?>
<?php if($row->title) {$sPattern="^([a-zA-Z0-9]*|{$row->title})$";}else{$sPattern="^[a-zA-Z0-9]*$";} ?>
<span class="glyphicon glyphicon-move"></span>
</td>
<td><input type='hidden' class='oldcode' id='oldcode_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' name='oldcode_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' value="<?php echo $row->title; ?>" />
<input type='text' id='code_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' class='code' name='code_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' value="<?php echo $row->title; ?>" maxlength='20' size='5' pattern='<?php echo $sPattern; ?>' required='required' />
<td style="vertical-align: middle;"><input type='hidden' class='oldcode' id='oldcode_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' name='oldcode_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' value="<?php echo $row->title; ?>" />
<!-- -->
<input type='text' class="form-control input-lg" id='code_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' class='code' name='code_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' value="<?php echo $row->title; ?>" maxlength='20' size='20' pattern='<?php echo $sPattern; ?>' required='required' />

<?php }
else
{ ?>
</td><td><?php echo $row->title; ?>
</td><td style="vertical-align: middle;"><?php echo $row->title; ?>

<?php } ?>

</td><td>
<input type='text' size='0' class='answer' id='answer_<?php echo $row->language; ?>_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' name='answer_<?php echo $row->language; ?>_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' placeholder='<?php eT("Some example subquestion","js") ?>' value="<?php echo $row->question; ?>" onkeypress=" if(event.keyCode==13) { if (event && event.preventDefault) event.preventDefault(); document.getElementById('saveallbtn_<?php echo $anslang; ?>').click(); return false;}" />
<?php echo getEditor("editanswer","answer_".$row->language."_".$row->qid."_{$row->scale_id}", "[".gT("Subquestion:", "js")."](".$row->language.")",$surveyid,$gid,$qid,'editanswer'); ?>
</td><td style="vertical-align: middle;">
<div class="col-sm-10">
<input type='text' size='20' class='answer form-control input-lg' id='answer_<?php echo $row->language; ?>_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' name='answer_<?php echo $row->language; ?>_<?php echo $row->qid; ?>_<?php echo $row->scale_id; ?>' placeholder='<?php eT("Some example subquestion","js") ?>' value="<?php echo $row->question; ?>" onkeypress=" if(event.keyCode==13) { if (event && event.preventDefault) event.preventDefault(); document.getElementById('saveallbtn_<?php echo $anslang; ?>').click(); return false;}" />
</div>
<div style="display: inline-block; margin-top: 10px;">
<?php echo getEditor("editanswer","answer_".$row->language."_".$row->qid."_{$row->scale_id}", "[".gT("Subquestion:", "js")."](".$row->language.")",$surveyid,$gid,$qid,'editanswer'); ?>
</div>
</td>
<?php if ($activated != 'Y' && $first)
{ ?>
<td>
<td style="vertical-align: middle;">
<span class="icon-add text-success btnaddanswer" data-toggle="tooltip" data-placement="bottom" title="<?php eT("Insert a new subquestion after this one") ?>"></span>
<span class="glyphicon glyphicon-trash text-success btndelanswer" data-toggle="tooltip" data-placement="bottom" title="<?php eT("Delete this subquestion") ?>"></span>
</td>
Expand All @@ -157,7 +163,7 @@ class="highlight"


<?php if ($scale_id==0) { /* relevance column */ ?>
<td>
<td style="vertical-align: middle;">
<?php if ($row->relevance!="1" && trim($row->relevance)!="") { ?>
<span class="icon-conditions text-success btntogglerelevance" data-toggle="tooltip" data-placement="bottom" title='<?php eT("Edit subquestion relevance") ?>'></span>
<?php } else { /* no relevance equation: icon deactivated */ ?>
Expand Down

0 comments on commit 6d49a3f

Please sign in to comment.