Edited wiki page through web user interface. git-svn-id: http://soc.googlecode.com/svn/wiki@3171 5fae56a1-394a-0410-ba46-5107137fd53f
diff --git a/SurveysModule.wiki b/SurveysModule.wiki index 5e79b58..a9cabed 100644 --- a/SurveysModule.wiki +++ b/SurveysModule.wiki
@@ -25,4 +25,51 @@ * Currently these are done using Google forms. In 2009 OSPO sent an additional survey to examine the relationship between numbers of student applications and quality. * Link to information on EXPANDO! -Surveys, or at least the techniques used to achieve them, could be used more widely to make existing Models extensible. Issue 520 and Issue 100 are related to this. \ No newline at end of file +Surveys, or at least the techniques used to achieve them, could be used more widely to make existing Models extensible. Issue 520 and Issue 100 are related to this. + + += Models = + +There are three model classes used for surveys - Survey, SurveyContent, and SurveyRecord. + +The Survey model describes read/write permissions and metadata of the survey entity, such as whether it is featured, and who has created and edited it. + +The SurveyContent model is a db.Expando() class where each property is the name of a field of the survey, and the value of the property contains information such as the prompt for the question and choices for a selection field. A schema property included in each instance is a dictionary describing what type of question each field is, such as selection (choice), short answer, or long answer. + +The SurveyRecord model is also a db.Expando() class, and each property is the name of a field for the given survey and the value is the supplied answer. The SurveyRecord refers to the user who took the survey and the Survey entity in question. + +Working with db.Expando() classes is mostly very straightforward. Python's getattr() and setattr() method are used to access survey fields since we don't know the name of the property/field in advance. + + += Views = + + +The Survey view and logic mostly inherited from the base classes, with some modifications since the properties saved and retrieved are dynamic in nature. + +There are also classes in views/helper/surveys.py to render widgets used to create, edit, and take surveys, and list survey results. + +The survey listing functionality is significantly modified from the base List class, also because the properties used to generate the list form are not hard-coded into the model class. + + + +== TODO == + +- Export Survey Results to CVS + +- Caching issues to be fixed. For instance, a field will be deleted +from the survey, but will appear in the survey on a page refresh, and +then will disappear once the cache has been cleared. + +- Fields should always be listed in the same order (a dictionary is +now used, so the order gets scrambled) + +- Correct answers can be specified and used to automatically grade the +survey (this is included in the Question model specification - +http://code.google.com/p/soc/wiki/QuestionModel) + +- A lot of refactoring to reduce false dependencies and confirm more +to the style guidelines and existing dynaform workflow. + +- Test Suite + +