Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pianoQuiz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
norhalimah
pianoQuiz
Commits
08cb2c66
Commit
08cb2c66
authored
Nov 23, 2020
by
norhalimah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
9ab3892d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
321 additions
and
586 deletions
+321
-586
App.js
App.js
+167
-279
q1.js
q1.js
+0
-0
quiz1.js
quiz1.js
+11
-21
quiz10.js
quiz10.js
+11
-22
quiz11.js
quiz11.js
+11
-22
quiz12.js
quiz12.js
+11
-22
quiz13.js
quiz13.js
+11
-22
quiz14.js
quiz14.js
+11
-22
quiz2.js
quiz2.js
+11
-22
quiz3.js
quiz3.js
+11
-22
quiz4.js
quiz4.js
+11
-22
quiz5.js
quiz5.js
+11
-22
quiz6.js
quiz6.js
+11
-22
quiz7.js
quiz7.js
+11
-22
quiz8.js
quiz8.js
+11
-22
quiz9.js
quiz9.js
+11
-22
No files found.
App.js
View file @
08cb2c66
This diff is collapsed.
Click to expand it.
q1.js
deleted
100644 → 0
View file @
9ab3892d
quiz1.js
View file @
08cb2c66
...
...
@@ -23,24 +23,11 @@ const NOTESGG = ['G#'];
const
NOTESAA
=
[
'A#'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
[
navigation
.
navigate
(
'2'
)];
}}
/
>
);
}
export
default
class
Quiz1
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -63,21 +50,26 @@ export default class Quiz1 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'C,D,E,F,G,A,B'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'2'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'2'
);
}
};
...
...
@@ -217,17 +209,15 @@ export default class Quiz1 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz10.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['G#'];
const
NOTESAA
=
[
'A#'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'11'
);
}}
/
>
);
}
export
default
class
Quiz10
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz10 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'B,C#,D#,E,F#,G#,A#'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'11'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'11'
);
}
};
...
...
@@ -218,17 +209,15 @@ export default class Quiz10 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz11.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['G#'];
const
NOTESAA
=
[
'A#'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'12'
);
}}
/
>
);
}
export
default
class
Quiz11
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz11 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'C#,D#,E#,F#,G#,A#,B#'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'12'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'12'
);
}
};
...
...
@@ -218,17 +209,15 @@ export default class Quiz11 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz12.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['Ab'];
const
NOTESAA
=
[
'Bb'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'13'
);
}}
/
>
);
}
export
default
class
Quiz12
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz12 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'Bb,C,D,Eb,F,G,A'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'13'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'13'
);
}
};
...
...
@@ -221,17 +212,15 @@ export default class Quiz12 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz13.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['Ab'];
const
NOTESAA
=
[
'Bb'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'14'
);
}}
/
>
);
}
export
default
class
Quiz13
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz13 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'Ab,Bb,C,Db,Eb,F,G'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'14'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'14'
);
}
};
...
...
@@ -221,17 +212,15 @@ export default class Quiz13 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz14.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['Ab'];
const
NOTESAA
=
[
'Bb'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"FINISH"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'1'
);
}}
/
>
);
}
export
default
class
Quiz14
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz14 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'Gb,Ab,Bb,Cb,Db,F'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'1'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'1'
);
}
};
...
...
@@ -222,17 +213,15 @@ export default class Quiz14 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz2.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['G#'];
const
NOTESAA
=
[
'A#'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'3'
);
}}
/
>
);
}
export
default
class
Quiz2
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz2 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'D,E,F#,G,A,B,C#'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'3'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'3'
);
}
};
...
...
@@ -218,17 +209,15 @@ export default class Quiz2 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz3.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['G#'];
const
NOTESAA
=
[
'A#'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'4'
);
}}
/
>
);
}
export
default
class
Quiz3
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz3 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'E,F#,G#,A,B,C#,D#'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'4'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'4'
);
}
};
...
...
@@ -218,17 +209,15 @@ export default class Quiz3 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz4.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['G#'];
const
NOTESAA
=
[
'A#'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'5'
);
}}
/
>
);
}
export
default
class
Quiz4
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz4 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'F#,G#,A#,B,C#,D#,E#'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'5'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'5'
);
}
};
...
...
@@ -218,17 +209,15 @@ export default class Quiz4 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz5.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['Ab'];
const
NOTESAA
=
[
'Bb'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'6'
);
}}
/
>
);
}
export
default
class
Quiz5
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz5 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'F,G,A,Bb,C,D,E'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'6'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'6'
);
}
};
...
...
@@ -218,17 +209,15 @@ export default class Quiz5 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz6.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['Ab'];
const
NOTESAA
=
[
'Bb'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'7'
);
}}
/
>
);
}
export
default
class
Quiz6
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz6 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'Eb,F,G,Ab,Bb,C,D'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'7'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'7'
);
}
};
...
...
@@ -221,17 +212,15 @@ export default class Quiz6 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz7.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['Ab'];
const
NOTESAA
=
[
'Bb'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'8'
);
}}
/
>
);
}
export
default
class
Quiz7
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz7 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'Db,Eb,F,Gb,Ab,Bb,C'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'8'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'8'
);
}
};
...
...
@@ -221,17 +212,15 @@ export default class Quiz7 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz8.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['G#'];
const
NOTESAA
=
[
'A#'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'9'
);
}}
/
>
);
}
export
default
class
Quiz8
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz8 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'G,A,B,C,D,E,F#'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'9'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'9'
);
}
};
...
...
@@ -218,17 +209,15 @@ export default class Quiz8 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
quiz9.js
View file @
08cb2c66
...
...
@@ -23,25 +23,11 @@ const NOTESGG = ['G#'];
const
NOTESAA
=
[
'A#'
];
const
keywordsList
=
[];
function
NextButton
()
{
const
navigation
=
useNavigation
();
return
(
<
Button
title
=
"NEXT"
color
=
"#E07EF9"
onPress
=
{()
=>
{
navigation
.
navigate
(
'10'
);
}}
/
>
);
}
export
default
class
Quiz9
extends
Component
{
constructor
(
props
:
Object
)
{
super
(
props
);
this
.
state
=
{
timer
:
1
,
timer
:
0
,
correct
:
0
,
wrong
:
0
,
keywordsList
:
''
,
...
...
@@ -64,21 +50,26 @@ export default class Quiz9 extends Component {
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
console
.
log
(
keywordsList
);
this
.
setState
({
timer
:
1
,
timer
:
0
,
});
};
onSubmit
=
()
=>
{
console
.
log
(
keywordsList
.
toString
());
if
(
keywordsList
.
toString
()
===
'A,B,C#,D,E,F#,G#'
)
{
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
}));
this
.
setState
((
prevState
)
=>
({
correct
:
prevState
.
correct
+
1
,
timer
:
0
,
}));
Alert
.
alert
(
'Correct!'
);
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
this
.
props
.
navigation
.
navigate
(
'10'
);
}
else
{
console
.
log
(
'wrong'
);
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
}));
this
.
setState
((
prevState
)
=>
({
wrong
:
prevState
.
wrong
+
2
,
timer
:
0
}));
keywordsList
.
splice
(
0
,
keywordsList
.
length
);
Alert
.
alert
(
'Try Again!'
);
this
.
props
.
navigation
.
navigate
(
'10'
);
}
};
...
...
@@ -219,17 +210,15 @@ export default class Quiz9 extends Component {
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
>
<
Button
title
=
"RESET"
color
=
"#E07EF9"
onPress
=
{
this
.
removeArray
}
/
>
<
/View
>
<
View
style
=
{
styles
.
submit
}
/
>
<
View
style
=
{
styles
.
submit
}
>
<
NextButton
/>
<
Button
title
=
"SUBMIT"
color
=
"#E07EF9"
onPress
=
{
this
.
onSubmit
}
/
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment