Commit 4dc87546 authored by David Paul's avatar David Paul
Browse files

Add warning outside alert, since some students disable alerts

parent 40090274
......@@ -86,6 +86,7 @@ def display_checks(code):
"""Displays alerts for any check that fails - returns True if all checks pass, False otherwise"""
for check in exercise.checks:
if not check.check(code):
jq("#warning").text(check.text)
alert(check.text)
return False
return True
......@@ -122,6 +123,7 @@ def grade_code():
def code_change(*args):
"""Handles any time the code changes - test results become invalid"""
jq("#warning").text("")
jq("#output-row").addClass("hidden")
jq("#test-row").addClass("hidden")
for test in exercise.tests:
......
......@@ -2,3 +2,7 @@
display: none;
color: red;
}
#warning {
color: red;
}
......@@ -57,6 +57,12 @@ require_once("bower_components/pythonauto/util/lti_util.php");
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<span id="warning"></span>
</div>
</div>
<div class="row hidden" id="output-row">
<div class="col-md-12">
<h3 class="text-center">Output</h3>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment