def instructor_task_status(request):
 output = {}
 task_id = (request.GET.get('task_id') or request.POST.get('task_id'))
 tasks = (request.GET.get('task_ids[]') or request.POST.get('task_ids[]'))
 if task_id:
  output = _get_instructor_task_status(task_id)
 elif tasks:
  for task_id in tasks:
   task_output = _get_instructor_task_status(task_id)
   if (task_output is not None):
    output[task_id] = task_output
 return HttpResponse(json.dumps(output, indent=4))

def instructor_task_status ( request ) : output = { } task_id = ( request . GET . get ( 'task_id' ) or request . POST . get ( 'task_id' ) ) tasks = ( request . GET . get ( 'task_ids[]' ) or request . POST . get ( 'task_ids[]' ) ) if task_id : output = _get_instructor_task_status ( task_id ) elif tasks : for task_id in tasks : task_output = _get_instructor_task_status ( task_id ) if ( task_output is not None ) : output [ task_id ] = task_output return HttpResponse ( json . dumps ( output , indent = 4 ) )
view method that returns the status of a course-related task or tasks .