app/soc/models/quiz.py
changeset 351 b37fc4c1e189
parent 342 72482d8e5b34
child 385 6d410bf49a82
equal deleted inserted replaced
350:e8f14fde7f0e 351:b37fc4c1e189
    25 from google.appengine.ext import db
    25 from google.appengine.ext import db
    26 
    26 
    27 from django.utils.translation import ugettext_lazy
    27 from django.utils.translation import ugettext_lazy
    28 
    28 
    29 import soc.models.answer
    29 import soc.models.answer
    30 import soc.models.document
       
    31 import soc.models.question
    30 import soc.models.question
       
    31 import soc.models.work
    32 
    32 
    33 
    33 
    34 class Quiz(soc.models.document.Document):
    34 class Quiz(soc.models.work.Work):
    35   """Model of a Quiz, a collection of Questions to be asked.
    35   """Model of a Quiz, a collection of Questions to be asked.
    36   
    36   
    37   (named Quiz because Questionnaire was too much to type...)
    37   (named Quiz because Questionnaire was too much to type...)
    38   
    38   
    39   A Quiz collects a set of Questions to which Answers are given in the
    39   A Quiz collects a set of Questions to which Answers are given in the
    47   Document, and also indirectly from Work, are used with a Quiz are
    47   Document, and also indirectly from Work, are used with a Quiz are
    48   described below.
    48   described below.
    49 
    49 
    50     work.title:  the title of the Quiz
    50     work.title:  the title of the Quiz
    51 
    51 
    52     work.abstract:  summary displayed as a snippet in Quiz list views
       
    53 
       
    54     work.author:  the author of the Work referred to by this relation
    52     work.author:  the author of the Work referred to by this relation
    55       is the author of the Quiz (but not necessarily the individual
    53       is the author of the Quiz (but not necessarily the individual
    56       Questions themselves, see the Question Model)
    54       Questions themselves, see the Question Model)
    57 
    55 
    58     work.reviews:  even Quizzes can be "reviewed" (possibly commented
    56     work.reviews:  even Quizzes can be "reviewed" (possibly commented
    59       on during creation or annotated once put into use).
    57       on during creation or annotated once put into use).
    60 
    58 
    61     work.partial_path/work.link_name: used to scope and uniquely identify
    59     work.partial_path/work.link_name: used to scope and uniquely identify
    62       a Quiz in the same way these properties are used with Documents, etc.
    60       a Quiz in the same way these properties are used with Documents, etc.
    63 
    61 
    64     document.content:  the "preface" of the Quiz, displayed before any
    62     work.content:  the "preface" of the Quiz, displayed before any
    65       of the Questions, usually containing instructions for the Quiz
    63       of the Questions, usually containing instructions for the Quiz
    66 
    64 
    67   In addition to any explicit ReferenceProperties in the Quiz Model and
    65   In addition to any explicit ReferenceProperties in the Quiz Model and
    68   those inherited as described above, a Quiz entity participates in these
    66   those inherited as described above, a Quiz entity participates in these
    69   relationships:
    67   relationships: