#!/usr/bin/python import sys from server.problems import load_problem if len(sys.argv) < 5: sys.stderr.write('usage: {} programming_language group problem language\n'.format(sys.argv[0])) sys.exit(1) language, group, problem, tail = sys.argv[1:] mod = load_problem(language, group, problem, tail) print('''\ Problem ''') print('

{}

'.format(mod.name)) print('{}'.format(mod.description)) print('
') print('

Plan

') for n, plan in enumerate(mod.plan): print('
') print('

Plan #{}

'.format(n)) if isinstance(plan, list): for i, p_part in enumerate(plan): if isinstance(p_part, dict): p_part = p_part['message'] print(p_part) if i < len(plan)-1: print('
') else: print(plan) print('
') print('
') print('
') print('

Hints

') for id, hint in sorted(mod.hint.items()): print('
') print('

{}

'.format(id)) if isinstance(hint, list): for i, hint_part in enumerate(hint): if isinstance(hint_part, dict): hint_part = hint_part['message'] print(hint_part) if i < len(hint)-1: print('
') else: print(hint) print('
') print('
') print('''\ ''')