Closed espositodaniele closed 1 year ago
Hi @espositodaniele,
The entry point for all question types is questions/single.blade.php, that's where we populate those two values:
<div class="p-4 border-bottom">
@include(view()->exists("survey::questions.types.{$question->type}")
? "survey::questions.types.{$question->type}"
: "survey::questions.types.text",[
'disabled' => !($eligible ?? true),
'value' => $lastEntry ? $lastEntry->answerFor($question) : null,
'includeResults' => ($lastEntry ?? null) !== null
]
)
</div>
And if you're wondering about $eligible
and $lastEntry
, they're populated by SurveyComposer.php:
public function compose(View $view)
{
$view->with([
'eligible' => $view->survey->isEligible($this->auth->user()),
'lastEntry' => $view->survey->lastEntry(auth()->user()),
]);
}
Hello,
From the example views in the type partial I can see that there are two variables
$value, $disabled
where this are passed throw ?Here is the code snippet:
Thanks