def has_ended(self):
assessment_offered = self.get_assessment_offered()<EOL>now = DateTime.utcnow()<EOL>if self._my_map['<STR_LIT>'] is not None:<EOL><INDENT>return True<EOL><DEDENT>elif assessment_offered.has_deadline() and assessment_offered.has_duration():<EOL><INDENT>if self._my_map['<STR_LIT>'] is None:<EOL><INDENT>return now >= assessment_offered.get_deadline()<EOL><DEDENT>else:<EOL><INDENT>return (now >= assessment_offered.get_deadline() and<EOL>now >= self._my_map['<STR_LIT>'] + assessment_offered.get_duration())<EOL><DEDENT><DEDENT>elif assessment_offered.has_deadline():<EOL><INDENT>return now >= assessment_offered.get_deadline()<EOL><DEDENT>elif assessment_offered.has_duration() and self._my_map['<STR_LIT>'] is not None:<EOL><INDENT>return now >= self._my_map['<STR_LIT>'] + assessment_offered.get_duration()<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
Tests if this assessment has ended.

        return: (boolean) - ``true`` if the assessment has ended,
                ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*