From 66bec18794c01545c4451b9a43a29caae81e0b0d Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 22 May 2016 17:52:25 +0200 Subject: Add support for per-problem initial code --- scripts/build_web_resources.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/build_web_resources.py b/scripts/build_web_resources.py index f0dc6b1..919ccc1 100644 --- a/scripts/build_web_resources.py +++ b/scripts/build_web_resources.py @@ -76,7 +76,8 @@ problem_common_props = { # for common.py inside the problem subdirectory 'id': None, # database ID of the problem 'number': 1, # display index of problems inside their groups 'visible': True, # whether the problem is enabled (disabled problems are excluded from the application) - 'hint_type': {} # type definitions of problem hints + 'initial': None, # code to put in the editor when the user first opens this problem + 'hint_type': {}, # type definitions of problem hints } languages = {} # programming languages, info from database @@ -258,7 +259,8 @@ try: 'id': common_data['id'], 'identifier': problem_identifier, 'translations': problem_translations, - 'hint_type': hint_type + 'initial': common_data['initial'], + 'hint_type': hint_type, } problem_output_path = os.path.join(group_output_path, problem_identifier) -- cgit v1.2.1