eaglelandsonce commited on
Commit
84ff7b4
·
verified ·
1 Parent(s): df17ae0

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +339 -18
index.html CHANGED
@@ -1,19 +1,340 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Azure Approval Gates Jeopardy</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ display: flex;
11
+ flex-direction: column;
12
+ align-items: center;
13
+ background-color: #f0f0f0;
14
+ margin: 0;
15
+ }
16
+ h1 {
17
+ color: #0078D4;
18
+ }
19
+ #game-board {
20
+ display: grid;
21
+ grid-template-columns: repeat(5, 1fr);
22
+ grid-auto-rows: 100px;
23
+ gap: 2px;
24
+ margin: 20px 0;
25
+ background-color: #000;
26
+ border: 4px solid #000;
27
+ }
28
+ .category {
29
+ background-color: #005a9e;
30
+ color: #fff;
31
+ font-weight: bold;
32
+ display: flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+ text-align: center;
36
+ font-size: 18px;
37
+ border: 1px solid #000;
38
+ }
39
+ .card {
40
+ background-color: #0078D4;
41
+ color: #fff;
42
+ display: flex;
43
+ justify-content: center;
44
+ align-items: center;
45
+ font-size: 16px;
46
+ font-weight: bold;
47
+ cursor: pointer;
48
+ border: 1px solid #000;
49
+ text-align: center;
50
+ transition: background-color 0.3s;
51
+ }
52
+ .card:hover {
53
+ background-color: #005a9e;
54
+ }
55
+ .card.disabled {
56
+ background-color: #cccccc;
57
+ cursor: default;
58
+ }
59
+ #question-display {
60
+ width: 80%;
61
+ text-align: center;
62
+ margin-bottom: 20px;
63
+ }
64
+ #score {
65
+ font-size: 24px;
66
+ font-weight: bold;
67
+ color: #0078D4;
68
+ }
69
+ .answer-container {
70
+ display: flex;
71
+ justify-content: center;
72
+ margin-top: 20px;
73
+ }
74
+ .answer-btn {
75
+ margin: 5px;
76
+ padding: 10px 15px;
77
+ font-size: 18px;
78
+ cursor: pointer;
79
+ text-align: center;
80
+ border: 2px solid #005a9e;
81
+ border-radius: 5px;
82
+ background-color: #0078D4;
83
+ color: #fff;
84
+ font-weight: bold;
85
+ transition: background-color 0.3s, color 0.3s;
86
+ }
87
+ .answer-btn:hover {
88
+ background-color: #005a9e;
89
+ color: #f0f0f0;
90
+ }
91
+ .answer-btn.disabled {
92
+ background-color: #cccccc;
93
+ color: #666;
94
+ cursor: not-allowed;
95
+ }
96
+ .feedback {
97
+ margin-top: 10px;
98
+ font-size: 18px;
99
+ font-weight: bold;
100
+ }
101
+ </style>
102
+ </head>
103
+ <body>
104
+ <h1>Azure Approval Gates Jeopardy</h1>
105
+ <p>
106
+ <strong>Learn More:</strong>
107
+ <a
108
+ href="https://learn.microsoft.com/en-us/azure/devops/pipelines/release/approvals/gates?view=azure-devops"
109
+ target="_blank"
110
+ >Azure DevOps Approval Gates</a
111
+ >
112
+ </p>
113
+
114
+ <div id="game-board">
115
+ <!-- Categories -->
116
+ <div class="category">Release Gates</div>
117
+ <div class="category">Approvals</div>
118
+ <div class="category">Business Hours</div>
119
+ <div class="category">Azure Functions</div>
120
+ <div class="category">REST API Checks</div>
121
+ </div>
122
+
123
+ <div id="question-display"></div>
124
+ <div id="score">Score: 0</div>
125
+
126
+ <script>
127
+ const categories = [
128
+ "Release Gates",
129
+ "Approvals",
130
+ "Business Hours",
131
+ "Azure Functions",
132
+ "REST API Checks"
133
+ ];
134
+ const questions = [
135
+ // Release Gates (index 0)
136
+ [
137
+ {
138
+ q: "What is the purpose of release gates?",
139
+ a: [
140
+ "To automate pipeline approvals",
141
+ "To ensure deployment criteria are met before proceeding",
142
+ "To replace manual intervention"
143
+ ],
144
+ correct: 1
145
+ },
146
+ {
147
+ q: "Which deployment gate validates infrastructure health?",
148
+ a: ["Query Azure Monitor Alerts", "Invoke REST API", "Manual approval"],
149
+ correct: 0
150
+ },
151
+ {
152
+ q: "What happens if a deployment gate times out?",
153
+ a: [
154
+ "The deployment proceeds",
155
+ "The stage fails",
156
+ "It retries indefinitely"
157
+ ],
158
+ correct: 1
159
+ }
160
+ ],
161
+ // Approvals (index 1)
162
+ [
163
+ {
164
+ q: "What are pre-deployment approvals used for?",
165
+ a: [
166
+ "Validating deployment readiness",
167
+ "Post-deployment testing",
168
+ "Auto-scaling resources"
169
+ ],
170
+ correct: 0
171
+ },
172
+ {
173
+ q: "What does deferred approval allow?",
174
+ a: [
175
+ "Multiple approvers",
176
+ "Approvals at a later time",
177
+ "Skipping approvals"
178
+ ],
179
+ correct: 1
180
+ },
181
+ {
182
+ q: "Who can approve a stage if a group is designated?",
183
+ a: [
184
+ "All members",
185
+ "At least one group member",
186
+ "An external admin"
187
+ ],
188
+ correct: 1
189
+ }
190
+ ],
191
+ // Business Hours (index 2)
192
+ [
193
+ {
194
+ q: "What is the purpose of the business hours check?",
195
+ a: [
196
+ "To ensure deployments only occur in a specified time window",
197
+ "To automate REST API checks",
198
+ "To validate security settings"
199
+ ],
200
+ correct: 0
201
+ },
202
+ {
203
+ q: "What happens if business hours end before stage execution starts?",
204
+ a: [
205
+ "The check passes",
206
+ "The stage execution is withdrawn",
207
+ "It retries the next day"
208
+ ],
209
+ correct: 1
210
+ },
211
+ {
212
+ q: "What type of approval is combined with business hours?",
213
+ a: [
214
+ "Pre-deployment approvals",
215
+ "Post-deployment gates",
216
+ "Static checks"
217
+ ],
218
+ correct: 0
219
+ }
220
+ ],
221
+ // Azure Functions (index 3)
222
+ [
223
+ {
224
+ q: "What are Azure Functions used for in deployment gates?",
225
+ a: [
226
+ "Triggering custom checks",
227
+ "Handling manual approvals",
228
+ "Managing stage retries"
229
+ ],
230
+ correct: 0
231
+ },
232
+ {
233
+ q: "Which mode is recommended for Azure Function checks?",
234
+ a: ["Asynchronous", "Synchronous", "Manual"],
235
+ correct: 0
236
+ },
237
+ {
238
+ q: "How does an Azure Function check communicate a decision?",
239
+ a: [
240
+ "By returning a JSON payload",
241
+ "By making a REST API call back to Azure DevOps",
242
+ "By triggering a new build"
243
+ ],
244
+ correct: 1
245
+ }
246
+ ],
247
+ // REST API Checks (index 4)
248
+ [
249
+ {
250
+ q: "What is a REST API check used for?",
251
+ a: [
252
+ "Integrating external services",
253
+ "Validating pipelines YAML",
254
+ "Executing Azure Functions"
255
+ ],
256
+ correct: 0
257
+ },
258
+ {
259
+ q: "What happens if a REST API check times out?",
260
+ a: [
261
+ "The associated stage is skipped",
262
+ "The check retries indefinitely",
263
+ "The pipeline restarts"
264
+ ],
265
+ correct: 0
266
+ },
267
+ {
268
+ q: "Which response is expected for REST API checks to pass?",
269
+ a: [
270
+ "Successful status code",
271
+ "Timed-out requests",
272
+ "Failure logs"
273
+ ],
274
+ correct: 0
275
+ }
276
+ ]
277
+ ];
278
+ let score = 0;
279
+ let totalCards = 15; // 5 categories x 3 questions each
280
+ let answeredCards = 0;
281
+ const gameBoard = document.getElementById("game-board");
282
+ const questionDisplay = document.getElementById("question-display");
283
+ const scoreDisplay = document.getElementById("score");
284
+ function createBoard() {
285
+ for (let row = 0; row < 3; row++) {
286
+ for (let col = 0; col < 5; col++) {
287
+ const card = document.createElement("div");
288
+ card.className = "card";
289
+ card.textContent = `$${(row + 1) * 100}`;
290
+ card.onclick = () => showQuestion(col, row, card);
291
+ gameBoard.appendChild(card);
292
+ }
293
+ }
294
+ }
295
+ function showQuestion(category, difficulty, cardElement) {
296
+ if (cardElement.classList.contains("disabled")) return;
297
+ const question = questions[category][difficulty];
298
+ const answerHtml = question.a
299
+ .map(
300
+ (answer, index) =>
301
+ `<button class="answer-btn" onclick="checkAnswer(${category}, ${difficulty}, ${index})">${answer}</button>`
302
+ )
303
+ .join("");
304
+ questionDisplay.innerHTML = `
305
+ <h2>${categories[category]} for $${(difficulty + 1) * 100}</h2>
306
+ <p>${question.q}</p>
307
+ <div class="answer-container">${answerHtml}</div>
308
+ `;
309
+ cardElement.classList.add("disabled");
310
+ cardElement.style.backgroundColor = "#cccccc";
311
+ answeredCards++;
312
+ }
313
+ function checkAnswer(category, difficulty, selectedAnswer) {
314
+ const question = questions[category][difficulty];
315
+ const correctAnswer = question.a[question.correct];
316
+ const isCorrect = selectedAnswer === question.correct;
317
+ const value = (difficulty + 1) * 100;
318
+ document.querySelectorAll(".answer-btn").forEach((btn) => {
319
+ btn.disabled = true;
320
+ btn.classList.add("disabled");
321
+ });
322
+ if (isCorrect) {
323
+ score += value;
324
+ questionDisplay.innerHTML += `<p class="feedback" style="color: green;">Correct! You earned $${value}.</p>`;
325
+ } else {
326
+ score -= value;
327
+ questionDisplay.innerHTML += `<p class="feedback" style="color: red;">Wrong! You lost $${value}. The correct answer was: ${correctAnswer}</p>`;
328
+ }
329
+ scoreDisplay.textContent = `Score: ${score}`;
330
+ if (answeredCards === totalCards) {
331
+ endGame();
332
+ }
333
+ }
334
+ function endGame() {
335
+ questionDisplay.innerHTML = `<h2>Game Over!</h2><p>Your final score is $${score}.</p>`;
336
+ }
337
+ createBoard();
338
+ </script>
339
+ </body>
340
  </html>