Make student profile CSV download a background task, add cohort column

This commit is contained in:
Daniel Friedman
2014-09-26 17:01:04 -04:00
parent bb58e4b3ce
commit ba3f7f9409
17 changed files with 351 additions and 114 deletions

View File

@@ -17,7 +17,8 @@ from instructor_task.tasks import (rescore_problem,
reset_problem_attempts,
delete_problem_state,
send_bulk_course_email,
calculate_grades_csv)
calculate_grades_csv,
calculate_students_features_csv)
from instructor_task.api_helper import (check_arguments_for_rescoring,
encode_problem_and_student_input,
@@ -218,3 +219,17 @@ def submit_calculate_grades_csv(request, course_key):
task_key = ""
return submit_task(request, task_type, task_class, course_key, task_input, task_key)
def submit_calculate_students_features_csv(request, course_key, features):
"""
Submits a task to generate a CSV containing student profile info.
Raises AlreadyRunningError if said CSV is already being updated.
"""
task_type = 'profile_info_csv'
task_class = calculate_students_features_csv
task_input = {'features': features}
task_key = ""
return submit_task(request, task_type, task_class, course_key, task_input, task_key)