Skip to content

Instantly share code, notes, and snippets.

@Greenscreener
Last active February 23, 2026 13:48
Show Gist options
  • Select an option

  • Save Greenscreener/9713d12905d6993c75cba213a222e292 to your computer and use it in GitHub Desktop.

Select an option

Save Greenscreener/9713d12905d6993c75cba213a222e292 to your computer and use it in GitHub Desktop.
function avgvar(str) {
return str.replaceAll(",",".").split(":").map(e => parseFloat(e))
}
function anketatoarray() {
let ucitel = "";
const list = [];
for (let tr of document.querySelectorAll("#content > .tab1 tr")) {
if (tr.children[0].innerText.trim() === "") continue;
else if (tr.children.length === 1) {
ucitel = tr.children[0].innerText.trim();
} else {
list.push([
ucitel,
tr.children[0].innerText.trim(),
tr.children[1].innerText.trim(),
...(tr.children[2].innerText.trim() === "-" ? avgvar(tr.children[3].innerText.trim()) : avgvar(tr.children[2].innerText.trim())),
])
}
}
return list;
}
function anketatotsv() {
return `Učitel\tPředmět\tPočet\tPrůměr\tRozptyl?\n` + anketatoarray().map(e => e.join("\t")).join("\n") + "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment