The SIO2 project
  1. The SIO2 project
  2. SIO-1329

sorting submissions execution time / source code length for admins

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Obsolete
    • Affects Version/s: Current Version
    • Fix Version/s: Far Future
    • Component/s: OIOIOI
    • Labels:
      None

      Description

      It could be useful for contest admins to list the submissions with shortest execution time, for example if they could sort submissions by their maximal execution time among all test cases / sum of execution times on all test cases. Admins could also want to see the submissions with the shortest source code (in bytes) or see only the submissions which scored the maximal amount of points.

        Issue Links

          Activity

          Hide
          Maciej Dębski added a comment - - edited
          Well, every sorting field you mention is a different case :P

          1. score - I believe we shall allow db ordering for scores. I think it
          shall be solved by adding db_order method to ScoreValue, returning
          int, which could be used for sorting. Then, add a field to Submission
          which on save() will be updated from score.db_order. Obviously some
          scores may not implement db_order, ex. always returning None from
          db_order().

          I know we currently use Very Flexible Design For Scores, but it shall
          not prevent us from implementing some useful features where it is
          possible.
          BTW, i cannot think of score which could not be mapped homomorphically to int...

          2. execution time - O.o it could be done pretty easily - you may annotate qs in admin, then sort by annotated. However, we shall decide if we want it, as it costs a bit db work.

          3. source code length - it seems ok to me to add source_length int field to ProgramSubmission and update it on save()

          Caution: 1 and 3 needs not only scheme, but also data migration

          ^ review pls
          Show
          Maciej Dębski added a comment - - edited Well, every sorting field you mention is a different case :P 1. score - I believe we shall allow db ordering for scores. I think it shall be solved by adding db_order method to ScoreValue, returning int, which could be used for sorting. Then, add a field to Submission which on save() will be updated from score.db_order. Obviously some scores may not implement db_order, ex. always returning None from db_order(). I know we currently use Very Flexible Design For Scores, but it shall not prevent us from implementing some useful features where it is possible. BTW, i cannot think of score which could not be mapped homomorphically to int... 2. execution time - O.o it could be done pretty easily - you may annotate qs in admin, then sort by annotated. However, we shall decide if we want it, as it costs a bit db work. 3. source code length - it seems ok to me to add source_length int field to ProgramSubmission and update it on save() Caution: 1 and 3 needs not only scheme, but also data migration ^ review pls
          Hide
          Szymon Acedański added a comment -
          Ad. 2, 3. I think we shouldn't add 2 and 3 to the admin submission view, which is already cluttered. I'd follow the SIO1 solution with separate pages for these stats.

          Ad. 1. Database representations of ScoreValues should be by design naturally orderable (lexicographically), without any extra logic. Then we could use normal ordering in Django. I think this design may not be followed in practice, which I think is worth fixing.
          Show
          Szymon Acedański added a comment - Ad. 2, 3. I think we shouldn't add 2 and 3 to the admin submission view, which is already cluttered. I'd follow the SIO1 solution with separate pages for these stats. Ad. 1. Database representations of ScoreValues should be by design naturally orderable (lexicographically), without any extra logic. Then we could use normal ordering in Django. I think this design may not be followed in practice, which I think is worth fixing.
          Hide
          Szymon Acedański added a comment -
          Ad. 3. The source_length fields sounds good. I'm no sure if the data migration is worth the hassle. Maybe it's ok to make it work only for new submissions.
          Show
          Szymon Acedański added a comment - Ad. 3. The source_length fields sounds good. I'm no sure if the data migration is worth the hassle. Maybe it's ok to make it work only for new submissions.
          Hide
          Maciej Dębski added a comment -
          2,3: it would be extremaly useful to be able to dynamically select visible columns in admin. Unfortunalety django-admin does not support this, maybe it could be added somehow? For sure there exist replacements which does, eg. django-xadmin.

          1. Ok, I will create separate ticket for it.
          3. Ok, I will create separate ticket for adding field.
          Show
          Maciej Dębski added a comment - 2,3: it would be extremaly useful to be able to dynamically select visible columns in admin. Unfortunalety django-admin does not support this, maybe it could be added somehow? For sure there exist replacements which does, eg. django-xadmin. 1. Ok, I will create separate ticket for it. 3. Ok, I will create separate ticket for adding field.
          Hide
          Szymon Acedański added a comment - - edited
          I like this idea: "2,3: it would be extremaly useful to be able to dynamically select visible columns in admin. Unfortunalety django-admin does not support this, maybe it could be added somehow? For sure there exist replacements which does, eg. django-xadmin."

          But I don't know at the moment how to do this or if this is feasible. Unfortunately it doesn't sound like a high enough priority for now. But, maybe there's some easy solution I don't know?
          Show
          Szymon Acedański added a comment - - edited I like this idea: "2,3: it would be extremaly useful to be able to dynamically select visible columns in admin. Unfortunalety django-admin does not support this, maybe it could be added somehow? For sure there exist replacements which does, eg. django-xadmin." But I don't know at the moment how to do this or if this is feasible. Unfortunately it doesn't sound like a high enough priority for now. But, maybe there's some easy solution I don't know?
          Hide
          Szymon Acedański added a comment -
          Sorting by score is already done.
          Show
          Szymon Acedański added a comment - Sorting by score is already done.
          Hide
          Szymon Acedański added a comment -
          This issue has been automatically closed as Obsolete due to no activity for 365 days.

          Feel free to reopen it or create a new one if it's still relevant.
          Show
          Szymon Acedański added a comment - This issue has been automatically closed as Obsolete due to no activity for 365 days. Feel free to reopen it or create a new one if it's still relevant.

            People

            • Assignee:
              Szymon Acedański
              Reporter:
              Bartosz Tarnawski
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: