FOAP-NetMind-2022 / beetlepush

Learn JavaScript array methods
https://beetlepush.vercel.app/
Mozilla Public License 2.0
4 stars 0 forks source link

Feedback after code is executed #45

Closed omiras closed 2 years ago

omiras commented 2 years ago

Description

We need to improve the feedback we give to the user after exercise code is executed.

Requirements

It would be a good idea, after executing the code, give a piece of information about what is just happened. The message could be in the bottom of the app, just below the Instructions and JavaScript Editor area. An easy way to implement this would be using Bootstrap's alert component:

https://getbootstrap.com/docs/5.0/components/alerts/

Exercise is correct

If the exercise is correct, display the evaluation of the exercise Image

User's code throws error

If the user's code generated a syntax or execution error, make him know

Image

There is a place in the code where we can catch the exception's error. Have a look at checlLevelCorrect function.

Image

Exercise not correct

If there is no error, but the exercise is not correct, make him know too.

  1. User tries to solve the first problem, using pop method instead of push method 2.Editor and Instructions section will play the stoke animation
  2. Additionally, display a warning with the value of the variable to be evaluated.

Image

omiras commented 2 years ago

Expect to finish this issue today or tomorrow.

@fataranto @lisis What do you think about design? I am using Bootstrap default colors.

Correct

image

Incorrect

TODO: I will display here the current code for the evaluated variable so the user can check what is the result of the evaluation. image

Error

image

fataranto commented 2 years ago

We're still working on the style guide so don't worry, once you have the functionality finished I can adapt the way the message is displayed