Skip to content

Commit

Permalink
Implemented an addition catch to provide more useful feedback from th…
Browse files Browse the repository at this point in the history
…e GFM model in the case of a client error. Ideally these never occur, but it might still be the case. This solves and fixes #26.
  • Loading branch information
TiBiBa authored and TiBiBa committed May 18, 2021
1 parent 42be85d commit 9ab37c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions coursedata/texts/en.yaml
Expand Up @@ -33,6 +33,7 @@ ClientErrorMessages:
Feedback_similar_code: "Similar correct code"
Feedback_new: "What's new"
Feedback_duplicate: "This code is identical!"
Feedback_client_error: "There is a client error... <TODO>"
HedyErrorMessages:
Wrong Level: "That was correct Hedy code, but not at the right level. You wrote code for level {original_level} at level {working_level}."
Incomplete: "Oops! You forgot a bit of code! On line {line_number}, you need to enter text behind {incomplete_command}."
Expand Down
1 change: 1 addition & 0 deletions coursedata/texts/nl.yaml
Expand Up @@ -33,6 +33,7 @@ ClientErrorMessages:
Feedback_similar_code: "Correcte vergelijkbare code"
Feedback_new: "Wat is nieuw"
Feedback_duplicate: "Deze code is hetzelfde!"
Feedback_client_error: "Er is een client error... <TODO>"
HedyErrorMessages:
Wrong Level: "Dat was goede code hoor, maar niet op het goede level. Je schreef code voor level {original_level} op level {working_level}."
Incomplete: "Let op, je bent een stukje code vergeten. Op regel {line_number} moet er achter {incomplete_command} nog tekst komen."
Expand Down
4 changes: 4 additions & 0 deletions static/js/app.js
Expand Up @@ -187,6 +187,10 @@ function runit(level, lang, cb) {
}
runPythonProgram(response.Code, cb).catch(function(err) {
error.show(ErrorMessages.Execute_error, err.message);
if (prev_feedback_level >= 1) { // So now we are at level 2 or higher, necessary to use a prev value
$ ('#feedbackbox .expand-dialog').text("▲ " + GradualErrorMessages.Click_expand + " ▲")
error.showFeedback(ErrorMessages.Feedback_error, ErrorMessages.Feedback_client_error);
}
reportClientError(level, code, err.message);
});
}).fail(function(err) {
Expand Down

0 comments on commit 9ab37c1

Please sign in to comment.