diff --git a/examples/TimeoutContinuationTest/TimeoutContinuationTest-A.ipynb b/examples/TimeoutContinuationTest/TimeoutContinuationTest-A.ipynb new file mode 100644 index 0000000..771791f --- /dev/null +++ b/examples/TimeoutContinuationTest/TimeoutContinuationTest-A.ipynb @@ -0,0 +1,69 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "nbgrader": { + "grade": false, + "grade_id": "cell-markdown-task", + "locked": true, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "source": [ + "# Timeout continuation test\n", + "\n", + "Tests, if the grading of all ngbrader-tests continue, even if there is a timeout during one single test. \n", + "The test has to be auto-graded. \n", + "\n", + "One test in one file should fail. \n", + "The overall grading should result in 40 points." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": true, + "grade_id": "cell-autograde-visible", + "locked": true, + "points": 10, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "outputs": [], + "source": [ + "%maven org.junit.jupiter:junit-jupiter-api:5.3.1\n", + "import org.junit.jupiter.api.Assertions;\n", + "\n", + "System.out.println(\"Testing A\");\n", + "\n", + "Assertions.assertTrue(true);" + ] + } + ], + "metadata": { + "celltoolbar": "Create Assignment", + "kernelspec": { + "display_name": "Java", + "language": "java", + "name": "java" + }, + "language_info": { + "codemirror_mode": "java", + "file_extension": ".jshell", + "mimetype": "text/x-java-source", + "name": "Java", + "pygments_lexer": "java", + "version": "11.0.4+11-post-Ubuntu-1ubuntu218.04.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} + diff --git a/examples/TimeoutContinuationTest/TimeoutContinuationTest-B.ipynb b/examples/TimeoutContinuationTest/TimeoutContinuationTest-B.ipynb new file mode 100644 index 0000000..89e4ea9 --- /dev/null +++ b/examples/TimeoutContinuationTest/TimeoutContinuationTest-B.ipynb @@ -0,0 +1,69 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "nbgrader": { + "grade": false, + "grade_id": "cell-markdown-task", + "locked": true, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "source": [ + "# Timeout continuation test\n", + "\n", + "Tests, if the grading of all ngbrader-tests continue, even if there is a timeout during one single test. \n", + "The test has to be auto-graded. \n", + "\n", + "One test in one file should fail. \n", + "The overall grading should result in 40 points." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": true, + "grade_id": "cell-autograde-visible", + "locked": true, + "points": 10, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "outputs": [], + "source": [ + "%maven org.junit.jupiter:junit-jupiter-api:5.3.1\n", + "import org.junit.jupiter.api.Assertions;\n", + "\n", + "System.out.println(\"Testing B\");\n", + "\n", + "Assertions.assertTrue(true);" + ] + } + ], + "metadata": { + "celltoolbar": "Create Assignment", + "kernelspec": { + "display_name": "Java", + "language": "java", + "name": "java" + }, + "language_info": { + "codemirror_mode": "java", + "file_extension": ".jshell", + "mimetype": "text/x-java-source", + "name": "Java", + "pygments_lexer": "java", + "version": "11.0.4+11-post-Ubuntu-1ubuntu218.04.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} + diff --git a/examples/TimeoutContinuationTest/TimeoutContinuationTest-C-Fails.ipynb b/examples/TimeoutContinuationTest/TimeoutContinuationTest-C-Fails.ipynb new file mode 100644 index 0000000..92f5542 --- /dev/null +++ b/examples/TimeoutContinuationTest/TimeoutContinuationTest-C-Fails.ipynb @@ -0,0 +1,201 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "nbgrader": { + "grade": false, + "grade_id": "cell-markdown-task", + "locked": true, + "schema_version": 3, + "solution": false + } + }, + "source": [ + "# Timeout continuation test\n", + "\n", + "Tests, if the grading of all ngbrader-tests continue, even if there is a timeout during one single test. \n", + "The test has to be auto-graded. \n", + "\n", + "One test in one file should fail. \n", + "The overall grading should result in 40 points." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": false, + "grade_id": "cell-code", + "locked": false, + "schema_version": 3, + "solution": true + } + }, + "outputs": [], + "source": [ + "// BEGIN SOLUTION\n", + "// END SOLUTION\n", + "int timeoutSecondsPass = 1;\n", + "int timeoutSecondsFail = 400;" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": false, + "grade_id": "cell-a74effbecac8c29b", + "locked": true, + "schema_version": 3, + "solution": false + } + }, + "outputs": [], + "source": [ + "boolean doSomething(int timeoutSeconds) throws java.lang.InterruptedException {\n", + " long time = System.currentTimeMillis();\n", + " long end = time + (timeoutSeconds * 1000);\n", + " System.out.println(\"\");\n", + " while(System.currentTimeMillis() < end) {\n", + " System.out.print(((end-time)/1000) + \" \");\n", + " Thread.sleep(5000);\n", + " time = System.currentTimeMillis();\n", + " }\n", + " System.out.println(\"\");\n", + " return true;\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": true, + "grade_id": "cell-autograde-visible-1", + "locked": true, + "points": 1, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "outputs": [], + "source": [ + "%maven org.junit.jupiter:junit-jupiter-api:5.3.1\n", + "import org.junit.jupiter.api.Assertions;\n", + "\n", + "System.out.println(\"Testing C\");\n", + "\n", + "System.out.println(\"Waiting \" + timeoutSecondsPass + \" seconds\");\n", + "Assertions.assertTrue(doSomething(timeoutSecondsPass));\n", + "System.out.println(\"Test 1 successfully completed\");" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": true, + "grade_id": "cell-autograde-visible-2", + "locked": true, + "points": 1, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "outputs": [], + "source": [ + "System.out.println(\"Waiting \" + timeoutSecondsPass + \" seconds\");\n", + "Assertions.assertTrue(doSomething(timeoutSecondsPass));\n", + "System.out.println(\"Test 2 successfully completed\");" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": true, + "grade_id": "cell-autograde-visible-3", + "locked": true, + "points": 1, + "schema_version": 3, + "solution": false + } + }, + "outputs": [], + "source": [ + "System.out.println(\"Waiting \" + timeoutSecondsFail + \" seconds\");\n", + "Assertions.assertTrue(doSomething(timeoutSecondsFail));\n", + "System.out.println(\"Test 3 successfully completed\");" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": true, + "grade_id": "cell-autograde-visible-4", + "locked": true, + "points": 1, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "outputs": [], + "source": [ + "System.out.println(\"Waiting \" + timeoutSecondsPass + \" seconds\");\n", + "Assertions.assertTrue(doSomething(timeoutSecondsPass));\n", + "System.out.println(\"Test 4 successfully completed\");" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": true, + "grade_id": "cell-autograde-visible-5", + "locked": true, + "points": 1, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "outputs": [], + "source": [ + "System.out.println(\"Waiting \" + timeoutSecondsPass + \" seconds\");\n", + "Assertions.assertTrue(doSomething(timeoutSecondsPass));\n", + "System.out.println(\"Test 5 successfully completed\");" + ] + } + ], + "metadata": { + "celltoolbar": "Create Assignment", + "kernelspec": { + "display_name": "Java", + "language": "java", + "name": "java" + }, + "language_info": { + "codemirror_mode": "java", + "file_extension": ".jshell", + "mimetype": "text/x-java-source", + "name": "Java", + "pygments_lexer": "java", + "version": "11.0.4+11-post-Ubuntu-1ubuntu218.04.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} + diff --git a/examples/TimeoutContinuationTest/TimeoutContinuationTest-D.ipynb b/examples/TimeoutContinuationTest/TimeoutContinuationTest-D.ipynb new file mode 100644 index 0000000..120d674 --- /dev/null +++ b/examples/TimeoutContinuationTest/TimeoutContinuationTest-D.ipynb @@ -0,0 +1,69 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "nbgrader": { + "grade": false, + "grade_id": "cell-markdown-task", + "locked": true, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "source": [ + "# Timeout continuation test\n", + "\n", + "Tests, if the grading of all ngbrader-tests continue, even if there is a timeout during one single test. \n", + "The test has to be auto-graded. \n", + "\n", + "One test in one file should fail. \n", + "The overall grading should result in 40 points." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": true, + "grade_id": "cell-autograde-visible", + "locked": true, + "points": 10, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "outputs": [], + "source": [ + "%maven org.junit.jupiter:junit-jupiter-api:5.3.1\n", + "import org.junit.jupiter.api.Assertions;\n", + "\n", + "System.out.println(\"Testing D\");\n", + "\n", + "Assertions.assertTrue(true);" + ] + } + ], + "metadata": { + "celltoolbar": "Create Assignment", + "kernelspec": { + "display_name": "Java", + "language": "java", + "name": "java" + }, + "language_info": { + "codemirror_mode": "java", + "file_extension": ".jshell", + "mimetype": "text/x-java-source", + "name": "Java", + "pygments_lexer": "java", + "version": "11.0.4+11-post-Ubuntu-1ubuntu218.04.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} + diff --git a/examples/TimeoutContinuationTest/TimeoutContinuationTest-E.ipynb b/examples/TimeoutContinuationTest/TimeoutContinuationTest-E.ipynb new file mode 100644 index 0000000..7cd618f --- /dev/null +++ b/examples/TimeoutContinuationTest/TimeoutContinuationTest-E.ipynb @@ -0,0 +1,69 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "nbgrader": { + "grade": false, + "grade_id": "cell-markdown-task", + "locked": true, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "source": [ + "# Timeout continuation test\n", + "\n", + "Tests, if the grading of all ngbrader-tests continue, even if there is a timeout during one single test. \n", + "The test has to be auto-graded. \n", + "\n", + "One test in one file should fail. \n", + "The overall grading should result in 40 points." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "nbgrader": { + "grade": true, + "grade_id": "cell-autograde-visible", + "locked": true, + "points": 10, + "schema_version": 3, + "solution": false, + "task": false + } + }, + "outputs": [], + "source": [ + "%maven org.junit.jupiter:junit-jupiter-api:5.3.1\n", + "import org.junit.jupiter.api.Assertions;\n", + "\n", + "System.out.println(\"Testing E\");\n", + "\n", + "Assertions.assertTrue(true);" + ] + } + ], + "metadata": { + "celltoolbar": "Create Assignment", + "kernelspec": { + "display_name": "Java", + "language": "java", + "name": "java" + }, + "language_info": { + "codemirror_mode": "java", + "file_extension": ".jshell", + "mimetype": "text/x-java-source", + "name": "Java", + "pygments_lexer": "java", + "version": "11.0.4+11-post-Ubuntu-1ubuntu218.04.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} +