Cannot submit after changing group

Issue #5 resolved
Gregoire Detrez created an issue

There seems to be a problem if: - a student has an un-submitted submission - changes group - tries to submit again for the same lab

fire.errors.DataInvariantException: The following users already have submissions to this lab: ...

This is due to the fact that the student has already an active (albeit not submitted) submission.

Comments (6)

  1. Evgeny Kotelnikov

    Presence of "un-submitted submissions" seems to cause a lot of trouble. Why do we have them anyway? Since they are not really submissions, may be we should have them as separated entities, say "drafts"?

  2. Gregoire Detrez reporter

    There is a few reason why those exists at the moment. One of them is to have a place to upload new files, for this we could simply have a tmp directory to put the new files and not have a submission written in the database. An other reason is that deadline extension are stored in the submission, so to be able to extend the deadline to a group that has not submitted yet, you need to have those "un-submitted submission". (I started to work on that but I got stuck a bit on too much refactoring...)

    Changing them to draft wouldn't address the problem because there is the explicit "rule" in the system that there cannot be two non-submitted submissions for the same student. I started a discussion on the mailing list about those rules. Maybe we should try to see to that first...

  3. Evgeny Kotelnikov

    Isn't the problem is that submissions are designed to be group-based, but in DB schema they are user-based? That is, to fix the bug we need to remove submitters table and all related code as submissions table already has a group number.

  4. Evgeny Kotelnikov

    After further thoughts — not, it's not that easy. We need to keep track of submitters separately from the group.

    A different thought is that creating an empty submission immediately after visiting the submission page seems a bit strange. What if we only create a submission when a student uploads the first file? That would help things in most cases with this issue and #29.

  5. Evgeny Kotelnikov

    Maintain new submissions invariant (fixes #5)

    New submissions have the following invariant -- all its submitters should belong to its group. It has been violated when the student leaves the group. In such case the student should be removed from all new submissions of his group.

    → <<cset b1bb9b3dabd5>>

  6. Log in to comment