@require_POST
@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@require_level('staff')
def list_entrance_exam_instructor_tasks(request, course_id):
 course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)
 course = get_course_by_id(course_id)
 student = request.POST.get('unique_student_identifier', None)
 if (student is not None):
  student = get_student_from_identifier(student)
 try:
  entrance_exam_key = course_id.make_usage_key_from_deprecated_string(course.entrance_exam_id)
 except InvalidKeyError:
  return HttpResponseBadRequest(_('Course has no valid entrance exam section.'))
 if student:
  tasks = lms.djangoapps.instructor_task.api.get_entrance_exam_instructor_task_history(course_id, entrance_exam_key, student)
 else:
  tasks = lms.djangoapps.instructor_task.api.get_entrance_exam_instructor_task_history(course_id, entrance_exam_key)
 response_payload = {'tasks': map(extract_task_features, tasks)}
 return JsonResponse(response_payload)

@ require_POST @ ensure_csrf_cookie @ cache_control ( no_cache = True , no_store = True , must_revalidate = True ) @ require_level ( 'staff' ) def list_entrance_exam_instructor_tasks ( request , course_id ) : course_id = SlashSeparatedCourseKey . from_deprecated_string ( course_id ) course = get_course_by_id ( course_id ) student = request . POST . get ( 'unique_student_identifier' , None ) if ( student is not None ) : student = get_student_from_identifier ( student ) try : entrance_exam_key = course_id . make_usage_key_from_deprecated_string ( course . entrance_exam_id ) except InvalidKeyError : return HttpResponseBadRequest ( _ ( 'Course has no valid entrance exam section.' ) ) if student : tasks = lms . djangoapps . instructor_task . api . get_entrance_exam_instructor_task_history ( course_id , entrance_exam_key , student ) else : tasks = lms . djangoapps . instructor_task . api . get_entrance_exam_instructor_task_history ( course_id , entrance_exam_key ) response_payload = { 'tasks' : map ( extract_task_features , tasks ) } return JsonResponse ( response_payload )
list entrance exam related instructor tasks .