summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-05-22 17:52:25 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-05-22 17:52:25 +0200
commit66bec18794c01545c4451b9a43a29caae81e0b0d (patch)
treea910caf0837d56555672e732542e4d13f80e82db
parent5266ae684cce210de6521644aed0bf6f0fbf1e31 (diff)
Add support for per-problem initial code
-rw-r--r--scripts/build_web_resources.py6
1 files 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)