File size: 9,144 Bytes
f6a6c81
 
 
 
 
4f8a08a
f6a6c81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aadd6ce
f6a6c81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c578c5a
f6a6c81
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>Azure Pipeline Agents Jeopardy</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      display: flex;
      flex-direction: column;
      align-items: center;
      background-color: #f0f0f0;
      margin: 0;
    }
    h1 {
      color: #0078D4;
    }
    #game-board {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      grid-auto-rows: 100px;
      gap: 2px;
      margin: 20px 0;
      background-color: #000;
      border: 4px solid #000;
    }
    .category {
      background-color: #005a9e;
      color: #fff;
      font-weight: bold;
      display: flex;
      justify-content: center;
      align-items: center;
      text-align: center;
      font-size: 18px;
      border: 1px solid #000;
    }
    .card {
      background-color: #0078D4;
      color: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 16px;
      font-weight: bold;
      cursor: pointer;
      border: 1px solid #000;
      text-align: center;
      transition: background-color 0.3s;
    }
    .card:hover {
      background-color: #005a9e;
    }
    .card.disabled {
      background-color: #cccccc;
      cursor: default;
    }
    #question-display {
      width: 80%;
      text-align: center;
      margin-bottom: 20px;
    }
    #score {
      font-size: 24px;
      font-weight: bold;
      color: #0078D4;
    }
    .answer-container {
      display: flex;
      justify-content: center;
      margin-top: 20px;
    }
    .answer-btn {
      margin: 5px;
      padding: 10px 15px;
      font-size: 18px;
      cursor: pointer;
      text-align: center;
      border: 2px solid #005a9e;
      border-radius: 5px;
      background-color: #0078D4;
      color: #fff;
      font-weight: bold;
      transition: background-color 0.3s, color 0.3s;
    }
    .answer-btn:hover {
      background-color: #005a9e;
      color: #f0f0f0;
    }
    .answer-btn.disabled {
      background-color: #cccccc;
      color: #666;
      cursor: not-allowed;
    }
    .feedback {
      margin-top: 10px;
      font-size: 18px;
      font-weight: bold;
    }
  </style>
</head>
<body>
  <h1>Azure Pipeline Agents Jeopardy</h1>
  <p>
    <strong>Learn More:</strong>
    <a
      href="https://docs.microsoft.com/azure/devops/pipelines/agents/agents"
      target="_blank"
      >Azure Pipelines Agents</a
    >
  </p>

  <div id="game-board">
    <!-- Categories -->
    <div class="category">Agent Types</div>
    <div class="category">Microsoft-Hosted Agents</div>
    <div class="category">Self-Hosted Agents</div>
    <div class="category">VM Scale Set Agents</div>
    <div class="category">Capabilities</div>
  </div>

  <div id="question-display"></div>
  <div id="score">Score: 0</div>

  <script>
    // 5 categories, each with 3 questions = 15 total
    const categories = [
      "Agent Types",
      "Microsoft-Hosted Agents",
      "Self-Hosted Agents",
      "VM Scale Set Agents",
      "Capabilities"
    ];
    const questions = [
      // Agent Types (index 0)
      [
        {
          q: "Which type of agent is managed entirely by Microsoft?",
          a: ["Self-hosted", "Microsoft-hosted", "VM Scale Set"],
          correct: 1
        },
        {
          q: "What is a key feature of self-hosted agents?",
          a: ["Automatically updated by Microsoft", "User-managed with persistent caches", "Always use containers"],
          correct: 1
        },
        {
          q: "Which agent type scales automatically using Azure Virtual Machine Scale Sets?",
          a: ["Microsoft-hosted", "VM Scale Set", "Managed DevOps Pools"],
          correct: 1
        }
      ],
      // Microsoft-Hosted Agents (index 1)
      [
        {
          q: "What happens to a Microsoft-hosted agent after a job is completed?",
          a: ["It is reused for the next job", "It is discarded and reset", "It continues running"],
          correct: 1
        },
        {
          q: "What is an advantage of Microsoft-hosted agents?",
          a: ["No need for maintenance", "Persistent machine caches", "Custom software installation"],
          correct: 0
        },
        {
          q: "How can Microsoft-hosted agents run jobs?",
          a: ["Directly on the VM or in a container", "Only in containers", "Only on physical hardware"],
          correct: 0
        }
      ],
      // Self-Hosted Agents (index 2)
      [
        {
          q: "Which operating systems support self-hosted agents?",
          a: ["Windows only", "Linux, macOS, and Windows", "Linux only"],
          correct: 1
        },
        {
          q: "What is the primary advantage of self-hosted agents?",
          a: ["Greater control over environment", "Automatic updates", "Requires no management"],
          correct: 0
        },
        {
          q: "What should be avoided when setting up multiple self-hosted agents on a single machine?",
          a: ["Installing more than one agent", "Persistent caches", "System capability configuration"],
          correct: 0
        }
      ],
      // VM Scale Set Agents (index 3)
      [
        {
          q: "What is a benefit of using VM Scale Set agents?",
          a: ["Fully managed by Microsoft", "Autoscaling to meet demands", "No setup required"],
          correct: 1
        },
        {
          q: "How do VM Scale Set agents manage scaling?",
          a: ["Manually by administrators", "Automatically through Azure Pipelines", "Through user scripts"],
          correct: 1
        },
        {
          q: "What must you define when configuring a VM Scale Set agent pool?",
          a: ["Number of agents and VM image", "Agent IP addresses", "Host machine hardware"],
          correct: 0
        }
      ],
      // Capabilities (index 4)
      [
        {
          q: "What are agent capabilities used for?",
          a: ["Storing secrets", "Matching jobs to agents", "Disabling environment variables"],
          correct: 1
        },
        {
          q: "What is a system capability?",
          a: ["Manually added capability", "Automatically detected capability", "User-defined configuration"],
          correct: 1
        },
        {
          q: "What should you do after installing new software on a self-hosted agent?",
          a: ["Restart the agent", "Reinstall the agent", "Manually add a capability"],
          correct: 0
        }
      ]
    ];

    let score = 0;
    let totalCards = 15; // 5 categories x 3 questions each
    let answeredCards = 0;
    const gameBoard = document.getElementById("game-board");
    const questionDisplay = document.getElementById("question-display");
    const scoreDisplay = document.getElementById("score");

    function createBoard() {
      for (let row = 0; row < 3; row++) {
        for (let col = 0; col < 5; col++) {
          const card = document.createElement("div");
          card.className = "card";
          card.textContent = `$${(row + 1) * 100}`;
          card.onclick = () => showQuestion(col, row, card);
          gameBoard.appendChild(card);
        }
      }
    }

    function showQuestion(category, difficulty, cardElement) {
      if (cardElement.classList.contains("disabled")) return;
      const question = questions[category][difficulty];
      const answerHtml = question.a
        .map(
          (answer, index) =>
            `<button class="answer-btn" onclick="checkAnswer(${category}, ${difficulty}, ${index})">${answer}</button>`
        )
        .join("");
      questionDisplay.innerHTML = `
        <h2>${categories[category]} for $${(difficulty + 1) * 100}</h2>
        <p>${question.q}</p>
        <div class="answer-container">${answerHtml}</div>
      `;
      // Mark card as disabled
      cardElement.classList.add("disabled");
      cardElement.style.backgroundColor = "#cccccc";
      answeredCards++;
    }

    function checkAnswer(category, difficulty, selectedAnswer) {
      const question = questions[category][difficulty];
      const correctAnswer = question.a[question.correct];
      const isCorrect = selectedAnswer === question.correct;
      const value = (difficulty + 1) * 100;
      // Disable all answer buttons
      document.querySelectorAll(".answer-btn").forEach((btn) => {
        btn.disabled = true;
        btn.classList.add("disabled");
      });
      if (isCorrect) {
        score += value;
        questionDisplay.innerHTML += `<p class="feedback" style="color: green;">Correct! You earned $${value}.</p>`;
      } else {
        score -= value;
        questionDisplay.innerHTML += `<p class="feedback" style="color: red;">Wrong! You lost $${value}. The correct answer was: ${correctAnswer}</p>`;
      }
      scoreDisplay.textContent = `Score: ${score}`;
      if (answeredCards === totalCards) {
        endGame();
      }
    }

    function endGame() {
      questionDisplay.innerHTML = `<h2>Game Over!</h2><p>Your final score is $${score}.</p>`;
    }

    createBoard();
  </script>
</body>
</html>