You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.6 KiB
68 lines
1.6 KiB
<script>
|
|
const Survey = {
|
|
"Title": "Sample Survey",
|
|
"Description": "The description.",
|
|
"Questions": [
|
|
{
|
|
"Id": 1,
|
|
"Question": "Do you like HTML?",
|
|
"Result": 20
|
|
},
|
|
{
|
|
"Id": 2,
|
|
"Question": "Do you like CSS?",
|
|
"Result": 33
|
|
},
|
|
{
|
|
"Id": 3,
|
|
"Question": "Do you like JavaScript?",
|
|
"Result": 48
|
|
},
|
|
{
|
|
"Id": 4,
|
|
"Question": "Are you a programmer?",
|
|
"Result": 2
|
|
},
|
|
]
|
|
};
|
|
|
|
$boot(async () => {
|
|
const items = Survey.Questions;
|
|
const list = $id('question-list');
|
|
const tmpl = $id('question-row');
|
|
|
|
for(let i in items) {
|
|
$append(list, $render(tmpl, {i, item: items[i]}));
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
#question-list {
|
|
font-size: 1.1em;
|
|
grid-template-columns: 1fr 60px;
|
|
gap: 10px;
|
|
}
|
|
</style>
|
|
|
|
|
|
<h1>Results of Survey "Sample Finished Survey"</h1>
|
|
|
|
<block>
|
|
<p>Street art kettlebell burrata offal portra decolonize are.na akerman shabby chic blue bottle post-ironic breathwork. Roof party natural wine bell hooks cold plunge metrograph granny square ugh dad shoes garum before they sold out zines tahini side hustle. Indigo dye pork belly amaro, post-ironic health goth candle making van life hairpin robert walser.</p>
|
|
<bar>
|
|
<span>01/20/23</span> <span>Finished</span>
|
|
<span>Respondents: 200</span>
|
|
</bar>
|
|
</block>
|
|
|
|
<h2>Questions</h2>
|
|
|
|
<grid id="question-list">
|
|
<template id="question-row">
|
|
<label for="${item.Id}">${item.Question}</label>
|
|
<span>${item.Result}%</span>
|
|
</template>
|
|
</grid>
|
|
|
|
<a href="/">View More Surveys</a>
|
|
|