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

Fix submission messages to display the full name

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Current Version
    • Fix Version/s: None
    • Component/s: OIOIOI
    • Labels:

      Description

      We do stuff like this (in the order of execution):

          # ...
          submission_statuses.register('WA', _("Wrong Answer"))
          
          class TestReport(models.Model):
              status = EnumField(submission_statuses)
              # ...
          
          # in different file
          submission_statuses.register('MCE', _("Message Count Exceeded"))


      Because of the way EnumField snapshots the registry at construction time,
      TestReport.get_status_display will not be aware of MCE's display name.

      As a result, Zeus statuses (MCE and MSE) display as "MCE"/"MSE" instead of their full name in the tests table on the submission report page.

      Moreover, in the header of submission report page, and on the my submissions page, all statuses (except 'OK', 'ERR' and '?', as those are defined in contests/models.py) show as their acronym (eg. "WA") instead of their full name (i.e. "Wrong Answer")

      This may have something to do with SIO-1600

        Issue Links

          Activity

          Wojciech Dubiel made changes -
          Field Original Value New Value
          Description We do stuff like this (in the order of execution):

          ```
          # ...
          submission_statuses.register('WA', _("Wrong Answer"))

          class TestReport(models.Model):
              status = EnumField(submission_statuses)
              # ...

          # in different file
          submission_statuses.register('MCE', _("Message Count Exceeded"))
          ```

          Because of the way EnumField snapshots the registry at construction time,
          TestReport.get_status_display will not be aware of MCE's display name.

          As a result, Zeus statuses (MCE and MSE) display as "MCE"/"MSE" instead of their full name in the tests table on the submission report page.

          Moreover, in the header of submission report page, and on the my submissions page, all statuses (except 'OK', 'ERR' and '?', as those are defined in contests/models.py) show as their acronym (eg. "WA") instead of their full name (i.e. "Wrong Answer")
          We do stuff like this (in the order of execution):

          <code>
          # ...
          submission_statuses.register('WA', _("Wrong Answer"))

          class TestReport(models.Model):
              status = EnumField(submission_statuses)
              # ...

          # in different file
          submission_statuses.register('MCE', _("Message Count Exceeded"))
          </code>

          Because of the way EnumField snapshots the registry at construction time,
          TestReport.get_status_display will not be aware of MCE's display name.

          As a result, Zeus statuses (MCE and MSE) display as "MCE"/"MSE" instead of their full name in the tests table on the submission report page.

          Moreover, in the header of submission report page, and on the my submissions page, all statuses (except 'OK', 'ERR' and '?', as those are defined in contests/models.py) show as their acronym (eg. "WA") instead of their full name (i.e. "Wrong Answer")
          Wojciech Dubiel made changes -
          Description We do stuff like this (in the order of execution):

          <code>
          # ...
          submission_statuses.register('WA', _("Wrong Answer"))

          class TestReport(models.Model):
              status = EnumField(submission_statuses)
              # ...

          # in different file
          submission_statuses.register('MCE', _("Message Count Exceeded"))
          </code>

          Because of the way EnumField snapshots the registry at construction time,
          TestReport.get_status_display will not be aware of MCE's display name.

          As a result, Zeus statuses (MCE and MSE) display as "MCE"/"MSE" instead of their full name in the tests table on the submission report page.

          Moreover, in the header of submission report page, and on the my submissions page, all statuses (except 'OK', 'ERR' and '?', as those are defined in contests/models.py) show as their acronym (eg. "WA") instead of their full name (i.e. "Wrong Answer")
          We do stuff like this (in the order of execution):

          {code}
          # ...
          submission_statuses.register('WA', _("Wrong Answer"))

          class TestReport(models.Model):
              status = EnumField(submission_statuses)
              # ...

          # in different file
          submission_statuses.register('MCE', _("Message Count Exceeded"))
          {code}

          Because of the way EnumField snapshots the registry at construction time,
          TestReport.get_status_display will not be aware of MCE's display name.

          As a result, Zeus statuses (MCE and MSE) display as "MCE"/"MSE" instead of their full name in the tests table on the submission report page.

          Moreover, in the header of submission report page, and on the my submissions page, all statuses (except 'OK', 'ERR' and '?', as those are defined in contests/models.py) show as their acronym (eg. "WA") instead of their full name (i.e. "Wrong Answer")
          Wojciech Dubiel made changes -
          Description We do stuff like this (in the order of execution):

          {code}
          # ...
          submission_statuses.register('WA', _("Wrong Answer"))

          class TestReport(models.Model):
              status = EnumField(submission_statuses)
              # ...

          # in different file
          submission_statuses.register('MCE', _("Message Count Exceeded"))
          {code}

          Because of the way EnumField snapshots the registry at construction time,
          TestReport.get_status_display will not be aware of MCE's display name.

          As a result, Zeus statuses (MCE and MSE) display as "MCE"/"MSE" instead of their full name in the tests table on the submission report page.

          Moreover, in the header of submission report page, and on the my submissions page, all statuses (except 'OK', 'ERR' and '?', as those are defined in contests/models.py) show as their acronym (eg. "WA") instead of their full name (i.e. "Wrong Answer")
          We do stuff like this (in the order of execution):

              # ...
              submission_statuses.register('WA', _("Wrong Answer"))
              
              class TestReport(models.Model):
                  status = EnumField(submission_statuses)
                  # ...
              
              # in different file
              submission_statuses.register('MCE', _("Message Count Exceeded"))


          Because of the way EnumField snapshots the registry at construction time,
          TestReport.get_status_display will not be aware of MCE's display name.

          As a result, Zeus statuses (MCE and MSE) display as "MCE"/"MSE" instead of their full name in the tests table on the submission report page.

          Moreover, in the header of submission report page, and on the my submissions page, all statuses (except 'OK', 'ERR' and '?', as those are defined in contests/models.py) show as their acronym (eg. "WA") instead of their full name (i.e. "Wrong Answer")

          This may have something to do with SIO-1600
          Szymon Acedański made changes -
          Labels easy
          Piotr Wojtczak made changes -
          Assignee Piotr Wojtczak [ starosta ]
          Hide
          Gerrit Gerrit added a comment -
          Change oioioi~master~I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967, patchset 1
          https://gerrit.sio2project.mimuw.edu.pl/3136

          SIO-2131 Some submission statuses display as internal acronym instead of their full display name

          It turned out that classes that used the submission_statuses registry referenced an early made copy.
          Making those read only properties allowing fetching when accessed resolved the issue.

          Change-Id: I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967
          Show
          Gerrit Gerrit added a comment - Change oioioi~master~I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967, patchset 1 https://gerrit.sio2project.mimuw.edu.pl/3136 SIO-2131 Some submission statuses display as internal acronym instead of their full display name It turned out that classes that used the submission_statuses registry referenced an early made copy. Making those read only properties allowing fetching when accessed resolved the issue. Change-Id: I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967
          Hide
          Gerrit Gerrit added a comment -
          Change oioioi~master~I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967, patchset 2
          https://gerrit.sio2project.mimuw.edu.pl/3136

          SIO-2131 Some submission statuses display as internal acronym instead of their full display name

          It turned out that classes that used the submission_statuses registry referenced an early made copy.
          Making those read only properties allowing fetching when accessed resolved the issue.

          Change-Id: I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967
          Show
          Gerrit Gerrit added a comment - Change oioioi~master~I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967, patchset 2 https://gerrit.sio2project.mimuw.edu.pl/3136 SIO-2131 Some submission statuses display as internal acronym instead of their full display name It turned out that classes that used the submission_statuses registry referenced an early made copy. Making those read only properties allowing fetching when accessed resolved the issue. Change-Id: I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967
          Hide
          Gerrit Gerrit added a comment -
          Change oioioi~master~I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967, patchset 3
          https://gerrit.sio2project.mimuw.edu.pl/3136

          SIO-2131 Fix submission messages to display the full name

          It turned out that classes that used the submission_statuses registry referenced an early made copy.
          Making those read only properties allowing fetching when accessed resolved the issue.

          Change-Id: I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967
          Show
          Gerrit Gerrit added a comment - Change oioioi~master~I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967, patchset 3 https://gerrit.sio2project.mimuw.edu.pl/3136 SIO-2131 Fix submission messages to display the full name It turned out that classes that used the submission_statuses registry referenced an early made copy. Making those read only properties allowing fetching when accessed resolved the issue. Change-Id: I7a9d5b8e9dfc31c6898e67f6c251f594c99e6967
          Piotr Wojtczak made changes -
          Summary Some submission statuses display as internal acronym instead of their full display name. Fix submission messages to display the full name
          Piotr Wojtczak made changes -
          Status New [ 10000 ] Resolved [ 5 ]
          Assignee Piotr Wojtczak [ starosta ] Szymon Acedański [ accek ]
          Resolution Fixed [ 1 ]
          Piotr Wojtczak made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Piotr Wojtczak made changes -
          Link This issue relates to SIO-2132 [ SIO-2132 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          New New Resolved Resolved
          54d 16h 7m 1 Piotr Wojtczak 2019-01-31 13:12
          Resolved Resolved Closed Closed
          13s 1 Piotr Wojtczak 2019-01-31 13:13

            People

            • Assignee:
              Szymon Acedański
              Reporter:
              Wojciech Dubiel
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: