-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathrenderSurveys.js
61 lines (56 loc) · 1.63 KB
/
renderSurveys.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
function renderSurveys(surveys) {
return `
<div class="text-center mt-5">
<code>${JSON.stringify(surveys)}</code>
</div>
`
}
function surveys() {
var content = document.getElementById('content');
var surveysAbstraction = [
{
title: "Movie Goer Survey",
fields: [
{
label: "Have you gone to the movies in the last month?",
type: "radio",
options: [
"yes",
"no"
]
},
{
label: "On a scale of 1 to 5, Did you enjoy your last theater experience?",
type: "radio",
options: [
1,
2,
3,
4,
5
]
},
],
submitButtonText: "Submit Survey"
},
{
title: "DigitalCrafts Survey",
fields: [
{
label: "Are you currently enrolled in a DigitalCrafts class?",
type: "radio",
options: [
"yes",
"no"
]
},
{
label: "In 3000 words or more, explain what's so great about Adam?",
type: "text"
}
],
submitButtonText: "I'm Done"
}
]
content.innerHTML = renderSurveys(surveysAbstraction);
}