|
1 #!/usr/bin/python2.5 |
|
2 # |
|
3 # Copyright 2009 the Melange authors. |
|
4 # |
|
5 # Licensed under the Apache License, Version 2.0 (the "License"); |
|
6 # you may not use this file except in compliance with the License. |
|
7 # You may obtain a copy of the License at |
|
8 # |
|
9 # http://www.apache.org/licenses/LICENSE-2.0 |
|
10 # |
|
11 # Unless required by applicable law or agreed to in writing, software |
|
12 # distributed under the License is distributed on an "AS IS" BASIS, |
|
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 # See the License for the specific language governing permissions and |
|
15 # limitations under the License. |
|
16 |
|
17 """GradingProjectSurveyRecord extends ProjectSurveyRecord to store the grade. |
|
18 """ |
|
19 |
|
20 __authors__ = [ |
|
21 '"Daniel Diniz" <ajaksu@gmail.com>', |
|
22 '"Lennard de Rijk" <ljvderijk@gmail.com>', |
|
23 ] |
|
24 |
|
25 |
|
26 from google.appengine.ext import db |
|
27 |
|
28 from django.utils.translation import ugettext |
|
29 |
|
30 from soc.models.project_survey_record import ProjectSurveyRecord |
|
31 from soc.models.grading_project_survey import GradingProjectSurvey |
|
32 |
|
33 |
|
34 class GradingProjectSurveyRecord(ProjectSurveyRecord): |
|
35 """Grading record for evaluation surveys. |
|
36 |
|
37 Represents the grading part of a evaluation survey group (usually a pair) |
|
38 where the grading (e.g. Mentor's) survey is linked to a non-grading (e.g |
|
39 Student's) one by a project. |
|
40 """ |
|
41 |
|
42 #: The survey for which this entity is a record. |
|
43 grading_survey = db.ReferenceProperty(GradingProjectSurvey, |
|
44 collection_name="grading_survey_records") |
|
45 |
|
46 #: Required grade given to the project that this survey is about. |
|
47 grade = db.BooleanProperty(required=True) |
|
48 |
|
49 def getSurvey(self): |
|
50 """Returns the GradingProjectSurvey that belongs to this record. |
|
51 """ |
|
52 return self.grading_survey |