Skip to content

Commit

Permalink
update questions data file with all questions
Browse files Browse the repository at this point in the history
  • Loading branch information
rbozek committed Jan 4, 2024
1 parent e536f8e commit a30b074
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 74 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,37 @@

![screenshot here eventually](https://dietmartemps.com/media_library/image/28928_1374416277166.jpg)

What kind of footprint do you leave on the world? What impact do you have on the people around you? Being a good person doesn't have to be a pretentious sweater you show off - all it takes is paying attention to the little details of life.
The goal is simple - choose a category and answer questions. Each question will have multiple choice answers, and after selecting your answer you will receive points - or not! At the end of a category you will see your total score and see how close you are to being a "perfect person". (FYI - no such thing.)
What kind of footprint do you leave on the world? What impact do you have on the people around you? Do you know how to deal with emergency situations? Being a good person doesn't have to be a pretentious sweater you show off - all it takes is paying attention to the little details in life.
The goal is simple - choose a category and answer questions. Each question will have multiple choice answers, and after selecting your answer you will receive points - or not! At the end of a category you will see your total score and learn how close you are to being a "perfect person". (FYI - no such thing.)

#[PLAY GAME!](https://rbozek.github.io/Quiz-BeAGreatHuman/)


Technologies used
##Technologies used

HTML
CSS
Javascript
-HTML
-CSS
-Javascript

Credits
##Credits

https://www.sitepoint.com/simple-javascript-quiz/
https://simplestepscode.com/javascript-quiz-tutorial/ (stolen from first page?)
freesound.org
https://www.flaticon.com/
https://wallpapers.com/background/abstract-and-artistic-tile-background-idgwxxk9z0oyx967.html
https://www.etsy.com/listing/1191383415/chakra-balance-meditation-jar
or here? https://www.colorsexplained.com/
https://github.com/jmca

Minecat uses JoyPixels 6.0 Cat With Wry Smile as favicon. Found at: Joypixels. (link)


Basic Improvements (not quite Ice Box)
##Basic Improvements (not quite Ice Box)

list here

Ice Box
##Ice Box

Categories -> after finishing 1st category & seeing score, user can proceed to the other categories & keep updating their total score, rather than only re-starting
Score handling complexity -> instead of only correct/incorrect, have a "maximum amount of points" for guessing correctly the first time, and subtract points for each incorrect guess
Expand Down
4 changes: 4 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ ul#answers-ul{
color: #fff;
}

div#countdown {
background-color: rgb(255, 160, 66);
}

div#player-score {
background-color: rgb(255, 160, 66);
}
Expand Down
11 changes: 11 additions & 0 deletions js/DeadStorage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
// let startTimer = setInterval(function() {
// countdown.textContent = timeLeft + ' seconds remaining.'
// timeLeft -= 1
// if (timeLeft < 0) {
// countdownEl.textContent = 'Finished!'
// confetti.start(500)
// }
// }, 1000)



let currQuestionIdx=0 -> this would icnrement up as we go thru next questions
could also do for let score = 0 -> same idea, to keep adding to score
render question method would put questions into (renderedQuestion)
Expand Down
13 changes: 1 addition & 12 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ const questionsCat2 = Object.values(questionsImportCat2);
const questionsCat3 = Object.values(questionsImportCat3);
// console.log(questionsCat1);


/*------------ Variables ------------*/
let playerScore = 0 // can reset in init or render
let currentQuesIdx = 0
let currQuesCorrAnsIdx // for playerChooseAnswer
let currentCategory // to fix problem in renderQUestion & playerCHoice
let timeLeft = 80 // TIMER
let timeLeft = 80 // TIMER
let timerSeconds, timerInterval

/*---- Cached Element References ----*/
Expand All @@ -40,15 +39,6 @@ btnReset.addEventListener('click', resetGame)

/*------------ Functions ------------*/

// let startTimer = setInterval(function() {
// countdown.textContent = timeLeft + ' seconds remaining.'
// timeLeft -= 1
// if (timeLeft < 0) {
// countdownEl.textContent = 'Finished!'
// confetti.start(500)
// }
// }, 1000)

function startTimer() {
// Reset the timer
timerSeconds = 80;
Expand All @@ -64,7 +54,6 @@ function stopTimer() {
clearInterval(timerInterval);
}


function renderQuestionCat1() {
rulesBtnDiv.style.display = 'none'
currentCategory = 1 // to fix problem at end of playerChooseAnswer
Expand Down
12 changes: 5 additions & 7 deletions js/pseudocode.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
//??
//init function vs reset, not sure what elements needed for what here.


//next:
// //next:
// // move questions into app.js (big array of objects, each object k:v pairs)
// CATEGORIES - separate question array for each (category1, category 2, etc)
// // CATEGORIES - separate question array for each (category1, category 2, etc)
// // fix/finish createQuestionCat1 to print questions & answers one at a time! - w Jackson's help
// // created global varible for current question (outside)
// // create variable for single question, use that variable to print Q
Expand All @@ -29,9 +27,9 @@
// // when user selects category, tagline, rules, & category buttons disappear -> at any point "reset" or init button starts us over
// // reset button / init

// PROBLEM - 'reset game' resets board, but then cant populate any new questions - probably has to do with TypeError that appears after I finish a category
// -line 99! I think ChatGPT came up with a gurd idear! (saved bookmark)
// PROBLEM - FIXED!--I have "rulesBtnDiv.innerHTML" inside function ONLY FOR CATEGORY 1 - but for some reason it activates even if i'm using category 2 - im calling cat1() inside playerAnswer too! DAMMIT! how can i get that global? - FIXED!!! conditional
// // PROBLEM - 'reset game' resets board, but then cant populate any new questions - probably has to do with TypeError that appears after I finish a category
// // -line 99! I think ChatGPT came up with a gurd idear! (saved bookmark)
// // PROBLEM - FIXED!--I have "rulesBtnDiv.innerHTML" inside function ONLY FOR CATEGORY 1 - but for some reason it activates even if i'm using category 2 - im calling cat1() inside playerAnswer too! DAMMIT! how can i get that global? - FIXED!!! conditional

-Check playerScore!! might be a little wonky

Expand Down
144 changes: 98 additions & 46 deletions js/questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,93 +2,145 @@ const questionsImportCat1 = [
{
quesQ: `Fill in the blanks: "Hey, ____ cat spilled that latte all over ____ suitcase."`,
quesAs: [
{ answer: 'be nice', correctAnswer: true },
{ answer: 'be rude', correctAnswer: false },
{ answer: 'be crude', correctAnswer: false },
{ answer: 'be tude', correctAnswer: false },
{ answer: `you're, you're`, correctAnswer: false },
{ answer: `you're, your`, correctAnswer: false },
{ answer: `your, you're`, correctAnswer: false },
{ answer: `your, your`, correctAnswer: true },
]
},
{
quesQ: "Question 2, what's good to do??",
quesQ: `If someone is blocking your walking path forward, your kindest approach would be:`,
quesAs: [
{ answer: '?? people', correctAnswer: false },
{ answer: 'HELP people', correctAnswer: true },
{ answer: 'kill people', correctAnswer: false },
{ answer: 'steal someones car', correctAnswer: false },
{ answer: `"Move it or lose it."`, correctAnswer: false },
{ answer: `"Excuse me."`, correctAnswer: true },
{ answer: `"Where have you been all my life?"`, correctAnswer: false },
{ answer: `Cough loudly and push them out of the way.`, correctAnswer: false },
]
},
{
quesQ: "#3, who's a good person to have around?",
quesQ: `Fill in the blanks: "Uh oh. See those bus drivers over ____? ____ tires have all been slashed - looks like ____ about to brawl with the Uber union."`,
quesAs: [
{ answer: 'bad friend', correctAnswer: false },
{ answer: 'no friend', correctAnswer: false },
{ answer: 'Good friend', correctAnswer: true },
{ answer: 'Donut stealer', correctAnswer: false },
{ answer: `There, their, they're`, correctAnswer: true },
{ answer: `Their, they're, there`, correctAnswer: false },
{ answer: `There, they're, their`, correctAnswer: false },
{ answer: `There, there, their`, correctAnswer: false },
]
},
{
quesQ: `Which option is NOT COOL for service industry / waitstaff?`,
quesAs: [
{ answer: `Tips`, correctAnswer: false },
{ answer: `Human decency`, correctAnswer: false },
{ answer: `Eye contact (non-creepy)`, correctAnswer: false },
{ answer: `Doing an accent to order an ethnic dish`, correctAnswer: true },
]
},
{
quesQ: `Here's a 5th question!`,
quesAs: [
{ answer: `Wrong answer`, correctAnswer: false },
{ answer: `Wrong answer (or is it?)`, correctAnswer: false },
{ answer: `Definitely wrong answer`, correctAnswer: false },
{ answer: `Correct answer`, correctAnswer: true },
]
},
]

const questionsImportCat2 = [
{
quesQ: "CAT 2 question 1 etc etc?",
quesQ: `If a cat is choking, you can perform the Heimlich Maneuver on it.`,
quesAs: [
{ answer: `True`, correctAnswer: true },
{ answer: `False`, correctAnswer: false },
// { answer: ``, correctAnswer: false },
// { answer: ``, correctAnswer: false },
]
},
{
quesQ: `If you find yourself in a car sinking into a body of water, what is the FIRST THING you should attempt?`,
quesAs: [
{ answer: `Rotate steering wheel rapidly.`, correctAnswer: false },
{ answer: `Turn off the engine.`, correctAnswer: false },
{ answer: `Open a window.`, correctAnswer: true },
{ answer: `Try and call Aquaman (saltwater only).`, correctAnswer: false },
]
},
{
quesQ: `If you receive a burn while cooking in the kitchen -- assuming it's not bad enough to necessitate medical assistance -- what should you put on it?`,
quesAs: [
{ answer: 'be nice', correctAnswer: true },
{ answer: 'be rude', correctAnswer: false },
{ answer: 'be crude', correctAnswer: false },
{ answer: 'be tude', correctAnswer: false },
{ answer: `Ice`, correctAnswer: false },
{ answer: `Cold water`, correctAnswer: false },
{ answer: `Cool / room temp water`, correctAnswer: true },
{ answer: `Warm water`, correctAnswer: false },
]
},
{
quesQ: "CAT 2 Question 2, what's good to do??",
quesQ: `Is yellow snow safe to eat?`,
quesAs: [
{ answer: '?? people', correctAnswer: false },
{ answer: 'HELP people', correctAnswer: true },
{ answer: 'kill people', correctAnswer: false },
{ answer: 'steal someones car', correctAnswer: false },
{ answer: `Yes`, correctAnswer: false },
{ answer: `No`, correctAnswer: true },
{ answer: `Not sure, get your little brother to try it`, correctAnswer: false },
// { answer: ``, correctAnswer: false },
]
},
{
quesQ: "CAT 2 #3, who's a good person to have around?",
quesQ: `Here's a 5th question!`,
quesAs: [
{ answer: 'bad friend', correctAnswer: false },
{ answer: 'no friend', correctAnswer: false },
{ answer: 'Good friend', correctAnswer: true },
{ answer: 'Donut stealer', correctAnswer: false },
{ answer: `Wrong answer`, correctAnswer: false },
{ answer: `Wrong answer (or is it?)`, correctAnswer: false },
{ answer: `Definitely wrong answer`, correctAnswer: false },
{ answer: `Correct answer`, correctAnswer: true },
]
},
]

const questionsImportCat3 = [
{
quesQ: "CAT 3 question 1 etc etc?",
quesQ: `When driving on a highway in the U.S., the left-hand lanes are legally intended for _____.`,
quesAs: [
{ answer: `Driving fast.`, correctAnswer: false },
{ answer: `Passing, then returning to a right-hand lane.`, correctAnswer: true },
{ answer: `Passing, then staying in lane.`, correctAnswer: false },
{ answer: `Evading police.`, correctAnswer: false },
]
},
{
quesQ: `After you finish your Arby's Gut Buster with Cream Cheese, you should do this with your trash:`,
quesAs: [
{ answer: 'be nice', correctAnswer: true },
{ answer: 'be rude', correctAnswer: false },
{ answer: 'be crude', correctAnswer: false },
{ answer: 'be tude', correctAnswer: false },
{ answer: `Recycle if possible, otherwise trash it.`, correctAnswer: true },
{ answer: `Toss it on the ground.`, correctAnswer: false },
{ answer: `Give it back to an employee.`, correctAnswer: false },
{ answer: `Leave it on the table for a staff member.`, correctAnswer: false },
]
},
{
quesQ: "CAT 3 Question 2, what's good to do??",
quesQ: `What item is NOT recyclable?`,
quesAs: [
{ answer: '?? people', correctAnswer: false },
{ answer: 'HELP people', correctAnswer: true },
{ answer: 'kill people', correctAnswer: false },
{ answer: 'steal someones car', correctAnswer: false },
{ answer: `A toilet`, correctAnswer: false },
{ answer: `Pizza boxes`, correctAnswer: true },
{ answer: `Crayons`, correctAnswer: false },
{ answer: `Roof shingles`, correctAnswer: false },
]
},
{
quesQ: "CAT 3 #3, who's a good person to have around?",
quesQ: `Here's a 4th question!`,
quesAs: [
{ answer: 'bad friend', correctAnswer: false },
{ answer: 'no friend', correctAnswer: false },
{ answer: 'Good friend', correctAnswer: true },
{ answer: 'Donut stealer', correctAnswer: false },
{ answer: `Wrong answer`, correctAnswer: false },
{ answer: `Wrong answer (or is it?)`, correctAnswer: false },
{ answer: `Definitely wrong answer`, correctAnswer: false },
{ answer: `Correct answer`, correctAnswer: true },
]
},
{
quesQ: `Here's a 5th question!`,
quesAs: [
{ answer: `Wrong answer`, correctAnswer: false },
{ answer: `Wrong answer (or is it?)`, correctAnswer: false },
{ answer: `Definitely wrong answer`, correctAnswer: false },
{ answer: `Correct answer`, correctAnswer: true },
]
},
]



export { questionsImportCat1, questionsImportCat2, questionsImportCat3
}

0 comments on commit a30b074

Please sign in to comment.