Skip to content

Commit 8c1e372

Browse files
authored
Update string_to_pl_user_file function
1 parent 70b5d0a commit 8c1e372

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/problem_bank_helpers/problem_bank_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def string_to_pl_user_file(string, data):
385385
"""Encode a string to base64 and add it as the user submitted code file
386386
"""
387387
# partially based off of https://github.com/PrairieLearn/PrairieLearn/blob/2ff7c5cc2435bae80c0ba512631749f9c3eadb43/apps/prairielearn/elements/pl-file-upload/pl-file-upload.py#L114C1-L119
388-
parsed_file = {"name": "user_code.py", "contents": base64_encode_string(answer)}
388+
parsed_file = {"name": "user_code.py", "contents": base64_encode(string)}
389389
if isinstance(data["submitted_answers"].get("_files", None), list):
390390
data["submitted_answers"]["_files"].append(parsed_file)
391391
else:

0 commit comments

Comments
 (0)