예제 #1
0
 def test_get_problems_student_has_tried(self):
     success, sub_list = grader_util.get_problems_student_has_tried(STUDENT_ID, "course_id")
     self.assertTrue(isinstance(sub_list, list))
     test_sub = test_util.get_sub("PE", STUDENT_ID, LOCATION, "PE")
     test_sub.save()
     success, sub_list = grader_util.get_problems_student_has_tried(STUDENT_ID, "course_id")
     self.assertTrue(len(sub_list)>0)
예제 #2
0
 def test_get_problems_student_has_tried(self):
     success, sub_list = grader_util.get_problems_student_has_tried(STUDENT_ID, "course_id")
     self.assertTrue(isinstance(sub_list, list))
     test_sub = test_util.get_sub("PE", STUDENT_ID, LOCATION, "PE")
     test_sub.save()
     success, sub_list = grader_util.get_problems_student_has_tried(STUDENT_ID, "course_id")
     self.assertTrue(len(sub_list)>0)
예제 #3
0
파일: views.py 프로젝트: EDUlib/edx-ora
def get_grading_status_list(request):
    """
    Get a list of locations where student has submitted open ended questions and the status of each.
    Input:
        Course id, student id
    Output:
        Dictionary containing success, and a list of problems in the course with student submission status.
        See grader_util for format details.
    """
    if request.method != 'GET':
        return util._error_response("Request type must be GET", _INTERFACE_VERSION)

    for tag in ['course_id', 'student_id']:
        if tag not in request.GET:
            return util._error_response("Missing required key {0}".format(tag), _INTERFACE_VERSION)

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

    success, sub_list = grader_util.get_problems_student_has_tried(student_id, course_id)

    if not success:
        return util._error_response("Could not generate a submission list. {0}".format(sub_list),_INTERFACE_VERSION)

    problem_list_dict={
        'success' : success,
        'problem_list' : sub_list,
        }

    util.log_connection_data()
    return util._success_response(problem_list_dict, _INTERFACE_VERSION)
예제 #4
0
파일: views.py 프로젝트: qimi2008/edx-ora
def get_grading_status_list(request):
    """
    Get a list of locations where student has submitted open ended questions and the status of each.
    Input:
        Course id, student id
    Output:
        Dictionary containing success, and a list of problems in the course with student submission status.
        See grader_util for format details.
    """
    if request.method != 'GET':
        return util._error_response("Request type must be GET", _INTERFACE_VERSION)

    for tag in ['course_id', 'student_id']:
        if tag not in request.GET:
            return util._error_response("Missing required key {0}".format(tag), _INTERFACE_VERSION)

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

    success, sub_list = grader_util.get_problems_student_has_tried(student_id, course_id)

    if not success:
        return util._error_response("Could not generate a submission list. {0}".format(sub_list),_INTERFACE_VERSION)

    problem_list_dict={
        'success' : success,
        'problem_list' : sub_list,
        }

    util.log_connection_data()
    return util._success_response(problem_list_dict, _INTERFACE_VERSION)