Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

change the way the progress bar acts

  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #117381 by pmonstad
change the way the progress bar acts was created by pmonstad
I find it rather odd the progress bar always starts at position 0% in the first question. If I have 10 questions in a survey I believe it should be 10% on the first question, and 100% at the last, not 0% on the first and 90% on the last.

Is there any place I could change this behaviour, or am I the only person finding this a little odd?
The topic has been locked.
More
9 years 1 month ago - 9 years 1 month ago #117382 by jelo
Replied by jelo on topic change the way the progress bar acts
You could add a little Javascript to the Questiontext or Grouptext.
Code:
<script>
  $(document).ready(function() {
    $("#progressbar").progressbar({ value: 10 });
  });
  </script>

That way the progressbar is set to 10.

I would like to see a way to see an option tab for the progress bar.

Postion: Top / Bottom

Beginning Value: e.g 10%
Ending Value: e.g 80%

Calulation of Value via different algorithms:
a) Position of currently displayed question
b) Questions already seen

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Last edit: 9 years 1 month ago by jelo.
The topic has been locked.
  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #117385 by pmonstad
Replied by pmonstad on topic change the way the progress bar acts

jelo wrote: You could add a little Javascript to the Questiontext or Grouptext.

Code:
<script>
  $(document).ready(function() {
    $("#progressbar").progressbar({ value: 10 });
  });
  </script>

That way the progressbar is set to 10.

I would like to see a way to see an option tab for the progress bar.

Postion: Top / Bottom

Beginning Value: e.g 10%
Ending Value: e.g 80%

Calulation of Value via different algorithms:
a) Position of currently displayed question
b) Questions already seen


Thanks! I will test this. I think I found another solution, changing the line
$percentcomplete = makegraph($_SESSION[$LEMsessid]+1, $_SESSION[$LEMsessid]);

I added "+1" after the step parameter. The file I altered is application/helpers/SurveyRuntimeHelper.php (line 898) in build 141229.
The topic has been locked.
  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #117390 by pmonstad
Replied by pmonstad on topic change the way the progress bar acts
Some wrong pasting in the code line abow. Here is the correct code:
$percentcomplete = makegraph($_SESSION[$LEMsessid]+1, $_SESSION[$LEMsessid]);
The topic has been locked.
More
9 years 1 month ago #117392 by jelo
Replied by jelo on topic change the way the progress bar acts

pmonstad wrote: I added "+1" after the step parameter. The file I altered is application/helpers/SurveyRuntimeHelper.php (line 898) in build 141229.

Since I update LS often, I try to keep my hand off the php code. But a good alternative. Perhaps a plugin is the way to go.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago #117402 by DenisChenu
Replied by DenisChenu on topic change the way the progress bar acts
progressbar jquery function can be replaced in template.js

github.com/Shnoulle/skeletonquest/blob/master/template.js#L334

But we must use a function more easily replaced in template.js. Maybe you can put a feature request.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #117410 by pmonstad
Replied by pmonstad on topic change the way the progress bar acts
Thanks Denis! I will sum up both requests mentioned here and make them a feature request.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago - 9 years 1 month ago #117411 by DenisChenu
Replied by DenisChenu on topic change the way the progress bar acts
I think we just need:

makegraph; call a javascript function. Default function do :
Code:
function doProgressBar(step,maxstep){
  $(document).ready(function() {
    $("#progressbar").progressbar({ value: step/maxstep });
  });
}

in surveyruntime js.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 9 years 1 month ago by DenisChenu.
The topic has been locked.
  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #117415 by pmonstad
Replied by pmonstad on topic change the way the progress bar acts
Thanks Denis! Can you guide me a little here as I'm not sure where to find the file surveyhelper.js Is the function just to be added at the bottom of this file? And if I run an update it will be replaced again?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago #117416 by holch
Replied by holch on topic change the way the progress bar acts
Well, I guess this has also to do with "philosophy".

There are two ways to see it:
- When you see the first question, you actually haven't made any progress yet, thus it starts with 0%. When you pass to the next question, you actually made some progress and the % go up.

Or the way you see it. All in all, I wouldn't give too much weight to the progress bar. It is just for people knowing, more or less, how much is left. If it starts with 0% or with 10% wouldn't worry me too much.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • pmonstad
  • pmonstad's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #117417 by pmonstad
Replied by pmonstad on topic change the way the progress bar acts
Yeah, not I big deal really, but it is quite strange to be at the last page (group-by group), the graph shows e.g. 80% and as soon as you hit next it is in fact completed. It makes more sense if if starts at a higher level than 0% at the first question.

I answer a lot of surveys during a month (not LimeSurvey) and I think most if not all starts at a higher level than 0, which makes much more sense to me :-)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose