Skip to content

Commit 6d280cb

Browse files
committed
fix for workout resolution in OpenDSA (multiple workouts per page)
1 parent 6bca12b commit 6d280cb

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

app/controllers/exercises_controller.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,12 @@ def evaluate
633633
end
634634
end
635635

636-
if @workout_offering && @workout.nil?
637-
@workout = @workout_offering.workout
636+
if @workout.nil?
637+
if @workout_offering
638+
@workout = @workout_offering.workout
639+
elsif params[:workout_id]
640+
@workout = Workout.find_by(id: params[:workout_id])
641+
end
638642
end
639643

640644
if @workout.nil? && session[:current_workout]

app/views/exercises/practice.html.haml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
workout_offering_id: @workout_offering.id,
4242
lti_launch: @lti_launch) : exercise_evaluate_path(@exercise_version.exercise,
4343
exercise_version_id: @exercise_version.id,
44+
workout_id: @workout.andand.id,
4445
feedback_return: true, lti_launch: @lti_launch,
4546
lis_result_sourcedid: @workout_score.andand.lis_result_sourcedid,
4647
lis_outcome_service_url: @workout_score.andand.lis_outcome_service_url)), remote: true do |f|

0 commit comments

Comments
 (0)