!7
p { ai_spec_init(); }
html {
L answers = ai_matrix_standardAnswers();
S _topic = params.get("topic");
if (empty(_topic)) _topic = ai_randomString();
fS topic = _topic;
Set options = ai_matrix_categoriesForTopic(topic);
options.addAll(ai_matrix_standardCategories());
bool authed = creatorAuthed();
ret htitle_htmlencode("Matrix: " + topic)
+ hcenter(
p(b(hfontsize(20, topic)), style := "margin-top: 3em")
+ form(hhidden(+topic)
+ htable_noEncode(
map(options, func(S s) -> Map {
S userAnswer = null;
ret litorderedmap(
"Statement", b(htmlencode2(topic)) + " is " + htmlencode2(s),
"Computer Answer", htmlEncode(ai_matrixGet(topic, s)),
"Your Answer",
hselect_list(answers, userAnswer, name := "cat-" + urlencode(category))
//hcheckbox(urlencode(s), tossCoin())
);
}
))))
+ p(authed ? "Authed" : "Not authed");
}