Over the next 10 updates you will build your own trivia game show in JavaScript: a question bank, scoring, a countdown, shuffled rounds and a lifeline. Copilot writes your first questions, and you fact-check every single one. At Game Show Night you host your show for your table. You are the producer. You are the fact-checker. You are the coder.
questions. Each question has its text q, its options and the position of the right answer. Positions start at 0..html file to Downloads. Start of every update: Open and choose that file. The Studio keeps a draft in this browser too, but your Downloads file is the safe copy..html file that runs in any browser. On the night you host it on your own laptop for your table: you read the questions, they play.Need to log into Minecraft Education, Canva, or any other app that asks you to sign in? Most school and app accounts use the same login: your username is [email protected] (add a number if your name needs one, e.g. firstname.lastname2), and your password is the same one you use to log into your school computer.
Every project has at least one thing to hand in. Log into connect.det.wa.edu.au with your firstname.lastname and computer password, then head to your class and open the Submission section. Handing in more than one file? Zip them together first - total size must stay under 50MB.
Produce a trivia game show on a topic you choose, with a fact-checked question bank, scoring, a countdown, shuffled rounds and a lifeline, then host it for your table at Game Show Night.
| Criteria | Practice Round (0-1) |
Contestant (2-3) |
Finalist (4) |
Champion (5) |
Score |
|---|---|---|---|---|---|
| Show Design | No clear topic or look | A name, an intro and a topic | A clear topic, a host voice in the intro and end messages, and its own theme | A show people want to play again, with every part fitting one idea | / 5 |
| Code | Show only works with heavy teacher help | Questions play using the Studio code | Scoring, countdown, shuffled rounds, the 50:50 and an end message all work in your own show | Your own changes or new rules, and you can explain every function you use | / 5 |
| Fact-Check | Answers not checked | Some answers checked, log started | 15+ questions, every answer checked against a named source, Copilot's mistakes logged and fixed | Checked twice from different sources, with facts that teach the player something | / 5 |
| Playtest & Host | No testing, show not ready | Played once, some fixes made | Playtest log with fixes, show ready and hosted on the night | Polished, fair show, hosted with energy, clear reflection | / 5 |
| Total | / 20 | ||||
Run restarts your show. Players can click an answer or press 1 to 4. Save downloads one .html file (your whole show). Open loads it back. Play opens your show full screen in a new tab. Reset brings back the demo show - press it twice to confirm.
showName is the name at the top, intro() is the title screen message, and questions is the question bankq is the question, options is the list of choices, and answer is the position of the right one. Positions start at 0, so Mars, the second option, is answer: 1showName holds one, and intro() returns one. If your text has an apostrophe in it, like You're, wrap it in double quotes.opt is the answer buttons, .opt.right and .opt.wrong show after a click, .big is Start and Nextbody {
background: #04223a;
color: #e9f6ff;
font-family: 'Trebuchet MS', Arial, sans-serif;
}
#top, h1, #timer {
color: #4ff0c8;
}
h1 {
text-shadow: 0 0 18px #4ff0c8;
letter-spacing: 2px;
}
.opt {
background: #0b3b5c;
color: #e9f6ff;
border-color: #145c85;
}
.opt:hover {
border-color: #4ff0c8;
}
.opt.right {
background: #138a5e;
}
.opt.wrong {
background: #b3263e;
}
.big {
background: #4ff0c8;
color: #04223a;
}
.life {
background: transparent;
color: #4ff0c8;
border: 2px solid #4ff0c8;
}
const showName = 'Deep Sea Showdown';
function intro() {
return 'Dive in! Ten questions from the bottom of the ocean. Can you make it back to the surface?';
}
.opt b { background: #4ff0c8; color: #04223a; } to the bottom of your CSS tab, then change the colours to yours.questions is an array: a list in square brackets. Each question inside it is an object: parts with names, inside curly brackets { }[ ] of your questions list, replacing the demo questions. Every } needs a comma after it, except the last oneanswer number too. Count the options from 0 and make sure it points at the right one| Question | The question, short |
| Copilot said | The answer Copilot gave |
| Source | The website or book you checked, by name |
| Verdict | Correct, Fixed (what was wrong) or Removed (why) |
{
q: 'Your question here?',
options: ['Option 0', 'Option 1', 'Option 2', 'Option 3'],
answer: 0
},
answer number that points at the wrong option, two options that are both right, and "facts" that sound true but aren't. Check all three.options: ['True', 'False'], with answer: 0 for true or answer: 1 for false. The show handles any number of options from 2 up.pointsFor() lets you decidepointsFor(correct, secondsLeft, streak) after every answer. correct is true or false, and whatever number you return is added to the score// Runs after every answer. Whatever it returns is added to the score.
// correct is true or false. streak is how many right in a row.
function pointsFor(correct, secondsLeft, streak) {
if (correct) {
return 100;
} else {
return 0;
}
}
pointsFor needs a return. If the show warns that pointsFor() gave back nothing, one of your if / else paths has no return.pointsFor if (correct && streak >= 3) { return 200; }. From the third right answer in a row, every right answer is worth double, until a wrong answer resets the streak.timeLimit at the top of your JS tab. A bar counts down above each question. Hit 0 and the show counts it as wrongsecondsLeft is how many seconds were left when the player clicked. Replace your pointsFor with the time bonus box100 + 10 * 10 is 200 points// Seconds for each question. Run out and it counts as wrong.
const timeLimit = 15;
function pointsFor(correct, secondsLeft, streak) {
if (correct) {
return 100 + secondsLeft * 10;
} else {
return 0;
}
}
timeLimit must be a number with no quote marks: 15, not '15'. With quotes it's a string, and the show ignores it.pointsFor, change return 0; to return -50;. Now guessing is risky. Ask a classmate to play it: is it fairer, or just meaner?prepare(list) runs at the start of every game, and whatever list it returns is that game's questionsreturn list; to return list.slice(0, 10);. slice(0, 10) keeps the first 10 of the shuffled list, so every game is a different 10// Runs at the start of every game. Whatever list it returns is the game.
function prepare(list) {
// Fisher-Yates shuffle: swap each question with a random one
for (let i = list.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
const temp = list[i];
list[i] = list[j];
list[j] = temp;
}
return list;
}
prepare must end with return. Without it the show gets nothing back, so it has no questions to ask.prepare to return list.slice(0, 3); and timeLimit to 5. Three questions, five seconds each. Change them back when you've tried it.fiftyFifty exists, a 50:50 button appears under the options. Players can use it once per gamefor loop checks every position. !== means "is not", so every position that isn't the answer goes into the wrong list. slice(0, 2) keeps the first two// Return the positions of two WRONG options to hide.
// Players can use it once per game.
function fiftyFifty(question) {
const wrong = [];
for (let i = 0; i < question.options.length; i++) {
if (i !== question.answer) {
wrong.push(i);
}
}
return wrong.slice(0, 2);
}
return wrong.slice(0, 2); add wrong.sort(() => Math.random() - 0.5);. That mixes the wrong list, so the two hidden options change every time.fact to at least five questions. It shows after the player answers, so they learn something either way. Write it from your source, in your own words {
q: 'Which planet is known as the Red Planet?',
options: ['Venus', 'Mars', 'Jupiter', 'Saturn'],
answer: 1,
fact: 'Mars looks red because its dust is full of iron oxide - rust.'
},
fact: 'Mars looks red because its dust is full of iron oxide - rust. (NASA)'.finalMessage(correctCount, total, score) decides the message on the end screen. It uses if / else if to pick one for great, okay and low scorestotal / 2 is half the questions, so correctCount >= total / 2 means "at least half right"// The message on the end screen
function finalMessage(correctCount, total, score) {
if (correctCount === total) {
return 'PERFECT GAME! You are the champion!';
} else if (correctCount >= total / 2) {
return 'Great effort! ' + score + ' points.';
} else {
return 'Better luck next time! Study up and try again.';
}
}
| Identity | Your name, intro, theme and end messages, all in one voice |
| Question bank | 15 or more questions, every answer in your Fact-Check Log with a source |
| Scoring | Points with a time bonus and a countdown that fits |
| Rounds | Shuffled, 10 questions a game |
| Lifeline | 50:50 hides two wrong options, once per game |
timeLimit is under 20 seconds, raise it for the night and Save a copy for hosting.After 10 updates the lights go on. Every student hosts their show for their table, every show gets played, and the class crowns its champions.
Play the demo show, then plan your own // Update 01