success:@clear_errors_then->alert"Success! Problem attempts reset for problem '#{problem_to_reset}' and student '#{unique_student_identifier}'."
error:std_ajax_err=>@$request_response_error_single.text"Error resetting problem attempts for problem '#{problem_to_reset}' and student '#{unique_student_identifier}'."
error:std_ajax_err=>@$request_response_error_grade.text"Error resetting problem attempts for problem '#{problem_to_reset}' and student '#{unique_student_identifier}'."
# delete state for student on problem
@$btn_delete_state_single.click=>confirm_then
msg:"Delete student '#{@$field_student_select_grade.val()}'s state on problem '#{@$field_problem_select_single.val()}'?"
success:@clear_errors_then->alert"Started rescore problem task for problem '#{problem_to_reset}' and student '#{unique_student_identifier}'. Click the 'Show Background Task History for Student' button to see the status of the task."
error:std_ajax_err=>@$request_response_error_single.text"Error starting a task to rescore problem '#{problem_to_reset}' for student '#{unique_student_identifier}'."
error:std_ajax_err=>@$request_response_error_grade.text"Error starting a task to rescore problem '#{problem_to_reset}' for student '#{unique_student_identifier}'."
error:std_ajax_err=>@$request_response_error_single.text"Error getting task history for student+problem"
error:std_ajax_err=>@$request_response_error_grade.text"Error getting task history for student '#{unique_student_identifier}' and problem '#{problem_to_reset}'."
# start task to reset attempts on problem for all students
@$btn_reset_attempts_all.click=>confirm_then
msg:"Reset attempts for all students on problem '#{@$field_problem_select_all.val()}'?"
ok:=>
@$btn_reset_attempts_all.click=>
problem_to_reset=@$field_problem_select_all.val()
ifnotproblem_to_reset
return@$request_response_error_all.text"Please enter a problem urlname."
ifwindow.confirm"Reset attempts for all students on problem '#{@$field_problem_select_all.val()}'?"
send_data=
all_students:true
problem_to_reset:problem_to_reset
...
...
@@ -236,12 +257,15 @@ class StudentAdmin
data:send_data
success:@clear_errors_then->alert"Successfully started task to reset attempts for problem '#{problem_to_reset}'. Click the 'Show Background Task History for Problem' button to see the status of the task."
error:std_ajax_err=>@$request_response_error_all.text"Error starting a task to reset attempts for all students on this problem."
else
@clear_errors()
# start task to rescore problem for all students
@$btn_rescore_problem_all.click=>confirm_then
msg:"Rescore problem '#{@$field_problem_select_all.val()}' for all students?"
ok:=>
@$btn_rescore_problem_all.click=>
problem_to_reset=@$field_problem_select_all.val()
ifnotproblem_to_reset
return@$request_response_error_all.text"Please enter a problem urlname."
ifwindow.confirm"Rescore problem '#{@$field_problem_select_all.val()}' for all students?"
send_data=
all_students:true
problem_to_reset:problem_to_reset
...
...
@@ -252,6 +276,8 @@ class StudentAdmin
data:send_data
success:@clear_errors_then->alert"Successfully started task to rescore problem '#{problem_to_reset}' for all students. Click the 'Show Background Task History for Problem' button to see the status of the task."
error:std_ajax_err=>@$request_response_error_all.text"Error starting a task to rescore this problem for all students."
else
@clear_errors()
# list task history for problem
@$btn_task_history_all.click=>
...
...
@@ -259,7 +285,7 @@ class StudentAdmin
problem_urlname:@$field_problem_select_all.val()
ifnotsend_data.problem_urlname
return@$request_response_error_all.text"Enter a problem urlname."
return@$request_response_error_all.text"Please enter a problem urlname."
$.ajax
dataType:'json'
...
...
@@ -279,11 +305,18 @@ class StudentAdmin
# wraps a function, but first clear the error displays