def open_student_endpoint(self): return Json404Response()
def open_student_endpoint(self): if is_open_student_corrected_assignment_relationship(self.user, self.assignment): return self.anon_open_assignment_chart_data() return Json404Response()
def open_student_endpoint(self): # validation - only the logged in open student should be able to see his/her own chart if self.student != self.user: return Json404Response() return self.open_student_chart_data()
def admin_endpoint(self): # validation - the logged in admin should only see the subjectteacher's subjectrooms if the subjectteacher belongs to same school if self.user.userinfo.school != self.subjectteacher.userinfo.school: return Json404Response() return self.all_subjectroom_data()
def admin_endpoint(self): # validation - the logged in admin should only see the classteacher's classroom if the classteacher belongs to same school if self.user.userinfo.school != self.classteacher.userinfo.school: return Json404Response() return self.classroom_data()
def parent_endpoint(self): #validation - the logged in parent should only see the chart of his/her child if not is_parent_child_relationship(self.user, self.student): return Json404Response() return self.student_chart_data()
def admin_endpoint(self): if self.user.userinfo.school == self.student.userinfo.school: return HWCentralJsonResponse( StudentEdgeData(self.student, self.subjectroom)) return Json404Response()
def focusroom_chart_get(request, focusroom_id): statsd.increment('core.hits.chart.focusroom') try: focusroom = get_object_or_404(FocusRoom, pk=focusroom_id) except Http404, e: return Json404Response(e)
def subject_id_get(request, subjectroom_id): statsd.increment('edge.hits.get.subject_id') try: subjectroom = get_object_or_404(SubjectRoom, pk=subjectroom_id) except Http404, e: return Json404Response(e)
def parent_endpoint(self): if not is_parent_child_relationship(self.user, self.student): return Json404Response() return HWCentralJsonResponse( StudentEdgeData(self.student, self.subjectroom))
raise Http404 else: raise InvalidHWCentralAssignmentTypeError(assignment_type) @login_required @statsd.timed('core.chart.student') def student_chart_get(request, student_id): statsd.increment('core.hits.chart.student') try: student = get_object_or_404(User, pk=student_id) except Http404, e: return Json404Response(e) if student.userinfo.group != HWCentralGroup.refs.STUDENT and student.userinfo.group != HWCentralGroup.refs.OPEN_STUDENT: return Json404Response() return StudentChartGet(request, student).handle() @login_required @statsd.timed('core.chart.single_subject_student') def single_subject_student_chart_get(request, student_id, subjectroom_id): statsd.increment('core.hits.chart.single_subject_student') try: student = get_object_or_404(User, pk=student_id) except Http404, e: return Json404Response(e) try: subjectroom = get_object_or_404(SubjectRoom, pk=subjectroom_id)
def student_endpoint(self): if self.user != self.student: return Json404Response() return HWCentralJsonResponse( StudentEdgeData(self.student, self.subjectroom))
def admin_endpoint(self): if self.user.userinfo.school == self.subjectroom.classRoom.school: return HWCentralJsonResponse( SubjectRoomEdgeData(self.user, self.subjectroom)) return Json404Response()
def teacher_endpoint(self): if self.user == self.subjectroom.teacher or self.user == self.subjectroom.classRoom.classTeacher: return HWCentralJsonResponse( SubjectRoomEdgeData(self.user, self.subjectroom)) return Json404Response()
def parent_endpoint(self): return Json404Response()
def open_student_chart_data(self): return Json404Response()
def admin_endpoint(self): # validation - the logged in admin should only see the assignment chart if the assignment belongs to same school if self.user.userinfo.school != (self.assignment.get_subjectroom()).classRoom.school: return Json404Response() return self.assignment_chart_data()
def admin_endpoint(self): # validation - the logged in admin should only see the focusroom chart if focusroom belongs to same school if self.user.userinfo.school != self.focusroom.subjectRoom.classRoom.school: return Json404Response() return self.single_focusroom_data()
def admin_endpoint(self): #validation - the logged in admin should only see the student chart if student belongs to same school if self.user.userinfo.school != self.student.userinfo.school: return Json404Response() return self.student_chart_data()
def admin_endpoint(self): return Json404Response()