Skip to content

Commit

Permalink
show 'wrong' indicator on manage quiz attempts pages (#75)
Browse files Browse the repository at this point in the history
* show 'wrong' indicator on manage quiz attempts pages
* remove unnecessary else-if case
* remove unused method showIncorrectAndUnchecked
  • Loading branch information
Bryan Borgeson authored May 30, 2019
1 parent bd9647a commit 61f1b3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
2 changes: 1 addition & 1 deletion client/js/components/common/checkbox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class CheckBox extends React.Component {
style={styles.checkStyleCorrect}
/>
);
} else if (this.shouldShowAnswerFeedback()) {
} else {
return this.getAnswerIndicator();
}
}
Expand Down
34 changes: 5 additions & 29 deletions client/js/components/common/radio_button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,35 +64,23 @@ export default class RadioButton extends React.Component {
}
}

renderAnswerIndicator() {
if (this.isAnswerPage()) {
return this.getAnswerPageIndicator();
} else if (this.isQuizPage()) {
return this.getQuizPageIndicator();
}
}

isAnswerPage() {
return !this.props.assessmentKind && this.props.isDisabled && this.props.showAsCorrect ? true : false;
}

isQuizPage() {
return this.props.assessmentKind === "formative" || this.props.assessmentKind === "practice" ? true : false;
return this.props.assessmentKind === "formative" || this.props.assessmentKind === "practice";
}

showCorrectAndChecked() {
return this.props.showAsCorrect === true && this.props.checked === true ? true : false;
return this.props.showAsCorrect === true && this.props.checked === true;
}

showIncorrectAndChecked() {
return this.props.showAsCorrect === false && this.props.checked === true ? true : false;
return this.props.showAsCorrect === false && this.props.checked === true;
}

showCorrectAnswerIcon() {
return this.props.showAsCorrect === true ? true : false;
return this.props.showAsCorrect === true;
}

getQuizPageIndicator() {
renderAnswerIndicator() {
if (this.showCorrectAnswerIcon()) {
return (
<img
Expand All @@ -116,18 +104,6 @@ export default class RadioButton extends React.Component {
}
}

getAnswerPageIndicator() {
return (
<img
src="/assets/correct.png"
className="correctIndicator"
aria-label="Correct Answer"
alt="Icon indicating the correct answer"
style={styles.checkStyleCorrect}
/>
);
}

checkedStatus() {
if (!this.props.isDisabled) {
return AssessmentStore.studentAnswers() && AssessmentStore.studentAnswers().indexOf(this.props.item.id) > -1 ? true : null;
Expand Down

0 comments on commit 61f1b3f

Please sign in to comment.