Skip to content

Commit

Permalink
Little refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDerval committed Jun 23, 2015
1 parent 1f88132 commit e8e6e82
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions frontend/pages/course_admin/task_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,10 @@ def parse_problem(self, problem_content):
""" Parses a problem, modifying some data """
del problem_content["@order"]

if "headerIsHTML" in problem_content:
problem_content["headerIsHTML"] = True

if "optional" in problem_content:
problem_content["optional"] = True

if "multiple" in problem_content:
problem_content["multiple"] = True

if "centralize" in problem_content:
problem_content["centralize"] = True
# store boolean fields as booleans
for field in ["headerIsHTML", "optional", "multiple", "centralize"]:
if field in problem_content:
problem_content[field] = True

if "choices" in problem_content:
problem_content["choices"] = [val for _, val in sorted(problem_content["choices"].iteritems(), key=lambda x: int(x[0]))]
Expand Down

0 comments on commit e8e6e82

Please sign in to comment.