PyKubeGrader 0.1.15__tar.gz → 0.1.17__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. {pykubegrader-0.1.15/src/PyKubeGrader.egg-info → pykubegrader-0.1.17}/PKG-INFO +1 -1
  2. {pykubegrader-0.1.15 → pykubegrader-0.1.17/src/PyKubeGrader.egg-info}/PKG-INFO +1 -1
  3. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/initialize.py +1 -0
  4. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/telemetry.py +29 -3
  5. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets_base/multi_select.py +12 -1
  6. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets_base/select.py +3 -12
  7. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/.coveragerc +0 -0
  8. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/.github/workflows/main.yml +0 -0
  9. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/.gitignore +0 -0
  10. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/.readthedocs.yml +0 -0
  11. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/AUTHORS.rst +0 -0
  12. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/CHANGELOG.rst +0 -0
  13. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/CONTRIBUTING.rst +0 -0
  14. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/LICENSE.txt +0 -0
  15. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/README.rst +0 -0
  16. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/Makefile +0 -0
  17. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/_static/Drexel_blue_Logo_square_Dark.png +0 -0
  18. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/_static/Drexel_blue_Logo_square_Light.png +0 -0
  19. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/_static/custom.css +0 -0
  20. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/authors.rst +0 -0
  21. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/changelog.rst +0 -0
  22. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/conf.py +0 -0
  23. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/contributing.rst +0 -0
  24. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/index.rst +0 -0
  25. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/license.rst +0 -0
  26. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/readme.rst +0 -0
  27. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/docs/requirements.txt +0 -0
  28. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/examples/.responses.json +0 -0
  29. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/examples/true_false.ipynb +0 -0
  30. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/pyproject.toml +0 -0
  31. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/setup.cfg +0 -0
  32. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/setup.py +0 -0
  33. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/PyKubeGrader.egg-info/SOURCES.txt +0 -0
  34. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/PyKubeGrader.egg-info/dependency_links.txt +0 -0
  35. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/PyKubeGrader.egg-info/entry_points.txt +0 -0
  36. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/PyKubeGrader.egg-info/not-zip-safe +0 -0
  37. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/PyKubeGrader.egg-info/requires.txt +0 -0
  38. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/PyKubeGrader.egg-info/top_level.txt +0 -0
  39. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/__init__.py +0 -0
  40. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/build/api_notebook_builder.py +0 -0
  41. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/build/build_folder.py +0 -0
  42. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/log_parser/parse.ipynb +0 -0
  43. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/log_parser/parse.py +0 -0
  44. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/utils.py +0 -0
  45. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/validate.py +0 -0
  46. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets/__init__.py +0 -0
  47. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets/multiple_choice.py +0 -0
  48. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets/reading_question.py +0 -0
  49. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets/select_many.py +0 -0
  50. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets/student_info.py +0 -0
  51. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets/style.py +0 -0
  52. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets/true_false.py +0 -0
  53. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets/types_question.py +0 -0
  54. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets_base/__init__.py +0 -0
  55. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/src/pykubegrader/widgets_base/reading.py +0 -0
  56. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/tests/conftest.py +0 -0
  57. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/tests/import_test.py +0 -0
  58. {pykubegrader-0.1.15 → pykubegrader-0.1.17}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyKubeGrader
3
- Version: 0.1.15
3
+ Version: 0.1.17
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.1.15
3
+ Version: 0.1.17
4
4
  Summary: Add a short description here!
5
5
  Home-page: https://github.com/pyscaffold/pyscaffold/
6
6
  Author: jagar2
@@ -50,6 +50,7 @@ def initialize_assignment(
50
50
  update_responses(key="assignment", value=name)
51
51
  update_responses(key="jhub_user", value=jhub_user)
52
52
 
53
+ # TODO: Check whether this is called correctly
53
54
  log_variable("Student Info", jhub_user, seed)
54
55
 
55
56
  responses = ensure_responses()
@@ -3,7 +3,7 @@ import datetime
3
3
  import json
4
4
  import logging
5
5
  import os
6
- from typing import Optional
6
+ from typing import Any, Optional
7
7
 
8
8
  import nacl.public
9
9
  import requests
@@ -187,5 +187,31 @@ def verify_server(
187
187
 
188
188
  # TODO: implement function; or maybe not?
189
189
  # At least improve other one
190
- def score_question_improved(question_name: str, responses: dict) -> dict:
191
- return {}
190
+ def score_question_improved(
191
+ week: str,
192
+ assignment_category: str,
193
+ term: str = "winter_2025",
194
+ base_url: str = "https://engr-131-api.eastus.cloudapp.azure.com/",
195
+ ) -> None:
196
+ url = base_url + "/live-scorer"
197
+
198
+ responses = ensure_responses()
199
+
200
+ payload: dict[str, Any] = {
201
+ "student_email": f'{responses["jhub_user"]}@drexel.edu',
202
+ "term": term,
203
+ "week": week,
204
+ "assignment": assignment_category,
205
+ "question": f'_{responses["assignment"]}',
206
+ "responses": responses,
207
+ }
208
+
209
+ res = requests.post(url, json=payload, auth=HTTPBasicAuth("student", "capture"))
210
+
211
+ res_data = res.json()
212
+ max_points, points_earned = res_data["max_points"], res_data["points_earned"]
213
+ log_variable(
214
+ assignment_name=responses["assignment"],
215
+ value=f"{points_earned}, {max_points}",
216
+ info_type="score",
217
+ )
@@ -34,6 +34,8 @@ class MultiSelectQuestion:
34
34
  self.question_number = question_number
35
35
  self.style = style
36
36
 
37
+ self.true_keys = keys # Debugging; update later
38
+
37
39
  flat_index = 0
38
40
  self.keys: list[str] = []
39
41
  for i, _ in enumerate(keys):
@@ -79,9 +81,11 @@ class MultiSelectQuestion:
79
81
  def submit(self, _) -> None:
80
82
  responses_flat: list[bool] = []
81
83
  self.responses_nested: list[list[bool]] = []
84
+ self.names_nested: list[list[str]] = [] # Debugging; update later
82
85
 
83
86
  for row in self.widgets:
84
- next_selections = []
87
+ next_selections: list[bool] = []
88
+ next_names: list[str] = [] # Debugging; update later
85
89
 
86
90
  for widget in row.objects:
87
91
  # Skip HTML widgets
@@ -90,10 +94,13 @@ class MultiSelectQuestion:
90
94
 
91
95
  if isinstance(widget, pn.widgets.Checkbox):
92
96
  next_selections.append(widget.value)
97
+ if widget.value:
98
+ next_names.append(widget.name) # Debugging; update later
93
99
  responses_flat.append(widget.value) # For flat list of responses
94
100
 
95
101
  # Append all responses for this widget at once, forming a list of lists
96
102
  self.responses_nested.append(next_selections)
103
+ self.names_nested.append(next_names) # Debugging; update later
97
104
 
98
105
  self.record_responses(responses_flat)
99
106
 
@@ -101,6 +108,10 @@ class MultiSelectQuestion:
101
108
  for key, value in zip(self.keys, responses_flat):
102
109
  update_responses(key, value)
103
110
 
111
+ # Debugging; update later
112
+ for k, v in zip(self.true_keys, self.names_nested):
113
+ update_responses(k, v)
114
+
104
115
  self.submit_button.name = "Responses Submitted"
105
116
  time.sleep(1)
106
117
  self.submit_button.name = "Submit"
@@ -7,7 +7,7 @@ from ..telemetry import ensure_responses, update_responses
7
7
  from ..utils import shuffle_questions
8
8
  from ..widgets.style import drexel_colors
9
9
 
10
- # Pass the custom CSS to Panel
10
+ # Pass custom CSS to Panel
11
11
  pn.extension(design="material", global_css=[drexel_colors])
12
12
 
13
13
 
@@ -39,7 +39,7 @@ class SelectQuestion:
39
39
  "You must submit your student info before starting the exam"
40
40
  )
41
41
 
42
- # Dynamically assigning attributes based on keys, with default values from responses
42
+ # Dynamically assign attributes based on keys, with default values from responses
43
43
  for key in self.keys:
44
44
  setattr(self, key, responses.get(key, None))
45
45
 
@@ -71,19 +71,10 @@ class SelectQuestion:
71
71
  for key, value in selections.items():
72
72
  update_responses(key, value)
73
73
 
74
+ # Temporarily change button text to indicate submission
74
75
  self.submit_button.name = "Responses Submitted"
75
76
  time.sleep(1)
76
77
  self.submit_button.name = "Submit"
77
78
 
78
- # # Display the message with a unique display_id
79
- # display_id = "temp_message"
80
- # display("Responses recorded successfully", display_id=display_id)
81
-
82
- # # Wait for 1 second
83
- # time.sleep(1)
84
-
85
- # # Update the display with an empty string to clear it
86
- # update_display('', display_id=display_id)
87
-
88
79
  def show(self):
89
80
  return self.layout
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes