Skip to content

Commit

Permalink
fixes sparse likert and multiple attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Gachuhi committed Jul 12, 2024
1 parent 03d6987 commit 3a38b86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/oli/activities/reports/providers/OliLikert.ex
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ defmodule Oli.Activities.Reports.Providers.OliLikert do
group = Map.get(a, "group")

{:ok, choice} =
Enum.at(choices, r - 1) |> JSONPointer.get("/content/0/children/0/text")
if is_integer(r),
do: Enum.at(choices, r - 1) |> JSONPointer.get("/content/0/children/0/text"),
else: {:ok, ""}

{color, c} =
case Map.get(Map.get(c, :colors), group) do
Expand Down
2 changes: 1 addition & 1 deletion lib/oli/delivery/attempts/core.ex
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ defmodule Oli.Delivery.Attempts.Core do
from(aa in ActivityAttempt,
left_join: aa2 in ActivityAttempt,
on:
aa.resource_attempt_id == aa2.resource_attempt_id and
aa.resource_id == aa2.resource_id and
aa.id < aa2.id,
join: ra in ResourceAttempt,
on: ra.id == aa.resource_attempt_id,
Expand Down

0 comments on commit 3a38b86

Please sign in to comment.