1) Add this to the end of
template.js (so it can be used for multiple questions):
Code:
function removeAnswerText(qID) {
// Identify some stuff
var thisQuestion = $('#question'+qID);
var thisArray = $('table.questions-list', thisQuestion);
// Only if all row labels are empty
var labelsWithText = $('th.answertext', thisArray).filter(function(i) {return $.trim($(this).text()) != '';}).length
if(labelsWithText == 0) {
// Add a class to the question
thisQuestion.addClass('without-answertext');
// Remove the first column
$('.col-answers, thead td:eq(0), th.answertext', thisArray).remove();
//Reset the column widths
$('col', thisArray).attr('width', 100/$('col', thisArray).length+'%');
}
}
2) Call the function with this script in the question text of the array:
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
removeAnswerText({QID});
});
</script>
3) Since it appears that you are using the citronade template, add this to the end of
template.css:
Code:
.without-answertext table.questions-list thead th:first-child,
.without-answertext table.questions-list tbody td:first-child {
border-width: 1px 1px 0 1px;
border-left-color: #D5DBE7;
}
.without-answertext table.questions-list tbody td:last-child {
border-right-color: #D5DBE7;
}