I was able to get some code to use an HTML validator when created as a customized python3 question (attached as Simple Web Page). However, when I tried to create an HTML_via_python prototype, the exact same code failed when I tested questions based on the prototype (attached as h1). Any idea what is happening? Here's the code:
import json import subprocess, sys studentAnswerDictionary = json.loads(r"""{{ STUDENT_ANSWER }}""") studentHTML = studentAnswerDictionary["crui_html"][0] student_page = f"""<!DOCTYPE html><html lang="en-US"><head><title>Grade</title></head><body>{studentHTML}</body></html>""" with open("page.html", "w") as src: print(student_page, file=src) output = subprocess.check_output(["java", "-jar", "/usr/share/java/vnu.jar","--exit-zero-always","--stdout","page.html"],encoding='UTF-8') if output == "": print("OK") else: print(output)