Added types to model properties and explained how TaskHistory works.

git-svn-id: http://soc.googlecode.com/svn/wiki@3205 5fae56a1-394a-0410-ba46-5107137fd53f
diff --git a/GHOPImplementationDesign.wiki b/GHOPImplementationDesign.wiki
index d9bdc02..6943c61 100644
--- a/GHOPImplementationDesign.wiki
+++ b/GHOPImplementationDesign.wiki
@@ -19,7 +19,7 @@
 
 == Program Admin ==
   * Program Creation View - Already exists (same as GSoC).
-  * Program Configuration View - Will have options to create new task types and new task states, specify lower age limit, timeline for the program and the maximum number of tasks that the student can work simultaneously during the program. None of these fields will be mandatory, so PA can fill it up whenever she has the relevant details.
+  * Program Configuration View - Will have options to create new task types and new task states, specify lower age limit, number of winners and runner-ups, prize to be given for winner and runner-ups, timeline for the program and the maximum number of tasks that the student can work simultaneously during the program. None of these fields will be mandatory, so PA can fill it up whenever she has the relevant details.
   * Organization Applications Review View - (Same as GSoC)
   * Task Quota Limits - PA will be able to assign tasks-limit quotas to Organizations and will be able tune it whenever required. (GSoC slot allocation interfaces can be re-used?)
   
@@ -132,17 +132,17 @@
 == Task ==
 We will be storing a reference to User property which is mandatory and an optional reference to a Student property. So when a particular student claims his first task we just attach the User property to it. However once he completes the task, before it is set to be completed we will enforce to fill in his student profile so we don't lose track of it. This also helps us to show if the task is taken up by a new student. 
 
-  * _user_
-  * _student_
-  * _organization_  
-  * title
-  * description
-  * difficulty (Question: pre-defined or arbitrary?)
-  * time_to_complete
-  * state
-  * type
-  * date_of_creation
-  * date_last_modified
+  * _user_ - *ReferenceProperty(User)*
+  * _student_ - *ReferenceProperty(Student)*
+  * _organization_ - *ReferenceProperty(Organization)*
+  * title - *StringProperty*
+  * description - *StringProperty*
+  * difficulty - *StringProperty* or *StringListProperty* (yet to be decided)
+  * time_to_complete - *IntegerProperty* (As specified in the views this holds the number of hours before the deadline from the moment task was assigned to the student [http://code.google.com/p/soc/wiki/GHOP GHOP requirements] )
+  * state - *StringListProperty* 
+  * type - *StringListProperty*
+  * date_of_creation - *DateTimeProperty*
+  * date_last_modified - *DateTimeProperty*
   
 == TaskHistory ==
 Lennie: This is what I meant by "snapshot of the task at particular instance of time". It can be handled in one of the 2 ways, either store all the property values as it at the moment when one or more values change or just store the value of the property that changes at that time instance before the value was changed and along with that store the timestamp. 
@@ -158,28 +158,61 @@
   * _organization_    
   * title
   * description
-  * difficulty (Question: pre-defined or arbitrary?)
+  * difficulty 
   * time_to_complete
   * state
   * type
   * date_of_creation
   * date_last_modified
-  * timestamp
+  * timestamp - *DateTimeProperty* 
+
+Explanation: Say suppose at this time instance we have a Task entity with the following values:
+  * user: "reference to madhu's user model entity"
+  * student: "reference to madhu's student model entity"
+  * title: "Melange's easiest task"
+  * ...
+  * state: 'Claimed'
+  * ...
+
+Madhu completes his work and marks it as 'NeedsReview' at 20:00HRS November 19th, 2009. The task entity changes to 
+  * user: "reference to madhu's user model entity"
+  * student: "reference to madhu's student model entity"
+  * title: "Melange's easiest task"
+  * ...
+  * state: 'NeedsReview'
+  * ...
+
+When this change in the Task entity occurs we create a new TaskHistory entity with the following values:
+  * task: "reference to the task titled 'Melange's easiest task'"
+  * user: "reference to madhu's user model entity"
+  * student: "reference to madhu's student model entity"
+  * ...
+  * state: 'Claimed'
+  * ...
+  * timestamp: 2000 November 19th, 2009 as a *DateTimeProperty*
+<madhu>
+I am really concerned about the storage space this kind of a model would consume in the datastore.
+</madhu>
+
+
 
 The following models are shared models with GSoC with different OOP. Look at Module Architecture.
 == Organization ==
 
-  * task_quota_limit
-(Question: Since orgs task_quota_limit can be changed during the program, is it necessary to store the history of the changes in this quota limits? Is it necessary for reports)
+  * task_quota_limit - *IntegerProperty* (Pawel: It is not necessary to store the history of changed task quota limits at all)
+
   
 == Student ==
 
   
 == Program ==
-  * student_min_age
-  * number_of_simultaneous_tasks
-  * Winner Prize
-  * Runner-up Prize
+  * student_min_age - *DateTimeProperty* (We are storing the the latest birth date above which a student cannot participate. For example if the contest rule says, "must be 13 years or above on November 1, 2009". We store this is as November 1, 1996 in DateTimeProperty format)
+  * number_of_simultaneous_tasks - *IntegerProperty*  (Configurable in Program Configuration page by Program Admin. For GHOP it is 1, the number of tasks students can work on simultaneously)
+  * Winner Prize - *StringProperty*
+  * Runner-up Prize - *StringProperty*
+Above 2 properties have been under discussion for sometime now. I just wanted to store the prizes that would be given to students as text thats all. Following is an additional field which just shows the number of runner-ups an organization can give. 
+  * number_of_winners - *IntegerProperty*
+  * number_of_runnerups - *IntegerProperty* (Configurable in the Program Configuration page)
   
 == Mentor ==
 
@@ -189,6 +222,12 @@
 
 == Timeline == 
 
+== PrizePerOrg ==
+  This model holds the students who have won the prizes for a particular program instance for each organization.
+  * _program_ - *ReferenceProperty(Program)*
+  * _organization_ - *ReferenceProperty(Organization)*
+  * _winner_ - *ReferenceProperty(Student)*
+  * _runnerups_ - List of *ReferenceProperty(Student)s* (More in the questions at the bottom of the page)
 
 = Task States =
 
@@ -270,4 +309,10 @@
 
 <Pawel>Nope, we don't want anybody to abuse the system that way</Pawel>
 
-<Lennard> Indeed NO, contest rules forbid this </Lennard>
\ No newline at end of file
+<Lennard> Indeed NO, contest rules forbid this </Lennard>
+
+  * Should difficulty level for the tasks be pre-defined or be allowed to arbitrarily set by anyone who adds the task. If they are pre-defined who is going to define them? Program Admin or Org Admin?
+
+  * In PrizePerOrg model Lennie asked me to store the winner and runner-ups ordered. I have planned to store the winner and runner ups separately. Is it necessary that these need to be ordered still? If this kind of split between winner and runner ups is ok do we still need to order the runner ups in some order?
+
+  * If the above properties of winner and runner ups are acceptable, I planned to store the runner ups as a list of *ReferenceProperty* s to Student model, which conceptually boils down to a PrizePerOrg 1:N Student relation and following the rules of Database design this needs to be stored as a reference to PrizePerOrg Model in the Student model. And this kind of design just for being conceptually correct is not making sense to me. I am a bit confused as to what to do here. Can any one suggest me a way out here please?
\ No newline at end of file