app/controllers/assignments_controller.rb
#-------------------------------------------------------------------------------------------------------------------
# COPY
# Creates a copy of an assignment along with dates and submission directory
# TODO: need to be tested
#-------------------------------------------------------------------------------------------------------------------
COPY
Creates a copy of an assignment along with dates and submission directory
TODO: need to be tested
COPY Creates a copy of an assignment along with dates and submission directory TODO : need to be tested
def copy
    @user = current_user
    session[:copy_flag] = true
    old_assign = Assignment.find(params[:id])
    new_assign_id = AssignmentForm.copy(params[:id], @user)
    if new_assign_id
      new_assign = Assignment.find(new_assign_id)
      flash[:note] = 'Warning: The submission directory for the copy of this assignment will be the same as the submission directory for the existing assignment. This will allow student submissions to one assignment to overwrite submissions to the other assignment.  If you do not want this to happen, change the submission directory in the new copy of the assignment.' if old_assign.directory_path == new_assign.directory_path
      redirect_to edit_assignment_path new_assign_id
    else
      flash[:error] = 'The assignment was not able to be copied. Please check the original assignment for missing information.'
      redirect_to list_tree_display_index_path
    end
  end
def copy @user = current_user session [ :copy_flag ] = true old_assign = Assignment . find ( params [ :id ] ) new_assign_id = AssignmentForm . copy ( params [ :id ] , @user ) if new_assign_id new_assign = Assignment . find ( new_assign_id ) flash [ :note ] = 'Warning: The submission directory for the copy of this assignment will be the same as the submission directory for the existing assignment. This will allow student submissions to one assignment to overwrite submissions to the other assignment.  If you do not want this to happen, change the submission directory in the new copy of the assignment.' if old_assign . directory_path == new_assign . directory_path redirect_to edit_assignment_path new_assign_id else flash [ :error ] = 'The assignment was not able to be copied. Please check the original assignment for missing information.' redirect_to list_tree_display_index_path end end
COPY
Creates a copy of an assignment along with dates and submission directory
TODO: need to be tested
COPY Creates a copy of an assignment along with dates and submission directory TODO : need to be tested
# check new assignment submission directory and old assignment submission directory