diff --git a/application/helpers/qanda_helper.php b/application/helpers/qanda_helper.php index d6246cee216..bb3c656be07 100644 --- a/application/helpers/qanda_helper.php +++ b/application/helpers/qanda_helper.php @@ -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 diff --git a/application/views/survey/questions/ranking/second_list.php b/application/views/survey/questions/ranking/second_list.php index 7110a1cc84e..02e55205f2e 100644 --- a/application/views/survey/questions/ranking/second_list.php +++ b/application/views/survey/questions/ranking/second_list.php @@ -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 */ @@ -17,7 +18,7 @@ diff --git a/scripts/ranking.js b/scripts/ranking.js index a9ad1f120d6..a4790915ad8 100644 --- a/scripts/ranking.js +++ b/scripts/ranking.js @@ -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'); @@ -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) {