Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

#173 Replace alert with SnackError for quiz. #184

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

gease
Copy link
Contributor

@gease gease commented May 21, 2022

There is also alert() on error in js/src/components/QuizOptionsHandler.js, but under condition !isQuiz (

onSubmit={!isQuiz && this.onSubmit}
and
alert(Drupal.t('Question submission failed. Please try again.', {}, { context: 'ANU LMS' }));
) - i wonder, if it is reachable at all.

Copy link
Contributor

@kalabro kalabro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onSubmit={!isQuiz && this.onSubmit}

I think this is the case when you add a question paragraph directly into lesson (content type module_lesson + paragraph type question_single_choice / question_multi_choice)

Let me know if I misunderstood your question 😀

show={this.state.alertOpen}
message={Drupal.t('Quiz submission failed. Please try again.', {}, { context: 'ANU LMS' })}
onClose={() => this.setState({ alertOpen: false })}
severity='warning'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gease why did you decide to use warning severity here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you decide to use warning severity here?
Arbitrary choice. Change to whatever you like.

As for QuizOptionsHandler, this component seems to never be rendered. At least i failed to find where it is.

@kalabro ^^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants