2016-01-07 08:01:18 +00:00
< div class = "page-header" >
< h1 > Problem Editor< / h1 >
< / div >
2016-01-05 02:12:50 +00:00
2016-01-07 08:40:19 +00:00
< style >
.ace_editor {
width: 100%;
height: 200px;
}
< / style >
2016-01-07 08:01:18 +00:00
< ul class = "nav nav-tabs" role = "tablist" >
< li role = "presentation" class = "active" > < a href = "#problems" aria-controls = "problems" role = "tab" data-toggle = "tab" > Problems< / a > < / li >
< li role = "presentation" > < a href = "#filesystem" aria-controls = "filesystem" role = "tab" data-toggle = "tab" > Filesystem< / a > < / li >
< / ul >
< div class = "tab-content" >
< div role = "tabpanel" class = "tab-pane active" id = "problems" >
< div class = "row" >
< div class = "col-sm-12 col-md-6" >
< div class = "panel-group" id = "problems" role = "tablist" aria-multiselectable = "true" >
< div class = "well" ng-show = "problems.length==0" > There are no problems to show!< / div >
<!-- <div class="panel panel - default">
< div class = "panel-heading" role = "tab" id = "heading-new" >
< h4 class = "panel-title" >
< a class = "NO_HOVER_UNDERLINE_DAMMIT" style = "display:block;" data-toggle = "collapse" data-parent = "#accordion" href = "#collapse-new" aria-expanded = "true" aria-controls = "collapse-new" >
< i class = "fa fa-fw fa-plus" > < / i > Create New Problem
< / a >
< / h4 >
< / div >
< div id = "collapse-new" class = "panel-collapse collapse in" role = "tabpanel" aria-labelledby = "heading-new" >
< div class = "panel-body" >
< / div >
< / div >
< / div > -->
< / div >
< / div >
< div class = "col-sm-12 col-md-6" >
< div class = "panel panel-default" >
< div class = "panel-heading" role = "tab" id = "heading-new" >
< h4 class = "panel-title" >
< i class = "fa fa-fw fa-plus" > < / i > Create New Problem
< / h4 >
< / div >
< div id = "collapse-new" class = "panel-collapse collapse in" role = "tabpanel" aria-labelledby = "heading-new" >
< div class = "panel-body" >
< form class = "form-horizontal" onsubmit = "create_problem(); return false;" id = "create_problem" >
< fieldset >
< div id = "register_msg" > < / div >
< / fieldset >
< fieldset class = "container-fluid" >
2016-01-07 08:40:19 +00:00
< p > Be sure you are familiar with guidelines to writing problems before you submit! Problem unlocking and other options will be available after you submit your problem.< / p >
2016-01-07 08:01:18 +00:00
< div class = "row" >
< div class = "col-sm-12 form-group" >
2016-01-07 08:40:19 +00:00
< label class = "col-sm-12" for = "name" > < small > Title< / small > < / label >
2016-01-07 08:01:18 +00:00
< div class = "col-sm-12" >
2016-01-07 08:40:19 +00:00
< input class = "form-control" type = "text" required name = "name" placeholder = "Title" autocomplete = "off" / >
2016-01-07 08:01:18 +00:00
< / div >
< / div >
< / div >
< div class = "row" >
< div class = "col-sm-12 form-group" >
< label class = "col-sm-12" for = "category" > < small > Category< / small > < / label >
< div class = "col-sm-12" >
< select name = "category" class = "selectpicker" data-width = "100%" >
< option value = "Algorithm" > Algorithm< / option >
< option value = "Binary Exploitation" > Binary Exploitation< / option >
< option value = "Cryptography" > Cryptography< / option >
< option value = "Forensics" > Forensics< / option >
< option value = "Linux" > Linux< / option >
< option value = "Miscellaneous" > Miscellaneous< / option >
< option value = "Programming" > Programming< / option >
< option value = "Reconnaissance" > Reconnaissance< / option >
< option value = "Reverse Engineering" > Reverse Engineering< / option >
< option value = "Web Exploitation" > Web Exploitation< / option >
< / select >
< / div >
< / div >
< / div >
< div class = "row" >
< div class = "col-sm-12 form-group" >
2016-01-07 08:40:19 +00:00
< label class = "col-sm-12" for = "value" > < small > Value< / small > < / label >
2016-01-07 08:01:18 +00:00
< div class = "col-sm-12" >
2016-01-07 08:40:19 +00:00
< input class = "form-control" type = "number" required name = "value" placeholder = "Value" autocomplete = "off" value = "10" / >
2016-01-07 08:01:18 +00:00
< / div >
< / div >
< / div >
< div class = "row" >
< div class = "col-sm-12 form-group" >
2016-01-07 08:40:19 +00:00
< label class = "col-sm-12" for = "description" > < small > Description< / small > < / label >
2016-01-07 08:01:18 +00:00
< div class = "col-sm-12" >
2016-01-07 08:40:19 +00:00
< textarea id = "new_description" name = "description" > < / textarea >
2016-01-07 08:01:18 +00:00
< / div >
< / div >
< / div >
< div class = "row" >
< div class = "col-sm-12 form-group" >
2016-01-07 08:40:19 +00:00
< label class = "col-sm-12" for = "hint" > < small > Hint< / small > < / label >
2016-01-07 08:01:18 +00:00
< div class = "col-sm-12" >
2016-01-07 08:40:19 +00:00
< input class = "form-control" type = "text" required name = "hint" placeholder = "Hint" autocomplete = "off" / >
2016-01-07 08:01:18 +00:00
< / div >
< / div >
< / div >
2016-01-07 08:40:19 +00:00
< div class = "row" >
< div class = "col-sm-12 form-group" >
< label class = "col-sm-12" for = "grader" > < small > Grader< / small > < / label >
< div class = "col-sm-12" >
< div id = "new_grader" class = "ace_editor" > def grade(key, tid):
""" Grade this problem. """
flag = "easyctf{a_flag}"
case_sensitive = True
if (key.find(flag) >= 0) if case_sensitive \
else (key.lower().find(flag.lower()) >= 0):
return { "success": 1, "message": "Correct!" }
return { "success": 0, "message": "Sorry, try again." }< / div >
< / div >
< / div >
< / div >
< div class = "row" >
< div class = "col-sm-12 form-group" >
< center >
< input type = "submit" class = "btn btn-primary btn-lg" value = "Create" / >
< / center >
< / div >
< / div >
2016-01-07 08:01:18 +00:00
< / fieldset >
< / form >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< div role = "tabpanel" class = "tab-pane" id = "filesystem" >
< div class = "well" > Nothing here yet.< / div >
< / div >
< / div >
2016-01-07 00:47:27 +00:00
2016-01-07 08:01:18 +00:00
< script type = "text/javascript" >
$("ul[role=tablist]").tab();
$("a[role=tab]").click(function(e) {
e.preventDefault();
});
$(".selectpicker").selectpicker();
var config = {
toolbar: [
2016-01-07 08:40:19 +00:00
{ name: "basicstyles", items: [ "Bold", "Italic", "Underline" ] },
2016-01-07 08:01:18 +00:00
{ name: "links", items: [ "Link" ] },
{ name: "paragraph", items: [ "NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "Blockquote" ] },
{ name: "tools", items: [ "Maximize" ] },
{ name: "document", items: [ "Source" ] },
]
};
2016-01-07 08:40:19 +00:00
CKEDITOR.replace("new_description", config);
var new_grader = ace.edit("new_grader");
new_grader.setTheme("ace/theme/tomorrow");
new_grader.getSession().setMode("ace/mode/python");
2016-01-07 08:01:18 +00:00
< / script >