cms icon indicating copy to clipboard operation
cms copied to clipboard

Cloning a contest

Open gollux opened this issue 6 years ago • 9 comments

Is there a way how to clone a contest? In older versions of CMS, I was used to exporting a contest and importing it again. With CMS 1.3, the import fails because it violates a uniqueness constraint on contest name and if I fix this, then it fails on creating the same users again.

gollux avatar Mar 24 '18 10:03 gollux

[I'll assume you're interested in cloning submissions and other data from a contest already held.]

We don't have an easy way I think. To adapt the contest.json, the easiest way is to add a suffix to Contest.name, Task.name, User.username, and that should be enough to import.

This will create new users, which I don't think it's what you want, but the format of the dump does not allow to refer to users already in the db.

stefano-maggiolo avatar Mar 24 '18 13:03 stefano-maggiolo

[I'll assume you're interested in cloning submissions and other data from a contest already held.]

My use case was this: When our contest was over, I wanted to give the participants an opportunity to inspect full test results and submit corrected solutions, while keeping the official state of the contest intact.

I will try to write a command-line tool for cloning contests.

gollux avatar Mar 24 '18 13:03 gollux

If you're using master there is an analysis mode now that solves exactly that problem. During analysis mode contestants can submit, but their submissions are "unofficial" and don't count towards the score.

stefano-maggiolo avatar Mar 24 '18 13:03 stefano-maggiolo

One pitfall: after you enable analysis mode and make all test cases public, you need to re-run scoring on submissions, otherwise users won't see full results.

andreyv avatar Mar 24 '18 14:03 andreyv

Ah, i didn't realize. Sure we can add an option to see full results of the submissions during analysis (I would guess in some situations you might not want to show full results).

stefano-maggiolo avatar Mar 24 '18 14:03 stefano-maggiolo

That would be useful indeed. It would allow to show results during analysis without altering contest or task state.

However, I think (correct me if I'm wrong) the public/not public part of the outcome is stored in the database after scoring, so changing that might not be trivial.

andreyv avatar Mar 24 '18 15:03 andreyv

I think it should be simple if the switch tells CWS to display the full results instead of the public, instead of changing what was public/private.

stefano-maggiolo avatar Mar 24 '18 16:03 stefano-maggiolo

The following line was intended to make sure the full results are displayed in analysis mode.

https://github.com/cms-dev/cms/blob/91366d87c0c728d22e1ec30e26b09f45dfb120a8/cms/server/contest/templates/submission_row.html#L35

However it fails if you make all the testcases public because then the max public score will be equal to max score and CMS will think there is no need to separate total score and public score.

akmohtashami avatar Mar 24 '18 19:03 akmohtashami

Oh, sorry, what I wrote probably applies more to group score types. This template is used for detailed results: https://github.com/cms-dev/cms/blob/master/cms/grading/ScoreType.py#L200

andreyv avatar Mar 24 '18 19:03 andreyv

Closing as it looks like the original issue is not applicable anymore.

wil93 avatar Nov 27 '22 23:11 wil93