Skip to content

Commit

Permalink
Fix debugging code
Browse files Browse the repository at this point in the history
  • Loading branch information
laike9m committed Nov 27, 2023
1 parent 5f832b2 commit d900b70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion templates/challenge.html
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@
}, 500);
}
document.getElementById("result").innerHTML = json.message;
console.log(json.debug_info);
if (json.debug_info !== undefined) {
console.log(json.debug_info);
}
})
.catch((error) => {
console.error('Error:', error);
Expand Down
4 changes: 3 additions & 1 deletion views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def run_challenge(level: str, name: str):
)
if result.passed:
message = "<h2>✅ Congratulations! You passed the test 🎉</h2>"
return jsonify({"passed": True, "message": message})
return jsonify(
{"passed": True, "message": message, "debug_info": result.debug_info}
)

error_message = "<h2>❌ Challenge failed 😢</h2>"
error_message += f"<p>Error:\n{result.message}</p>"
Expand Down

0 comments on commit d900b70

Please sign in to comment.