Minor fixes to problem updating

This commit is contained in:
James Wang 2016-01-03 18:12:07 +00:00
parent fa56204d0e
commit 6e6c35a222
2 changed files with 4 additions and 3 deletions

View file

@ -80,6 +80,7 @@ def problem_update():
problem = Problems.query.filter_by(pid=pid).first() problem = Problems.query.filter_by(pid=pid).first()
if problem: if problem:
problem.name = name problem.name = name
problem.category = category
problem.description = description problem.description = description
problem.hint = hint problem.hint = hint
problem.flag = flag problem.flag = flag

View file

@ -27,15 +27,15 @@ function render_problems() {
<br><br> <br><br>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<input type="text" name="flag" placeholder="Flag" autocomplete="off" class="form-control"> <input type="text" name="flag" placeholder="Flag" autocomplete="off" class="form-control" value="` + data[i]["flag"] + `">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<input type="text" name="hint" placeholder="Hint" autocomplete="off" class="form-control"> <input type="text" name="hint" placeholder="Hint" autocomplete="off" class="form-control" value="` + data[i]["hint"] + `">
</div> </div>
</div> </div>
<br> <br>
<div class="row"> <div class="row">
<input type="number" name="value" placeholder="Value" autocomplete="off" class="form-control-number"> <input type="number" name="value" placeholder="Value" autocomplete="off" class="form-control-number" value="` + data[i]["value"] + `">
<label><input type="checkbox" name="disabled" value="1"` + checked + `>Disabled</label> <label><input type="checkbox" name="disabled" value="1"` + checked + `>Disabled</label>
</div> </div>
</div> </div>