Esempio n. 1
0
    def __call__(self, *args):
        exercise_number = args[0]
        working_folder = Path(self._storage.get_working_folder(exercise_number))
        finished_folder = Path(self._storage.get_finished_folder(exercise_number))

        for directory in working_folder.iterdir():
            if directory.name.startswith("."):
                continue

            self.printer.inform()
            self.printer.inform(f"Working in {directory.name}")
            self.printer.inform("Polishing feedback ... ", end='')
            polisher = FeedbackPolisher(
                self._storage,
                directory,
                self.printer
            )
            self.printer.confirm("[Ok]")
            self.printer.inform("Saving meta data   ... ", end='')
            target_directory = finished_folder / directory.name
            polisher.save_meta_to_folder(target_directory)

            feedback_directory = target_directory / "Original and Comments"
            if not feedback_directory.is_dir():
                feedback_directory.mkdir()
            copy_files(directory, feedback_directory, filter_and(filter_name_not_end("Feedback"), filter_name_not_end("submission_meta")))
            self.printer.confirm("[Ok]")
Esempio n. 2
0
 def copy_cross_feedback(self, cross_assignments, submission_muesli_ids, all_next_submissions, target_directory):
     next_cross_submissions = set()
     for solution_by_muesli_id, was_assigned_to_muesli_id in cross_assignments:
         if solution_by_muesli_id in submission_muesli_ids and was_assigned_to_muesli_id in all_next_submissions:
             next_cross_submissions.add(all_next_submissions[was_assigned_to_muesli_id])
     for next_cross_submission in next_cross_submissions:
         # Find files ending with cross[-_]commented.X and copy them over
         cross_target = target_directory / f"Cross by {next_cross_submission.name}"
         if not cross_target.is_dir():
             cross_target.mkdir()
         copy_files(next_cross_submission, cross_target, WorkflowPrepareCommand.FILTER_CROSS_COMMENT)
Esempio n. 3
0
 def copy_own_feedback(self, submission_muesli_ids, all_next_submissions, target_directory):
     next_own_submissions = set()
     for submission_muesli_id in submission_muesli_ids:
         if submission_muesli_id in all_next_submissions:
             next_own_submissions.add(all_next_submissions[submission_muesli_id])
     for next_own_submission in next_own_submissions:
         # Find files ending with commented.X and copy them over
         self_target = target_directory / f"Own feedback by {next_own_submission.name}"
         if not self_target.is_dir():
             self_target.mkdir()
         copy_files(next_own_submission, self_target, WorkflowPrepareCommand.FILTER_SELF_COMMENT)