예제 #1
0
파일: views.py 프로젝트: Mankro/mooc-grader
 def children_recursion(parent):
     if not "children" in parent:
         return []
     result = []
     for o in [o for o in parent["children"] if "key" in o]:
         of = _type_dict(o, course.get("exercise_types", {}))
         if "config" in of:
             _, exercise = config.exercise_entry(course["key"], str(of["key"]), '_root')
             of = export.exercise(request, course, exercise, of)
         elif "static_content" in of:
             of = export.chapter(request, course, of)
         of["children"] = children_recursion(o)
         result.append(of)
     return result
예제 #2
0
 def children_recursion(parent):
     if not "children" in parent:
         return []
     result = []
     for o in [o for o in parent["children"] if "key" in o]:
         of = _type_dict(o, course.get("exercise_types", {}))
         if "config" in of:
             _, exercise = config.exercise_entry(course["key"], str(of["key"]), '_root')
             of = export.exercise(request, course, exercise, of)
         elif "static_content" in of:
             of = export.chapter(request, course, of)
         of["children"] = children_recursion(o)
         result.append(of)
     return result