Closed machow closed 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.
Coordinate with cc @rv2e on this
@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.
@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):
[ query_result ]
[ sct ]
payload which contains correct: true
and a congratulatory message.sqlbackend
, which leads to [ query_result, sct ]
.The second usecase (of runSubmit() in Exercise.py is):
[ query_result ]
[ sct ]
payload which contains correct: false
. The message of the SCT contains more info about the mistake the user made.sqlbackend
, which leads to [ query_result, sct ]
.The third usecase of runSumbit() in Exercise.py is:
[ error ]
. [ sct ]
payload which contains correct: false
. The message of the sct contains the error the user made (just copied over from the error
payload), with potentially additional information to fix it (depends on how smart sqlwhat is).[ error, sct ]
in the sqlbackend[ sct ]
. The SCT message will contain the error made anyways.The fourth usecase of runSubmit() in Exercise.py is:
backend-error
. [ backend-error ]
, and, for now, the frontend simply displays it as an incorrect message, so you have access to the error, but at some point we should message this differently. That's up to the frontend to do.I would really do it like this. If it is still not clear, don't build it yet. cc @machow @rv2e
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).
The first comes from the backend, and is passed to test_exercise. The second is from running the SCT.
Should...
test_error
function, which fails if backend sent in an error.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).