{{extend 'layout.html'}} {{import cPickle}}

Report for Survey: {{=survey.title}}

{{if len(rows)==0:}}

No data available!

{{pass}} {{if len(sas):}}

Users

{{for row in sas:}} {{link=A(row.auth_user.name,_href=URL(r=request,args=[survey.id,row.auth_user.id])) if not row.sa.anonymous else 'Anonymous'}} {{pass}}
UserCompletion timestampPoints
{{=link}} {{=row.sa.timestamp or survey.stop}} {{=total_points[row.sa.owner]}} {{if row.auth_user.id!=survey.owner:}}[{{=A('delete',_href=URL('delete_sa',args=[survey.id,row.auth_user.id]))}}]{{pass}}
{{pass}} {{question_id=0}} {{for i,row in enumerate(rows):}} {{if row.question.id!=question_id:}} {{question_id=row.question.id}} {{if question_id:}}

{{pass}}

{{=i+1}}) {{=row.question.title}}

{{pass}} {{value=cPickle.loads(row.answer.value)}} {{link=A(row.auth_user.name,_href=URL(r=request,args=[survey.id,row.auth_user.id])) if not row.sa.anonymous else 'Anonymous'}} {{if row.answer.comment:}} {{pass}} {{pass}} {{if question_id:}}
{{=link}}: {{if row.question.type[:8]=='upload':}} [{{=A('file',_href=URL('dowloadn_attachement',args=[row.sa.id,row.answer.file])) if row.answer.file else 'None'}}] {{elif row.question.type[:8]=='multiple':}} {{value=', '.join([chr(ord('A')+int(c)) for c in value])}} {{=value}} {{elif row.question.type=='long text':}} {{=XML(value)}} {{elif row.question.type[-8:]=='verbatim':}}
{{=value}}
{{else:}} {{=value}} {{pass}}
{{=points[row.auth_user.id][row.question.id]}}
Comment:{{=XML(row.answer.comment)}}
{{pass}}