app/soc/models/question.py
changeset 533 ba3309b2fd30
parent 513 3c1e16637ad7
child 1307 091a21cf3627
equal deleted inserted replaced
532:3a50bdfb75a9 533:ba3309b2fd30
    42       which Quizzes might incorporate the Question
    42       which Quizzes might incorporate the Question
    43 
    43 
    44     work.reviews:  even Questions can be "reviewed" (possibly commented
    44     work.reviews:  even Questions can be "reviewed" (possibly commented
    45       on during creation or annotated once put into use).
    45       on during creation or annotated once put into use).
    46 
    46 
    47     work.scope_path:  used to scope (and, when combined with
    47     work.content:  the Question text, asked to the respondent
    48       work.link_id, uniquely identify) a Question in the same way the
    48 
       
    49     linkable.scope:  used to scope (and, when combined with
       
    50       linkable.link_id, uniquely identify) a Question in the same way the
    49       property are used with Documents, etc.
    51       property are used with Documents, etc.
    50 
    52 
    51     work.link_id:  used to identify (and, when combined with
    53     linkable.link_id:  used to identify (and, when combined with
    52       work.scope_path, *uniquely* identify) a Question in the same way
    54       linkable.scope, *uniquely* identify) a Question in the same way
    53       these properties are used with Documents, etc.
    55       these properties are used with Documents, etc.
    54       
       
    55     work.content:  the Question text, asked to the respondent
       
    56 
    56 
    57   In addition to any explicit ReferenceProperties in the Question Model
    57   In addition to any explicit ReferenceProperties in the Question Model
    58   and those inherited as described above, a Question entity participates
    58   and those inherited as described above, a Question entity participates
    59   in these relationships:
    59   in these relationships:
    60 
    60 
    84   ######################################################################
    84   ######################################################################
    85   # TODO(tlarsen): the following verbose comments can be removed later,
    85   # TODO(tlarsen): the following verbose comments can be removed later,
    86     when these ideas are implemented in the views and controllers; they
    86     when these ideas are implemented in the views and controllers; they
    87     are here now so that the concepts will not be lost before that time.
    87     are here now so that the concepts will not be lost before that time.
    88 
    88 
    89   The recommended use for the combination of work.scope_path and
    89   The recommended use for the combination of linkable.scope and
    90   work.link_id is to keep the *same* link_id when copying and
    90   linkable.link_id is to keep the *same* link_id when copying and
    91   modifying an existing Question for a new Program (or instance of a
    91   modifying an existing Question for a new Program (or instance of a
    92   Group that is per-Program), while changing the work.scope_path to
    92   Group that is per-Program), while changing the linkable.scope to
    93   represent the Program and Group "ownership" of the Question.  For
    93   represent the Program and Group "ownership" of the Question.  For
    94   example, if a Question asking about prior GSoC participation needed
    94   example, if a Question asking about prior GSoC participation needed
    95   to have an additional choice (see the choice_ids and choices properties
    95   to have an additional choice (see the choice_ids and choices properties
    96   below), it is desirable to keep the same work.link_id (and also
    96   below), it is desirable to keep the same linkable.link_id (and also
    97   simply append new choice_ids and choices to keep the old answer values
    97   simply append new choice_ids and choices to keep the old answer values
    98   compatible).  An existing Question in the above example might be identified
    98   compatible).  An existing Question in the above example might be identified
    99   as something like:
    99   as something like:
   100     Question:google/gsoc2009/gsoc_past_participation
   100     Question:google/gsoc2009/gsoc_past_participation
   101     <type>:<Sponsor>/<Program>/<link_id> 
   101     <type>:<Sponsor>/<Program>/<link_id> 
   114   combination with GSoC, the gsoc_past_participation Question would be
   114   combination with GSoC, the gsoc_past_participation Question would be
   115   duplicated (unaltered) to something like:
   115   duplicated (unaltered) to something like:
   116     Question:google/ghop2009/gsoc_past_participation
   116     Question:google/ghop2009/gsoc_past_participation
   117   To get the combined results, query on a link_id of
   117   To get the combined results, query on a link_id of
   118   gsoc_past_participation.  For more targeted results, include the
   118   gsoc_past_participation.  For more targeted results, include the
   119   scope_path to make the query more specific.
   119   scope to make the query more specific.
   120 
   120 
   121   Question creation to permit use cases like the one above is going to
   121   Question creation to permit use cases like the one above is going to
   122   be a bit of an "advanced" skill, possibly.  "Doing it wrong" the first
   122   be a bit of an "advanced" skill, possibly.  "Doing it wrong" the first
   123   time a Question is created will make it difficult to implement stuff
   123   time a Question is created will make it difficult to implement stuff
   124   like multiple-choice Questions that "grow" new choices year-over-year.
   124   like multiple-choice Questions that "grow" new choices year-over-year.