function answer({
title,
questions = [],
guides = [],
hints = [],
solutions = [],
open = !!showAll
}) {
const div = d3.create("div").classed("answer", true);
if (title) {
div.append("hr");
div.append("h2").html(title);
}
div.call(renderGroup, questions, "question", true, d => md`${d}`);
div.call(renderGuide, guides, "guide", open, d => md`${d}`);
div.call(renderGroup, hints, "hint", open, d => code(d, "hint"));
div.call(renderGroup, solutions, "solution", open, d => code(d, "solution", renderSnippet));
return div.node();
}