// let BASE_DIR = './data'; let BASE_DIR = 'https://github.com/csbench/csbench.github.io'; function create_number(data) { let question = make_qt(data.question, data.unit); // let hint = make_hint(data.hint) let image = ""; if (data.image !== -1) // image = make_img(`${BASE_DImetadataR}/${filters.dataset}/${data.image}`); image = make_img(`${BASE_DIR}/${data.image}`); let choices = ""; if (data.question_type === "multi_choice") choices = make_choices(data.choices); // if data has the answer attr. let answer = ""; if ("answer" in data) answer = make_answer(data.answer); html = make_box([question, image, choices, answer]); return html; } // creates a div with question text in it function make_qt(question, unit) { let html = ""; if (unit === null) html = `
Question
${question}
`; else html = `Question
${question} (unit: ${unit})
`; return html; } function make_img(path) { if (path === null) return ""; let html = `Choices
Choices
${choice}
`; return html; } function make_answer(answer) { let html = `Answer
${answer}
`; return html; }