Merge branch 'issue-1-codeharbor-endpoint'
This commit is contained in:
@ -11,6 +11,10 @@ class ExercisesController < ApplicationController
|
||||
before_action :set_file_types, only: [:create, :edit, :new, :update]
|
||||
before_action :set_teams, only: [:create, :edit, :new, :update]
|
||||
|
||||
skip_before_filter :verify_authenticity_token, only: [:import_thin_common_cartridge]
|
||||
skip_after_action :verify_authorized, only: [:import_thin_common_cartridge]
|
||||
skip_after_action :verify_policy_scoped, only: [:import_thin_common_cartridge]
|
||||
|
||||
def authorize!
|
||||
authorize(@exercise || @exercises)
|
||||
end
|
||||
@ -62,6 +66,12 @@ class ExercisesController < ApplicationController
|
||||
def edit
|
||||
end
|
||||
|
||||
def import_thin_common_cartridge
|
||||
logger.info(request.headers['Authorization'])
|
||||
logger.info(request.headers['Authorisation'])
|
||||
render :nothing => true, :status => 200, :content_type => 'text/html'
|
||||
end
|
||||
|
||||
def exercise_params
|
||||
params[:exercise].permit(:description, :execution_environment_id, :file_id, :instructions, :public, :hide_file_tree, :team_id, :title, files_attributes: file_attributes).merge(user_id: current_user.id, user_type: current_user.class.name)
|
||||
end
|
||||
|
@ -41,6 +41,8 @@ Rails.application.routes.draw do
|
||||
resources :hints
|
||||
end
|
||||
|
||||
post '/thin_common_cartridge' => 'exercises#import_thin_common_cartridge'
|
||||
|
||||
resources :exercises do
|
||||
collection do
|
||||
match '', to: 'exercises#batch_update', via: [:patch, :put]
|
||||
|
Reference in New Issue
Block a user