PyKubeGrader 0.1.15__py3-none-any.whl → 0.1.17__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
  pykubegrader/__init__.py,sha256=AoAkdfIjDDZGWLlsIRENNq06L9h46kDGBIE8vRmsCfg,311
2
- pykubegrader/initialize.py,sha256=_PuzOs4p3qQYgZtZ5MSs6qITIvTSw26yNa24bbkQR-4,3112
3
- pykubegrader/telemetry.py,sha256=-74wZq69W5CkD-Ous8hUnox8temjUOz1LMj3qfElOFM,4900
2
+ pykubegrader/initialize.py,sha256=UQ828VrueLOgrzJsYqWeQe6k0J6OWuX8AnojdU1eqFg,3167
3
+ pykubegrader/telemetry.py,sha256=Nov9SUXpquMCUK4Ym2OatRsPt02g3jEw2c5HsJ_6lbo,5693
4
4
  pykubegrader/utils.py,sha256=dKw6SyRYU3DWRgD3xER7wq-C9e1daWPkqr901LpcwiQ,642
5
5
  pykubegrader/validate.py,sha256=vEdNN386yFloDRcjMDrTAqfBmeCXGcDPNH_rLZScIm8,10945
6
6
  pykubegrader/build/api_notebook_builder.py,sha256=GVi6hupfQaWeFMv6Bdela3FTRHvOQYXPIcICnkaLhgA,20119
@@ -16,12 +16,12 @@ pykubegrader/widgets/style.py,sha256=fVBMYy_a6Yoz21avNpiORWC3f5FD-OrVpaZ3npmunvs
16
16
  pykubegrader/widgets/true_false.py,sha256=pE2FjvX6WQ-Z423N40nTWMtudtGS7LiNXZ5dERk6uWs,2823
17
17
  pykubegrader/widgets/types_question.py,sha256=kZdRRXyFzOtYTmGdC7XWb_2oaxqg1WSuLcQn_sTj6Qc,2300
18
18
  pykubegrader/widgets_base/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
19
- pykubegrader/widgets_base/multi_select.py,sha256=u50IOhYxC_S_gq31VnFPLdbNajk_SUWhaqlMSJxhqVQ,3439
19
+ pykubegrader/widgets_base/multi_select.py,sha256=jzuK_1eLyhDOzR1jragLRBf_aO8IEaoixfozxBeMBs0,3975
20
20
  pykubegrader/widgets_base/reading.py,sha256=4uTLmlPzCwxVzufFhPjM7W19uMGguRb6y4eAV3x-zAc,5314
21
- pykubegrader/widgets_base/select.py,sha256=h1S5StcbX8S-Wiyga4fVDhPbVvRxffwaqyVbiiuInRs,2743
22
- PyKubeGrader-0.1.15.dist-info/LICENSE.txt,sha256=YTp-Ewc8Kems8PJEE27KnBPFnZSxoWvSg7nnknzPyYw,1546
23
- PyKubeGrader-0.1.15.dist-info/METADATA,sha256=3DJfL95kKRkM9_5ibnwBkaOM9FbMequnthLBMBVwW84,2665
24
- PyKubeGrader-0.1.15.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
25
- PyKubeGrader-0.1.15.dist-info/entry_points.txt,sha256=Kd4Bh-i3hc4qlnLU1p0nc8yPw9cC5AQGOtkk2eLGnQw,78
26
- PyKubeGrader-0.1.15.dist-info/top_level.txt,sha256=e550Klfze6higFxER1V62fnGOcIgiKRbsrl9CC4UdtQ,13
27
- PyKubeGrader-0.1.15.dist-info/RECORD,,
21
+ pykubegrader/widgets_base/select.py,sha256=b5mmd-Cl1A2T2ePZ20-KLVyvP3bzvzYX36n3lMcrcFM,2456
22
+ PyKubeGrader-0.1.17.dist-info/LICENSE.txt,sha256=YTp-Ewc8Kems8PJEE27KnBPFnZSxoWvSg7nnknzPyYw,1546
23
+ PyKubeGrader-0.1.17.dist-info/METADATA,sha256=oBvV_FM6SvvA6W-5XA_imXzUJUE-5micul2klAAklHw,2665
24
+ PyKubeGrader-0.1.17.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
25
+ PyKubeGrader-0.1.17.dist-info/entry_points.txt,sha256=Kd4Bh-i3hc4qlnLU1p0nc8yPw9cC5AQGOtkk2eLGnQw,78
26
+ PyKubeGrader-0.1.17.dist-info/top_level.txt,sha256=e550Klfze6higFxER1V62fnGOcIgiKRbsrl9CC4UdtQ,13
27
+ PyKubeGrader-0.1.17.dist-info/RECORD,,
@@ -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()
pykubegrader/telemetry.py CHANGED
@@ -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