@@ -97,15 +97,7 @@ def copy_file(self, file, relative_dest):
97
97
SOLUTION_DIR_NAME = "solutions"
98
98
99
99
100
- def export_problem_global_data (self ):
101
- json_file = "problem.json"
102
- vp .print ("Writing '{}'..." .format (json_file ))
103
- PROBLEM_JSON = os .environ .get ('PROBLEM_JSON' )
104
- task_data = load_json (PROBLEM_JSON )
105
-
106
- task_type = task_data ["type" ]
107
- vp .print_var ("task_type" , task_type )
108
-
100
+ def _get_task_type_parameters (self , task_data , task_type ):
109
101
task_type_params = task_data .get ("type_params" , {})
110
102
111
103
if task_type == "Communication" :
@@ -121,6 +113,18 @@ def export_problem_global_data(self):
121
113
compilation_type = "alone"
122
114
task_type_params ["task_type_parameters_Batch_compilation" ] = compilation_type
123
115
116
+ return json .dumps (task_type_params )
117
+
118
+
119
+ def export_problem_global_data (self ):
120
+ json_file = "problem.json"
121
+ vp .print ("Writing '{}'..." .format (json_file ))
122
+ PROBLEM_JSON = os .environ .get ('PROBLEM_JSON' )
123
+ task_data = load_json (PROBLEM_JSON )
124
+
125
+ task_type = task_data ["type" ]
126
+ vp .print_var ("task_type" , task_type )
127
+
124
128
problem_data_dict = {
125
129
"protocol_version" : self .protocol_version ,
126
130
"code" : task_data ["name" ],
@@ -129,7 +133,7 @@ def export_problem_global_data(self):
129
133
"memory_limit" : task_data ["memory_limit" ]* 1024 * 1024 ,
130
134
"score_precision" : task_data .get ("score_precision" , 2 ),
131
135
"task_type" : task_type ,
132
- "task_type_params" : json . dumps ( task_type_params ),
136
+ "task_type_params" : self . _get_task_type_parameters ( task_data , task_type ),
133
137
}
134
138
135
139
problem_data_str = json .dumps (problem_data_dict )
0 commit comments