Skip to content

Commit

Permalink
Dev: quanda cleaning, and views for array 5point question type
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Mar 22, 2016
1 parent 9f9ceac commit 178fb70
Show file tree
Hide file tree
Showing 20 changed files with 245 additions and 191 deletions.
14 changes: 9 additions & 5 deletions application/helpers/common_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2783,9 +2783,9 @@ function questionAttributes($returnByName=false)
'sortorder'=>100,
//'inputtype'=>'integer',
'inputtype'=>'columns',
'default'=>'1',
'default'=>'6',
'min'=>'1',
'max'=>'100',
'max'=>'12',
"help"=>gT('The answer options will be distributed across the number of columns set here'),
"caption"=>gT('Display columns'));

Expand Down Expand Up @@ -3583,9 +3583,13 @@ function questionAttributes($returnByName=false)
"types"=>"KNSTUQ;",
'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'text',
"help"=>gT('Width of text input box'),
"caption"=>gT('Input box width'));
//'inputtype'=>'text',
'inputtype'=>'columns',
'default'=>'6',
'min'=>'1',
'max'=>'12',
"help"=>gT('Number of Bootstrap columns for the input box'),
"caption"=>gT('Input box columns'));

$qattributes["text_input_columns"]=array(
"types"=>"Q",
Expand Down
256 changes: 103 additions & 153 deletions application/helpers/qanda_helper.php

Large diffs are not rendered by default.

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
</tr>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
</tbody>
</table>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
</tr>
</thead>
<tbody>
9 changes: 9 additions & 0 deletions application/views/survey/questions/arrays/5point/col.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/**
* Array 5pointchoice, column
*
* @var $odd_even
* @var $cellwidth
*/
?>
<col class="<?php echo $odd_even; ?>" style='width: <?php echo $cellwidth; ?>%;' />
12 changes: 12 additions & 0 deletions application/views/survey/questions/arrays/5point/header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* array 5 point choice Html : Header
* @var $extraclass
*
*/
?>
<div class="no-more-tables no-more-tables-5-point">
<!-- Array 5 point choice -->
<table class="table question subquestion-list questions-list <?php echo $extraclass; ?>">
<colgroup class="col-responses">
<col class="col-answers" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/**
*
*/
?>
</colgroup>
<thead>
<tr class="array1 dontread">
<th>&nbsp;</th>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

<th class='<?php echo $class'>
<?php echo $th_content;?>
</th>
11 changes: 11 additions & 0 deletions application/views/survey/questions/arrays/5point/table_headers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
*
* @var $class
* @var $style
* @var $th_content
*/
?>
<th class='<?php echo $class; ?>' style=<?php echo $style; ?>>
<?php echo $th_content;?>
</th>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/**
* @var $answerwidth
* @var $answertext2
*/
?>
<td class="answertextright" style='text-align:left; width: <?php echo $answerwidth; ?>%;'>
<?php echo $answertext2;?>
</td>
22 changes: 22 additions & 0 deletions application/views/survey/questions/arrays/5point/td_input.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* @var $i
* @var $myfname
* @var $CHECKED
* @var $checkconditionFunction
* @var $value
*/
?>
<td data-title='<?php echo $i;?>' class="answer-cell-1 answer_cell_00<?php echo $i;?> answer-item radio-item">
<label for="answer<?php echo $myfname;?>-<?php echo $i; ?>">
<input
class="radio"
type="radio"
name="<?php echo $myfname; ?>"
id="answer<?php echo $myfname; ?>-<?php echo $i;?>"
value="<?php echo $value; ?>"
<?php echo $CHECKED;?>
onclick="<?php echo $checkconditionFunction; ?>(this.value, this.name, this.type)"
/>
</label>
</td>
19 changes: 19 additions & 0 deletions application/views/survey/questions/arrays/5point/tr_open.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* @var $myfname
* @var $answerwidth
* @var $answertext
* @var $value
*/
?>
<tr id="javatbd<?php echo $myfname;?>" class="well answers-list radio-list" <?php echo $sDisplayStyle; ?>>
<th class="answertext" style="width: <?php echo $answerwidth;?>%;">
<?php if($error): ?>
<div class="alert alert-danger" role="alert">
<?php echo $answertext;?>
</div>
<?php else: ?>
<?php echo $answertext;?>
<?php endif;?>
<input name="java<?php echo $myfname;?>" id="java<?php echo $myfname;?>" value="<?php echo $value;?>" type="hidden">
</th>
14 changes: 0 additions & 14 deletions application/views/survey/questions/arrays/header.php

This file was deleted.

4 changes: 0 additions & 4 deletions application/views/survey/questions/listradio/item_row.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
*
* @var $ia
* @var $ansrow
* @var $nbColLabelXs
* @var $nbColLabelLg
* @var $nbColInputLg
* @var $nbColInputXs
* @var $checkedState
* @var $myfname
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
* @var $sDisable
* @var $sDisplayStyle
* @var $myfname
* @var $nbColLabelXs
* @var $nbColLabelLg
* @var $othertext
* @var $nbColInputLg
* @var $nbColInputXs
* @var $checkedState
* @var $kpclass
* @var $sValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
* @var $hiddenfield
* @var $ia
* @var $ansrow
* @var $nbColLabelXs
* @var $nbColLabelLg
* @var $nbColInputLg
* @var $nbColInputXs
* @var $checkedState
* @var $sCheckconditionFunction
* @var $myfname
Expand Down
25 changes: 25 additions & 0 deletions application/views/survey/questions/ranking/script.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* JavaScript snippet for ranking question
* TODO: create a js file, and move variable to data- HTML5 element in the HTML view.
*
* @var $qid $ia[0]
* @var $choice_title
* @var $rank_title
* @var $rank_help
* @var $showpopups $aQuestionAttributes["showpopups"]
* @var $samechoiceheight $aQuestionAttributes["samechoiceheight"]
* @var $samelistheight $aQuestionAttributes["samelistheight"]
*/
?>
<script type='text/javascript'>
<!--
var aRankingTranslations = {
choicetitle: '<?php echo $choice_title;?>',
ranktitle: '<?php echo $rank_title;?>',
rankhelp: '<?php echo $rank_help;?>'
};

doDragDropRank(<?php echo $qid; ?>, <?php echo $showpopups;?>,<?php echo $samechoiceheight;?>,<?php echo $samelistheight;?>);
-->
</script>
13 changes: 6 additions & 7 deletions templates/default/css/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ input[type="radio"],
.radio input[type="radio"],
.radio-inline input[type="radio"] {
position: relative;
margin-top: 6px;
margin-right: 4px;
vertical-align: top;
border: none;
Expand Down Expand Up @@ -826,20 +825,20 @@ table {
}

.no-more-tables tr,
.array-by-columns-div .radio-list {
border: 1px solid #ccc;
.array-by-columns-div .radio-list {
border: 1px solid #ccc;
padding: 1em;
}

/* Line header ; color is h4 color */
.no-more-tables tr th,
.array-by-columns-div .answertext {
font-size: 1.1em;
text-align: center;
.array-by-columns-div .answertext {
font-size: 1.1em;
text-align: center;
color: #317eac;
}

.array-by-columns-div .answertext {
.array-by-columns-div .answertext {
padding: 8px;
text-align: left;
font-weight: bold;
Expand Down

0 comments on commit 178fb70

Please sign in to comment.