     end
   end
 
-  def show(conn, %{"id" => id}) do
-    question = Repo.get!(Question, id)
+  def show(conn, %{"id" => _}) do
+    question = conn.assigns[:question]
     render(conn, "show.json", question: question)
   end
 
-  def update(conn, %{"id" => id, "question" => question_params}) do
-    question = Repo.get!(Question, id)
+  def update(conn, %{"id" => _, "question" => question_params}) do
+    question = conn.assigns[:question]
     changeset = Question.changeset(question, question_params)
 
     case Repo.update(changeset) do


    send_resp(conn, :no_content, "")
  end
end

    end
  end

  def delete(conn, %{"id" => _}) do
    question = conn.assigns[:question]

    # Here we use delete! (with a bang) because we expect
    # it to always work (and if it does not, it will raise).
