Add grader blueprint
This commit is contained in:
parent
db91af5d82
commit
aa4f19d976
1 changed files with 9 additions and 0 deletions
|
@ -111,5 +111,14 @@
|
||||||
var new_grader = ace.edit("new_grader");
|
var new_grader = ace.edit("new_grader");
|
||||||
new_grader.setTheme("ace/theme/tomorrow");
|
new_grader.setTheme("ace/theme/tomorrow");
|
||||||
new_grader.getSession().setMode("ace/mode/python");
|
new_grader.getSession().setMode("ace/mode/python");
|
||||||
|
new_grader.setValue(
|
||||||
|
'flag = "easyctf{FLAG}"\n\n'+
|
||||||
|
'def grade(candidate):\n'+
|
||||||
|
' if candidate == flag:\n'+
|
||||||
|
' return True, "Correct!"\n'+
|
||||||
|
' return False, "Incorrect."\n\n'+
|
||||||
|
'# Return True if the flag is correct, False otherwise, along with\n'+
|
||||||
|
'# a corresponding message to send to the user.'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue