Skip to content

Commit

Permalink
latest
Browse files Browse the repository at this point in the history
  • Loading branch information
NatTuck committed Nov 20, 2024
1 parent 77db511 commit 43fc457
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/inkfish/itty/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ defmodule Inkfish.Itty.Server do

def send_block(block, %{uuid: uuid, seq: seq, blocks: blocks} = state) do
blocks = [block | blocks]
IO.puts(" =[Itty]= Send block for UUID #{uuid} #{block.seq}")
# IO.puts(" =[Itty]= Send block for UUID #{uuid} #{block.seq}")
Phoenix.PubSub.broadcast!(Inkfish.PubSub, "ittys:" <> uuid, {:block, uuid, block})
{:noreply, %{state | seq: seq + 1, blocks: blocks}}
end
Expand Down
11 changes: 10 additions & 1 deletion lib/inkfish_web/controllers/sub_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,24 @@ defmodule InkfishWeb.SubController do
|> Map.put("reg_id", reg.id)
|> Map.put("team_id", team.id)

IO.inspect({:sub_params, sub_params})

case Subs.create_sub(sub_params) do
{:ok, sub} ->
GradingTasks.assign_grading_tasks(sub.assignment_id)
IO.inspect({:sub, sub})

try do
GradingTasks.assign_grading_tasks(sub.assignment_id)
rescue
ee -> IO.inspect({:assign_grading, ee})
end

conn
|> put_flash(:info, "Sub created successfully.")
|> redirect(to: Routes.sub_path(conn, :show, sub))

{:error, %Ecto.Changeset{} = changeset} ->
IO.inspect({:error, changeset})
nonce = Base.encode16(:crypto.strong_rand_bytes(32))
token = Phoenix.Token.sign(conn, "upload", %{kind: "sub", nonce: nonce})

Expand Down

0 comments on commit 43fc457

Please sign in to comment.