- Posts: 73
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Progress Bar shows wrong percentage display with hidden questions.
- arunicbe
- Topic Author
- Offline
- Senior Member
Less
More
7 years 7 months ago #139895
by arunicbe
Progress Bar shows wrong percentage display with hidden questions. was created by arunicbe
I am using LS Version 2.50+ Build 160715.
I have a survey with 14 questions and 20 hidden equation questions.
The progress bar seems to be taking count of the hidden questions also. It shows around 26% when the last question is displayed (14th question).
Is it possible to fix this?
I have a survey with 14 questions and 20 hidden equation questions.
The progress bar seems to be taking count of the hidden questions also. It shows around 26% when the last question is displayed (14th question).
Is it possible to fix this?
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
7 years 7 months ago #139900
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Progress Bar shows wrong percentage display with hidden questions.
Limesurvey is missing an option to calculate progress on shown questions instead of position.
You can support a feature request
bugs.limesurvey.org/view.php?id=9677
In that feature request you'll find a note how to modify the progressbar via JQuery.
You can support a feature request
bugs.limesurvey.org/view.php?id=9677
In that feature request you'll find a note how to modify the progressbar via JQuery.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- arunicbe
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 73
- Thank you received: 0
7 years 7 months ago #139904
by arunicbe
Replied by arunicbe on topic Progress Bar shows wrong percentage display with hidden questions.
Hello,
Thanks.
I am trying your workaround. If I paste this script in endpage.pstpl. I get javascript error "Unexpected token <" .
<script type="text/javascript">
$(document).ready(function() {
modprocessbar({processbarValueStart},{processbarValueEnd});
});
</script>
On inspection it shows the error.
modprocessbar(<span class='em-expression em-haveerror'><span title='Undefined variable' class='em-error'><span title='Undefined variable' class='em-var em-var-error' >processbarValueStart</span></span></span>,<span class='em-expression em-haveerror'><span title='Undefined variable' class='em-error'><span title='Undefined variable' class='em-var em-var-error' >processbarValueEnd</span></span></span>);
Do I need to define the two variables.
Thanks.
I am trying your workaround. If I paste this script in endpage.pstpl. I get javascript error "Unexpected token <" .
<script type="text/javascript">
$(document).ready(function() {
modprocessbar({processbarValueStart},{processbarValueEnd});
});
</script>
On inspection it shows the error.
modprocessbar(<span class='em-expression em-haveerror'><span title='Undefined variable' class='em-error'><span title='Undefined variable' class='em-var em-var-error' >processbarValueStart</span></span></span>,<span class='em-expression em-haveerror'><span title='Undefined variable' class='em-error'><span title='Undefined variable' class='em-var em-var-error' >processbarValueEnd</span></span></span>);
Do I need to define the two variables.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
7 years 7 months ago #139909
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Progress Bar shows wrong percentage display with hidden questions.
Via JavaScript/JQuery:
Read current value:
var valueprogress = $("#progressbar").progressbar("option","value");
Set value:
$("#progressbar").progressbar({
value: valueprogressnew
});
You might correct the progress by hand after finishing the survey design.
E.g. you can use the questions group to add the JavaScript and set the value of the progress-bar by hand.
The workaround in the bugtracker is used to bridge surveys. The
processbarValueStart and processbarValueEnd are hidden equation questions.
That way the survey designer don't need to fiddle with the javascript code.
But it won't make any sense to use that part for your issue.
Read current value:
var valueprogress = $("#progressbar").progressbar("option","value");
Set value:
$("#progressbar").progressbar({
value: valueprogressnew
});
You might correct the progress by hand after finishing the survey design.
E.g. you can use the questions group to add the JavaScript and set the value of the progress-bar by hand.
The workaround in the bugtracker is used to bridge surveys. The
processbarValueStart and processbarValueEnd are hidden equation questions.
That way the survey designer don't need to fiddle with the javascript code.
But it won't make any sense to use that part for your issue.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- arunicbe
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 73
- Thank you received: 0
7 years 7 months ago #139912
by arunicbe
Replied by arunicbe on topic Progress Bar shows wrong percentage display with hidden questions.
Meanwhile I found this issue has been fixed.
bugs.limesurvey.org/plugin.php?page=Source/view&id=19386
I am using LS Version 2.50+ Build 160715. But this is not updated in this version.
bugs.limesurvey.org/plugin.php?page=Source/view&id=19386
I am using LS Version 2.50+ Build 160715. But this is not updated in this version.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
7 years 7 months ago #139914
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Progress Bar shows wrong percentage display with hidden questions.
In version 2.5, the progress bars have been switched from jQuery to Bootstrap (for some reason?) so I think you will need to add something like this to the source of the group description or a question:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var progressValue = 32; $('.progress-bar').css({ 'transition': 'width 0s ease 0s', 'width': progressValue+'%' }).attr('aria-valuenow', progressValue).text(progressValue+'%'); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: jelo
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
7 years 7 months ago #139916
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Progress Bar shows wrong percentage display with hidden questions.
Thanks for pointing that out. Looks like i no longer need to answer topics around LS 2.5. Currently no option for me to switch from LTS.tpartner wrote: In version 2.5, the progress bars have been switched from jQuery to Bootstrap (for some reason?)
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- bruce78
- Offline
- Senior Member
Less
More
- Posts: 77
- Thank you received: 4
6 years 10 months ago #155097
by bruce78
Thanks Tony, this works for me... I assume I can use this to set the progress bar % for any question or question group? Also, do you know if this will be upgrade safe between 2.5 and 3.0?
Replied by bruce78 on topic Progress Bar shows wrong percentage display with hidden questions.
tpartner wrote: In version 2.5, the progress bars have been switched from jQuery to Bootstrap (for some reason?) so I think you will need to add something like this to the source of the group description or a question:
Code:<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var progressValue = 32; $('.progress-bar').css({ 'transition': 'width 0s ease 0s', 'width': progressValue+'%' }).attr('aria-valuenow', progressValue).text(progressValue+'%'); }); </script>
Thanks Tony, this works for me... I assume I can use this to set the progress bar % for any question or question group? Also, do you know if this will be upgrade safe between 2.5 and 3.0?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
6 years 10 months ago #155102
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Progress Bar shows wrong percentage display with hidden questions.
Yes, you can use it in any question.
3.x will also use Bootstrap so you should be safe.
3.x will also use Bootstrap so you should be safe.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: bruce78
The topic has been locked.
- bruce78
- Offline
- Senior Member
Less
More
- Posts: 77
- Thank you received: 4
6 years 10 months ago #155108
by bruce78
Replied by bruce78 on topic Progress Bar shows wrong percentage display with hidden questions.
Great, thanks Tony...
The topic has been locked.
- marektondryk
- Offline
- Premium Member
Less
More
- Posts: 105
- Thank you received: 0
6 years 9 months ago #155476
by marektondryk
Replied by marektondryk on topic Progress Bar shows wrong percentage display with hidden questions.
I have the same problem.
LS 2.64.7+170404
I have survey with 60 questions in six groups (10 questions in each group). There are 60 hidden equation questions which are displayed ( I don't know why - each one is hide ) and counted on a progress bar...
I have no idea what I'm doing wrong....
LS 2.64.7+170404
I have survey with 60 questions in six groups (10 questions in each group). There are 60 hidden equation questions which are displayed ( I don't know why - each one is hide ) and counted on a progress bar...
I have no idea what I'm doing wrong....
The topic has been locked.