Permalink
Browse files

Pre-sort result rows so that answers are better combined. Issue 449.

  • Loading branch information...
1 parent 5902f05 commit e3f4b559e81bc7a6122259e1dc7ce54780641a8b @mworrell mworrell committed Nov 6, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 modules/mod_survey/models/m_survey.erl
@@ -251,7 +251,8 @@ survey_results(SurveyId, Context) ->
{survey, QuestionIds, Questions} ->
Rows = z_db:q("select user_id, persistent, question, name, value, text, created
from survey_answer
- where survey_id = $1", [SurveyId], Context),
+ where survey_id = $1
+ order by user_id, persistent", [SurveyId], Context),
Grouped = group_users(Rows),
QIds = [ z_convert:to_binary(QId) || QId <- QuestionIds ],
QsB = [ {z_convert:to_binary(QId), Q} || {QId, Q} <- Questions ],

1 comment on commit e3f4b55

@mworrell
Member

Issue #449

Please sign in to comment.