diff --git a/src/components/QuizGame.js b/src/components/QuizGame.js
index bbfe640..a3de6d8 100644
--- a/src/components/QuizGame.js
+++ b/src/components/QuizGame.js
@@ -3,21 +3,9 @@ import Grid from '@material-ui/core/Grid';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Quiz from 'react-quiz-component';
-
-/**
- * Shuffles a given array.
- * @param {*} array The array passed in.
- */
-function shuffleArray(array) {
- var j, x, i;
- for (i = array.length - 1; i > 0; i--) {
- j = Math.floor(Math.random() * (i + 1));
- x = array[i];
- array[i] = array[j];
- array[j] = x;
- }
- return array;
-}
+import { Typography } from '@material-ui/core';
+import Button from '@material-ui/core/Button';
+import RefreshIcon from '@material-ui/icons/Refresh';
// Style for the tabs.
const styles = theme => ({
@@ -25,13 +13,45 @@ const styles = theme => ({
flexGrow: 1,
backgroundColor: theme.palette.background.paper,
},
+ button: {
+ margin: theme.spacing.unit,
+ },
+ rightIcon: {
+ marginLeft: theme.spacing.unit,
+ },
});
class QuizGame extends React.Component {
+ /**
+ * Shuffles a given array.
+ * @param {*} array The array passed in.
+ */
+ shuffleArray = array => {
+ let shuffled = array;
+
+ var j, x, i;
+
+ for (i = shuffled.length - 1; i > 0; i--) {
+ j = Math.floor(Math.random() * (i + 1));
+ x = shuffled[i];
+ shuffled[i] = shuffled[j];
+ shuffled[j] = x;
+ }
+
+ return shuffled;
+ }
+
+ reset = () => {
+ this.setState({
+ difficulty: this.pickDifficulty(this.props.difficulty),
+ key: Math.random()
+ });
+ }
+
easy = {
"quizTitle": "Trail Cam Quiz: Easy",
- "questions": shuffleArray([
+ "questions": [
{
"question":