cms icon indicating copy to clipboard operation
cms copied to clipboard

Added script for cloning an existing task

Open akmohtashami opened this issue 8 years ago • 3 comments

This change is Reviewable

akmohtashami avatar Jun 30 '16 21:06 akmohtashami

What is the use case for this? I recently proposed a cmsImportDataset command (#613) for the use case of needing to change task data (testcases, grader, ...) during a contest.

Also: why does this include so much code from DumpExporter? In order to clone a task it should be enough to just store a copy of: the Dataset, the statement file, and maybe some other things. It shouldn't be necessary to export anything, I think...

wil93 avatar Jun 30 '16 22:06 wil93

You may use this script when you want to use the same task in two or more contests. For example for training purposes or contest's analysis mode(Although hopefully I'll try to implement analysis mode separately soon).

The export and import is actually the same as creating a copy of the task(though it might have one or two additional steps) but for the sake of simplicity of implementation I've used the code in DumpExporter and DumpImporter to create this script. Nothing is exported to a file though.

akmohtashami avatar Jun 30 '16 22:06 akmohtashami

I agree with @wil93, I wouldn't like having this code repeated for everything we want to clone...

I'll give another possibility: we already have a Dataset.clone_from() method, why don't we use that? It should be just a few lines to copy all the direct fields of task, and then a few more to clone the datasets.

stefano-maggiolo avatar Aug 14 '16 16:08 stefano-maggiolo