changed question sorting from strictly alphabetic from tuple-based sort on sort_id then number
parent
37429dcf32
commit
49aa449a83
|
@ -119,7 +119,7 @@ class QuestionSet(models.Model):
|
|||
|
||||
def sorted_questions(self):
|
||||
questions = self.questions()
|
||||
return sorted(questions, key = lambda question : str(question.sort_id)+question.number)
|
||||
return sorted(questions, key = lambda question : (question.sort_id, question.number))
|
||||
|
||||
def next(self):
|
||||
qs = self.questionnaire.questionsets()
|
||||
|
|
|
@ -599,7 +599,7 @@ def show_questionnaire(request, runinfo, errors={}):
|
|||
substitute_answer(qvalues, runinfo.questionset)
|
||||
|
||||
#we make it clear to the user that we're going to sort by sort id then number, so why wasn't it doing that?
|
||||
questions = sorted(questions, key=lambda question: str(question.sort_id)+question.number)
|
||||
questions = sorted(questions, key=lambda question: (question.sort_id, question.number))
|
||||
|
||||
for question in questions:
|
||||
# if we got here the questionset will at least contain one question
|
||||
|
|
Loading…
Reference in New Issue