diff --git a/CHANGELOG.md b/CHANGELOG.md index 26e8af7dc..901dd0a68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Fixed assignment summary in Otter Assign so that manual questions are included per [#886](https://github.com/ucbds-infra/otter-grader/issues/886) * Wrap `ModuleNotFoundError` for `otter` in grading image to include debugging instructions per [#907](https://github.com/ucbds-infra/otter-grader/issues/907) * Updated Otter Assign to disallow metadata tests for Colab notebooks per [#901](https://github.com/ucbds-infra/otter-grader/issues/901) +* Updated Otter Assign to leave solution cell tags in student notebooks per [#893](https://github.com/ucbds-infra/otter-grader/issues/893) **v6.0.5:** diff --git a/otter/assign/cell_factory.py b/otter/assign/cell_factory.py index ff9f47074..079d68a0b 100644 --- a/otter/assign/cell_factory.py +++ b/otter/assign/cell_factory.py @@ -5,6 +5,7 @@ from .assignment import Assignment from .feature_toggle import FeatureToggle from .question_config import QuestionConfig +from .solutions import ANSWER_CELL_TAG from .utils import lock @@ -174,4 +175,6 @@ def create_markdown_response_cell() -> nbformat.NotebookNode: Returns: ``nbformat.NotebookNode``: the response cell """ - return nbformat.v4.new_markdown_cell("_Type your answer here, replacing this text._") + return nbformat.v4.new_markdown_cell( + "_Type your answer here, replacing this text._", metadata={"tags": [ANSWER_CELL_TAG]} + ) diff --git a/otter/assign/notebook_transformer.py b/otter/assign/notebook_transformer.py index f5bc1f6b6..5dae83679 100644 --- a/otter/assign/notebook_transformer.py +++ b/otter/assign/notebook_transformer.py @@ -16,6 +16,7 @@ from .r_adapter import rmarkdown_converter from .r_adapter.cell_factory import RCellFactory from .solutions import ( + ANSWER_CELL_TAG, has_seed, overwrite_seed_vars, SOLUTION_CELL_TAG, @@ -319,6 +320,9 @@ def _get_transformed_cells(self, cells: list[nbf.NotebookNode]) -> list[nbf.Note self.tests_mgr.read_test(cell, question) continue + elif curr_block[-1] == BlockType.PROMPT: + cell = add_tag(cell, ANSWER_CELL_TAG) + elif curr_block[-1] == BlockType.SOLUTION: cell = add_tag(cell, SOLUTION_CELL_TAG) diff --git a/otter/assign/r_adapter/rmarkdown_converter.py b/otter/assign/r_adapter/rmarkdown_converter.py index 229c0c737..173dbc6a5 100644 --- a/otter/assign/r_adapter/rmarkdown_converter.py +++ b/otter/assign/r_adapter/rmarkdown_converter.py @@ -7,6 +7,8 @@ from copy import deepcopy +from ..solutions import ANSWER_CELL_TAG, SOLUTION_CELL_TAG +from ..utils import remove_tag from ...utils import get_source, NBFORMAT_VERSION, NOTEBOOK_METADATA_KEY @@ -113,6 +115,15 @@ def write_as_rmd(nb: nbf.NotebookNode, rmd_path: str, has_solutions: bool): # notebook (resolves whitespace issues caused by the use of prompts for written questions) if not has_solutions: for i, cell in enumerate(nb["cells"]): + # remove tags from all cells since they aren't needed for Rmd files + if "tags" in cell["metadata"]: + tags = cell["metadata"]["tags"] + if SOLUTION_CELL_TAG in tags: + tags.remove(SOLUTION_CELL_TAG) + if ANSWER_CELL_TAG in tags: + tags.remove(ANSWER_CELL_TAG) + if not tags: + cell["metadata"].pop("tags") if ( i < len(nb["cells"]) - 1 and cell["cell_type"] == "markdown" diff --git a/otter/assign/solutions.py b/otter/assign/solutions.py index ce41a4c2f..2e1f05fb6 100644 --- a/otter/assign/solutions.py +++ b/otter/assign/solutions.py @@ -6,11 +6,13 @@ from .assignment import Assignment from .r_adapter import solutions as r_solutions -from .utils import has_tag, is_cell_type, remove_output, remove_tag +from .utils import add_tag, has_tag, is_cell_type, remove_output, remove_tag from ..utils import get_source +ANSWER_CELL_TAG = "otter_answer_cell" BLOCK_PROMPT = "..." +OTTER_INCLUDE_TAG = "otter_include" SOLUTION_CELL_TAG = "otter_assign_solution_cell" @@ -205,9 +207,6 @@ def strip_ignored_lines(nb: nbf.NotebookNode) -> nbf.NotebookNode: return nb -OTTER_INCLUDE_TAG = "otter_include" - - def strip_solutions_and_output(assignment: Assignment, nb: nbf.NotebookNode) -> nbf.NotebookNode: """ Create a copy of a notebook with solutions and outputs stripped. @@ -231,7 +230,7 @@ def strip_solutions_and_output(assignment: Assignment, nb: nbf.NotebookNode) -> cell = remove_tag(cell, OTTER_INCLUDE_TAG) else: del_md_solutions.append(i) - nb["cells"][i] = remove_tag(cell, SOLUTION_CELL_TAG) + nb["cells"][i] = add_tag(remove_tag(cell, SOLUTION_CELL_TAG), ANSWER_CELL_TAG) del_md_solutions.reverse() for i in del_md_solutions: diff --git a/test/test_assign/files/example-correct/autograder/example.ipynb b/test/test_assign/files/example-correct/autograder/example.ipynb index 6dcd5c4d4..8902ad9e4 100644 --- a/test/test_assign/files/example-correct/autograder/example.ipynb +++ b/test/test_assign/files/example-correct/autograder/example.ipynb @@ -197,7 +197,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -310,7 +314,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -333,7 +341,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -549,9 +561,9 @@ "assignment_name": "hw01", "tests": { "q1": { + "all_or_nothing": true, "name": "q1", "points": null, - "all_or_nothing": true, "suites": [ { "cases": [ diff --git a/test/test_assign/files/example-correct/student/example.ipynb b/test/test_assign/files/example-correct/student/example.ipynb index a2c792927..e9e0729ad 100644 --- a/test/test_assign/files/example-correct/student/example.ipynb +++ b/test/test_assign/files/example-correct/student/example.ipynb @@ -42,7 +42,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -81,7 +83,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -126,7 +130,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -165,7 +171,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -208,7 +218,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -249,7 +261,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -272,7 +288,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -295,7 +315,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -331,7 +353,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -342,7 +366,9 @@ { "cell_type": "markdown", "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "source": [ "Then call your function below to add the numbers 1 and 2 (should not be removed)" @@ -352,7 +378,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -440,9 +468,9 @@ "assignment_name": "hw01", "tests": { "q1": { + "all_or_nothing": true, "name": "q1", "points": null, - "all_or_nothing": true, "suites": [ { "cases": [ diff --git a/test/test_assign/files/exception-correct/autograder/exception-example.ipynb b/test/test_assign/files/exception-correct/autograder/exception-example.ipynb index 15f823d38..b4eb83ea8 100644 --- a/test/test_assign/files/exception-correct/autograder/exception-example.ipynb +++ b/test/test_assign/files/exception-correct/autograder/exception-example.ipynb @@ -189,7 +189,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -298,7 +302,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -319,7 +327,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/exception-correct/student/exception-example.ipynb b/test/test_assign/files/exception-correct/student/exception-example.ipynb index f2bc53ce8..ebc01e0d9 100644 --- a/test/test_assign/files/exception-correct/student/exception-example.ipynb +++ b/test/test_assign/files/exception-correct/student/exception-example.ipynb @@ -40,7 +40,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -77,7 +79,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -120,7 +124,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -157,7 +163,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -198,7 +208,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -237,7 +249,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -258,7 +274,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -279,7 +299,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ diff --git a/test/test_assign/files/gs-correct/autograder/generate-gradescope.ipynb b/test/test_assign/files/gs-correct/autograder/generate-gradescope.ipynb index e8d1f67a3..848904e03 100644 --- a/test/test_assign/files/gs-correct/autograder/generate-gradescope.ipynb +++ b/test/test_assign/files/gs-correct/autograder/generate-gradescope.ipynb @@ -197,7 +197,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -306,7 +310,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -338,7 +346,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/gs-correct/student/generate-gradescope.ipynb b/test/test_assign/files/gs-correct/student/generate-gradescope.ipynb index f1bf6078b..41e6b6cad 100644 --- a/test/test_assign/files/gs-correct/student/generate-gradescope.ipynb +++ b/test/test_assign/files/gs-correct/student/generate-gradescope.ipynb @@ -1,16 +1,16 @@ { "cells": [ { - "cell_type": "code", - "execution_count": null, - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "%pip install -q otter-grader" - ] + "cell_type": "code", + "execution_count": null, + "metadata": { + "deletable": false, + "editable": false + }, + "outputs": [], + "source": [ + "%pip install -q otter-grader" + ] }, { "cell_type": "code", @@ -50,7 +50,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -85,7 +87,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -128,7 +132,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -165,7 +171,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -206,7 +216,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -245,7 +257,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -266,7 +282,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -287,7 +307,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ diff --git a/test/test_assign/files/jupyterlite-correct/autograder/master.ipynb b/test/test_assign/files/jupyterlite-correct/autograder/master.ipynb index 68e0c73e4..859a499ce 100644 --- a/test/test_assign/files/jupyterlite-correct/autograder/master.ipynb +++ b/test/test_assign/files/jupyterlite-correct/autograder/master.ipynb @@ -188,7 +188,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -297,7 +301,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -318,7 +326,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/jupyterlite-correct/student/master.ipynb b/test/test_assign/files/jupyterlite-correct/student/master.ipynb index 8f1ea5754..95b93ea35 100644 --- a/test/test_assign/files/jupyterlite-correct/student/master.ipynb +++ b/test/test_assign/files/jupyterlite-correct/student/master.ipynb @@ -40,7 +40,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -77,7 +79,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -119,7 +123,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -156,7 +162,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -197,7 +207,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -236,7 +248,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -257,7 +273,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/no-pdf-ack-correct/autograder/master.ipynb b/test/test_assign/files/no-pdf-ack-correct/autograder/master.ipynb index eac927b50..f1759539b 100644 --- a/test/test_assign/files/no-pdf-ack-correct/autograder/master.ipynb +++ b/test/test_assign/files/no-pdf-ack-correct/autograder/master.ipynb @@ -188,7 +188,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -297,7 +301,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -318,7 +326,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/no-pdf-ack-correct/student/master.ipynb b/test/test_assign/files/no-pdf-ack-correct/student/master.ipynb index 764ba0cd9..73450210e 100644 --- a/test/test_assign/files/no-pdf-ack-correct/student/master.ipynb +++ b/test/test_assign/files/no-pdf-ack-correct/student/master.ipynb @@ -40,7 +40,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -77,7 +79,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -119,7 +123,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -156,7 +162,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -197,7 +207,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -236,7 +248,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -257,7 +273,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/no-pdf-ack-with-message-correct/autograder/master.ipynb b/test/test_assign/files/no-pdf-ack-with-message-correct/autograder/master.ipynb index 6808cb862..84cb7d99e 100644 --- a/test/test_assign/files/no-pdf-ack-with-message-correct/autograder/master.ipynb +++ b/test/test_assign/files/no-pdf-ack-with-message-correct/autograder/master.ipynb @@ -188,7 +188,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -297,7 +301,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -318,7 +326,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/no-pdf-ack-with-message-correct/student/master.ipynb b/test/test_assign/files/no-pdf-ack-with-message-correct/student/master.ipynb index 9a5ee8011..85751dfe2 100644 --- a/test/test_assign/files/no-pdf-ack-with-message-correct/student/master.ipynb +++ b/test/test_assign/files/no-pdf-ack-with-message-correct/student/master.ipynb @@ -40,7 +40,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -77,7 +79,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -119,7 +123,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -156,7 +162,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -197,7 +207,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -236,7 +248,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -257,7 +273,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/otter-correct/autograder/generate-otter.ipynb b/test/test_assign/files/otter-correct/autograder/generate-otter.ipynb index 5ed5c75e9..ecde0064c 100644 --- a/test/test_assign/files/otter-correct/autograder/generate-otter.ipynb +++ b/test/test_assign/files/otter-correct/autograder/generate-otter.ipynb @@ -133,10 +133,10 @@ "execution_count": 30, "metadata": { "otter": { - "tests": [ - "q3" - ] - }, + "tests": [ + "q3" + ] + }, "tags": [ "otter_assign_solution_cell" ] @@ -164,7 +164,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -273,7 +277,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -305,7 +313,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/otter-correct/student/generate-otter.ipynb b/test/test_assign/files/otter-correct/student/generate-otter.ipynb index db07556ff..70079056b 100644 --- a/test/test_assign/files/otter-correct/student/generate-otter.ipynb +++ b/test/test_assign/files/otter-correct/student/generate-otter.ipynb @@ -24,7 +24,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -59,7 +61,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -107,7 +111,9 @@ "q3" ] }, - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -132,7 +138,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -173,7 +183,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -212,7 +224,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -233,7 +249,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/pdf-correct/autograder/generate-pdf.ipynb b/test/test_assign/files/pdf-correct/autograder/generate-pdf.ipynb index 235a89035..24b69f0f0 100644 --- a/test/test_assign/files/pdf-correct/autograder/generate-pdf.ipynb +++ b/test/test_assign/files/pdf-correct/autograder/generate-pdf.ipynb @@ -171,7 +171,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -280,7 +284,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -312,7 +320,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/pdf-correct/student/generate-pdf.ipynb b/test/test_assign/files/pdf-correct/student/generate-pdf.ipynb index 965e35202..38142f8c3 100644 --- a/test/test_assign/files/pdf-correct/student/generate-pdf.ipynb +++ b/test/test_assign/files/pdf-correct/student/generate-pdf.ipynb @@ -24,7 +24,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -59,7 +61,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -102,7 +106,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -139,7 +145,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -180,7 +190,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -219,7 +231,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -240,7 +256,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -261,7 +281,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ diff --git a/test/test_assign/files/r-correct/autograder/r-example.ipynb b/test/test_assign/files/r-correct/autograder/r-example.ipynb index ebd7e2f48..8c9d8a41c 100644 --- a/test/test_assign/files/r-correct/autograder/r-example.ipynb +++ b/test/test_assign/files/r-correct/autograder/r-example.ipynb @@ -180,7 +180,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -290,7 +294,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -311,7 +319,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] diff --git a/test/test_assign/files/r-correct/student/r-example.ipynb b/test/test_assign/files/r-correct/student/r-example.ipynb index 5ef03de05..a08a1fe23 100644 --- a/test/test_assign/files/r-correct/student/r-example.ipynb +++ b/test/test_assign/files/r-correct/student/r-example.ipynb @@ -24,7 +24,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -59,7 +61,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -101,7 +105,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -139,7 +145,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -180,7 +190,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ @@ -220,7 +232,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Write your thing here._" ] @@ -241,7 +257,11 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "otter_answer_cell" + ] + }, "source": [ "_Type your answer here, replacing this text._" ] @@ -262,7 +282,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "otter_answer_cell" + ] }, "outputs": [], "source": [ diff --git a/test/test_assign/files/rmd-correct/autograder/rmd-example.Rmd b/test/test_assign/files/rmd-correct/autograder/rmd-example.Rmd index 33385754d..b0ccc2368 100644 --- a/test/test_assign/files/rmd-correct/autograder/rmd-example.Rmd +++ b/test/test_assign/files/rmd-correct/autograder/rmd-example.Rmd @@ -67,8 +67,9 @@ nine <- square(3) # SOLUTION **Question 4.** What does equilateral mean? - + _Type your answer here, replacing this text._ + Having equal side lengths. @@ -109,14 +110,15 @@ circumference <- function(r) { **Question 6.** Write something _This question has a custom prompt below, so that prompt should be in the output. It also has no solution!_ - + _Write your thing here._ - + **Question 7:** What is the answer? - + _Type your answer here, replacing this text._ + 42 diff --git a/test/test_assign/files/rmd-correct/student/rmd-example.Rmd b/test/test_assign/files/rmd-correct/student/rmd-example.Rmd index 98ebd5a6a..3554ae3eb 100644 --- a/test/test_assign/files/rmd-correct/student/rmd-example.Rmd +++ b/test/test_assign/files/rmd-correct/student/rmd-example.Rmd @@ -20,7 +20,7 @@ rng_seed <- 90 **Question 1.** Assign x to the smallest prime number. -```{r tags=c()} +```{r} x <- NULL # YOUR CODE HERE ``` @@ -30,7 +30,7 @@ x <- NULL # YOUR CODE HERE **Question 2.** Visualize the answer -```{r tags=c()} +```{r} plt.plot(...); ``` @@ -42,7 +42,7 @@ y <- 3 **Question 3.** Define `square` and assign `nine` to 3 squared. -```{r tags=c()} +```{r} square <- function(x) { y <- NULL # YOUR CODE HERE # YOUR CODE HERE @@ -67,7 +67,7 @@ _Type your answer here, replacing this text._ **Question 5.** Approximate the area and circumference of a circle with radius 3. -```{r tags=c()} +```{r} pi <- 3.14 if (TRUE) { # YOUR CODE HERE @@ -95,7 +95,7 @@ _Type your answer here, replacing this text._ **Question 8:** Test intercell seeding by generating 10 random $N(4,2)$ numbers. -```{r tags=c()} +```{r} z <- NULL # YOUR CODE HERE z ```