View Issue Details

IDProjectCategoryView StatusLast Update
14003Bug reports[All Projects] _ Unknownpublic2019-06-08 22:40
ReporterSiemAssigned Todominikvitt 
Status confirmedResolutionopen 
Product Version3.13.x 
Target VersionFixed in Version 
Summary14003: progressbar includes hidden questions

When there are hidden calculation questions (questions that have "Always hide this question" turned on) the progress bar also counts these when indicating the progress.

Solution: the X-variable used in "There are X questions in this survey" is counting the questions right. Why not use the same count in the 'total questions variable' of the progress-bar?

Steps To Reproduce

create a survey that has a progress-bar with 10 questions.

the first 5 questions are normal questions, the last 5 questions are for instance equations with "Always hide this question" turned on.

At question #5, the last visible question for the participant, the progress-bar will indicate 40% instead of 80%, since it includes the hidden questions in its count.

TagsNo tags attached.
Complete LimeSurvey version number (& build) Version 3.14.5+180815
I will donate to the project if issue is resolvedNo
Database & DB-VersionMySQL 5.5.60-0+deb7u1
Server OS (if known)Debian (DB: 201802130)
Webserver software & version (if known)Apache/2.2.22 (Debian)
PHP VersionPHP 5.6


duplicate of 11361 assignedLouisGac progress bar counts hidden questions 




2018-09-19 15:55

partner   ~49092

The numbering with hidden questions seems to wrong too.,-numbering-is-wrong

The impact and way of hiding questions might need a broader look. Currently many workarounds need to hide the question via CSS or Javascript, which will cause the same "visual" glitches to the respondent.

The hide question option might should be improved to recognize these techniques too.



2019-01-10 09:38

developer   ~50143

Someone have a lss to start fixing issue ?



2019-06-07 19:56

reporter   ~52332

Wondering if this has a projected resolution. With one of my surveys, I have a group of 30 items plus a group of 9 hidden equations. The progress bar shows 76% (30/39) when the last item is answered and users are confused when the survey concludes. Looks like this has been an issue for a while (see "duplicate" 11665).



2019-06-08 09:29

developer   ~52333

@teracomp : i write «Someone have a lss to start fixing issue ?»
Personnaly, except major issue : no lss , no fix (or not need for me)…

I know i can do a lss easily, but it take time :)



2019-06-08 11:29

reporter   ~52334


I have a workaround for this problem, I put this code in the custom.jss of the theme of the survey, you change the number 226 to the number of questions in your survey:

$(document).on('ready pjax:scriptcomplete',function(){
var QUESTIONS = 226;
var questionNumber = $(".question-number").text() - 1;
var progressValue = (Math.round((questionNumber/QUESTIONS)*1000)/10);
if (progressValue < 0){
progressValue = 0;
'transition': 'width 0s ease 0s',
'width': progressValue+'%'
}).attr('aria-valuenow', progressValue).text(progressValue+'%');



2019-06-08 13:22

reporter   ~52336

Here is a LSS survey to work with. There are 3 groups: background (1 question), items (10 questions-randomized), and calculations (5-do not show expressions).
When the survey starts, it indicates there are 11 questions (background + items). After answering the background question and clicking next, you'll see the survey is 6% complete (1 / 16). By the time I get to the last item, the progress bar will show 62%. When I click [NEXT] on the last item, the survey is suddenly complete (from 62% to the end). From the user's perspective, they didn't answer most of the questions.

I will try the workaround from Siem, of course, but this is provided per @DenisChenu request.

limesurvey_survey_progressbar_test.lss (25,424 bytes)


2019-06-08 22:40

reporter   ~52337

Borrowing @Siem's idea, here's my solution to solve a number of issues. (See attached LSS file).

  1. Instead of adding the script to my theme, I include this in the source code for the group. This allows me to use this for each survey where necessary.
  2. One of the nagging issues is the user never gets to "Submit" the survey. I added a group named "All Done" and provided a text question to prompt the user to simply click submit. At this point, the progress bar will show 100% and the user can click submit with confidence.
  3. I added a second batch of questions (group: "Items2") with the same randomization code ("all") to show that multiple groups can be randomized with random questions being served. This meets the needs for several of my longer survey instruments that have multiple groups and more questions.

Assuming #thisstep is the right variable to use, this method seems to solve my current issues. I'm obviously open to suggestions, especially if my assumption is faulty!

Recommendation: If this logic is valid, it seems like a rather simple solution is to expose a "Total Questions for Progress Bar" property on the Settings:Presentation panel. Whatever value is entered there would be the basis for the progress bar.

$(document).on('ready pjax:scriptcomplete',function(){
var TotalPBarQuestions = 21; // total questions to count for progress-bar
var qFactor = round( ( 100 / TotalPBarQuestions ), 1); // divide progress-bar into equal segments
var current = parseInt( $('#thisstep').val() ) - 1; // use #thisstep hidden value to determine question #
var progressValue = round( current * qFactor, 0); // round value for display

// control bounds
if ( progressValue &lt;= 0 ){
    progressValue = 0;
} else if ( progressValue > 100 ) {

// set progress-bar
$('.progress-bar').css({'transition': 'width 0s ease 0s', 'width': progressValue+'%' }).attr('aria-valuenow', progressValue).text(progressValue+'%');


limesurvey_progBarWorkaround.lss (35,170 bytes)

Issue History

Date Modified Username Field Change
2018-08-24 10:53 Siem New Issue
2018-09-07 13:29 dominikvitt Assigned To => dominikvitt
2018-09-07 13:29 dominikvitt Status new => assigned
2018-09-07 13:29 dominikvitt Status assigned => confirmed
2018-09-19 15:55 jelo Note Added: 49092
2019-01-10 09:38 DenisChenu Note Added: 50143
2019-01-29 13:09 jelo Relationship added duplicate of 11361
2019-06-07 19:56 teracomp Note Added: 52332
2019-06-08 09:30 DenisChenu Note Added: 52333
2019-06-08 11:29 Siem Note Added: 52334
2019-06-08 13:22 teracomp File Added: limesurvey_survey_progressbar_test.lss
2019-06-08 13:22 teracomp Note Added: 52336
2019-06-08 22:40 teracomp File Added: limesurvey_progBarWorkaround.lss
2019-06-08 22:40 teracomp Note Added: 52337