Skip to content

Commit

Permalink
Update QuestionnaireAnswerService.php (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyfero authored Mar 22, 2024
1 parent d633d1e commit bfacd1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Services/QuestionnaireAnswerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ public function saveAnswer(QuestionnaireModel $questionnaireModel, array $data,
$public = $question && !$question->public_answers
? false
: Config::get(EscolaLmsQuestionnaireServiceProvider::CONFIG_KEY . '.new_answers_visible_by_default', false);

$this
->questionAnswerRepository
->create(
array_merge(
$data,
[
'visible_on_front' => $public,
'visible_on_front' => $public ?? false,
'user_id' => $user->getKey(),
'question_id' => $questionId,
'questionnaire_model_id' => $questionnaireModel->getKey(),
Expand Down

0 comments on commit bfacd1e

Please sign in to comment.