:py:mod:`oioioi.mp.score` ========================= .. py:module:: oioioi.mp.score Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.mp.score.FloatScore .. py:class:: FloatScore(value) Bases: :py:obj:`oioioi.contests.scores.ScoreValue` Base class of all classes that represent a score. Subclass :class:`ScoreValue` to implement a custom score. .. py:attribute:: symbol :annotation: = float .. py:attribute:: __rmul__ .. py:method:: __add__(other) Implementation of operator ``+``. Used for example when creating user result for round based on scores from all problems of the round. Must be overridden in all subclasses. .. py:method:: __mul__(other) .. py:method:: __eq__(other) Implementation of operator ``==``. Used to produce ranking, being greater means better result. Must be overridden in all subclasses. .. py:method:: __lt__(other) Implementation of operator ``<``. Used to produce ranking, being greater means better result. Must be overridden in all subclasses. .. py:method:: __str__() Return str(self). .. py:method:: __unicode__() Returns string representing score, suitable to display to the user. Must be overridden in all subclasses. .. py:method:: __repr__() Return repr(self). .. py:method:: _from_repr(value) :classmethod: Creates an instance based on data from :meth:`_to_repr`. Must be overridden in all subclasses. .. py:method:: _to_repr() Returns score data serialized to string, without the class's symbol. Must be overridden in all subclasses. Lexicographical order of serialized data has to correspond to the given by :meth:`__eq__` and :meth:`__lt__`, it will be used for sorting at db level. .. py:method:: to_int()