Skip to content

Instantly share code, notes, and snippets.

@brittanydionigi
Last active April 13, 2018 16:06
Show Gist options
  • Save brittanydionigi/074676c2270695fe80ed90bb659503bb to your computer and use it in GitHub Desktop.
Save brittanydionigi/074676c2270695fe80ed90bb659503bb to your computer and use it in GitHub Desktop.
// Given an array of categories and an array of trivia questions,
// return an object that summarizes the number of questions in each
// category and the average difficulty of those questions like so:
{
"Entertainment": {
"numberOfQuestions": ?,
"averageDifficulty": ?
},
"General_Knowledge": {
"numberOfQuestions": ?,
"averageDifficulty": ?
},
"Geography": {
"numberOfQuestions": ?,
"averageDifficulty": ?
},
"History": {
"numberOfQuestions": ?,
"averageDifficulty": ?
}
};
const categories = [
{ "id": 22, "name": "Geography" },
{ "id": 9, "name": "General Knowledge" },
{ "id": 23, "name": "History" },
{ "id": 15, "name": "Entertainment" },
{ "id": 10, "name": "Sports" },
{ "id": 12, "name": "Vehicles" }
];
const triviaQuestions = [
{
"category":15,
"type":"multiple",
"difficulty":5,
"title":"When was the first Call of Duty title released?",
"correct_answer":"October 29, 2003",
"incorrect_answers":["December 1, 2003","November 14, 2002","July 18, 2004"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"How many books are in the Chronicles of Narnia series?",
"correct_answer":"7",
"incorrect_answers":["6","8","5"]
},
{
"category":15,
"type":"boolean",
"difficulty":1,
"title":"Han Solo's co-pilot and best friend, "Chewbacca", is an Ewok.",
"correct_answer":"False",
"incorrect_answers":["True"]
},
{
"category":9,
"type":"multiple",
"difficulty":3,
"title":"The Tsar Bomba, the most powerful nuclear bomb ever tested, had a yield of 50 megatons but theoretically had a maximum yield of how much?",
"correct_answer":"100 Megatons",
"incorrect_answers":["200 Megatons","75 Megatons","150 Megatons"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"Which of these is NOT a terrorist faction in Counter-Strike (2000)?",
"correct_answer":"Midwest Militia",
"incorrect_answers":["Phoenix Connection","Elite Crew","Guerrilla Warfare"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"Which of these games was the earliest known first-person shooter with a known time of publication?",
"correct_answer":"Spasim",
"incorrect_answers":["Doom","Wolfenstein","Quake"]
},
{
"category":15,
"type":"multiple",
"difficulty":5,
"title":"What did Alfred Hitchcock use as blood in the film "Psycho"? ",
"correct_answer":"Chocolate syrup",
"incorrect_answers":["Ketchup","Red food coloring","Maple syrup"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"How many Star Spirits do you rescue in the Nintendo 64 video game "Paper Mario"?",
"correct_answer":"7",
"incorrect_answers":["5","10","12"]
},
{
"category":15,"type":"multiple",
"difficulty":3,
"title":"Who played Batman in the 1997 film "Batman and Robin"?",
"correct_answer":"George Clooney",
"incorrect_answers":["Michael Keaton","Val Kilmer","Christian Bale"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"This movie contains the quote, "What we've got here is a failure to communicate."",
"correct_answer":"Cool Hand Luke",
"incorrect_answers":["Bonnie and Clyde","The Graduate","In the Heat of the Night"]
},
{
"category":"Entertainment: Books",
"type":"multiple",
"difficulty":3,
"title":"Who wrote the children's story "The Little Match Girl"?",
"correct_answer":"Hans Christian Andersen",
"incorrect_answers":["Charles Dickens","Lewis Carroll","Oscar Wilde"]
},
{
"category":"Science & Nature",
"type":"multiple",
"difficulty":5,
"title":"An organic compound is considered an alcohol if it has what functional group?",
"correct_answer":"Hydroxyl",
"incorrect_answers":["Carbonyl","Alkyl","Aldehyde"]
},
{
"category":"Mythology",
"type":"multiple",
"difficulty":3,
"title":"Neptune's greek name was...",
"correct_answer":"Poseidon",
"incorrect_answers":["Ares","Zeus","Apollo"]
},
{
"category":9,"type":"multiple",
"difficulty":3,
"title":"What is a "dakimakura"?",
"correct_answer":"A body pillow",
"incorrect_answers":["A Chinese meal, essentially composed of fish","A yoga posture","A word used to describe two people who truly love each other"]
},
{
"category":22,
"type":"multiple",
"difficulty":3,
"title":"Which of these countries is NOT located in Africa?",
"correct_answer":"Suriname",
"incorrect_answers":["Burkina Faso","Mozambique","Algeria"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"What is the name of the comic about a young boy, and a tiger who is actually a stuffed animal?",
"correct_answer":"Calvin and Hobbes",
"incorrect_answers":["Winnie the Pooh","Albert and Pogo","Peanuts"]
},
{
"category":23,
"type":"boolean","difficulty":1,"title":"The United States was a member of the League of Nations.",
"correct_answer":"False",
"incorrect_answers":["True"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"In the 2002 video game "Kingdom Hearts", how many playable worlds were there?",
"correct_answer":"14",
"incorrect_answers":["13","16","11"]
},
{
"category":9,"type":"multiple",
"difficulty":5,
"title":"What is the romanized Korean word for "heart"?",
"correct_answer":"Simjang",
"incorrect_answers":["Aejeong","Jeongsin","Segseu"]
},
{
"category":10,
"type":"multiple",
"difficulty":5,
"title":"Where was the Games of the XXII Olympiad held?",
"correct_answer":"Moscow",
"incorrect_answers":["Barcelona","Tokyo","Los Angeles"]
},
{
"category":23,
"type":"multiple",
"difficulty":5,
"title":"When was the SS or Schutzstaffel established?",
"correct_answer":"April 4th, 1925",
"incorrect_answers":["September 1st, 1941","March 8th, 1935","February 21st, 1926"]
},
{
"category":9,"type":"boolean","difficulty":1,"title":"You can legally drink alcohol while driving in Mississippi.",
"correct_answer":"True",
"incorrect_answers":["False"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"Which of these is the name of a cut enemy from "Half-Life 2"?",
"correct_answer":"Hydra",
"incorrect_answers":["Cthulu","Spike","Tremor"]
},
{
"category":15,"type":"multiple",
"difficulty":3,
"title":"Who played Baron Victor Frankestein in the 1957 Hammer horror film "The Curse of Frankenstein"?",
"correct_answer":"Peter Cushing",
"incorrect_answers":["Boris Karloff","Vincent Price","Lon Chaney Jr."]
},
{
"category":12,
"type":"multiple",
"difficulty":3,
"title":"Which car brand does NOT belong to General Motors?",
"correct_answer":"Ford",
"incorrect_answers":["Buick","Cadillac","Chevrolet"]
},
{
"category":12,
"type":"multiple",
"difficulty":3,
"title":"What do the 4 Rings in Audi's Logo represent?",
"correct_answer":"Previously independent automobile manufacturers",
"incorrect_answers":["States in which Audi makes the most sales","Main cities vital to Audi","Countries in which Audi makes the most sales"]
},
{
"category":50,
"type":"multiple",
"difficulty":5,
"title":"What is the Gray Wolf's scientific name?",
"correct_answer":"Canis Lupus",
"incorrect_answers":["Canis Aureus","Canis Latrans","Canis Lupus Lycaon"]
},
{
"category":15,
"type":"multiple",
"difficulty":1,"title":"In vanilla Minecraft, which of the following cannot be made into a block?",
"correct_answer":"Charcoal",
"incorrect_answers":["Coal","Wheat","String"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"Which is not a playable character in the 2005 video game Killer7?",
"correct_answer":"Frank Smith",
"incorrect_answers":["Mask de Smith","Dan Smith","Coyote Smith"]
},
{
"category":15,
"type":"multiple",
"difficulty":1,"title":"What country is Cory in the House set in?",
"correct_answer":"The United States of America",
"incorrect_answers":["Canada","Venezuala","England"]
},
{
"category":23,
"type":"multiple",
"difficulty":1,"title":"What was the first sport to have been played on the moon?",
"correct_answer":"Golf",
"incorrect_answers":["Football","Tennis","Soccer"]
},
{
"category":12,
"type":"multiple",
"difficulty":5,
"title":"What engine is in the Lexus SC400?",
"correct_answer":"1UZ-FE",
"incorrect_answers":["2JZ-GTE","7M-GTE","5M-GE"]
},
{
"category":15,
"type":"multiple",
"difficulty":5,
"title":"Which year was the album "Floral Shoppe" by Macintosh Plus released?",
"correct_answer":"2011",
"incorrect_answers":["2014","2013","2012"]
},
{
"category":15,
"type":"multiple",
"difficulty":5,
"title":"Which country does the YouTuber "SinowBeats" originate from?",
"correct_answer":"Scotland",
"incorrect_answers":["England","Sweden","Germany"]
},
{
"category":15,"type":"boolean","difficulty":5,
"title":""Cube", "Cube 2: Hypercube" and "Cube Zero" were directed by the same person.",
"correct_answer":"False",
"incorrect_answers":["True"]
},
{
"category":15,
"type":"boolean","difficulty":3,
"title":"EDM label Monstercat signs tracks instead of artists.",
"correct_answer":"True",
"incorrect_answers":["False"]
},
{
"category":22,
"type":"multiple",
"difficulty":3,
"title":"How tall is One World Trade Center in New York City?",
"correct_answer":"1,776 ft",
"incorrect_answers":["1,888 ft","1,225 ft","1,960 ft"]
},
{
"category":22,
"type":"multiple",
"difficulty":5,
"title":"What is the name of rocky region that spans most of eastern Canada?",
"correct_answer":"Canadian Shield",
"incorrect_answers":["Rocky Mountains","Appalachian Mountains","Himalayas"]
},
{
"category":23,
"type":"multiple",
"difficulty":1,"title":"How was Socrates executed?",
"correct_answer":"Poison",
"incorrect_answers":["Decapitation","Firing squad","Crucifixion "]
},
{
"category":10,
"type":"multiple",
"difficulty":1,"title":"What year did the New Orleans Saints win the Super Bowl?",
"correct_answer":"2009",
"incorrect_answers":["2008","2010","2011"]
},
{
"category":9,"type":"multiple",
"difficulty":3,
"title":"When was Hubba Bubba first introduced?",
"correct_answer":"1979",
"incorrect_answers":["1984","1972","1980"]
},
{
"category":22,
"type":"multiple",
"difficulty":1,"title":"What is the capital of Spain?",
"correct_answer":"Madrid",
"incorrect_answers":["Barcelona","Sevilla","Toledo"]
},
{
"category":15,
"type":"multiple",
"difficulty":1,"title":"In the show "Steven Universe", who are the main two employees of The Big Donut?",
"correct_answer":"Sadie and Lars",
"incorrect_answers":["Steven and James","Erik and Julie","Bob and May"]
},
{
"category":22,
"type":"multiple",
"difficulty":1,"title":"What is the capital of India?",
"correct_answer":"New Delhi",
"incorrect_answers":["Bejing","Montreal","Tithi"]
},
{
"category":15,
"type":"multiple",
"difficulty":1,"title":"In season one of the Netflix political drama "House of Cards", what government position does Frank Underwood hold?",
"correct_answer":"House Majority Whip",
"incorrect_answers":["Attorney General","President","Chief of Staff"]
},
{
"category":23,
"type":"multiple",
"difficulty":3,
"title":"What was the name of one of the surviving palaces of Henry VIII located near Richmond, London?",
"correct_answer":"Hampton Court",
"incorrect_answers":["St James's Palace","Buckingham Palace","Coughton Court"]
},
{
"category":15,
"type":"multiple",
"difficulty":5,
"title":"Which one of these characters is from "Legendz : Tale of the Dragon Kings"?",
"correct_answer":"Shiron",
"incorrect_answers":["Jack","Axia","Drum"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"What was David Bowie's real surname?",
"correct_answer":"Jones",
"incorrect_answers":["Johnson","Edwards","Carter"]
},
{
"category":15,
"type":"multiple",
"difficulty":3,
"title":"In Pokémon Chronicles, why was Misty afraid of Gyarados?",
"correct_answer":"She crawled into it's mouth as a baby.",
"incorrect_answers":["She found it scary.","She was badly injured from it.","It is part Bug."]
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment