Skip to content

Commit

Permalink
Dev: Ranking question, Human Readable views
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Apr 5, 2016
1 parent 575d5d5 commit 8ab272b
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 207 deletions.
220 changes: 102 additions & 118 deletions application/helpers/qanda_helper.php

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions application/views/survey/questions/ranking/answer.php
@@ -0,0 +1,80 @@
<?php
/**
* Ranking question, item list header Html
* @var $sOptions : the select options, generated with the view answer_row.php
*
* @var $name
* @var $myfname
* @var $labeltext
* @var $rankId
* @var $rankingName
* @var $max_answers
* @var $min_answers
* @var $qid
* @var $choice_title
* @var $rank_title
* @var $rank_help
* @var $showpopups
* @var $samechoiceheight
* @var $samelistheight
*/
?>

<!-- Ranking -->

<!-- answer -->
<div class="ranking-answers">
<ul class="list-unstyled answers-list select-list">
<li class="select-item">
<label for="answer<?php echo $myfname;?>">
<?php echo $labeltext;?>
</label>

<select class='form-control' name="<?php echo $myfname;?>" id="answer<?php echo $myfname;?>">

<?php
// rows/answer_row.php
echo $sOptions;
?>
</select>

<!-- Hidden form: maybe can be replaced with ranking.js -->
<input type="hidden" id="java<?php echo $myfname;?>" disabled="disabled" value="<?php echo $thisvalue; ?>"/>
</li>
</ul>

<div style='display:none' id='ranking-<?php echo $rankId;?>-maxans'>
<?php echo $max_answers;?>
</div>

<div style='display:none' id='ranking-<?php echo $rankId;?>-minans'>
<?php echo $min_answers;?>
</div>

<div style='display:none' id='ranking-<?php echo $rankId;?>-name'>
<?php echo $rankingName;?>
</div>
</div>

<!-- The list with HTML answers -->
<div style="display:none">
<?php foreach ($answers as $ansrow):?>
<div id="htmlblock-<?php echo $rankId;?>-<?php echo $ansrow['code'];?>">
<?php echo $ansrow['answer']; ?>
</div>
<?php endforeach;?>
</div>


<script type='text/javascript'>
<!--
var aRankingTranslations = {
choicetitle: '<?php echo $choice_title;?>',
ranktitle: '<?php echo $rank_title;?>',
rankhelp: '<?php echo $rank_help;?>'
};

doDragDropRank(<?php echo $rankId; ?>, <?php echo $showpopups;?>,<?php echo $samechoiceheight;?>,<?php echo $samelistheight;?>);
-->
</script>
<!-- end of answer -->
8 changes: 0 additions & 8 deletions application/views/survey/questions/ranking/header.php

This file was deleted.

11 changes: 0 additions & 11 deletions application/views/survey/questions/ranking/item_list_footer.php

This file was deleted.

13 changes: 0 additions & 13 deletions application/views/survey/questions/ranking/item_list_header.php

This file was deleted.

25 changes: 0 additions & 25 deletions application/views/survey/questions/ranking/script.php

This file was deleted.

32 changes: 0 additions & 32 deletions application/views/survey/questions/ranking/second_list.php

This file was deleted.

0 comments on commit 8ab272b

Please sign in to comment.