287 |
287 |
288 # update the GradingSurveyGroup with the new timestamp |
288 # update the GradingSurveyGroup with the new timestamp |
289 fields = {'last_update_started': datetime.datetime.now()} |
289 fields = {'last_update_started': datetime.datetime.now()} |
290 survey_group_logic.updateEntityProperties(entity, fields) |
290 survey_group_logic.updateEntityProperties(entity, fields) |
291 |
291 |
292 context['message'] = 'Updating GradingRecords successfully started' |
292 context['message'] = 'Updating GradingRecords successfully started.' |
293 |
293 |
294 if post_dict.get('update_projects'): |
294 if post_dict.get('update_projects'): |
295 # start the task to update all StudentProjects for the given group |
295 # start the task to update all StudentProjects for the given group |
296 task_params = { |
296 task_params = { |
297 'group_key': entity.key().id_or_name()} |
297 'group_key': entity.key().id_or_name()} |
298 task_url = '/tasks/grading_survey_group/update_projects' |
298 task_url = '/tasks/grading_survey_group/update_projects' |
299 |
299 |
300 new_task = taskqueue.Task(params=task_params, url=task_url) |
300 new_task = taskqueue.Task(params=task_params, url=task_url) |
301 new_task.add() |
301 new_task.add() |
302 |
302 |
303 context['message'] = 'Updating StudentProjects successfully started' |
303 context['message'] = 'Updating StudentProjects successfully started.' |
|
304 |
|
305 if post_dict.get('update_projects_and_mail'): |
|
306 # Start the task to update all StudentProjects for the given group and |
|
307 # send out emails. |
|
308 task_params = { |
|
309 'group_key': entity.key().id_or_name(), |
|
310 'send_mail': 'true'} |
|
311 task_url = '/tasks/grading_survey_group/update_projects' |
|
312 |
|
313 new_task = taskqueue.Task(params=task_params, url=task_url) |
|
314 new_task.add() |
|
315 |
|
316 context['message'] = ('Updating StudentProjects successfully started. ' |
|
317 'And sending out e-mail with the results.') |
|
318 |
304 |
319 |
305 list_params = params.copy() |
320 list_params = params.copy() |
306 list_params['logic'] = record_logic |
321 list_params['logic'] = record_logic |
307 list_params['list_heading'] = params['records_heading_template'] |
322 list_params['list_heading'] = params['records_heading_template'] |
308 list_params['list_row'] = params['records_row_template'] |
323 list_params['list_row'] = params['records_row_template'] |