- Posts: 9
- Thank you received: 0
- Community
- Forums
- English support forums
- Design issues
- Hide comments in Multiple choice question with comments
Hide comments in Multiple choice question with comments
- ReenaAyodheea
-
Topic Author
- Offline
- Fresh Lemon
-
Less
More
3 weeks 6 days ago #191055
by ReenaAyodheea
Hello,
I have an issue with the web version of Limesurvey.
I have a multiple choice question with comments and I want to hide comments for some answers. In the local version I used the following script :
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var codesToHide = ; //add answer codes to hide here.
for (var i = 0; i < codesToHide.length; i++) {
$('#answer{SGQ}'+codesToHide+'').parent().parent().find('input:text').hide();
};
});
</script>
This works in the desktop version but not for web version. When I check logic, SGQ is highlighted in red.
Can anyone help ? Note I'm new to lime and java.
Thank you
Reena
I have an issue with the web version of Limesurvey.
I have a multiple choice question with comments and I want to hide comments for some answers. In the local version I used the following script :
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var codesToHide = ; //add answer codes to hide here.
for (var i = 0; i < codesToHide.length; i++) {
$('#answer{SGQ}'+codesToHide+'').parent().parent().find('input:text').hide();
};
});
</script>
This works in the desktop version but not for web version. When I check logic, SGQ is highlighted in red.
Can anyone help ? Note I'm new to lime and java.
Thank you
Reena
Please Log in or Create an account to join the conversation.
- ReenaAyodheea
-
Topic Author
- Offline
- Fresh Lemon
-
Less
More
- Posts: 9
- Thank you received: 0
3 weeks 6 days ago #191056
by ReenaAyodheea
Replied by ReenaAyodheea on topic Hide comments in Multiple choice question with comments
was able to do it with following script :
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Remove the first comment box
$('#question{QID} ul.ls-answers li:eq(0) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(1) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(2) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(3) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(4) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(5) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(6) .comment-item').remove();
});
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Remove the first comment box
$('#question{QID} ul.ls-answers li:eq(0) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(1) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(2) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(3) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(4) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(5) .comment-item').remove();
$('#question{QID} ul.ls-answers li:eq(6) .comment-item').remove();
});
Please Log in or Create an account to join the conversation.