Skip to content

Commit fa97f09

Browse files
committed
Debugging and Modifications
1 parent 105b877 commit fa97f09

File tree

3 files changed

+50
-46
lines changed

3 files changed

+50
-46
lines changed

assets/script.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function showResults() {
3838

3939
const answerContainer = answerContainers[questionNumber];
4040
const selector = `input[name=question${questionNumber}]:checked`;
41-
const userAnswer = (answerContainer.querySelector(selector)|| {}).value;
41+
const userAnswer = (answerContainer.querySelector(selector) || {}).value;
4242

4343
if(userAnswer === currentQuestion.correctAnswer){
4444

@@ -66,7 +66,7 @@ function showSlide(n) {
6666
if(currentSlide === 0) {
6767
previousButton.style.display = 'none';
6868
}
69-
}
69+
7070
else {
7171
previousButton.style.display = 'inline-block';
7272
}
@@ -99,49 +99,49 @@ const myQuestions = [
9999
{
100100
question: "During which period of the Mesozoic Era did the Tyrannosaurus rex live?",
101101
answers: {
102-
a: "Cretaceous"
103-
b: "Jurassic"
104-
c: "Triassic"
102+
a: "Cretaceous",
103+
b: "Jurassic",
104+
c: "Triassic",
105105
d: "None of the Above"
106106
},
107107
correctAnswer: "a"
108108
},
109109
{
110110
question: "More than a hundred years ago, a paleontologist from the American Museum of Natural History discovered the first fossils of <em>Tyrannosaurus rex<em>. Who found the fossils and where?",
111111
answers: {
112-
a: "Luke McMurtrie in Richmond, Virginia"
113-
b: "Barnum Brown in Hell Creek, Montana, U.S.A."
114-
c: "Dr. Ian Malcolm along the coast of the Osa Peninsula, Costa Rica"
112+
a: "Luke McMurtrie in Richmond, Virginia",
113+
b: "Barnum Brown in Hell Creek, Montana, U.S.A.",
114+
c: "Dr. Ian Malcolm along the coast of the Osa Peninsula, Costa Rica",
115115
d: "Dr. John Hammond in the Gobi Desert, Northern China"
116116
},
117117
correctAnswer: "b"
118118
},
119119
{
120120
question: "T.Rex grew much bigger and much faster than humans. How many pounds (kilograms) do scientists maintain they gained per DAY?",
121121
answers: {
122-
a: "1 pound (0.5 kilograms)"
123-
b: "4.6 pounds (2.1 kilograms"
124-
c: "2 pounds (1 kilogram)"
122+
a: "1 pound (0.5 kilograms)",
123+
b: "4.6 pounds (2.1 kilograms",
124+
c: "2 pounds (1 kilogram)",
125125
d: "13 pounds (5.9 kilograms)"
126126
},
127127
correctAnswer: "b"
128128
},
129129
{
130130
question: "What color do paleontologists, scientists and scholars believe the Tyrannosaurus rex was?",
131131
answers: {
132-
a: "We don't know"
133-
b: "Greyish-Blue"
134-
c: "Blood-Red"
132+
a: "We don't know",
133+
b: "Greyish-Blue",
134+
c: "Blood-Red",
135135
d: "Brown"
136136
},
137137
correctAnswer: "a"
138138
},
139139
{
140140
question: "At a goliath 40 feet long and 13 feet tall at the hip, Sue, the largest Tyrannosaurus rex specimen ever discovered, is currently on display at which museum?",
141141
answers: {
142-
a: "Black Hills Institue of Geological Research"
143-
b: "California Museum of Natural History"
144-
c: "The Vatican Museum"
142+
a: "Black Hills Institue of Geological Research",
143+
b: "California Museum of Natural History",
144+
c: "The Vatican Museum",
145145
d: "Field Museum of Natural History in Chicago"
146146
},
147147
correctAnswer: "d"

assets/style.css

+32-28
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,45 @@ h1 {
3030
display: inline-block;
3131
}
3232

33-
34-
35-
html, body, .wrapper {
36-
height: 100%;
37-
margin: 0;
38-
padding: 0;
33+
.answers label {
34+
display: block;
35+
margin-bottom: 10px;
3936
}
4037

38+
button {
39+
font-family: 'Work Sans', sans-serif;
40+
font-size: 21px;
41+
background-color: grey;
42+
color: white;
43+
border: 0px;
44+
border-radius: 3px;
45+
padding: 17px;
46+
cursor: pointer;
47+
margin-bottom: 20px;
48+
}
4149

50+
button:hover {
51+
background-color: yellow;
52+
}
4253

43-
.wrapper {
44-
padding-top: 30px;
45-
padding-left: 20px;
46-
padding-right: 20px;
54+
.slide {
55+
position: absolute;
56+
left: 0px;
57+
top: 0px;
58+
width: 0px;
59+
z-index: 1;
60+
opacity: 0;
61+
transition: opacity 0.5s;
4762
}
4863

49-
header {
50-
text-align: center;
51-
padding: 20px;
52-
padding-top: 0px;
53-
color:rgb(35, 121, 197)
64+
.active-slide {
65+
opacity: 1;
66+
z-index: 2;
5467
}
5568

56-
h2 {
57-
text-align: center;
69+
.quiz-container {
70+
position: relative;
71+
height: 200px;
72+
margin-top: 40px;
5873
}
5974

60-
.card {
61-
background-color: burlywood;
62-
border-radius: 5px;
63-
border-width: 1px;
64-
box-shadow: rgba(0, 0, 0, 0.15) 0px 2px 8px 0px;
65-
color: black;
66-
font-size: 18px;
67-
margin: 0 auto;
68-
max-width: 800px;
69-
padding: 30px 40px;
70-
}

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</head>
1010

1111
<body>
12-
<h1>Tyrannosaurus rex Quiz</h1>
12+
<h1>Tyrannosaurus Rex Timed Quiz</h1>
1313
<div class="quiz-container">
1414
<div id="quiz"></div>
1515
</div>

0 commit comments

Comments
 (0)