Skip to content

Commit

Permalink
Fixed issue #10696: Array filter not working on ranking
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Mar 7, 2016
1 parent 3bca021 commit 09525c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions application/helpers/qanda_helper.php
Expand Up @@ -2106,6 +2106,7 @@ function do_ranking($ia)
);
$secondlistDatas = array(
'rankId'=>$ia[0],
'rankingName'=>$ia[1],
'max_answers'=>$max_answers,
'min_answers'=>$min_answers,
'answers'=>$answers
Expand Down
3 changes: 2 additions & 1 deletion application/views/survey/questions/ranking/second_list.php
Expand Up @@ -2,6 +2,7 @@
/**
* Ranking question, Html between the two lists of items
* @var $rankId $ia[0]
* @var $rankingName $ia[1]
* @var $max_answers
* @var $min_answers
*/
Expand All @@ -17,7 +18,7 @@
</div>

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

Expand Down
8 changes: 4 additions & 4 deletions scripts/ranking.js
Expand Up @@ -10,13 +10,13 @@
* @param {number} qId The qid of the question where apply.
*/
function doDragDropRank(qID, showpopups, samechoiceheight, samelistheight) {
console.log('doDragDropRank');
// TODO : advanced setting in attributes
if (typeof showpopups === 'undefined'){showpopups=true;}
if (typeof samechoiceheight === 'undefined'){samechoiceheight=true;}
if (typeof samelistheight === 'undefined'){ samelistheight=true;}
var maxanswers= parseInt($("#ranking-"+qID+"-maxans").text().trim(),10);
var rankingname= "javatbd"+$("#ranking-"+qID+"-name").text().trim();
console.log('rankingname: '+rankingname);
var rankingnamewidth=rankingname.length;
//Add a class to the question
$('#question'+qID+'').addClass('dragDropRanking');
Expand Down Expand Up @@ -126,9 +126,9 @@ function doDragDropRank(qID, showpopups, samechoiceheight, samelistheight) {
* @param {number} qId The qid of the question where apply.
*/
function updateDragDropRank(qID){
var maxanswers= parseInt($("#ranking-"+qID+"-maxans").text().trim(),10);
var rankingname= "javatbd"+$("#ranking-"+qID+"-name").text().trim();
var relevancename= "relevance"+$("#ranking-"+qID+"-name").text().trim();
var maxanswers= parseInt($("#ranking-"+qID+"-maxans").text().trim(),10);
var rankingname= "javatbd"+$("#ranking-"+qID+"-name").text().trim();
var relevancename= "relevance"+$("#ranking-"+qID+"-name").text().trim();
var rankingnamewidth=rankingname.length;
$('#question'+qID+' .select-item select').val('');
$('#sortable-rank-'+qID+' li').each(function(index) {
Expand Down

0 comments on commit 09525c2

Please sign in to comment.