Skip to content

Commit

Permalink
Dev: Converted php into twig for arrays/array/dropdown question type
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikvitt committed May 4, 2018
1 parent 40b6c90 commit 7beb995
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 72 deletions.

This file was deleted.

@@ -0,0 +1,30 @@
{#
/**
* array array, dropdown, Html
*
* @var $sRows : the rows, generated with the view rows/answer_row.php
*
* @var $extraclass
*
*/
#}
<!-- Array -->

<!-- answer -->
<table class="{{ coreClass }} table table-bordered table-hover table-array-dropdown" role="group" aria-labelledby="ls-question-text-{{ basename }}">
<colgroup class="col-responses">
<col class="col-answers" style='width: {{ answerwidth }}%;' />
<col class="odd" style='width: {{ columnswidth }}%;' />
{% if right_exists %}
<col class="col-answersright" style='width: {{ answerwidth }}%;' />
{% endif %}
</colgroup>
<tbody>

{# rows/answer_row.php #}
{{ sRows }}

</tbody>
</table>
<!-- end of answer -->

This file was deleted.

@@ -0,0 +1,4 @@
<!-- empty -->
<p class="error">
{{ gT("Error: There are no answer options for this question and/or they don't exist in this language."); }}
</p>

This file was deleted.

@@ -0,0 +1,40 @@
{#
/**
* @var $myfname
* @var $answertext
* @var $value
* @var $error
* @var $checkconditions
* @var $options
* @var $thRight
* @var $tdRight
* @var $right_exists
* @var $answertextright
*/
#}
<tr id="javatbd{{ myfname }}" class="question-item answer-item dropdown-item {% if odd %} ls-odd {% else %} ls-even{% endif %}{% if error %} ls-error-mandatory has-error{% endif %}" >
<th class="answertext control-label{% if answerwidth==0 %} sr-only{% endif %}">
<label for="answer{{ myfname }}">
{{ answertext }}
</label>

{# Value for expression manager javascript (use id) ; no need to submit #}
{{ C.Html.hiddenField("java"~myfname,value,({
'id' : "java"~myfname,
'disabled' : true,
}))
}}
</th>
<td>
<select class="form-control" name="{{ myfname }}" id="answer{{ myfname }}">
{% for option in options %}
<option value="{{ option.value }}" {{ option.selected }}>
{{ option.text }}
</option>
{% endfor %}
</select>
</td>
{% if right_exists %}
<th class='answertextright information-item'>{{ answertextright }}</th>
{% endif %}
</tr>

0 comments on commit 7beb995

Please sign in to comment.