View Issue Details

IDProjectCategoryView StatusLast Update
04599User patchesSurvey Takingpublic2010-12-14 13:02
Reporteruser9586Assigned Toc_schmitz 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.90 
Target VersionFixed in Version1.91 
Summary04599: In "question by question" mode, you cannot go "back" from the starting element of a group.
Description

In "question by question" mode, you cannot go "back" from the starting element of a group, you can only go "forward".

Steps To Reproduce

Create a new questionnaire, two groups (A and B), with one question each.
At the start of the group B, only "next" is displayed. Still, if you go forward, the first question of group B will allow you to go back to group A (skipping the introduction of group B entirely).

Additional Information

Note that I'm fine with the current behavior of "back" of the first question of a group skipping the group itself, but when the group text is displayed, a 'back' button should also be made available.

TagsNo tags attached.
Complete LimeSurvey version number (& build)9114

Activities

user9586

2010-09-29 17:48

  ~12939

The fix seems trivial.

c_schmitz

c_schmitz

2010-10-11 23:55

administrator   ~13092

Can you please provide the patch as a subversion patch (svn diff) against our 1.91 development version at the subversion branch at :
https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev

Thank you!

user9586

2010-11-08 16:24

  ~13461

Next patch.

Let me further clarify the resulting behavior of the patch: in question-by-question mode, a group description is shown (if present) only when going forward (as before).

In the group description, you can now also go back to the last question of the previous group: without the patch, you had to go forward to the next question and then backward.

user9586

2010-11-10 16:54

 

patch-svn-2.diff (2,011 bytes)
Index: question.php
===================================================================
--- question.php	(revision 9443)
+++ question.php	(working copy)
@@ -21,9 +21,7 @@
 //Move current step
 if (!isset($_SESSION['step'])) {$_SESSION['step']=0;}
 if (!isset($_SESSION['totalsteps'])) {$_SESSION['totalsteps']=0;}
-if (!isset($_POST['newgroupondisplay'])) {$_POST['newgroupondisplay'] = "";}
-if (isset($move) && $move == "moveprev" && !$_POST['newgroupondisplay'] && $thissurvey['allowprev']=='Y') {$_SESSION['step'] = $thisstep-1;}
-elseif (isset($move) && $move == "moveprev" && $_POST['newgroupondisplay'] == "Y" && $thissurvey['allowprev']=='Y') {$_SESSION['step'] = $thisstep;}
+if (isset($move) && $move == "moveprev" && $thissurvey['allowprev']=='Y' && $_SESSION['step'] > 0) {$_SESSION['step'] = $thisstep-1;}
 if (isset($move) && $move == "movenext")
 {
     if ($_SESSION['step']==$thisstep)
@@ -458,7 +456,6 @@
     echo "\n";
 
     $_SESSION['step']--;
-    echo "\t<input type='hidden' name='newgroupondisplay' value='Y' id='newgroupondisplay' />\n";
 }
 else
 {
Index: index.php
===================================================================
--- index.php	(revision 9443)
+++ index.php	(working copy)
@@ -2751,8 +2751,8 @@
         $surveymover = "<input type=\"hidden\" name=\"move\" value=\"movenext\" id=\"movenext\" />";
     }
 
-
-    if (isset($_SESSION['step']) && $_SESSION['step'] > 0 && $thissurvey['format'] != "A" && !$presentinggroupdescription && $thissurvey['allowprev'] != "N")
+    if (isset($_SESSION['step']) && $thissurvey['format'] != "A" && $thissurvey['allowprev'] != "N" &&
+	($_SESSION['step'] > 0 || (!$_SESSION['step'] && $presentinggroupdescription && $thissurvey['showwelcome'] == 'Y')))
     {
         $surveymover .= "<input class='submit' accesskey='p' type='button' onclick=\"javascript:document.limesurvey.move.value = 'moveprev'; $('#limesurvey').submit();\" value=' &lt;&lt; "
         . $clang->gT("Previous")." ' name='move2' id='moveprevbtn' />\n";
patch-svn-2.diff (2,011 bytes)

user9586

2010-11-10 16:56

  ~13483

In "patch-svn-2.diff" I also enable "Previous" for the description of the first group when "showwelcome" is enabled. In this case, pressing "Previous" will bring you back to the welcome screen, as "Previous" in the first question would do.

Issue History

Date Modified Username Field Change
2010-09-14 18:29 user9586 New Issue
2010-09-29 17:48 user9586 File Added: patch.diff
2010-09-29 17:48 user9586 Note Added: 12939
2010-09-29 18:24 user9586 File Added: patch2.diff
2010-10-11 23:55 c_schmitz Status new => feedback
2010-10-11 23:55 c_schmitz Note Added: 13092
2010-11-08 16:20 user9586 File Added: patch-svn.diff
2010-11-08 16:24 user9586 Note Added: 13461
2010-11-08 16:24 user9586 Status feedback => new
2010-11-08 16:47 c_schmitz Assigned To => c_schmitz
2010-11-08 16:47 c_schmitz Status new => assigned
2010-11-10 16:54 user9586 File Added: patch-svn-2.diff
2010-11-10 16:56 user9586 Note Added: 13483
2010-11-10 18:13 c_schmitz File Deleted: patch.diff
2010-11-10 18:14 c_schmitz File Deleted: patch2.diff
2010-11-10 18:14 c_schmitz File Deleted: patch-svn.diff
2010-11-10 18:17 c_schmitz Status assigned => resolved
2010-11-10 18:17 c_schmitz Fixed in Version => 1.91
2010-11-10 18:17 c_schmitz Resolution open => fixed
2010-12-14 13:02 c_schmitz Status resolved => closed