Completely remove old hints connected to the execution environment
This commit is contained in:
@ -10,14 +10,9 @@ module CodeOcean
|
||||
def create
|
||||
@error = CodeOcean::Error.new(error_params)
|
||||
authorize!
|
||||
hint = Whistleblower.new(execution_environment: @error.execution_environment).generate_hint(@error.message)
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
if hint
|
||||
render(json: {hint: hint})
|
||||
else
|
||||
head (@error.save ? :created : :unprocessable_entity)
|
||||
end
|
||||
head (@error.save ? :created : :unprocessable_entity)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,57 +0,0 @@
|
||||
class HintsController < ApplicationController
|
||||
include CommonBehavior
|
||||
|
||||
before_action :set_execution_environment
|
||||
before_action :set_hint, only: MEMBER_ACTIONS
|
||||
|
||||
def authorize!
|
||||
authorize(@hint || @hints)
|
||||
end
|
||||
private :authorize!
|
||||
|
||||
def create
|
||||
@hint = Hint.new(hint_params)
|
||||
authorize!
|
||||
create_and_respond(object: @hint, path: proc { execution_environment_hint_path(@execution_environment, @hint) })
|
||||
end
|
||||
|
||||
def destroy
|
||||
destroy_and_respond(object: @hint, path: execution_environment_hints_path(@execution_environment))
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def hint_params
|
||||
params[:hint].permit(:locale, :message, :name, :regular_expression).merge(execution_environment_id: @execution_environment.id) if params[:hint].present?
|
||||
end
|
||||
private :hint_params
|
||||
|
||||
def index
|
||||
@hints = @execution_environment.hints.order(:name).paginate(page: params[:page])
|
||||
authorize!
|
||||
end
|
||||
|
||||
def new
|
||||
@hint = Hint.new
|
||||
authorize!
|
||||
end
|
||||
|
||||
def set_execution_environment
|
||||
@execution_environment = ExecutionEnvironment.find(params[:execution_environment_id])
|
||||
end
|
||||
private :set_execution_environment
|
||||
|
||||
def set_hint
|
||||
@hint = Hint.find(params[:id])
|
||||
authorize!
|
||||
end
|
||||
private :set_hint
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def update
|
||||
update_and_respond(object: @hint, params: hint_params, path: execution_environment_hint_path(@execution_environment, @hint))
|
||||
end
|
||||
end
|
@ -128,11 +128,7 @@ class SubmissionsController < ApplicationController
|
||||
# server_sent_event.write({stderr: output[:stderr]}, event: 'output') if output[:stderr]
|
||||
|
||||
# unless output[:stderr].nil?
|
||||
# if hint = Whistleblower.new(execution_environment: @submission.execution_environment).generate_hint(output[:stderr])
|
||||
# server_sent_event.write(hint, event: 'hint')
|
||||
# else
|
||||
# store_error(output[:stderr])
|
||||
# end
|
||||
# store_error(output[:stderr])
|
||||
# end
|
||||
# end
|
||||
|
||||
|
Reference in New Issue
Block a user