Skip to content

Commit

Permalink
Add new type for creating
Browse files Browse the repository at this point in the history
  • Loading branch information
keweizhan committed Mar 14, 2024
1 parent 4a6a04b commit 74b7c82
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/exercises_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ def create
multiplechoiceprompt = {"multiple_choice_prompt" => msg[:multiple_choice_prompt].clone()}
form_hash["current_version"]["prompts"] << multiplechoiceprompt
form_hash.delete("multiple_choice_prompt")
elsif msg[:question_type].to_i == 4
msg[:parsons_prompt].merge!(msg[:prompt])
form_hash["current_version"]["prompts"] = Array.new
parsonsprompt = {"parsons_prompt" => msg[:parsons_prompt].clone()}
form_hash["current_version"]["prompts"] << parsonsprompt
form_hash.delete("parsons_prompt")
end
form_hash.delete("prompt")
form_hash.delete("exercise_version")
Expand Down

0 comments on commit 74b7c82

Please sign in to comment.