diff --git a/README.md b/README.md index fb8a454..1f41f3b 100644 --- a/README.md +++ b/README.md @@ -162,8 +162,8 @@ PDF feedback you can use whichever tool you like, and overwrite the `.pdf.todo` placeholder with the resulting output. If this tool adds files to the feedback directory that you do not want to send to the students, you can add their endings to the config file under the `ignore_feedback_suffix` key. Marking with -Xournal++ is supported by default: Simply add the flag `-x` to the `init` -command above to automatically create the relevant `.xopp` files. +Xournal++ is supported by default: Simply set the value of the `xopp` key in +the config file to `true` to automatically create the relevant `.xopp` files. While writing the feedback, you can keep track of the points the teams get in the file `points.json`. In the case of plagiarism, write `Plagiarism` in the @@ -184,9 +184,9 @@ match up. A json file containing the individual points per student is also generated. In case you need make changes to the markings and rerun the collection step, use -the `-r` flag to overwrite existing feedback archives. If you are using -Xournal++, you can also use the `-x` flag here to automatically export the -`.xopp` files before collecting the feedback. +the `-r` flag to overwrite existing feedback archives. If you use +Xournal++, the `.xopp` files will be exported automatically before collecting +the feedback if the value of the `xopp` key in the config file is set to `true`. ### combine This command is only relevant for the `exercise` marking mode. @@ -238,6 +238,10 @@ LibreOffice. To access this command: `smtp-ext` setup) - `smtp_user`: SMTP user, empty by default (use your short unibas account name for an `smtp-ext` setup) +- `xopp`: if you use Xournal++ for marking, set the value to `true`; the + relevant `xopp` files are then automatically created with the `init` + subcommand and exported with the `collect` subcommand before the feedback + is collected. - `ignore_feedback_suffix`: a list of extensions that should be ignored by the `collect` sub-command; this is useful if the tools you use for marking create files in the feedback folders that you don't want to send to the students diff --git a/krummstab/__init__.py b/krummstab/__init__.py index 7862bd8..b544208 100755 --- a/krummstab/__init__.py +++ b/krummstab/__init__.py @@ -552,8 +552,7 @@ def collect_feedback_files(submission: submissions.Submission, if not feedback_files: logging.critical( - f"Feedback archive for team {submission.root_dir.name} is empty! " - "Did you forget the '-x' flag to export .xopp files?" + f"Feedback archive for team {submission.root_dir.name} is empty!" ) # If there is exactly one pdf in the feedback directory, we do not need to @@ -782,7 +781,7 @@ def collect(_the_config: config.Config, args) -> None: delete_collected_feedback_directories(sheet) else: logging.critical("Aborting 'collect' without overwriting existing collected feedback.") - if args.xopp: + if _the_config.xopp: export_xopp_files(sheet) create_collected_feedback_directories(sheet) for submission in sheet.get_relevant_submissions(): @@ -1380,7 +1379,7 @@ def init(_the_config: config.Config, args) -> None: # . └── submission.json # ├── sheet.json # └── points.json - if args.xopp: + if _the_config.xopp: generate_xopp_files(sheet) diff --git a/krummstab/parsers.py b/krummstab/parsers.py index 7a8a763..635893a 100644 --- a/krummstab/parsers.py +++ b/krummstab/parsers.py @@ -96,13 +96,6 @@ def add_init_command_parser(subparsers): type=int, help="the exercises you have to mark", ) - parser_init.add_argument( - "-x", - "--xopp", - action=argparse.BooleanOptionalAction, - default=False, - help="generate .xopp files", - ) return parser_init @@ -111,13 +104,6 @@ def add_collect_command_parser(subparsers): "collect", help="collect feedback files after marking is done", ) - parser_collect.add_argument( - "-x", - "--xopp", - action=argparse.BooleanOptionalAction, - default=False, - help="export .xopp files", - ) parser_collect.add_argument( "sheet_root_dir", type=pathlib.Path, diff --git a/krummstab/schemas/config-schema.json b/krummstab/schemas/config-schema.json index 735f691..f0a9118 100644 --- a/krummstab/schemas/config-schema.json +++ b/krummstab/schemas/config-schema.json @@ -128,6 +128,9 @@ "smtp_user": { "type": "string" }, + "xopp": { + "type": "boolean" + }, "ignore_feedback_suffix": { "type": "array", "items": { @@ -153,6 +156,7 @@ "smtp_url", "smtp_port", "smtp_user", + "xopp", "ignore_feedback_suffix" ], "if": { diff --git a/tests/config-individual.json b/tests/config-individual.json index f19eafa..b48578d 100644 --- a/tests/config-individual.json +++ b/tests/config-individual.json @@ -6,5 +6,6 @@ "smtp_url": "smtp.unibas.ch", "smtp_port": 25, "smtp_user": "", + "xopp": false, "ignore_feedback_suffix": [ ".xopp" ] }