Ejemplo n.º 1
0
def answer_sheets(request, assigned_school=None):
    assigned_school = School.objects.get(assigned_to=request.user)
    rteachers = ResponsibleTeacher.objects.filter(school=assigned_school.id)
    if rteachers and compadmin.school_students_venue_assigned(assigned_school):
        teacher = rteachers[0]
        teacher.answer_sheet_downloaded = datetime.now()
        teacher.save()
        return compadmin.generate_school_answer_sheets(request,
                                                       [assigned_school])
    elif not rteachers:
        return HttpResponse(
            "A responsible teacher has not been provided for your school yet.")
    else:
        return HttpResponse(
            "Your school's answer sheets cannot be generated at this time.")
Ejemplo n.º 2
0
 def generate_school_answer_sheets(self, request, queryset):
     return compadmin.generate_school_answer_sheets(request, queryset)