PyKubeGrader 0.1.16__py3-none-any.whl → 0.1.18__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.16
3
+ Version: 0.1.18
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
2
  pykubegrader/initialize.py,sha256=UQ828VrueLOgrzJsYqWeQe6k0J6OWuX8AnojdU1eqFg,3167
3
- pykubegrader/telemetry.py,sha256=-74wZq69W5CkD-Ous8hUnox8temjUOz1LMj3qfElOFM,4900
3
+ pykubegrader/telemetry.py,sha256=0nPdqvd70IACz3tz1lZmjwQhJByqLz9IUVmxKhfaWCw,5692
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
@@ -19,9 +19,9 @@ pykubegrader/widgets_base/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-
19
19
  pykubegrader/widgets_base/multi_select.py,sha256=jzuK_1eLyhDOzR1jragLRBf_aO8IEaoixfozxBeMBs0,3975
20
20
  pykubegrader/widgets_base/reading.py,sha256=4uTLmlPzCwxVzufFhPjM7W19uMGguRb6y4eAV3x-zAc,5314
21
21
  pykubegrader/widgets_base/select.py,sha256=b5mmd-Cl1A2T2ePZ20-KLVyvP3bzvzYX36n3lMcrcFM,2456
22
- PyKubeGrader-0.1.16.dist-info/LICENSE.txt,sha256=YTp-Ewc8Kems8PJEE27KnBPFnZSxoWvSg7nnknzPyYw,1546
23
- PyKubeGrader-0.1.16.dist-info/METADATA,sha256=5kikimBqB4JnKir0KV8dhIcCx5ivOJQKG0mbSf425vI,2665
24
- PyKubeGrader-0.1.16.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
25
- PyKubeGrader-0.1.16.dist-info/entry_points.txt,sha256=Kd4Bh-i3hc4qlnLU1p0nc8yPw9cC5AQGOtkk2eLGnQw,78
26
- PyKubeGrader-0.1.16.dist-info/top_level.txt,sha256=e550Klfze6higFxER1V62fnGOcIgiKRbsrl9CC4UdtQ,13
27
- PyKubeGrader-0.1.16.dist-info/RECORD,,
22
+ PyKubeGrader-0.1.18.dist-info/LICENSE.txt,sha256=YTp-Ewc8Kems8PJEE27KnBPFnZSxoWvSg7nnknzPyYw,1546
23
+ PyKubeGrader-0.1.18.dist-info/METADATA,sha256=bAEbjpLxVjiLYlX8xo5k42-Wd-AtpRuc-bk24-6rLg0,2665
24
+ PyKubeGrader-0.1.18.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
25
+ PyKubeGrader-0.1.18.dist-info/entry_points.txt,sha256=Kd4Bh-i3hc4qlnLU1p0nc8yPw9cC5AQGOtkk2eLGnQw,78
26
+ PyKubeGrader-0.1.18.dist-info/top_level.txt,sha256=e550Klfze6higFxER1V62fnGOcIgiKRbsrl9CC4UdtQ,13
27
+ PyKubeGrader-0.1.18.dist-info/RECORD,,
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
+ )