PyKubeGrader 0.1.6__py3-none-any.whl → 0.1.8__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {PyKubeGrader-0.1.6.dist-info → PyKubeGrader-0.1.8.dist-info}/METADATA +1 -1
- {PyKubeGrader-0.1.6.dist-info → PyKubeGrader-0.1.8.dist-info}/RECORD +9 -9
- pykubegrader/initialize.py +16 -2
- pykubegrader/telemetry.py +2 -2
- pykubegrader/validate.py +2 -2
- {PyKubeGrader-0.1.6.dist-info → PyKubeGrader-0.1.8.dist-info}/LICENSE.txt +0 -0
- {PyKubeGrader-0.1.6.dist-info → PyKubeGrader-0.1.8.dist-info}/WHEEL +0 -0
- {PyKubeGrader-0.1.6.dist-info → PyKubeGrader-0.1.8.dist-info}/entry_points.txt +0 -0
- {PyKubeGrader-0.1.6.dist-info → PyKubeGrader-0.1.8.dist-info}/top_level.txt +0 -0
@@ -1,8 +1,8 @@
|
|
1
1
|
pykubegrader/__init__.py,sha256=AoAkdfIjDDZGWLlsIRENNq06L9h46kDGBIE8vRmsCfg,311
|
2
|
-
pykubegrader/initialize.py,sha256=
|
3
|
-
pykubegrader/telemetry.py,sha256=
|
2
|
+
pykubegrader/initialize.py,sha256=zC-gvfBM69oXfkZUjyUqyQttHsx1p8902DHbZVjkUMg,1148
|
3
|
+
pykubegrader/telemetry.py,sha256=uuC4ZPLHYrAmKFBu3dJ3LGoEvQlT1LtOJjUldnfISEE,3343
|
4
4
|
pykubegrader/utils.py,sha256=dKw6SyRYU3DWRgD3xER7wq-C9e1daWPkqr901LpcwiQ,642
|
5
|
-
pykubegrader/validate.py,sha256=
|
5
|
+
pykubegrader/validate.py,sha256=A6FxQrC76ulneRvC7PBHawTSBck6xe1qBGMgqhBXd9c,10682
|
6
6
|
pykubegrader/build/build_folder.py,sha256=YQz11Jpb6huUMrVoi6aupGOMDmIy3e2impCuELUKtG8,58886
|
7
7
|
pykubegrader/widgets/__init__.py,sha256=s3ky3eJDa1RedFVdpKxmqv6mHBYpOSL9Z6qThSH9cbs,303
|
8
8
|
pykubegrader/widgets/multiple_choice.py,sha256=NjD3-uXSnibpUQ0mO3hRp_O-rynFyl0Dz6IXE4tnCRI,2078
|
@@ -16,9 +16,9 @@ pykubegrader/widgets_base/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-
|
|
16
16
|
pykubegrader/widgets_base/multi_select.py,sha256=u50IOhYxC_S_gq31VnFPLdbNajk_SUWhaqlMSJxhqVQ,3439
|
17
17
|
pykubegrader/widgets_base/reading.py,sha256=4uTLmlPzCwxVzufFhPjM7W19uMGguRb6y4eAV3x-zAc,5314
|
18
18
|
pykubegrader/widgets_base/select.py,sha256=h1S5StcbX8S-Wiyga4fVDhPbVvRxffwaqyVbiiuInRs,2743
|
19
|
-
PyKubeGrader-0.1.
|
20
|
-
PyKubeGrader-0.1.
|
21
|
-
PyKubeGrader-0.1.
|
22
|
-
PyKubeGrader-0.1.
|
23
|
-
PyKubeGrader-0.1.
|
24
|
-
PyKubeGrader-0.1.
|
19
|
+
PyKubeGrader-0.1.8.dist-info/LICENSE.txt,sha256=YTp-Ewc8Kems8PJEE27KnBPFnZSxoWvSg7nnknzPyYw,1546
|
20
|
+
PyKubeGrader-0.1.8.dist-info/METADATA,sha256=QqJKMWHkbo4tdqI4x4308uTVybZVYYuKNtcbc5o3oyw,2664
|
21
|
+
PyKubeGrader-0.1.8.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
22
|
+
PyKubeGrader-0.1.8.dist-info/entry_points.txt,sha256=Kd4Bh-i3hc4qlnLU1p0nc8yPw9cC5AQGOtkk2eLGnQw,78
|
23
|
+
PyKubeGrader-0.1.8.dist-info/top_level.txt,sha256=e550Klfze6higFxER1V62fnGOcIgiKRbsrl9CC4UdtQ,13
|
24
|
+
PyKubeGrader-0.1.8.dist-info/RECORD,,
|
pykubegrader/initialize.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import json
|
2
|
+
import os
|
2
3
|
|
3
4
|
import panel as pn
|
4
5
|
from IPython import get_ipython
|
@@ -16,13 +17,26 @@ def initialize_assignment(name: str) -> None:
|
|
16
17
|
ipython.events.register("pre_run_cell", telemetry)
|
17
18
|
except TypeError as e:
|
18
19
|
print(f"Failed to register telemetry: {e}")
|
20
|
+
return
|
21
|
+
|
22
|
+
jhub_user = os.getenv("JUPYTERHUB_USER")
|
23
|
+
if jhub_user is None:
|
24
|
+
print("Setup unsuccessful. Are you on JupyterHub?")
|
25
|
+
return
|
19
26
|
|
20
|
-
pn.extension()
|
27
|
+
pn.extension(silent=True)
|
21
28
|
|
22
29
|
try:
|
23
|
-
update_responses(key="assignment", value=name)
|
30
|
+
responses = update_responses(key="assignment", value=name)
|
31
|
+
|
32
|
+
seed = responses.get("seed")
|
33
|
+
if seed is None:
|
34
|
+
new_seed = hash(jhub_user) % 1000
|
35
|
+
responses = update_responses(key="seed", value=new_seed)
|
24
36
|
except (TypeError, json.JSONDecodeError) as e:
|
25
37
|
print(f"Failed to initialize assignment: {e}")
|
26
38
|
return
|
27
39
|
|
28
40
|
print("Assignment successfully initialized")
|
41
|
+
print(f"Assignment: {name}")
|
42
|
+
print(f"Username: {jhub_user}")
|
pykubegrader/telemetry.py
CHANGED
@@ -100,7 +100,7 @@ def score_question(
|
|
100
100
|
assignment: str,
|
101
101
|
question: str,
|
102
102
|
submission: str,
|
103
|
-
base_url: str = "https://engr-131-api.
|
103
|
+
base_url: str = "https://engr-131-api.eastus.cloudapp.azure.com/",
|
104
104
|
) -> Response:
|
105
105
|
url = base_url + "/live-scorer"
|
106
106
|
|
@@ -124,7 +124,7 @@ def submit_question_new(
|
|
124
124
|
question: str,
|
125
125
|
responses: dict,
|
126
126
|
score: dict,
|
127
|
-
base_url: str = "https://engr-131-api.
|
127
|
+
base_url: str = "https://engr-131-api.eastus.cloudapp.azure.com/",
|
128
128
|
):
|
129
129
|
url = base_url + "/submit-question"
|
130
130
|
|
pykubegrader/validate.py
CHANGED
@@ -18,8 +18,8 @@ def validate_logfile(
|
|
18
18
|
free_response_questions=0,
|
19
19
|
username="student",
|
20
20
|
password="capture",
|
21
|
-
post_url="https://engr-131-api.
|
22
|
-
login_url="https://engr-131-api.
|
21
|
+
post_url="https://engr-131-api.eastus.cloudapp.azure.com/upload-score",
|
22
|
+
login_url="https://engr-131-api.eastus.cloudapp.azure.com/login",
|
23
23
|
) -> None:
|
24
24
|
login_data = {
|
25
25
|
"username": username,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|