{# !!!! BECAREFUL: ONLY FOR TESTING !!!!! !!!! DON'T START TO TRANSLATE ALL VIEWS BASED ON THIS MODEL !!!!! !!!! IT WILL PROBABLY FIRST NEED TO CHANGE THE TWIG TEMPLATE SYNTAX TO AVOID CONFLICT WITH EXPRESSION MANAGER !!!! /** * 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 **** Additional attributes: * @var question_template_attribute.show_handle * @var question_template_attribute.only_pull * @var question_template_attribute.visualize */ #}
{% set script %} try{ var ranking{{qId}} = new RankingQuestion({ max_answers : "{{ processString("{" ~ max_answers ~ "}", 1) }}", min_answers : "{{ processString("{" ~ min_answers ~ "}", 1) }}", showpopups : "{{showpopups}}", samechoiceheight : "{{samechoiceheight}}", samelistheight : "{{samelistheight}}", rankingName : "{{rankingName}}", questionId : "{{qId}}" }); ranking{{qId}}.init() } catch(e){} {% endset %} {{ registerPackage('sortablejs') }} {{ registerPackage('question-ranking') }} {{ registerScript( 'RankingQuestionTranslate'~qId, 'LSvar.lang.rankhelp="' ~ gT("Double-click or drag-and-drop items in the left list to move them to the right - your highest ranking item should be on the top right, moving through to your lowest ranking item.") ~ '";', 'POS_BEGIN') }} {{ registerScript( 'RankingQuestion'~qId, script, 'POS_POSTSCRIPT') }}