blob: 4d1660bf96ea7724cc484caf9f8e7797f91c3182 [file]
#summary Design/discussion for Surveys
#labels Importance-Details,Phase-Design,Contents-Draft
<wiki:toc max_depth="3" />
= GSoC Project Info =
|| James Levy || [http://socghop.appspot.com/student_project/show/google/gsoc2009/melange/t124022698643 Project description] ||
= Introduction =
Surveys are used in GSoC for assessing progress of projects at the mid term and end of each GSoC project. There are surveys filled in by students, mentors and organization admins.
Each year the questions asked change slightly.
The intent of surveys is that the program admin can set up the questions and collect the answers.
* Planned Surveys
* Mid term progress (by student)
* Mid term progress (by mentor - determines whether student gets mid-term payment)
* Final survey (by student)
* Final survey (by mentor - determines whether student passes overall)
* Final survey (by admin(s)) - Feedback on orgs participation
* Ad-Hoc surveys
* 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.
= 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 ==
- 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.
- Make sure permissions are working properly, and will work for all of the required use types described above.
- Fields should always be listed in the same order (a dictionary is
now used, so the order gets scrambled) (Update: FIXED)
- When the form doesn't validate, changes to the survey shouldn't be lost.
- List view of survey results might not work well for lots of long answers. (CVS export would help alleviate this)
- Some issues related to limitations and rules. Should the survey taker be limited in the length of their answer, and should the survey maker specify these limits or should they be constants? Should the survey-taker be able to edit their survey after submitting it?
- 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.
- Export Survey Results to CVS
- Test Suite