-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaddpoll.html
110 lines (107 loc) · 6.44 KB
/
addpoll.html
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/tachyon.min.css">
<link rel="stylesheet" href="css/mycss.css">
<title>Polling App | Add Poll</title>
</head>
<body>
<div id="overlay" style="display: none;">
<img src="img/progressBar.gif" id="progressBar">
</div>
<div class="min-vh-100 flex flex-column justify-center pa3 avenir bg-washed-yellow">
<header class="flex flex-wrap justify-center tc w-100 bb">
<h1 class="f2 lh-title fw1 mt0"> Add Poll </h1>
<a class="f5 link dim br2 ph3 pv2 mb2 dib white bg-dark-green fixed right-2" href="polls.html"
onclick="return confirm('You are about to leave the page.')">Cancel</a>
</header>
<div class="w-100 flex flex-wrap flex-row justify-center items-center pt2 bg-washed-yellow z-1 ">
<div class="flex flex-row justify-center items-center">
<label class="pa2 db fw6 lh-copy f6 mh1" for="title">Title</label>
<input class="pa2 mh1 input-reset f6 ba bg-transparent" type="text" name="title" id="title"
placeholder="Poll Title" onchange="updatePoll()" required>
</div>
<div class="flex flex-row justify-center items-center flex-grow-1">
<label class="pa2 mh1 db fw6 lh-copy f6" for="desc">Description</label>
<input class="pa2 mh1 input-reset f6 ba bg-transparent flex-grow-1" type="text" name="desc" id="desc"
placeholder="Short Description; By who, for who, for what etc." onchange="updatePoll()" required>
</div>
<div class="flex flex-row justify-center items-center">
<input class="mh1" type="checkbox" id="anon" value="anon" onchange="updatePoll()" checked disabled>
<label for="anon" class="lh-copy mh1">Anonymous Responses</label>
</div>
</div>
<div id="displayArea"
class="br3 ba b--dark-blue bg-white pa3 tc mh1 mv2 flex-grow-1 flex flex-wrap flex-column justify-start items-center">
No questions added </div>
<div id="addQDialog"
class="dn flex-column justify-center items-center vh-100 w-100 z-2 bg-black-50 fixed top-0 bottom-0 left-0 right-0">
<form id="Qform" class="bg-white ba b--black br2 pa3" onsubmit="return addQuestion()"
onreset="resetoptions()">
<fieldset class="ba b--transparent ph0 mh0">
<legend class="f3 fw6 ph0 mh0">Add Question</legend>
<div class="mt3">
<label class="db fw6 lh-copy f6" for="question">Question</label>
<input class="pa2 input-reset ba bg-transparent w-100" type="text" name="question" id="question"
placeholder="Question" required>
</div>
<div class="mt3">
<label class="db fw6 lh-copy f6">Type</label>
<input type="radio" id="scq" name="type" value="0" required>
<label for="scq">Single Choice Question</label>
<input type="radio" id="mcq" name="type" value="1" required>
<label for="mcq">Multiple Choice Question</label>
<input type="radio" id="long" name="type" value="2" required>
<label for="long">Long Answer</label>
</div>
<div class="mt3">
<label class="db fw6 lh-copy f6">Options <span class="f7">(Ignore for Long
Answer)</span></label>
<div id="options" class="flex flex-wrap flex-column w-auto"></div>
<button type="button" class="ph2 pv1 ba b--dark-green br1 bg-transparent dim pointer f4 dib mv1"
onclick="addoption()">+</button>
<a type="button"
class="ph2 pv1 ba b--dark-green br1 bg-transparent dim pointer f4 dib mv1 black link"
href="optionhelp.html" target="_blank">?</a>
</div>
</fieldset>
<div class="flex flex-wrap flex-row justify-center">
<input class="ph3 pv2 mh2 input-reset ba b--black grow pointer f5 dib bg-dark-green white"
type="submit" value="Save Question">
<input class="ph3 pv2 mh2 input-reset ba b--dark-green grow pointer f5 dib bg-transparent"
type="reset" value="Reset">
<button class="ph3 pv2 mh2 input-reset ba b--dark-green grow pointer f5 dib bg-transparent"
type="button" onclick="closedialog()"> Close </button>
</div>
</form>
</div>
<div class="w-100 flex flex-wrap flex-row justify-center pt2 bg-washed-yellow z-1 bt">
<a class="f6 link grow br2 ph3 pv2 mb2 dib black ba b--dark-green mh2 pointer" onclick="opendialog()">Add
Question</a>
<a class="f6 link grow br2 ph3 pv2 mb2 dib black ba b--dark-green mh2 pointer"
onclick="removeLastQuestion()">Remove Question</a>
<a class="f6 link grow br2 ph3 pv2 mb2 dib white bg-dark-green mh2 pointer" onclick="uploadPoll()">Upload
Poll</a>
</div>
</div>
<div id="errorDiv" class="fixed bottom-2 z-1 flex flex-wrap flex-row justify-center vp-center hidden">
<div class="pa2 bg-lightest-blue black ba br-pill">
<svg class="w1" data-icon="info" viewBox="0 0 32 32" style="fill:currentcolor">
<title>info icon</title>
<path
d="M16 0 A16 16 0 0 1 16 32 A16 16 0 0 1 16 0 M19 15 L13 15 L13 26 L19 26 z M16 6 A3 3 0 0 0 16 12 A3 3 0 0 0 16 6">
</path>
</svg>
<span class="lh-title ml3" id="errorMsg"></span>
</div>
</div>
<script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-firestore.js"></script>
<script src="js\domPurify\dist\purify.min.js"></script>
<script src="js/classes.js"></script>
<script src="js/createPoll.js"></script>
</body>
</html>