Published
Edited
Nov 23, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// see if user's answer is correct by checking
// that all properties have correct value
answerok = function() {
const ok = radiolabels.map(l => propertyok(l))
return (! ok.includes(false))
}
Insert cell
// true if correct value is chosen for a given property pname
propertyok = function(pname) {
return (answer[pname] == quizdata[pname])
}
Insert cell
randomQuestion = function() {
return d3.shuffle(data)[0]
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more