Skip to content

Commit c150e67

Browse files
When none of pass-fail, scoring is given, add pass-fail as default.
1 parent b32fc5c commit c150e67

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

webapp/src/Service/ImportProblemService.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,11 @@ public function importZippedProblem(
286286
$yamlProblemProperties['typesAsString'] = ['pass-fail'];
287287
}
288288

289+
if (!in_array('pass-fail', $yamlProblemProperties['typesAsString']) &&
290+
!in_array('scoring', $yamlProblemProperties['typesAsString'])) {
291+
$yamlProblemProperties['typesAsString'][] = 'pass-fail';
292+
}
293+
289294
if (isset($yamlData['validator_flags'])) {
290295
$yamlProblemProperties['special_compare_args'] = $yamlData['validator_flags'];
291296
}

0 commit comments

Comments
 (0)