datacamp / sqlwhat

https://sqlwhat.readthedocs.io
GNU Affero General Public License v3.0
3 stars 8 forks source link

Multiple feedback messages when submission has syntax error #53

Closed machow closed 7 years ago

machow commented 7 years ago

The first comes from the backend, and is passed to test_exercise. The second is from running the SCT.

Should...

  1. add test_error function, which fails if backend sent in an error.
  2. ensure that if SCT completes, and there is already an error, then it fails and returns the original error message.

Note that this does not include the case where someone wants an exercise to succeed, even if there is a syntax error (we can always through in an allow_error function if it comes to it, seems unlikely).

filipsch commented 7 years ago

@machow I've made a proposal for this issue in the google doc I've shared with you (not sharing here because this is a public repo); I think this will be the cleanest solution of all other solutions, that requires the least amount of extra work on the campus-app side, and keeps it consistent for the frontend side with other languages.

filipsch commented 7 years ago

Coordinate with cc @rv2e on this

machow commented 7 years ago

@filipsch, okay I've read the proposal and think it makes sense. If I understand it correctly, then the original steps conform to the proposal, yeah? It sounds like I should also make sure the original backend-error stays in the output, so [backend-error, sct-fail] is an acceptable payload. (the frontend would just show the sct message.

filipsch commented 7 years ago

@machow you're confusing error and backend-error I think. backend-error is a real failure of the backend, and is a special case (because the backend should never fail, hopefully).

The first usecase (of runSubmit() in Exercise.py is):

The second usecase (of runSubmit() in Exercise.py is):

The third usecase of runSumbit() in Exercise.py is:

The fourth usecase of runSubmit() in Exercise.py is:

I would really do it like this. If it is still not clear, don't build it yet. cc @machow @rv2e

machow commented 7 years ago

in production w/ implementation of test_error (not that we changed the behavior to communicating error and sct type messages in different places, so did not need to select only one message to display).