It is possible to show all questionniare questions when adding show_all=1 GET parameter.
It is useful for debugging purposes, when you want to see all questions rendered on one screen. Conflicts: questionnaire/views.pyEmailTemplateFixes
parent
be73a2f7e0
commit
fab1c8b37a
|
@ -77,6 +77,12 @@ class Questionnaire(models.Model):
|
|||
QuestionSet.objects.filter(questionnaire=self).order_by('sortid')
|
||||
return self.__qscache
|
||||
|
||||
def questions(self):
|
||||
questions = []
|
||||
for questionset in self.questionsets():
|
||||
questions += questionset.questions()
|
||||
return questions
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("export", "Can export questionnaire answers"),
|
||||
|
|
|
@ -453,7 +453,12 @@ def show_questionnaire(request, runinfo, errors={}):
|
|||
|
||||
Also add the javascript dependency code.
|
||||
"""
|
||||
questions = runinfo.questionset.questions()
|
||||
|
||||
request.runinfo = runinfo
|
||||
if request.GET.get('show_all') == '1': # for debugging purposes.
|
||||
questions = runinfo.questionset.questionnaire.questions()
|
||||
else:
|
||||
questions = runinfo.questionset.questions()
|
||||
|
||||
qlist = []
|
||||
jsinclude = [] # js files to include
|
||||
|
|
Loading…
Reference in New Issue