app/soc/views/models/grading_project_survey.py
changeset 2745 c45dc8a5d64e
parent 2744 6f5e303f64b5
child 2755 e8b599ba7b37
equal deleted inserted replaced
2744:6f5e303f64b5 2745:c45dc8a5d64e
    69     new_params['logic'] = grading_survey_logic
    69     new_params['logic'] = grading_survey_logic
    70     new_params['rights'] = rights
    70     new_params['rights'] = rights
    71 
    71 
    72     new_params['name'] = "Grading Project Survey"
    72     new_params['name'] = "Grading Project Survey"
    73 
    73 
       
    74     new_params['survey_take_form'] = GradeSurveyTakeForm
       
    75 
    74     # used for sending reminders
    76     # used for sending reminders
    75     new_params['survey_type'] = 'grading'
    77     new_params['survey_type'] = 'grading'
    76 
    78 
    77     new_params['manage_student_project_heading'] = \
    79     new_params['manage_student_project_heading'] = \
    78         'soc/grading_project_survey/list/heading_manage_student_project.html'
    80         'soc/grading_project_survey/list/heading_manage_student_project.html'
    80         'soc/grading_project_survey/list/row_manage_student_project.html'
    82         'soc/grading_project_survey/list/row_manage_student_project.html'
    81 
    83 
    82     params = dicts.merge(params, new_params, sub_merge=True)
    84     params = dicts.merge(params, new_params, sub_merge=True)
    83 
    85 
    84     super(View, self).__init__(params=params)
    86     super(View, self).__init__(params=params)
    85 
       
    86   def _getSurveyTakeForm(self, survey, record, params, post_dict=None):
       
    87     """Returns the specific SurveyTakeForm needed for the take view.
       
    88 
       
    89     For args see survey.View._getSurveyTakeForm().
       
    90 
       
    91     Returns:
       
    92         An instance of GradeSurveyTakeForm.
       
    93     """
       
    94 
       
    95     survey_form = GradeSurveyTakeForm(survey_content=survey.survey_content,
       
    96                                       survey_record=record,
       
    97                                       survey_logic=params['logic'],
       
    98                                       data=post_dict)
       
    99 
       
   100     return survey_form
       
   101 
    87 
   102   def _constructFilterForProjectSelection(self, survey, params):
    88   def _constructFilterForProjectSelection(self, survey, params):
   103     """Returns the filter needed for the Project selection view.
    89     """Returns the filter needed for the Project selection view.
   104 
    90 
   105     Constructs a filter that returns all valid projects for which the current
    91     Constructs a filter that returns all valid projects for which the current