def METHOD_NAME(self):
    # create a temporary file at which to write a script if necessary
    _, script_path = tempfile.mkstemp(suffix=".R")
    # convert IPYNB files to Rmd files
    nbs = glob("*.ipynb")
    if len(nbs) > 1:
        raise OtterRuntimeError("More than one IPYNB file found in submission")
    elif len(nbs) == 1:
        nb_path = nbs[0]
        self.validate_submission(nb_path)
        nb = nbf.read(nb_path, as_version=NBFORMAT_VERSION)
        nb = self.filter_cells_with_syntax_errors(nb)
        # create the R script
        script, _ = ScriptExporter().from_notebook_node(nb)
        with open(script_path, "w") as f:
            f.write(script)
        self.subm_path_deletion_required = True
        return script_path
    # convert Rmd files to R files
    rmds = glob("*.Rmd")
    if len(rmds) > 1:
        raise OtterRuntimeError("More than one Rmd file found in submission")
    elif len(rmds) == 1:
        rmd_path = rmds[0]
        self.validate_submission(rmd_path)
        # add seeds
        if self.ag_config.seed is not None:
            self.add_seeds_to_rmd_file(rmd_path)
        # create the R script
        rmd_path = os.path.abspath(rmd_path)
        R_PACKAGES["knitr"].purl(rmd_path, script_path)
        self.subm_path_deletion_required = True
        return script_path
    os.remove(script_path)
    # get the R script
    scripts = glob("*.[Rr]")
    if len(scripts) > 1:
        raise OtterRuntimeError("More than one R script found in submission")
    elif len(scripts) == 0:
        raise OtterRuntimeError("No gradable files found in submission")
    if self.ag_config.seed is not None:
        self.add_seed_to_script(scripts[0]) 
    return scripts[0]