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
  • arunicbe's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 3 months ago #139895 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?
The topic has been locked.
More
8 years 3 months ago #139900 by jelo
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.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • arunicbe
  • arunicbe's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 3 months ago #139904 by arunicbe
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.
The topic has been locked.
More
8 years 3 months ago #139909 by jelo
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.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • arunicbe
  • arunicbe's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 3 months ago #139912 by arunicbe
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.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 3 months ago #139914 by tpartner
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.
More
8 years 3 months ago #139916 by jelo

tpartner wrote: In version 2.5, the progress bars have been switched from jQuery to Bootstrap (for some reason?)

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.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
7 years 5 months ago #155097 by bruce78

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
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #155102 by tpartner
Yes, you can use it in any question.

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.
More
7 years 5 months ago #155108 by bruce78
Great, thanks Tony...
The topic has been locked.
More
7 years 5 months ago #155476 by marektondryk
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 :O ) and counted on a progress bar...
I have no idea what I'm doing wrong....
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose