app/controllers/questionnaires_controller.rb
def assign_instructor_id
    # if the user to copy the questionnaire is a TA, the instructor should be the owner instead of the TA
    if session[:user].role.name != "Teaching Assistant"
      session[:user].id
    else # for TA we need to get his instructor id and by default add it to his course for which he is the TA
      Ta.get_my_instructor(session[:user].id)
    end
  end
# Controller for Questionnaire objects
# A Questionnaire can be of several types (QuestionnaireType)
# Each Questionnaire contains zero or more questions (Question)
# Generally a questionnaire is associated with an assignment (Assignment)
Controller for Questionnaire objects
A Questionnaire can be of several types (QuestionnaireType)
Each Questionnaire contains zero or more questions (Question)
Generally a questionnaire is associated with an assignment (Assignment)
Controller for Questionnaire objects A Questionnaire can be of several types ( QuestionnaireType ) Each Questionnaire contains zero or more questions ( Question ) Generally a questionnaire is associated with an assignment ( Assignment )
def assign_instructor_id
    if session[:user].role.name != "Teaching Assistant"
      session[:user].id
    else 
      Ta.get_my_instructor(session[:user].id)
    end
  end
def assign_instructor_id if session [ :user ] . role . name != "Teaching Assistant" session [ :user ] . id else Ta . get_my_instructor ( session [ :user ] . id ) end end
Controller for Questionnaire objects
A Questionnaire can be of several types (QuestionnaireType)
Each Questionnaire contains zero or more questions (Question)
Generally a questionnaire is associated with an assignment (Assignment)
Controller for Questionnaire objects A Questionnaire can be of several types ( QuestionnaireType ) Each Questionnaire contains zero or more questions ( Question ) Generally a questionnaire is associated with an assignment ( Assignment )
# if the user to copy the questionnaire is a TA, the instructor should be the owner instead of the TA # for TA we need to get his instructor id and by default add it to his course for which he is the TA