def METHOD_NAME(self):
    os.environ["PATH"] = f"{self.ag_config.miniconda_path}/bin:" + os.environ.get("PATH")
    with chdir("./submission"):
        if self.ag_config.token is not None:
            client = APIClient(token=self.ag_config.token)
            generate_pdf = True
            has_token = True
        else:
            generate_pdf = self.ag_config.pdf
            has_token = False
            client = None
        subm_path = self.resolve_submission_path()
        output = R_PACKAGES["ottr"].run_autograder(
            subm_path, ignore_errors = not self.ag_config.debug, test_dir = "./tests")[0]
        scores = GradingResults.from_ottr_json(output)
        if generate_pdf:
            self.write_and_maybe_submit_pdf(client, None, has_token, scores)
    # delete the script if necessary
    if self.subm_path_deletion_required:
        os.remove(subm_path)
        self.subm_path_deletion_required = False
    return scores