Skip to content

Commit

Permalink
fix: edit mode high score fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
manki11 committed Aug 9, 2018
1 parent ef5f691 commit 238a7bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/containers/Players/CLOZEPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,10 @@ class CLOZEPlayer extends Component {
scores.push(score);
times.push(currentTime);

this.props.addScoreTime(id, score, currentTime);

if (goBackToEdit)
this.props.history.push('/edit/cloze', {exercise: exercise});
else
else {
this.props.addScoreTime(id, score, currentTime);
this.props.history.push('/scores', {
scores: scores,
userScore: score,
Expand All @@ -168,6 +167,7 @@ class CLOZEPlayer extends Component {
exercise: exercise,
type: "CLOZE"
});
}
};

timer = () => {
Expand Down
5 changes: 3 additions & 2 deletions src/containers/Players/MCQPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ class MCQPlayer extends Component {
let exercise = this.props.location.state.exercise;
scores.push(currentScore);
times.push(currentTime);
this.props.addScoreTime(id, currentScore, currentTime);

if (goBackToEdit)
this.props.history.push('/edit/mcq', {exercise: exercise});
else
else {
this.props.addScoreTime(id, currentScore, currentTime);
this.props.history.push('/scores', {
scores: scores,
userScore: currentScore,
Expand All @@ -162,6 +162,7 @@ class MCQPlayer extends Component {
exercise: exercise,
type: "MCQ"
});
}
};

render() {
Expand Down
6 changes: 3 additions & 3 deletions src/containers/Players/REORDERPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@ class REORDERPlayer extends Component {
scores.push(score);
times.push(currentTime);

this.props.addScoreTime(id, score, currentTime);

if (goBackToEdit)
this.props.history.push('/edit/reorder', {exercise: exercise});
else
else {
this.props.addScoreTime(id, score, currentTime);
this.props.history.push('/scores', {
scores: scores,
userScore: score,
Expand All @@ -128,6 +127,7 @@ class REORDERPlayer extends Component {
exercise: exercise,
type: "REORDER"
});
}
};

render() {
Expand Down

0 comments on commit 238a7bc

Please sign in to comment.