Exemple #1
0
    def test_get_peer_grading_notifications(self):
        test_sub = test_util.get_sub("PE", ALTERNATE_STUDENT, LOCATION, "PE")
        test_sub.save()
        handle_submission(test_sub)
        test_sub.next_grader_type = "PE"
        test_sub.is_duplicate = False
        test_sub.save()

        test_sub = test_util.get_sub("PE", STUDENT_ID, LOCATION, "PE")
        test_sub.save()
        handle_submission(test_sub)
        test_sub.next_grader_type = "PE"
        test_sub.is_duplicate = False
        test_sub.save()

        success, student_needs_to_peer_grade = peer_grading_util.get_peer_grading_notifications(COURSE_ID, ALTERNATE_STUDENT)
        self.assertEqual(success, True)
        self.assertEqual(student_needs_to_peer_grade, True)
Exemple #2
0
    def test_get_peer_grading_notifications(self):
        test_sub = test_util.get_sub("PE", ALTERNATE_STUDENT, LOCATION, "PE")
        test_sub.save()
        handle_submission(test_sub)
        test_sub.next_grader_type = "PE"
        test_sub.is_duplicate = False
        test_sub.save()

        test_sub = test_util.get_sub("PE", STUDENT_ID, LOCATION, "PE")
        test_sub.save()
        handle_submission(test_sub)
        test_sub.next_grader_type = "PE"
        test_sub.is_duplicate = False
        test_sub.save()

        success, student_needs_to_peer_grade = peer_grading_util.get_peer_grading_notifications(
            "course_id", ALTERNATE_STUDENT)
        self.assertEqual(success, True)
        self.assertEqual(student_needs_to_peer_grade, True)
Exemple #3
0
def get_notifications(request):
    if request.method!="GET":
        error_message="Request needs to be GET."
        log.error(error_message)
        return util._error_response(error_message, _INTERFACE_VERSION)

    course_id=request.GET.get("course_id")
    student_id = request.GET.get("student_id")

    if not course_id or not student_id:
        error_message="Missing needed tag course_id or student_id"
        log.error(error_message)
        return util._error_response(error_message, _INTERFACE_VERSION)

    success, student_needs_to_peer_grade = peer_grading_util.get_peer_grading_notifications(course_id, student_id)
    if not success:
        return util._error_response(student_needs_to_peer_grade, _INTERFACE_VERSION)

    util.log_connection_data()
    return util._success_response({'student_needs_to_peer_grade' : student_needs_to_peer_grade}, _INTERFACE_VERSION)
Exemple #4
0
def get_notifications(request):
    if request.method != "GET":
        error_message = "Request needs to be GET."
        log.error(error_message)
        return util._error_response(error_message, _INTERFACE_VERSION)

    course_id = request.GET.get("course_id")
    student_id = request.GET.get("student_id")

    if not course_id or not student_id:
        error_message = "Missing needed tag course_id or student_id"
        log.error(error_message)
        return util._error_response(error_message, _INTERFACE_VERSION)

    success, student_needs_to_peer_grade = peer_grading_util.get_peer_grading_notifications(
        course_id, student_id)
    if not success:
        return util._error_response(student_needs_to_peer_grade,
                                    _INTERFACE_VERSION)

    util.log_connection_data()
    return util._success_response(
        {'student_needs_to_peer_grade': student_needs_to_peer_grade},
        _INTERFACE_VERSION)