eaglelandsonce commited on
Commit
f6a6c81
·
verified ·
1 Parent(s): c578c5a

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +297 -18
index.html CHANGED
@@ -1,19 +1,298 @@
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 Pipelines Agents 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 Pipelines Agents Jeopardy</h1>
105
+ <p>
106
+ <strong>Learn More:</strong>
107
+ <a
108
+ href="https://docs.microsoft.com/azure/devops/pipelines/agents/agents"
109
+ target="_blank"
110
+ >Azure Pipelines Agents</a
111
+ >
112
+ </p>
113
+
114
+ <div id="game-board">
115
+ <!-- Categories -->
116
+ <div class="category">Agent Types</div>
117
+ <div class="category">Microsoft-Hosted Agents</div>
118
+ <div class="category">Self-Hosted Agents</div>
119
+ <div class="category">VM Scale Set Agents</div>
120
+ <div class="category">Capabilities</div>
121
+ </div>
122
+
123
+ <div id="question-display"></div>
124
+ <div id="score">Score: 0</div>
125
+
126
+ <script>
127
+ // 5 categories, each with 3 questions = 15 total
128
+ const categories = [
129
+ "Agent Types",
130
+ "Microsoft-Hosted Agents",
131
+ "Self-Hosted Agents",
132
+ "VM Scale Set Agents",
133
+ "Capabilities"
134
+ ];
135
+ const questions = [
136
+ // Agent Types (index 0)
137
+ [
138
+ {
139
+ q: "Which type of agent is managed entirely by Microsoft?",
140
+ a: ["Self-hosted", "Microsoft-hosted", "VM Scale Set"],
141
+ correct: 1
142
+ },
143
+ {
144
+ q: "What is a key feature of self-hosted agents?",
145
+ a: ["Automatically updated by Microsoft", "User-managed with persistent caches", "Always use containers"],
146
+ correct: 1
147
+ },
148
+ {
149
+ q: "Which agent type scales automatically using Azure Virtual Machine Scale Sets?",
150
+ a: ["Microsoft-hosted", "VM Scale Set", "Managed DevOps Pools"],
151
+ correct: 1
152
+ }
153
+ ],
154
+ // Microsoft-Hosted Agents (index 1)
155
+ [
156
+ {
157
+ q: "What happens to a Microsoft-hosted agent after a job is completed?",
158
+ a: ["It is reused for the next job", "It is discarded and reset", "It continues running"],
159
+ correct: 1
160
+ },
161
+ {
162
+ q: "What is an advantage of Microsoft-hosted agents?",
163
+ a: ["No need for maintenance", "Persistent machine caches", "Custom software installation"],
164
+ correct: 0
165
+ },
166
+ {
167
+ q: "How can Microsoft-hosted agents run jobs?",
168
+ a: ["Directly on the VM or in a container", "Only in containers", "Only on physical hardware"],
169
+ correct: 0
170
+ }
171
+ ],
172
+ // Self-Hosted Agents (index 2)
173
+ [
174
+ {
175
+ q: "Which operating systems support self-hosted agents?",
176
+ a: ["Windows only", "Linux, macOS, and Windows", "Linux only"],
177
+ correct: 1
178
+ },
179
+ {
180
+ q: "What is the primary advantage of self-hosted agents?",
181
+ a: ["Greater control over environment", "Automatic updates", "Requires no management"],
182
+ correct: 0
183
+ },
184
+ {
185
+ q: "What should be avoided when setting up multiple self-hosted agents on a single machine?",
186
+ a: ["Installing more than one agent", "Persistent caches", "System capability configuration"],
187
+ correct: 0
188
+ }
189
+ ],
190
+ // VM Scale Set Agents (index 3)
191
+ [
192
+ {
193
+ q: "What is a benefit of using VM Scale Set agents?",
194
+ a: ["Fully managed by Microsoft", "Autoscaling to meet demands", "No setup required"],
195
+ correct: 1
196
+ },
197
+ {
198
+ q: "How do VM Scale Set agents manage scaling?",
199
+ a: ["Manually by administrators", "Automatically through Azure Pipelines", "Through user scripts"],
200
+ correct: 1
201
+ },
202
+ {
203
+ q: "What must you define when configuring a VM Scale Set agent pool?",
204
+ a: ["Number of agents and VM image", "Agent IP addresses", "Host machine hardware"],
205
+ correct: 0
206
+ }
207
+ ],
208
+ // Capabilities (index 4)
209
+ [
210
+ {
211
+ q: "What are agent capabilities used for?",
212
+ a: ["Storing secrets", "Matching jobs to agents", "Disabling environment variables"],
213
+ correct: 1
214
+ },
215
+ {
216
+ q: "What is a system capability?",
217
+ a: ["Manually added capability", "Automatically detected capability", "User-defined configuration"],
218
+ correct: 1
219
+ },
220
+ {
221
+ q: "What should you do after installing new software on a self-hosted agent?",
222
+ a: ["Restart the agent", "Reinstall the agent", "Manually add a capability"],
223
+ correct: 0
224
+ }
225
+ ]
226
+ ];
227
+
228
+ let score = 0;
229
+ let totalCards = 15; // 5 categories x 3 questions each
230
+ let answeredCards = 0;
231
+ const gameBoard = document.getElementById("game-board");
232
+ const questionDisplay = document.getElementById("question-display");
233
+ const scoreDisplay = document.getElementById("score");
234
+
235
+ function createBoard() {
236
+ for (let row = 0; row < 3; row++) {
237
+ for (let col = 0; col < 5; col++) {
238
+ const card = document.createElement("div");
239
+ card.className = "card";
240
+ card.textContent = `$${(row + 1) * 100}`;
241
+ card.onclick = () => showQuestion(col, row, card);
242
+ gameBoard.appendChild(card);
243
+ }
244
+ }
245
+ }
246
+
247
+ function showQuestion(category, difficulty, cardElement) {
248
+ if (cardElement.classList.contains("disabled")) return;
249
+ const question = questions[category][difficulty];
250
+ const answerHtml = question.a
251
+ .map(
252
+ (answer, index) =>
253
+ `<button class="answer-btn" onclick="checkAnswer(${category}, ${difficulty}, ${index})">${answer}</button>`
254
+ )
255
+ .join("");
256
+ questionDisplay.innerHTML = `
257
+ <h2>${categories[category]} for $${(difficulty + 1) * 100}</h2>
258
+ <p>${question.q}</p>
259
+ <div class="answer-container">${answerHtml}</div>
260
+ `;
261
+ // Mark card as disabled
262
+ cardElement.classList.add("disabled");
263
+ cardElement.style.backgroundColor = "#cccccc";
264
+ answeredCards++;
265
+ }
266
+
267
+ function checkAnswer(category, difficulty, selectedAnswer) {
268
+ const question = questions[category][difficulty];
269
+ const correctAnswer = question.a[question.correct];
270
+ const isCorrect = selectedAnswer === question.correct;
271
+ const value = (difficulty + 1) * 100;
272
+ // Disable all answer buttons
273
+ document.querySelectorAll(".answer-btn").forEach((btn) => {
274
+ btn.disabled = true;
275
+ btn.classList.add("disabled");
276
+ });
277
+ if (isCorrect) {
278
+ score += value;
279
+ questionDisplay.innerHTML += `<p class="feedback" style="color: green;">Correct! You earned $${value}.</p>`;
280
+ } else {
281
+ score -= value;
282
+ questionDisplay.innerHTML += `<p class="feedback" style="color: red;">Wrong! You lost $${value}. The correct answer was: ${correctAnswer}</p>`;
283
+ }
284
+ scoreDisplay.textContent = `Score: ${score}`;
285
+ if (answeredCards === totalCards) {
286
+ endGame();
287
+ }
288
+ }
289
+
290
+ function endGame() {
291
+ questionDisplay.innerHTML = `<h2>Game Over!</h2><p>Your final score is $${score}.</p>`;
292
+ }
293
+
294
+ createBoard();
295
+ </script>
296
+ </body>
297
  </html>
298
+