Skip to content

Commit 52aea2a

Browse files
committed
Fix retrieval of selected choice via response item
1 parent cdf3ff8 commit 52aea2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Models/Question.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public function render(Response $response = null)
2727
$selectedChoice = null;
2828

2929
if ($response) {
30-
$selectedChoice = $this->responseItems()->where('response_id', $response->id)->first();
30+
$responseItem = $this->responseItems()->where('response_id', $response->id)->first();
31+
$selectedChoice = $responseItem->choice;
3132
}
3233

3334
$view = View::make('lmc::question', ['question' => $this, 'selectedChoice' => $selectedChoice]);

0 commit comments

Comments
 (0)