PyKubeGrader 0.2.1__tar.gz → 0.2.2__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. {pykubegrader-0.2.1/src/PyKubeGrader.egg-info → pykubegrader-0.2.2}/PKG-INFO +1 -1
  2. {pykubegrader-0.2.1 → pykubegrader-0.2.2/src/PyKubeGrader.egg-info}/PKG-INFO +1 -1
  3. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/build/build_folder.py +6 -1
  4. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/telemetry.py +19 -11
  5. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/.coveragerc +0 -0
  6. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/.github/workflows/main.yml +0 -0
  7. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/.gitignore +0 -0
  8. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/.readthedocs.yml +0 -0
  9. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/AUTHORS.rst +0 -0
  10. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/CHANGELOG.rst +0 -0
  11. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/CONTRIBUTING.rst +0 -0
  12. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/LICENSE.txt +0 -0
  13. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/README.rst +0 -0
  14. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/Makefile +0 -0
  15. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/_static/Drexel_blue_Logo_square_Dark.png +0 -0
  16. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/_static/Drexel_blue_Logo_square_Light.png +0 -0
  17. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/_static/custom.css +0 -0
  18. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/authors.rst +0 -0
  19. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/changelog.rst +0 -0
  20. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/conf.py +0 -0
  21. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/contributing.rst +0 -0
  22. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/index.rst +0 -0
  23. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/license.rst +0 -0
  24. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/readme.rst +0 -0
  25. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/docs/requirements.txt +0 -0
  26. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/examples/.responses.json +0 -0
  27. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/examples/true_false.ipynb +0 -0
  28. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/pyproject.toml +0 -0
  29. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/setup.cfg +0 -0
  30. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/setup.py +0 -0
  31. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/PyKubeGrader.egg-info/SOURCES.txt +0 -0
  32. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/PyKubeGrader.egg-info/dependency_links.txt +0 -0
  33. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/PyKubeGrader.egg-info/entry_points.txt +0 -0
  34. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/PyKubeGrader.egg-info/not-zip-safe +0 -0
  35. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/PyKubeGrader.egg-info/requires.txt +0 -0
  36. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/PyKubeGrader.egg-info/top_level.txt +0 -0
  37. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/__init__.py +0 -0
  38. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/build/__init__.py +0 -0
  39. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/build/api_notebook_builder.py +0 -0
  40. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/build/clean_folder.py +0 -0
  41. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/graders/__init__.py +0 -0
  42. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/graders/late_assignments.py +0 -0
  43. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/initialize.py +0 -0
  44. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/log_parser/__init__.py +0 -0
  45. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/log_parser/parse.ipynb +0 -0
  46. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/log_parser/parse.py +0 -0
  47. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/utils.py +0 -0
  48. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/validate.py +0 -0
  49. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets/__init__.py +0 -0
  50. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets/multiple_choice.py +0 -0
  51. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets/reading_question.py +0 -0
  52. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets/select_many.py +0 -0
  53. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets/student_info.py +0 -0
  54. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets/style.py +0 -0
  55. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets/true_false.py +0 -0
  56. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets/types_question.py +0 -0
  57. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets_base/__init__.py +0 -0
  58. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets_base/multi_select.py +0 -0
  59. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets_base/reading.py +0 -0
  60. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/src/pykubegrader/widgets_base/select.py +0 -0
  61. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/tests/conftest.py +0 -0
  62. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/tests/import_test.py +0 -0
  63. {pykubegrader-0.2.1 → pykubegrader-0.2.2}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyKubeGrader
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Add a short description here!
5
5
  Home-page: https://github.com/pyscaffold/pyscaffold/
6
6
  Author: jagar2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyKubeGrader
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Add a short description here!
5
5
  Home-page: https://github.com/pyscaffold/pyscaffold/
6
6
  Author: jagar2
@@ -503,6 +503,9 @@ class NotebookProcessor:
503
503
  NotebookProcessor.add_initialization_code(
504
504
  temp_notebook_path, self.week, self.assignment_type
505
505
  )
506
+ NotebookProcessor.replace_temp_in_notebook(
507
+ temp_notebook_path, temp_notebook_path
508
+ )
506
509
  return None, 0
507
510
 
508
511
  @staticmethod
@@ -1398,6 +1401,8 @@ def clean_notebook(notebook_path):
1398
1401
  cell.metadata["editable"] = cell.metadata.get("editable", False)
1399
1402
  cell.metadata["deletable"] = cell.metadata.get("deletable", False)
1400
1403
  if cell.cell_type == "code":
1404
+ if "grader.check(" in cell.source:
1405
+ continue
1401
1406
  cell.metadata["tags"] = cell.metadata.get("tags", [])
1402
1407
  if "skip-execution" not in cell.metadata["tags"]:
1403
1408
  cell.metadata["tags"].append("skip-execution")
@@ -1563,7 +1568,7 @@ def generate_mcq_file(data_dict, output_file="mc_questions.py"):
1563
1568
  )
1564
1569
  f.write(" def __init__(self):\n")
1565
1570
  f.write(" super().__init__(\n")
1566
- f.write(f" title=f'{q_value['question_text']}',\n")
1571
+ f.write(f' title=f"{q_value['question_text']}",\n')
1567
1572
  f.write(" style=MCQ,\n")
1568
1573
  f.write(
1569
1574
  f" question_number={q_value['question number']},\n"
@@ -10,6 +10,7 @@ import requests
10
10
  from IPython.core.interactiveshell import ExecutionInfo
11
11
  from requests import Response
12
12
  from requests.auth import HTTPBasicAuth
13
+ from requests.exceptions import RequestException
13
14
 
14
15
  #
15
16
  # Logging setup
@@ -122,7 +123,6 @@ def update_responses(key: str, value) -> dict:
122
123
  #
123
124
 
124
125
 
125
- # TODO: Improve error handling
126
126
  def score_question(
127
127
  term: str = "winter_2025",
128
128
  base_url: str = "https://engr-131-api.eastus.cloudapp.azure.com",
@@ -140,16 +140,24 @@ def score_question(
140
140
  "responses": responses,
141
141
  }
142
142
 
143
- res = requests.post(url, json=payload, auth=HTTPBasicAuth("student", "capture"))
144
-
145
- res_data: dict[str, tuple[float, float]] = res.json()
146
-
147
- for question, (points_earned, max_points) in res_data.items():
148
- log_variable(
149
- assignment_name=responses["assignment"],
150
- value=f"{points_earned}, {max_points}",
151
- info_type=question,
152
- )
143
+ try:
144
+ res = requests.post(url, json=payload, auth=HTTPBasicAuth("student", "capture"))
145
+ res.raise_for_status()
146
+
147
+ res_data: dict[str, tuple[float, float]] = res.json()
148
+
149
+ for question, (points_earned, max_points) in res_data.items():
150
+ log_variable(
151
+ assignment_name=responses["assignment"],
152
+ value=f"{points_earned}, {max_points}",
153
+ info_type=question,
154
+ )
155
+ except RequestException as e:
156
+ raise RuntimeError("Failed to access question-scoring endpoint") from e
157
+ except ValueError as e:
158
+ raise ValueError("Failed to parse question-scoring JSON response") from e
159
+ except Exception as e:
160
+ raise RuntimeError("Failed to score question") from e
153
161
 
154
162
 
155
163
  def submit_question(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes