diff --git a/_docs/instructor/assignment_configuration/configuration_path.md b/_docs/instructor/assignment_configuration/configuration_path.md index 048c8e90..78e0112d 100644 --- a/_docs/instructor/assignment_configuration/configuration_path.md +++ b/_docs/instructor/assignment_configuration/configuration_path.md @@ -39,6 +39,12 @@ previous uploads below. The uploaded configurations are sequentially numbered b default, but the name may be edited by clicking on the pencil to the left of each configuration. +For simple assignments, this upload may be a single `config.json` file. +For more complex assignments, Submitty also supports C/C++ style +comments and `#include` directives in `config.json`. If you use +`#include`, upload a zip archive that contains `config.json` and the +included files with their relative paths preserved. + ![](/images/config_upload_interface.png) Note: These uploaded configurations are stored in the course directory: @@ -55,6 +61,13 @@ However, repeatedly uploading files through this interface is a tedious workflow to develop and debug complex autograding configurations. +For larger configurations, it is often easier to keep the files in a +course repository and organize the autograding config across multiple +files with `#include`. If a build error references a confusing line +number, compare it against the generated / preprocessed config used +during the build, including any generated config shown in the +instructor build log. + ### Course Autograding Configuration Directory @@ -90,4 +103,4 @@ folders containing a file named 'config.json'. Folders that are found will be displayed in the dropdown menu (prefixed by "DIRECTORY"), as well as warnings if an error is encountered while searching the directory. -![](/images/config_repo_box.png) \ No newline at end of file +![](/images/config_repo_box.png) diff --git a/_docs/instructor/autograding/specification.md b/_docs/instructor/autograding/specification.md index de2a5b8d..0d999a4c 100644 --- a/_docs/instructor/autograding/specification.md +++ b/_docs/instructor/autograding/specification.md @@ -10,7 +10,21 @@ redirect_from: You are allowed to have C/C++ style comments in a `config.json` file. These will be removed before compilation of the autograding -executables. +executables. + +Submitty also supports C/C++ preprocessor `#include` directives in +`config.json`. This can be used to split a large autograding +configuration across multiple files and reuse common fragments across +gradeables. + +If a build or validation error points to a line number that does not +match the file you edited, compare it against the generated / +preprocessed config used during the build. If your build log includes +generated config sections, those files can make debugging much easier. + +See the +[multi-file autograding example](https://github.com/Submitty/Submitty/tree/main/more_autograding_examples/multifile_config_python_greeting) +for a concise example that uses `#include`. * **field:** ``"testcases"`` @@ -268,4 +282,3 @@ executables. * **field:** ``"textboxes"`` **type:** _array of textbox objects_ (Described below) **default value:** ``empty`` -