Welcome, Guest
Username: Password: Remember me

TOPIC: Change order of responses

Change order of responses 3 years 7 months ago #55610

  • waitz
  • waitz's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 171
  • Thank you received: 1
  • Karma: 3
Is it possible to rearrange the order of the responses in the backend, so that the latest comes first and not last?
Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
The administrator has disabled public write access.

Re: Change order of responses 3 years 7 months ago #55611

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
I'm not sure which question type you are reffering to, but when going to the edit answer screen there is an icon left to the answer code. Hold the mouse and then you can move the item up/down to change the order.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Change order of responses 3 years 7 months ago #55620

  • waitz
  • waitz's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 171
  • Thank you received: 1
  • Karma: 3
I mean the list of responses when you go to 'Browse responses for this survey' -> 'Display Responses' (See the screen shot)

screenshot.png


This is the page where I would like the newest responses to be on top, not at the bottom. Comprende?
Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
Last Edit: 3 years 7 months ago by waitz.
The administrator has disabled public write access.

Re: Change order of responses 3 years 7 months ago #55664

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
waitz wrote:
I mean the list of responses when you go to 'Browse responses for this survey' -> 'Display Responses' (See the screen shot)

screenshot.png


This is the page where I would like the newest responses to be on top, not at the bottom. Comprende?
Ahh, that is a different issue. This data is ordered by dataset ID, you have to adjust the SQL when retrieving the data from DB.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Change order of responses 3 years 7 months ago #55668

  • waitz
  • waitz's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 171
  • Thank you received: 1
  • Karma: 3
Mazi wrote:
Ahh, that is a different issue. This data is ordered by dataset ID, you have to adjust the SQL when retrieving the data from DB.

Oh, is that complicated..?
Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
The administrator has disabled public write access.

Re: Change order of responses 3 years 7 months ago #55714

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6331
  • Thank you received: 817
  • Karma: 243
I think you can start to look at admin/browse.php. It's not really difficult for a php dev :)
The administrator has disabled public write access.

Re: Change order of responses 3 years 7 months ago #55717

  • waitz
  • waitz's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 171
  • Thank you received: 1
  • Karma: 3
Shnoulle wrote:
I think you can start to look at admin/browse.php. It's not really difficult for a php dev :)
I was afraid someone would say that ;) I am not a developer, I just always want to find a solution.

I found this around line 420 in browse.php
//NOW LETS SHOW THE DATA
$dtquery = "SELECT * FROM $sql_from $sql_where ORDER BY id";
if ($order == "desc") {$dtquery .= " DESC";}
Is that the magic..? Just to change desc to asc? (before I try it)
Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
Last Edit: 3 years 7 months ago by waitz.
The administrator has disabled public write access.

Re: Change order of responses 3 years 7 months ago #55722

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6331
  • Thank you received: 817
  • Karma: 243
I think you can do doething like that:
$dtquery = "SELECT * FROM $sql_from $sql_where ORDER BY id";
if ($order != "desc") {$dtquery .= " DESC";}
The administrator has disabled public write access.

[SOLVED] Re: Change order of responses 3 years 7 months ago #55725

  • waitz
  • waitz's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 171
  • Thank you received: 1
  • Karma: 3
Lovely, that worked :)

Thanks, Shnoulle
Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.224 seconds
Donation Image