View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
03517Bug reportsSurvey editingpublic2009-08-09 19:04
ReporterMazi Assigned Touser4399 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.85+ 
Fixed in Version1.85+ 
Summary03517: When adding new questions they can't be added at the beginning
Description

How to reproduce:

  1. Create a survey
  2. Create a group
  3. Create Q1
  4. Create Q2 chosing "Position: at beginning"

Q2 is shown after Q1 and not placed at the beginning. Same when adding more questions, they are always placed second place and not at the beginning.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)7348
I will donate to the project if issue is resolved
BrowserFF3
Database type & versionMy Sql 5.1.30
Server OS (if known)Win XP Sp 3
Webserver software & version (if known)Apache 2.2
PHP Version5.2

Users monitoring this issue

There are no users monitoring this issue.

Activities

user372

2009-07-26 17:25

  ~08951

I can reproduce the issue in correctly that order, but not, when I create a survey with just one group and question - activate that survey - deactivate that survey and add a second question ==> just FYI.

user4399

2009-08-09 18:49

  ~09068

I couldn't reproduce the activate+deactivate behaviour, it happens all the times whenever you want to put some question to the beginning.

user4399

2009-08-09 18:56

  ~09069

"Position: at the beginning" just didn't work in any way because the sort order was wrong at the select box.
If you pay attention to the values on the select box, you can see a suspectable numbering:
At beginning = 0
After first question = also 0?

So something must be wrong with that.

Question order (at the database) begins in 0, so database.php, when inserting a new question that needs reordering makes an update of questions order after the new one but there it was a trick to somehow fix the bad order coming from the select box, it was added 1 to the first question that should be reordered:

$question_order=(sanitize_int($_POST['questionposition'])+1);
$cdquery = "UPDATE ".db_table_name('questions')." SET question_order=question_order+1 WHERE gid=".$postgid." AND question_order >= ".$question_order;

So, IMHO, the better way to fix this is to do the proper ordering when filling the select box (questionhandling.php) and taking out that tricky +1 on database.php.

user4399

2009-08-09 19:04

  ~09070

Revision: 7421

Issue History

Date Modified Username Field Change
2009-07-26 16:48 Mazi New Issue
2009-07-26 16:48 Mazi Status new => assigned
2009-07-26 16:48 Mazi Assigned To => user372
2009-07-26 16:48 Mazi Build Number => 7348
2009-07-26 16:48 Mazi Browser => FF3
2009-07-26 16:48 Mazi Database & DB-Version => My Sql 5.1.30
2009-07-26 16:48 Mazi Operating System (Server) => Win XP Sp 3
2009-07-26 16:48 Mazi Webserver => Apache 2.2
2009-07-26 16:48 Mazi PHP Version => 5.2
2009-07-26 17:25 user372 Note Added: 08951
2009-07-26 17:25 user372 Assigned To user372 => jcleeland
2009-08-03 21:24 user372 Assigned To jcleeland => user4399
2009-08-09 18:49 user4399 Note Added: 09068
2009-08-09 18:56 user4399 Note Added: 09069
2009-08-09 18:56 user4399 Status assigned => resolved
2009-08-09 18:56 user4399 Fixed in Version => 1.85+
2009-08-09 18:56 user4399 Resolution open => fixed
2009-08-09 19:04 user4399 Note Added: 09070
2009-08-09 19:04 user4399 Status resolved => closed
2010-10-25 00:17 c_schmitz Category Survey Design => Survey design
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing