'Internal method for generating a grade report for the given context.'

def _generate(self, context):

    context.update_status(u'Starting    grades')
    success_headers = self._success_headers(context)
    error_headers = self._error_headers()
    batched_rows = self._batched_rows(context)
    context.update_status(u'Compiling    grades')
    (success_rows, error_rows) = self._compile(context, batched_rows)
    context.update_status(u'Uploading    grades')
    self._upload(context, success_headers, success_rows, error_headers, error_rows)
    return context.update_status(u'Completed    grades')
