diff --git a/nbgrader/docs/source/conf.py b/nbgrader/docs/source/conf.py index 30e61a1f6..b1f53fe1a 100644 --- a/nbgrader/docs/source/conf.py +++ b/nbgrader/docs/source/conf.py @@ -33,7 +33,8 @@ 'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'sphinx_autodoc_typehints', - "myst_parser" + "myst_parser", + "sphinxcontrib.jquery" ] # Add any paths that contain templates here, relative to this directory. @@ -289,7 +290,7 @@ # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'http://docs.python.org/': None} +intersphinx_mapping = {'python': ('http://docs.python.org/', None)} # -- Run nbconvert on documentation -------------------------------------- diff --git a/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem1.ipynb b/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem1.ipynb index 19b0e6ec1..996d0f5b9 100644 --- a/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem1.ipynb +++ b/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem1.ipynb @@ -136,7 +136,7 @@ "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)", - "Input \u001b[0;32mIn [4]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;124;03m\"\"\"Check that squares returns the correct output for several inputs\"\"\"\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m squares(\u001b[38;5;241m1\u001b[39m) \u001b[38;5;241m==\u001b[39m [\u001b[38;5;241m1\u001b[39m]\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m squares(\u001b[38;5;241m2\u001b[39m) \u001b[38;5;241m==\u001b[39m [\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m4\u001b[39m]\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m squares(\u001b[38;5;241m10\u001b[39m) \u001b[38;5;241m==\u001b[39m [\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m4\u001b[39m, \u001b[38;5;241m9\u001b[39m, \u001b[38;5;241m16\u001b[39m, \u001b[38;5;241m25\u001b[39m, \u001b[38;5;241m36\u001b[39m, \u001b[38;5;241m49\u001b[39m, \u001b[38;5;241m64\u001b[39m, \u001b[38;5;241m81\u001b[39m, \u001b[38;5;241m100\u001b[39m]\n", + "Cell \u001b[0;32mIn[4], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;124;03m\"\"\"Check that squares returns the correct output for several inputs\"\"\"\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m squares(\u001b[38;5;241m1\u001b[39m) \u001b[38;5;241m==\u001b[39m [\u001b[38;5;241m1\u001b[39m]\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m squares(\u001b[38;5;241m2\u001b[39m) \u001b[38;5;241m==\u001b[39m [\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m4\u001b[39m]\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m squares(\u001b[38;5;241m10\u001b[39m) \u001b[38;5;241m==\u001b[39m [\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m4\u001b[39m, \u001b[38;5;241m9\u001b[39m, \u001b[38;5;241m16\u001b[39m, \u001b[38;5;241m25\u001b[39m, \u001b[38;5;241m36\u001b[39m, \u001b[38;5;241m49\u001b[39m, \u001b[38;5;241m64\u001b[39m, \u001b[38;5;241m81\u001b[39m, \u001b[38;5;241m100\u001b[39m]\n", "\u001b[0;31mAssertionError\u001b[0m: " ] } @@ -274,7 +274,7 @@ "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)", - "Input \u001b[0;32mIn [8]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;124;03m\"\"\"Check that sum_of_squares returns the correct answer for various inputs.\"\"\"\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m sum_of_squares(\u001b[38;5;241m1\u001b[39m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m sum_of_squares(\u001b[38;5;241m2\u001b[39m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m5\u001b[39m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m sum_of_squares(\u001b[38;5;241m10\u001b[39m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m385\u001b[39m\n", + "Cell \u001b[0;32mIn[8], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;124;03m\"\"\"Check that sum_of_squares returns the correct answer for various inputs.\"\"\"\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m sum_of_squares(\u001b[38;5;241m1\u001b[39m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m sum_of_squares(\u001b[38;5;241m2\u001b[39m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m5\u001b[39m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m sum_of_squares(\u001b[38;5;241m10\u001b[39m) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m385\u001b[39m\n", "\u001b[0;31mAssertionError\u001b[0m: " ] } @@ -384,7 +384,7 @@ "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNotImplementedError\u001b[0m Traceback (most recent call last)", - "Input \u001b[0;32mIn [10]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# YOUR CODE HERE\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mNotImplementedError\u001b[39;00m()\n", + "Cell \u001b[0;32mIn[10], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# YOUR CODE HERE\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mNotImplementedError\u001b[39;00m()\n", "\u001b[0;31mNotImplementedError\u001b[0m: " ] } diff --git a/nbgrader/docs/source/user_guide/creating_and_grading_assignments.ipynb b/nbgrader/docs/source/user_guide/creating_and_grading_assignments.ipynb index 198ea9561..90b5c1351 100644 --- a/nbgrader/docs/source/user_guide/creating_and_grading_assignments.ipynb +++ b/nbgrader/docs/source/user_guide/creating_and_grading_assignments.ipynb @@ -534,7 +534,19 @@ "text": [ "[ValidateApp | WARNING] No nbgrader_config.py file found (rerun with --debug to see where nbgrader is looking)\n", "[ValidateApp | INFO] Validating '[NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/source/ps1/problem1.ipynb'\n", - "[ValidateApp | INFO] Validating '[NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/source/ps1/problem2.ipynb'\n" + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n", + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n", + "[ValidateApp | INFO] Validating '[NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/source/ps1/problem2.ipynb'\n", + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n" ] }, { @@ -720,7 +732,19 @@ "text": [ "[ValidateApp | WARNING] No nbgrader_config.py file found (rerun with --debug to see where nbgrader is looking)\n", "[ValidateApp | INFO] Validating '[NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/release/ps1/problem1.ipynb'\n", - "[ValidateApp | INFO] Validating '[NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/release/ps1/problem2.ipynb'\n" + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n", + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n", + "[ValidateApp | INFO] Validating '[NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/release/ps1/problem2.ipynb'\n", + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n" ] }, { @@ -916,9 +940,15 @@ "output_type": "stream", "text": [ "[AutogradeApp | WARNING] No nbgrader_config.py file found (rerun with --debug to see where nbgrader is looking)\n", - "[AutogradeApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/submitted/bitdiddle/ps1/jupyter.png -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/jupyter.png\n", "[AutogradeApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/submitted/bitdiddle/ps1/timestamp.txt -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/timestamp.txt\n", + "[AutogradeApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/submitted/bitdiddle/ps1/jupyter.png -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/jupyter.png\n", "[AutogradeApp | INFO] Creating/updating student with ID 'bitdiddle': {}\n", + "[NB_GRADER_ROOT]/nbgrader/api.py:2256: SAWarning: Object of type not in session, add operation along 'Assignment.submissions' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)\n", + " for notebook in submission.assignment.notebooks:\n", + "[NB_GRADER_ROOT]/nbgrader/api.py:2256: SAWarning: Object of type not in session, add operation along 'Student.submissions' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)\n", + " for notebook in submission.assignment.notebooks:\n", + "[NB_GRADER_ROOT]/nbgrader/api.py:150: SAWarning: Object of type not in session, add operation along 'Notebook.submissions' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)\n", + " return [x for x in self._base_cells if isinstance(x, GradeCell)]\n", "[AutogradeApp | INFO] SubmittedAssignment submitted at [timestamp]\n", "[AutogradeApp | INFO] Overwriting files with master versions from the source directory\n", "[AutogradeApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/source/./ps1/jupyter.png -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/jupyter.png\n", @@ -929,17 +959,35 @@ "[AutogradeApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem1.ipynb\n", "[AutogradeApp | INFO] Autograding [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem1.ipynb\n", "[AutogradeApp | INFO] Converting notebook [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem1.ipynb\n", + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n", + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n", "[AutogradeApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem1.ipynb\n", "[AutogradeApp | INFO] Sanitizing [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/submitted/bitdiddle/ps1/problem2.ipynb\n", "[AutogradeApp | INFO] Converting notebook [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/submitted/bitdiddle/ps1/problem2.ipynb\n", "[AutogradeApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem2.ipynb\n", "[AutogradeApp | INFO] Autograding [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem2.ipynb\n", "[AutogradeApp | INFO] Converting notebook [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem2.ipynb\n", + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n", "[AutogradeApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem2.ipynb\n", "[AutogradeApp | INFO] Setting destination file permissions to 444\n", - "[AutogradeApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/submitted/hacker/ps1/jupyter.png -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/jupyter.png\n", "[AutogradeApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/submitted/hacker/ps1/timestamp.txt -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/timestamp.txt\n", + "[AutogradeApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/submitted/hacker/ps1/jupyter.png -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/jupyter.png\n", "[AutogradeApp | INFO] Creating/updating student with ID 'hacker': {}\n", + "[NB_GRADER_ROOT]/nbgrader/api.py:2256: SAWarning: Object of type not in session, add operation along 'Assignment.submissions' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)\n", + " for notebook in submission.assignment.notebooks:\n", + "[NB_GRADER_ROOT]/nbgrader/api.py:2256: SAWarning: Object of type not in session, add operation along 'Student.submissions' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)\n", + " for notebook in submission.assignment.notebooks:\n", + "[NB_GRADER_ROOT]/nbgrader/api.py:150: SAWarning: Object of type not in session, add operation along 'Notebook.submissions' will not proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)\n", + " return [x for x in self._base_cells if isinstance(x, GradeCell)]\n", "[AutogradeApp | INFO] SubmittedAssignment submitted at [timestamp]\n", "[AutogradeApp | INFO] Overwriting files with master versions from the source directory\n", "[AutogradeApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/source/./ps1/jupyter.png -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/jupyter.png\n", @@ -948,12 +996,20 @@ "[AutogradeApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem1.ipynb\n", "[AutogradeApp | INFO] Autograding [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem1.ipynb\n", "[AutogradeApp | INFO] Converting notebook [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem1.ipynb\n", + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n", "[AutogradeApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem1.ipynb\n", "[AutogradeApp | INFO] Sanitizing [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/submitted/hacker/ps1/problem2.ipynb\n", "[AutogradeApp | INFO] Converting notebook [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/submitted/hacker/ps1/problem2.ipynb\n", "[AutogradeApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem2.ipynb\n", "[AutogradeApp | INFO] Autograding [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem2.ipynb\n", "[AutogradeApp | INFO] Converting notebook [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem2.ipynb\n", + "0.00s - Debugger warning: It seems that frozen modules are being used, which may\n", + "0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n", + "0.00s - to python to disable frozen modules.\n", + "0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n", "[AutogradeApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem2.ipynb\n", "[AutogradeApp | INFO] Setting destination file permissions to 444\n" ] @@ -1142,15 +1198,15 @@ "output_type": "stream", "text": [ "[GenerateFeedbackApp | WARNING] No nbgrader_config.py file found (rerun with --debug to see where nbgrader is looking)\n", - "[GenerateFeedbackApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/jupyter.png -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/jupyter.png\n", "[GenerateFeedbackApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/timestamp.txt -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/timestamp.txt\n", + "[GenerateFeedbackApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/jupyter.png -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/jupyter.png\n", "[GenerateFeedbackApp | INFO] Converting notebook [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem1.ipynb\n", "[GenerateFeedbackApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/problem1.html\n", "[GenerateFeedbackApp | INFO] Converting notebook [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/bitdiddle/ps1/problem2.ipynb\n", "[GenerateFeedbackApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/problem2.html\n", "[GenerateFeedbackApp | INFO] Setting destination file permissions to 644\n", - "[GenerateFeedbackApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/jupyter.png -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/feedback/hacker/ps1/jupyter.png\n", "[GenerateFeedbackApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/timestamp.txt -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/feedback/hacker/ps1/timestamp.txt\n", + "[GenerateFeedbackApp | INFO] Copying [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/jupyter.png -> [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/feedback/hacker/ps1/jupyter.png\n", "[GenerateFeedbackApp | INFO] Converting notebook [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem1.ipynb\n", "[GenerateFeedbackApp | INFO] Writing [size] bytes to [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/feedback/hacker/ps1/problem1.html\n", "[GenerateFeedbackApp | INFO] Converting notebook [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/autograded/hacker/ps1/problem2.ipynb\n", diff --git a/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/problem1.html b/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/problem1.html index f9638904e..6ae63490e 100644 --- a/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/problem1.html +++ b/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/problem1.html @@ -1,17 +1,15 @@ + - - + problem1 - - - - - - - + + - - + - - -
-
-
-

problem1 (Score: 1.5 / 10.0)

-
-
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1. Test cell (Score: 0.0 / 1.0)
  2. - - - - -
  3. Test cell (Score: 1.0 / 1.0)
  4. - - - - - - - - - - - - - - - - -
  5. Test cell (Score: 0.0 / 0.5)
  6. - - - - -
  7. Test cell (Score: 0.5 / 0.5)
  8. - - - - - - - -
  9. Written response (Score: 0.0 / 1.0)
  10. - - - - - - - -
  11. Coding free-response (Score: 0.0 / 2.0)
  12. - - -
  13. Comment
  14. - - - -
  15. Task (Score: 0.0 / 4.0)
  16. - - - - - - - -
-
-
-
-
-
- + +
+
+
+

problem1 (Score: 1.5 / 10.0)

+
+
    +
  1. Test cell (Score: 0.0 / 1.0)
  2. +
  3. Test cell (Score: 1.0 / 1.0)
  4. +
  5. Test cell (Score: 0.0 / 0.5)
  6. +
  7. Test cell (Score: 0.5 / 0.5)
  8. +
  9. Written response (Score: 0.0 / 1.0)
  10. +
  11. Coding free-response (Score: 0.0 / 2.0)
  12. +
  13. Comment
  14. +
  15. Task (Score: 0.0 / 4.0)
  16. +
+
+
+
+
+
-
-
- +
+
+
-
+
-
-

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).

+
+

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).

Make sure you fill in any place that says YOUR CODE HERE or "YOUR ANSWER HERE", as well as your name and collaborators below:

- -
-
- +
+
-
In [1]:
-
-
NAME = "Ben Bitdiddle"
-COLLABORATORS = "Alyssa P. Hacker"
+
In [1]:
+
+
NAME = "Ben Bitdiddle"
+COLLABORATORS = "Alyssa P. Hacker"
 
- -
-
- +
+
-
+
-
-
- -
-
- +
+
+
+
-
+
-
-

For this problem set, we'll be using the Jupyter notebook:

-

- -
-
- +
+

For this problem set, we'll be using the Jupyter notebook:

+

+
+
-
+
-
-
-

Part A (2 points)

Write a function that returns a list of numbers, such that $x_i=i^2$, for $1\leq i \leq n$. Make sure it handles the case where $n<1$ by raising a ValueError.

- -
-
- +
+
+

Part A (2 points)

Write a function that returns a list of numbers, such that $x_i=i^2$, for $1\leq i \leq n$. Make sure it handles the case where $n<1$ by raising a ValueError.

+
+
-
In [2]:
-
Student's answer(Top)
-
-
-
def squares(n):
-    """Compute the squares of numbers from 1 to n, such that the 
+
In [2]:
+
Student's answer(Top)
+
+
+
def squares(n):
+    """Compute the squares of numbers from 1 to n, such that the 
     ith element of the returned list equals i^2.
     
-    """
+    """
     if n < 1:
         raise ValueError
     s = []
@@ -388,92 +296,67 @@ 

Part A (2 points)s.append(i**2) return s

- -
-
- -
- +
+
+
-
+
-
-

Your function should print [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] for $n=10$. Check that it does:

- -
-
- +
+

Your function should print [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] for $n=10$. Check that it does:

+
+
-
In [3]:
-
-
squares(10)
+
In [3]:
+
+
squares(10)
 
- -
-
- +
+
- -
- -
Out[3]:
- - - - +
Out[3]:
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
-
-
-
-
In [4]:
-
Grade cell: correct_squares - +
In [4]:
+
Grade cell: correct_squares + Score: 0.0 / 1.0 (Top) -
-
-
-
"""Check that squares returns the correct output for several inputs"""
+
+
+
+
"""Check that squares returns the correct output for several inputs"""
 assert squares(1) == [1]
 assert squares(2) == [1, 4]
 assert squares(10) == [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
 assert squares(11) == [1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121]
 
- -
-
- -
- +
+
+
- -
- -
- - +
 ---------------------------------------------------------------------------
 AssertionError                            Traceback (most recent call last)
-Input In [4], in <cell line: 2>()
-      1 """Check that squares returns the correct output for several inputs"""
+Cell In[4], line 2
+      1 """Check that squares returns the correct output for several inputs"""
 ----> 2 assert squares(1) == [1]
       3 assert squares(2) == [1, 4]
       4 assert squares(10) == [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
@@ -481,153 +364,121 @@ 

Part A (2 points)AssertionError:

-
-
-
In [5]:
-
Grade cell: squares_invalid_input - +
In [5]:
+
Grade cell: squares_invalid_input + Score: 1.0 / 1.0 (Top) -
-
-
-
"""Check that squares raises an error for invalid inputs"""
+
+
+
+
"""Check that squares raises an error for invalid inputs"""
 try:
     squares(0)
 except ValueError:
     pass
 else:
-    raise AssertionError("did not raise")
+    raise AssertionError("did not raise")
 
 try:
     squares(-4)
 except ValueError:
     pass
 else:
-    raise AssertionError("did not raise")
+    raise AssertionError("did not raise")
 
- -
-
- -
- +
+
+
-
+
-
-
-

Part B (1 point)

Using your squares function, write a function that computes the sum of the squares of the numbers from 1 to $n$. Your function should call the squares function -- it should NOT reimplement its functionality.

- -
-
- +
+
+

Part B (1 point)

Using your squares function, write a function that computes the sum of the squares of the numbers from 1 to $n$. Your function should call the squares function -- it should NOT reimplement its functionality.

+
+
-
In [6]:
-
Student's answer(Top)
-
-
-
def sum_of_squares(n):
-    """Compute the sum of the squares of numbers from 1 to n."""
+
In [6]:
+
Student's answer(Top)
+
+
+
def sum_of_squares(n):
+    """Compute the sum of the squares of numbers from 1 to n."""
     total = 0
     s = squares(n)
     for i in range(len(s)):
         total += s[i]
     return total
 
- -
-
- -
- +
+
+
-
+
-
-

The sum of squares from 1 to 10 should be 385. Verify that this is the answer you get:

- -
-
- +
+

The sum of squares from 1 to 10 should be 385. Verify that this is the answer you get:

+
+
-
In [7]:
-
-
sum_of_squares(10)
+
In [7]:
+
+
sum_of_squares(10)
 
- -
-
- +
+
- -
- -
Out[7]:
- - - - +
Out[7]:
285
-
-
-
-
In [8]:
-
Grade cell: correct_sum_of_squares - +
In [8]:
+
Grade cell: correct_sum_of_squares + Score: 0.0 / 0.5 (Top) -
-
-
-
"""Check that sum_of_squares returns the correct answer for various inputs."""
+
+
+
+
"""Check that sum_of_squares returns the correct answer for various inputs."""
 assert sum_of_squares(1) == 1
 assert sum_of_squares(2) == 5
 assert sum_of_squares(10) == 385
 assert sum_of_squares(11) == 506
 
- -
-
- -
- +
+
+
- -
- -
- - +
 ---------------------------------------------------------------------------
 AssertionError                            Traceback (most recent call last)
-Input In [8], in <cell line: 2>()
-      1 """Check that sum_of_squares returns the correct answer for various inputs."""
+Cell In[8], line 2
+      1 """Check that sum_of_squares returns the correct answer for various inputs."""
 ----> 2 assert sum_of_squares(1) == 1
       3 assert sum_of_squares(2) == 5
       4 assert sum_of_squares(10) == 385
@@ -635,21 +486,19 @@ 

Part B (1 point)AssertionError:

-
-
-
In [9]:
-
Grade cell: sum_of_squares_uses_squares - +
In [9]:
+
Grade cell: sum_of_squares_uses_squares + Score: 0.5 / 0.5 (Top) -
-
-
-
"""Check that sum_of_squares relies on squares."""
+
+
+
+
"""Check that sum_of_squares relies on squares."""
 orig_squares = squares
 del squares
 try:
@@ -657,135 +506,110 @@ 

Part B (1 point)except NameError: pass else: - raise AssertionError("sum_of_squares does not use squares") + raise AssertionError("sum_of_squares does not use squares") finally: squares = orig_squares

- -
-
- -
- +
+
+
-
+
-
-
-

Part C (1 point)

Using LaTeX math notation, write out the equation that is implemented by your sum_of_squares function.

- -
-
- +
+
+

Part C (1 point)

Using LaTeX math notation, write out the equation that is implemented by your sum_of_squares function.

+
+
-
+
-
Student's answer +
Student's answer Score: 0.0 / 1.0 (Top) -
-
-
-

$\sum_{i=0}^n i^2$

- -
-
- -
- +
+
+
+

$\sum_{i=0}^n i^2$

+
+
+
-
+
-
-
-

Part D (2 points)

Find a usecase for your sum_of_squares function and implement that usecase in the cell below.

- -
-
- +
+
+

Part D (2 points)

Find a usecase for your sum_of_squares function and implement that usecase in the cell below.

+
+
-
In [10]:
-
Student's answer +
In [10]:
+
Student's answer Score: 0.0 / 2.0 (Top) -
-
-
-
# YOUR CODE HERE
+
+
+
+
# YOUR CODE HERE
 raise NotImplementedError()
 
- -
-
- -
- + +
+
- -
- -
- - +
 ---------------------------------------------------------------------------
 NotImplementedError                       Traceback (most recent call last)
-Input In [10], in <cell line: 2>()
+Cell In[10], line 2
       1 # YOUR CODE HERE
 ----> 2 raise NotImplementedError()
 
 NotImplementedError: 
-
-
-
+
-
Student's task - +
Student's task + Score: 0.0 / 4.0 (Top) -
-
-
-
-

Part E (4 points)

State the formulae for an arithmetic and geometric sum and verify them numerically for an example of your choice.

- -
-
- -
- +
+
+
+
+

Part E (4 points)

State the formulae for an arithmetic and geometric sum and verify them numerically for an example of your choice.

+
+
+
-
+
-
-

$\sum x^i = \frac{1}{1-x}$

- -
-
- -
-
+
+

$\sum x^i = \frac{1}{1-x}$

+
+
+
+
+ - -
-
-
-
-
+
+
+
+
+ diff --git a/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/problem2.html b/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/problem2.html index 3539525aa..1166479aa 100644 --- a/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/problem2.html +++ b/nbgrader/docs/source/user_guide/feedback/bitdiddle/ps1/problem2.html @@ -1,17 +1,15 @@ + - - + problem2 - - - - - - - + + - - + - - -
-
-
-

problem2 (Score: 0.0 / 3.0)

-
-
    - - - - - - - - - - - - - - - - - -
  1. Written response (Score: 0.0 / 1.0)
  2. - - - - - - - -
  3. Written response (Score: 0.0 / 2.0)
  4. - - - - -
-
-
-
-
-
- + +
+
+
+

problem2 (Score: 0.0 / 3.0)

+
+
    +
  1. Written response (Score: 0.0 / 1.0)
  2. +
  3. Written response (Score: 0.0 / 2.0)
  4. +
+
+
+
+
+
-
-
- +
+
+
-
+
-
-

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).

+
+

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).

Make sure you fill in any place that says YOUR CODE HERE or "YOUR ANSWER HERE", as well as your name and collaborators below:

- -
-
- +
+
-
In [1]:
-
-
NAME = "Ben Bitdiddle"
-COLLABORATORS = "Alyssa P. Hacker"
+
In [1]:
+
+
NAME = "Ben Bitdiddle"
+COLLABORATORS = "Alyssa P. Hacker"
 
- -
-
- +
+
-
+
-
-
- -
-
- +
+
+
+
-
+
-
-

Consider the following piece of code:

+
+

Consider the following piece of code:

def f(x):
     if x == 0 or x == 1:
         return x
     return f(x - 1) + f(x - 2)
 
- -
-
- +
+
-
+
-
-
-

Part A (1 point)

Describe, in words, what this code does, and how it does it.

- -
-
- +
+
+

Part A (1 point)

Describe, in words, what this code does, and how it does it.

+
+
-
+
-
Student's answer +
Student's answer Score: 0.0 / 1.0 (Top) -
-
-
-

It computes the fibonnaci sequence.

- -
-
- -
- +
+
+
+

It computes the fibonnaci sequence.

+
+
+
-
+
-
-
-

Part B (2 points)

For what inputs will this function not behave as expected? What will happen?

- -
-
- +
+
+

Part B (2 points)

For what inputs will this function not behave as expected? What will happen?

+
+
-
+
-
Student's answer +
Student's answer Score: 0.0 / 2.0 (Top) -
-
-
-

Not sure.

- -
-
- -
- -
-
+
+
+
+

Not sure.

+
+
+
+
+
+ - -
-
-
-
- + + + + + diff --git a/nbgrader/docs/source/user_guide/feedback/hacker/ps1/problem1.html b/nbgrader/docs/source/user_guide/feedback/hacker/ps1/problem1.html index c8c2f775a..a2a4f793f 100644 --- a/nbgrader/docs/source/user_guide/feedback/hacker/ps1/problem1.html +++ b/nbgrader/docs/source/user_guide/feedback/hacker/ps1/problem1.html @@ -1,17 +1,15 @@ + - - + problem1 - - - - - - - + + - - + - - -
-
-
-

problem1 (Score: 3.0 / 10.0)

-
-
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1. Test cell (Score: 1.0 / 1.0)
  2. - - - - -
  3. Test cell (Score: 1.0 / 1.0)
  4. - - - - - - - - - - - - - - - - -
  5. Test cell (Score: 0.5 / 0.5)
  6. - - - - -
  7. Test cell (Score: 0.5 / 0.5)
  8. - - - - - - - -
  9. Written response (Score: 0.0 / 1.0)
  10. - - - - - - - -
  11. Coding free-response (Score: 0.0 / 2.0)
  12. - - - - - - - - - - -
  13. Task (Score: 0.0 / 4.0)
  14. - - - - - - - -
-
-
-
-
-
- + +
+
+
+

problem1 (Score: 3.0 / 10.0)

+
+
    +
  1. Test cell (Score: 1.0 / 1.0)
  2. +
  3. Test cell (Score: 1.0 / 1.0)
  4. +
  5. Test cell (Score: 0.5 / 0.5)
  6. +
  7. Test cell (Score: 0.5 / 0.5)
  8. +
  9. Written response (Score: 0.0 / 1.0)
  10. +
  11. Coding free-response (Score: 0.0 / 2.0)
  12. +
  13. Task (Score: 0.0 / 4.0)
  14. +
+
+
+
+
+
-
-
- +
+
+
-
+
-
-

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).

+
+

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).

Make sure you fill in any place that says YOUR CODE HERE or "YOUR ANSWER HERE", as well as your name and collaborators below:

- -
-
- +
+
-
In [1]:
-
-
NAME = "Alyssa P. Hacker"
-COLLABORATORS = "Ben Bitdiddle"
+
In [1]:
+
+
NAME = "Alyssa P. Hacker"
+COLLABORATORS = "Ben Bitdiddle"
 
- -
-
- +
+
-
+
-
-
- -
-
- +
+
+
+
-
+
-
-

For this problem set, we'll be using the Jupyter notebook:

-

- -
-
- +
+

For this problem set, we'll be using the Jupyter notebook:

+

+
+
-
+
-
-
-

Part A (2 points)

Write a function that returns a list of numbers, such that $x_i=i^2$, for $1\leq i \leq n$. Make sure it handles the case where $n<1$ by raising a ValueError.

- -
-
- +
+
+

Part A (2 points)

Write a function that returns a list of numbers, such that $x_i=i^2$, for $1\leq i \leq n$. Make sure it handles the case where $n<1$ by raising a ValueError.

+
+
-
In [2]:
-
Student's answer(Top)
-
-
-
def squares(n):
-    """Compute the squares of numbers from 1 to n, such that the 
+
In [2]:
+
Student's answer(Top)
+
+
+
def squares(n):
+    """Compute the squares of numbers from 1 to n, such that the 
     ith element of the returned list equals i^2.
     
-    """
+    """
     if n < 1:
         raise ValueError
     return [i ** 2 for i in range(1, n + 1)]
 
- -
-
- -
- +
+
+
-
+
-
-

Your function should print [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] for $n=10$. Check that it does:

- -
-
- +
+

Your function should print [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] for $n=10$. Check that it does:

+
+
-
In [3]:
-
-
squares(10)
+
In [3]:
+
+
squares(10)
 
- -
-
- +
+
- -
- -
Out[3]:
- - - - +
Out[3]:
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
-
-
-
-
In [4]:
-
Grade cell: correct_squares - +
In [4]:
+
Grade cell: correct_squares + Score: 1.0 / 1.0 (Top) -
-
-
-
"""Check that squares returns the correct output for several inputs"""
+
+
+
+
"""Check that squares returns the correct output for several inputs"""
 assert squares(1) == [1]
 assert squares(2) == [1, 4]
 assert squares(10) == [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
 assert squares(11) == [1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121]
 
- -
-
- -
- +
+
+
-
In [5]:
-
Grade cell: squares_invalid_input - +
In [5]:
+
Grade cell: squares_invalid_input + Score: 1.0 / 1.0 (Top) -
-
-
-
"""Check that squares raises an error for invalid inputs"""
+
+
+
+
"""Check that squares raises an error for invalid inputs"""
 try:
     squares(0)
 except ValueError:
     pass
 else:
-    raise AssertionError("did not raise")
+    raise AssertionError("did not raise")
 
 try:
     squares(-4)
 except ValueError:
     pass
 else:
-    raise AssertionError("did not raise")
+    raise AssertionError("did not raise")
 
- -
-
- -
- +
+
+
-
+
-
-
-

Part B (1 point)

Using your squares function, write a function that computes the sum of the squares of the numbers from 1 to $n$. Your function should call the squares function -- it should NOT reimplement its functionality.

- -
-
- +
+
+

Part B (1 point)

Using your squares function, write a function that computes the sum of the squares of the numbers from 1 to $n$. Your function should call the squares function -- it should NOT reimplement its functionality.

+
+
-
In [6]:
-
Student's answer(Top)
-
-
-
def sum_of_squares(n):
-    """Compute the sum of the squares of numbers from 1 to n."""
+
In [6]:
+
Student's answer(Top)
+
+
+
def sum_of_squares(n):
+    """Compute the sum of the squares of numbers from 1 to n."""
     return sum(squares(n))
 
- -
-
- -
- +
+
+
-
+
-
-

The sum of squares from 1 to 10 should be 385. Verify that this is the answer you get:

- -
-
- +
+

The sum of squares from 1 to 10 should be 385. Verify that this is the answer you get:

+
+
-
In [7]:
-
-
sum_of_squares(10)
+
In [7]:
+
+
sum_of_squares(10)
 
- -
-
- +
+
- -
- -
Out[7]:
- - - - +
Out[7]:
385
-
-
-
-
In [8]:
-
Grade cell: correct_sum_of_squares - +
In [8]:
+
Grade cell: correct_sum_of_squares + Score: 0.5 / 0.5 (Top) -
-
-
-
"""Check that sum_of_squares returns the correct answer for various inputs."""
+
+
+
+
"""Check that sum_of_squares returns the correct answer for various inputs."""
 assert sum_of_squares(1) == 1
 assert sum_of_squares(2) == 5
 assert sum_of_squares(10) == 385
 assert sum_of_squares(11) == 506
 
- -
-
- -
- +
+
+
-
In [9]:
-
Grade cell: sum_of_squares_uses_squares - +
In [9]:
+
Grade cell: sum_of_squares_uses_squares + Score: 0.5 / 0.5 (Top) -
-
-
-
"""Check that sum_of_squares relies on squares."""
+
+
+
+
"""Check that sum_of_squares relies on squares."""
 orig_squares = squares
 del squares
 try:
@@ -602,69 +460,59 @@ 

Part B (1 point)except NameError: pass else: - raise AssertionError("sum_of_squares does not use squares") + raise AssertionError("sum_of_squares does not use squares") finally: squares = orig_squares

- -
-
- -
- +
+
+
-
+
-
-
-

Part C (1 point)

Using LaTeX math notation, write out the equation that is implemented by your sum_of_squares function.

- -
-
- +
+
+

Part C (1 point)

Using LaTeX math notation, write out the equation that is implemented by your sum_of_squares function.

+
+
-
+
-
Student's answer +
Student's answer Score: 0.0 / 1.0 (Top) -
-
-
-

$\sum_{i=1}^n i^2$

- -
-
- -
- +
+
+
+

$\sum_{i=1}^n i^2$

+
+
+
-
+
-
-
-

Part D (2 points)

Find a usecase for your sum_of_squares function and implement that usecase in the cell below.

- -
-
- +
+
+

Part D (2 points)

Find a usecase for your sum_of_squares function and implement that usecase in the cell below.

+
+
-
In [10]:
-
Student's answer +
In [10]:
+
Student's answer Score: 0.0 / 2.0 (Top) -
-
-
-
import math
+
+
+
+
import math
 
 def hypotenuse(n):
-    """Finds the hypotenuse of a right triangle with one side of length n and
-    the other side of length n-1."""
+    """Finds the hypotenuse of a right triangle with one side of length n and
+    the other side of length n-1."""
     # find (n-1)**2 + n**2
     if (n < 2):
-        raise ValueError("n must be >= 2")
+        raise ValueError("n must be >= 2")
     elif n == 2:
         sum1 = 5
         sum2 = 0
@@ -673,112 +521,86 @@ 

Part D (2 points)sum2 = sum_of_squares(n-2) return math.sqrt(sum1 - sum2)

- -
-
- -
- +
+
+
-
In [11]:
-
-
print(hypotenuse(2))
+
In [11]:
+
+
print(hypotenuse(2))
 print(math.sqrt(2**2 + 1**2))
 
- -
-
- +
+
- -
- -
- - +
2.23606797749979
 2.23606797749979
 
-
-
-
In [12]:
-
-
print(hypotenuse(10))
+
In [12]:
+
+
print(hypotenuse(10))
 print(math.sqrt(10**2 + 9**2))
 
- -
-
- +
+
- -
- -
- - +
13.45362404707371
 13.45362404707371
 
-
-
-
+
-
Student's task - +
Student's task + Score: 0.0 / 4.0 (Top) -
-
-
-
-

Part E (4 points)

State the formulae for an arithmetic and geometric sum and verify them numerically for an example of your choice.

- -
-
- -
- +
+
+
+
+

Part E (4 points)

State the formulae for an arithmetic and geometric sum and verify them numerically for an example of your choice.

+
+
+
-
+
-
-

$\sum x^i = \frac{1}{1-x}$

- -
-
- -
-
+
+

$\sum x^i = \frac{1}{1-x}$

+
+
+
+
+ - -
-
-
-
-
+
+
+
+
+
diff --git a/nbgrader/docs/source/user_guide/feedback/hacker/ps1/problem2.html b/nbgrader/docs/source/user_guide/feedback/hacker/ps1/problem2.html index 1fa256ce3..1d524f3ab 100644 --- a/nbgrader/docs/source/user_guide/feedback/hacker/ps1/problem2.html +++ b/nbgrader/docs/source/user_guide/feedback/hacker/ps1/problem2.html @@ -1,17 +1,15 @@ + - - + problem2 - - - - - - - + + - - + - - -
-
-
-

problem2 (Score: 0.0 / 3.0)

-
-
    - - - - - - - - - - - - - - - - - -
  1. Written response (Score: 0.0 / 1.0)
  2. - - - - - - - -
  3. Written response (Score: 0.0 / 2.0)
  4. - - - - -
-
-
-
-
-
- + +
+
+
+

problem2 (Score: 0.0 / 3.0)

+
+
    +
  1. Written response (Score: 0.0 / 1.0)
  2. +
  3. Written response (Score: 0.0 / 2.0)
  4. +
+
+
+
+
+
-
-
- +
+
+
-
+
-
-

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).

+
+

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).

Make sure you fill in any place that says YOUR CODE HERE or "YOUR ANSWER HERE", as well as your name and collaborators below:

- -
-
- +
+
-
In [1]:
-
-
NAME = "Alyssa P. Hacker"
-COLLABORATORS = "Ben Bitdiddle"
+
In [1]:
+
+
NAME = "Alyssa P. Hacker"
+COLLABORATORS = "Ben Bitdiddle"
 
- -
-
- +
+
-
+
-
-
- -
-
- +
+
+
+
-
+
-
-

Consider the following piece of code:

+
+

Consider the following piece of code:

def f(x):
     if x == 0 or x == 1:
         return x
     return f(x - 1) + f(x - 2)
 
- -
-
- +
+
-
+
-
-
-

Part A (1 point)

Describe, in words, what this code does, and how it does it.

- -
-
- +
+
+

Part A (1 point)

Describe, in words, what this code does, and how it does it.

+
+
-
+
-
Student's answer +
Student's answer Score: 0.0 / 1.0 (Top) -
-
-
-

It computes the fibonacci sequence using recursion, with base cases of $x=0$ and $x=1$.

- -
-
- -
- +
+
+
+

It computes the fibonacci sequence using recursion, with base cases of $x=0$ and $x=1$.

+
+
+
-
+
-
-
-

Part B (2 points)

For what inputs will this function not behave as expected? What will happen?

- -
-
- +
+
+

Part B (2 points)

For what inputs will this function not behave as expected? What will happen?

+
+
-
+
-
Student's answer +
Student's answer Score: 0.0 / 2.0 (Top) -
-
-
-

It computes the fibonacci sequence using recursion, with base cases of $x=0$ and $x=1$.

- -
-
- -
- -
-
+
+
+
+

It computes the fibonacci sequence using recursion, with base cases of $x=0$ and $x=1$.

+
+
+
+
+
+ - -
-
-
-
- + + + + + diff --git a/nbgrader/docs/source/user_guide/managing_assignment_files.ipynb b/nbgrader/docs/source/user_guide/managing_assignment_files.ipynb index 49a0b52d9..4347958f6 100644 --- a/nbgrader/docs/source/user_guide/managing_assignment_files.ipynb +++ b/nbgrader/docs/source/user_guide/managing_assignment_files.ipynb @@ -1090,8 +1090,8 @@ "text": [ "total ##\n", "drwxrwxr-x 1 nb_user nb_group [size] [date] [time] bitdiddle\n", - "drwxrwxr-x 1 nb_user nb_group [size] [date] [time] hacker\n", - "drwxrwxr-x 1 nb_user nb_group [size] [date] [time] nb_user\n" + "drwxrwxr-x 1 nb_user nb_group [size] [date] [time] nb_user\n", + "drwxrwxr-x 1 nb_user nb_group [size] [date] [time] hacker\n" ] } ], diff --git a/nbgrader/docs/source/user_guide/managing_assignment_files_manually.ipynb b/nbgrader/docs/source/user_guide/managing_assignment_files_manually.ipynb index 0ca98be97..4ef6c29c9 100644 --- a/nbgrader/docs/source/user_guide/managing_assignment_files_manually.ipynb +++ b/nbgrader/docs/source/user_guide/managing_assignment_files_manually.ipynb @@ -354,12 +354,12 @@ "[ZipCollectApp | INFO] Using file extractor: ExtractorPlugin\n", "[ZipCollectApp | INFO] Using file collector: FileNameCollectorPlugin\n", "[ZipCollectApp | WARNING] Directory not found. Creating: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted\n", - "[ZipCollectApp | INFO] Copying from: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/archive/jupyter.png\n", - "[ZipCollectApp | INFO] Copying to: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/jupyter.png\n", "[ZipCollectApp | INFO] Extracting from: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/archive/notebooks.zip\n", "[ZipCollectApp | INFO] Extracting to: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/notebooks\n", "[ZipCollectApp | INFO] Copying from: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/archive/ps1_hacker_attempt_2016-01-30-20-30-10_problem1.ipynb\n", "[ZipCollectApp | INFO] Copying to: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/ps1_hacker_attempt_2016-01-30-20-30-10_problem1.ipynb\n", + "[ZipCollectApp | INFO] Copying from: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/archive/jupyter.png\n", + "[ZipCollectApp | INFO] Copying to: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/jupyter.png\n", "[ZipCollectApp | INFO] Start collecting files...\n", "[ZipCollectApp | INFO] Parsing file: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/jupyter.png\n", "[ZipCollectApp | WARNING] Skipped submission with no match information provided: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/jupyter.png\n", @@ -571,12 +571,12 @@ "[ZipCollectApp | INFO] Using file extractor: ExtractorPlugin\n", "[ZipCollectApp | INFO] Using file collector: CustomPlugin\n", "[ZipCollectApp | WARNING] Clearing existing files in [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted\n", - "[ZipCollectApp | INFO] Copying from: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/archive/jupyter.png\n", - "[ZipCollectApp | INFO] Copying to: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/jupyter.png\n", "[ZipCollectApp | INFO] Extracting from: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/archive/notebooks.zip\n", "[ZipCollectApp | INFO] Extracting to: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/notebooks\n", "[ZipCollectApp | INFO] Copying from: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/archive/ps1_hacker_attempt_2016-01-30-20-30-10_problem1.ipynb\n", "[ZipCollectApp | INFO] Copying to: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/ps1_hacker_attempt_2016-01-30-20-30-10_problem1.ipynb\n", + "[ZipCollectApp | INFO] Copying from: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/archive/jupyter.png\n", + "[ZipCollectApp | INFO] Copying to: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/jupyter.png\n", "[ZipCollectApp | INFO] Start collecting files...\n", "[ZipCollectApp | INFO] Parsing file: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/jupyter.png\n", "[ZipCollectApp | WARNING] Skipped submission with no match information provided: [NB_GRADER_ROOT]/nbgrader/docs/source/user_guide/downloaded/ps1/extracted/jupyter.png\n",