A tiny quiz system using Svelte
For getting all dependencies and set it up, run
npm install
Then build it with
npm run build
To finally run it, execute
node build
Then just use your browser with the following address: http://localhost:3000/
For the development, use
npm run dev
As long as the quiz data is not residing in a database, you have to edit the Typescript file that contains the quiz data. The path is src/lib/server/data.ts
(the directory server
must be created).
An exemplary content could be this:
export const quiz: Quiz = [
{
question: "Who is considered the father of the SID sound chip for C64/C65?",
score: 3,
answers: [
{
id: 0,
answer: "Bob Yannes",
isCorrect: true
},
{
id: 1,
answer: "Rob Hubbard",
isCorrect: false
},
{
id: 2,
answer: "Chuck Peddle",
isCorrect: false
},
{
id: 3,
answer: "Jay Miner",
isCorrect: false
},
]
},
{
question: "What does SID mean?",
score: 3,
answers: [
{
id: 4,
answer: "Serial Interactive Distribution",
isCorrect: false
},
{
id: 5,
answer: "Sound Interactive Design",
isCorrect: false
},
{
id: 6,
answer: "Sound Interface Digital",
isCorrect: false
},
{
id: 7,
answer: "Sound Interface Device",
isCorrect: true
},
]
},
{
question: "SID sound pioneer Rob Hubbard composed the music for the game Knucklebusters. What's special about it?",
score: 3,
answers: [
{
id: 8,
answer: "First Song with voice output",
isCorrect: false
},
{
id: 9,
answer: "First award for computer music",
isCorrect: false
},
{
id: 10,
answer: "Theme song of a british computer show",
isCorrect: false
},
{
id: 11,
answer: "His longest soundtrack",
isCorrect: true
},
]
},
{
question: "How many sound channels could the C64 sound chip officially produce simultaneously?",
score: 3,
answers: [
{
id: 12,
answer: "Five",
isCorrect: false
},
{
id: 13,
answer: "Two",
isCorrect: false
},
{
id: 14,
answer: "Three",
isCorrect: true
},
{
id: 15,
answer: "Four",
isCorrect: false
},
]
},
{
question: "What was the main advantage of the SID chip for the C64 compared to computers without a sound chip?",
score: 3,
answers: [
{
id: 16,
answer: "provided preemptive multitasking",
isCorrect: false
},
{
id: 17,
answer: "allowed better extensibility of sound hardware",
isCorrect: false
},
{
id: 18,
answer: "It was particularly easy to control via external hardware",
isCorrect: false
},
{
id: 19,
answer: "relieved the main processor",
isCorrect: true
},
]
},
{
question: "Chris Huelsbeck is one of THE componist of the home computer era. He was able to program, too: \"To Be On Top\" is",
score: 3,
answers: [
{
id: 20,
answer: "a C64 soundmonitor",
isCorrect: false
},
{
id: 21,
answer: "an Amiga jump'n'run game",
isCorrect: false
},
{
id: 22,
answer: "an Atari ST soundsampler",
isCorrect: false
},
{
id: 23,
answer: "C64 music action game",
isCorrect: true
},
]
},
{
question: "What honour was bestowed on Huelsbeck's Turrican soundtrack?",
score: 3,
answers: [
{
id: 70,
answer: "was part of a MOMA museum exhibition",
isCorrect: false
},
{
id: 71,
answer: "set to music several times via orchestra",
isCorrect: true
},
{
id: 72,
answer: "quoted in GTA 5",
isCorrect: false
},
{
id: 73,
answer: "played in Avengers movies",
isCorrect: false
},
]
},
{
question: "WWhich C64 classic soundtrack was NOT created with the participation of Chris Huelsbeck?",
score: 3,
answers: [
{
id: 80,
answer: "Turrican 2",
isCorrect: true
},
{
id: 81,
answer: "Katakis",
isCorrect: false
},
{
id: 82,
answer: "The Great Giana Sisters",
isCorrect: false
},
{
id: 83,
answer: "R-Type",
isCorrect: false
},
]
},
{
question: "Which song became a chart hit in 1999 with the help of a C64 melody?",
score: 3,
answers: [
{
id: 90,
answer: "Born This Way by Lady Gaga",
isCorrect: false
},
{
id: 91,
answer: "Acceptable in the 80s by Calvin Harris",
isCorrect: false
},
{
id: 92,
answer: "Kernkraft 400 by Zombie Nation",
isCorrect: true
},
{
id: 93,
answer: "Sky&Sand by Paul and Fritz Kalkbrenner",
isCorrect: false
},
]
},
]