Skip to content

Commit 9819463

Browse files
author
Martin Krulis
committed
Fixing some bugs.
1 parent e6bdb63 commit 9819463

File tree

4 files changed

+42
-9
lines changed

4 files changed

+42
-9
lines changed

app/helpers/ExerciseConfig/Pipeline/Box/BoxService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function __construct() {
4949
NodeRunBox::$NODE_RUN_TYPE => NodeRunBox::class,
5050
MergeFilesBox::$BOX_TYPE => MergeFilesBox::class,
5151
MergeStringsBox::$BOX_TYPE => MergeStringsBox::class,
52-
FileToArrayBox::$SCALAR_TO_ARRAY_TYPE => FileToArrayBox::class,
53-
StringToArrayBox::$SCALAR_TO_ARRAY_TYPE => StringToArrayBox::class,
52+
FileToArrayBox::$BOX_TYPE => FileToArrayBox::class,
53+
StringToArrayBox::$BOX_TYPE => StringToArrayBox::class,
5454
FilesNamesBox::$BOX_TYPE => FilesNamesBox::class,
5555
CustomCompilationBox::$CUSTOM_COMPILATION_TYPE => CustomCompilationBox::class,
5656
];

app/helpers/ExerciseConfig/Pipeline/Box/Boxes/BisonCompilationBox.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
/**
18-
* Box that comp
18+
* Box that compile Bison format into C/C++ sources.
1919
*/
2020
class BisonCompilationBox extends CompilationBox
2121
{
@@ -27,8 +27,8 @@ class BisonCompilationBox extends CompilationBox
2727
public static $OUTPUT_FILES_PORT_KEY = "output";
2828

2929
private static $initialized = false;
30-
private static $defaultInputPorts;
3130
private static $defaultOutputPorts;
31+
private static $defaultInputPorts;
3232

3333
/**
3434
* Static initializer.
@@ -47,7 +47,6 @@ public static function init() {
4747
}
4848

4949
/**
50-
* JudgeNormalBox constructor.
5150
* @param BoxMeta $meta
5251
*/
5352
public function __construct(BoxMeta $meta) {

app/helpers/ExerciseConfig/Pipeline/Box/Boxes/FileToArrayBox.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,31 @@
1414
*/
1515
class FileToArrayBox extends ScalarToArrayBox
1616
{
17+
public static $BOX_TYPE = "file-to-array";
18+
public static $DEFAULT_NAME = "File to array";
19+
1720
/**
1821
* Static initializer.
1922
* @throws ExerciseConfigException
2023
*/
2124
public static function init() {
22-
self::$SCALAR_TO_ARRAY_TYPE = "file-to-array";
23-
self::$DEFAULT_NAME = "File to array";
2425
static::initScalarToArray(VariableTypes::$FILE_TYPE, VariableTypes::$FILE_ARRAY_TYPE);
2526
}
2627

28+
/**
29+
* Get type of this box.
30+
* @return string
31+
*/
32+
public function getType(): string {
33+
return self::$BOX_TYPE;
34+
}
35+
36+
/**
37+
* Get default name of this box.
38+
* @return string
39+
*/
40+
public function getDefaultName(): string {
41+
return self::$DEFAULT_NAME;
42+
}
43+
2744
}

app/helpers/ExerciseConfig/Pipeline/Box/Boxes/StringToArrayBox.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,31 @@
1414
*/
1515
class StringToArrayBox extends ScalarToArrayBox
1616
{
17+
public static $BOX_TYPE = "string-to-array";
18+
public static $DEFAULT_NAME = "String to array";
19+
1720
/**
1821
* Static initializer.
1922
* @throws ExerciseConfigException
2023
*/
2124
public static function init() {
22-
self::$SCALAR_TO_ARRAY_TYPE = "string-to-array";
23-
self::$DEFAULT_NAME = "String to array";
2425
static::initScalarToArray(VariableTypes::$STRING_TYPE, VariableTypes::$STRING_ARRAY_TYPE);
2526
}
2627

28+
/**
29+
* Get type of this box.
30+
* @return string
31+
*/
32+
public function getType(): string {
33+
return self::$BOX_TYPE;
34+
}
35+
36+
/**
37+
* Get default name of this box.
38+
* @return string
39+
*/
40+
public function getDefaultName(): string {
41+
return self::$DEFAULT_NAME;
42+
}
43+
2744
}

0 commit comments

Comments
 (0)