forked from FH-Cloud-Computing/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
19 lines (16 loc) · 626 Bytes
/
main.py
File metadata and controls
19 lines (16 loc) · 626 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import uuid
from typing import List
def define_env(env):
@env.macro
def quiz(question: str, answers: List[str]):
return "<div class=\"admonition question\">" +\
"<p class=\"admonition-title\">" + question + "</p>" +\
"<div class=\"quiz__answers\">" + "".join(answers) + "</div>" +\
"</div>"
@env.macro
def answer(text: str):
id = str(uuid.uuid4())
return "<div class=\"quiz__answer\">" +\
"<input id=\"" + id + "\" type=\"checkbox\" />" +\
"<label for=\"" + id + "\"> " + text + "</label>" +\
"</div>"