Exemple #1
0
 def __unicode__(self):
     s = u"%s %s %s %s" % (self.course, self.semester.abbr(), EXAM_TYPE.get_name_from_value(self.exam_type), self.number)
     if self.has_solutions:
         s += u" Solutions"
     if self.is_practice:
         s += u" (practice)"
     if self.is_makeup:
         s += u" (makeup)"
     if not self.publishable:
         s += u" (unpublishable)"
     return s
Exemple #2
0
    def get_exam_filename(self):
        if self.complete:
            tokens = [self.course.short_name(), str(self.semester), self.instructor_names, EXAM_TYPE.get_abbr_from_value(self.exam_type, self.exam_type)]
            if self.number not in (None, "", "0"):
                tokens.append(self.number)

            maybe = (('s' if self.has_solutions else '') + ('p' if self.is_practice else '') + ('m' if self.is_makeup else ''))
            if maybe:
                tokens.append(maybe)
            return "__".join(tokens).replace(" ", "-")
        return "AUTO_%.8d" % random.randint(1, 1000000)
Exemple #3
0
 def describe_exam_type(self):
     if self.exam_type == EXAM_TYPE.FINAL:
         return EXAM_TYPE.get_name_from_value(EXAM_TYPE.FINAL)
     else:
         return "%s %s" % (EXAM_TYPE.get_name_from_value(self.exam_type), self.number)