Skip to content

Commit

Permalink
fix: use custom endpoint for Numbas
Browse files Browse the repository at this point in the history
  • Loading branch information
satikaj authored and ublefo committed Apr 9, 2024
1 parent d5ea0a8 commit 05632a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/api/numbas_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def stream_file_from_zip(zip_path, file_path)
requires :unit_id, type: Integer, desc: 'The unit to modify tasks for'
requires :task_def_id, type: Integer, desc: 'The task definition to get the Numbas test data of'
end
get '/units/:unit_id/task_definitions/:task_def_id/numbas_data/index.html' do
get 'numbas_api/units/:unit_id/task_definitions/:task_def_id/index.html' do
env['api.format'] = :txt
unit = Unit.find(params[:unit_id])
task_def = unit.task_definitions.find(params[:task_def_id])
Expand All @@ -70,7 +70,7 @@ def stream_file_from_zip(zip_path, file_path)
requires :unit_id, type: Integer, desc: 'The unit to modify tasks for'
requires :task_def_id, type: Integer, desc: 'The task definition to get the Numbas test data of'
end
get '/units/:unit_id/task_definitions/:task_def_id/numbas_data/*file_path' do
get 'numbas_api/units/:unit_id/task_definitions/:task_def_id/*file_path' do
env['api.format'] = :txt
unit = Unit.find(params[:unit_id])
task_def = unit.task_definitions.find(params[:task_def_id])
Expand Down

0 comments on commit 05632a2

Please sign in to comment.