You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: answer_tags_controller.rb
    path of file: ./repos/expertiza/app/controllers
    
    the code of the file until where you have to start completion: class AnswerTagsController < ApplicationController
  include AuthorizationHelper

  protect_from_forgery with: :null_session
  skip_before_action :verify_authenticity_token

  def action_allowed?
    case params[:action]
    when 'index', 'create_edit'
      current_user_has_student_privileges?
    end
  end

  # GET /answer_tags?assignment_id=xx&user_id=xx&questionnaire_id=xx
  def index
    @tag_prompts = []

    tag_deployments = Ta
    
  def index
    @tag_prompts = []

    tag_deployments = TagPromptDeployment.all
    tag_deployments = tag_deployments.where(assignment_id: params[:assignment_id]) if params.key?(:assignment_id)
    tag_deployments = tag_deployments.where(questionnaire_id: params[:questionnaire_id]) if params.key?(:questionnaire_id)

    tag_deployments.each do |tag_dep|
      stored_tags_records = AnswerTag.where(tag_prompt_deployment_id: tag_dep.id)
      stored_tags_records = stored_tags_records.where(user_id: params[:user_id]) if params.key?(:user_id)
      stored_tags_records.each do |stored_tag|
        @tag_prompts.append stored_tag
      end
    end

    render json: @tag_prompts
  end