Esempio n. 1
0
 def grade(self,
           request,
           submission,
           no_penalties=False,
           url_name="exercise"):
     """
     Loads the exercise feedback page.
     """
     language = get_language()
     submission_url = update_url_params(
         api_reverse("submission-grader",
                     kwargs={'submission_id': submission.id}),
         get_graderauth_submission_params(submission),
     )
     url = self._build_service_url(language, request,
                                   submission.submitters.all(),
                                   submission.ordinal_number(), url_name,
                                   submission_url)
     try:
         return load_feedback_page(request,
                                   url,
                                   self,
                                   submission,
                                   no_penalties=no_penalties)
     except OSError as error:
         page = ExercisePage(self)
         msg = "Unable to grade the submission. %s: %s" % (
             error.__class__.__name__, error)
         page.errors.append(msg)
         return page
Esempio n. 2
0
 def grade(self, request, submission, no_penalties=False, url_name="exercise"):
     """
     Loads the exercise feedback page.
     """
     language = get_language()
     submission_url = update_url_params(
         api_reverse("submission-grader", kwargs={
             'submission_id': submission.id
         }),
         get_graderauth_submission_params(submission),
     )
     url = self._build_service_url(
         language, request, submission.submitters.all(),
         submission.ordinal_number(), url_name, submission_url
     )
     return load_feedback_page(
         request, url, self, submission, no_penalties=no_penalties
     )