@extends('dashboard::layouts.app') @section('content')
{!! Form::open([ 'class' => 'form question-form', 'route' => ['app.questions.save-answer', $question->number], ]) !!} @include('dashboard::partials.errors') @include('dashboard::partials.session')
@if(isset($showProgress) && $showProgress == true)
@include('hack::frontend.partials.progress', [$progress])
@endif

{{ $question->title }}

@if($question->questionType->name == 'Radio')
@foreach($question->answers as $answer)
{!! Form::radio('value', $answer->id, null, ['class' => 'question-radio']) !!} {{--{!! Form::hidden('answer_type', $answer->question->questionType->name, []) !!}--}} {!! Form::label($answer->title, null, ['class' => 'radio-name']) !!}
@endforeach
@elseif($question->questionType->name == 'Select')
{!! Form::select('value', $question->answers->lists('title', 'id')->toArray(), null, ['class' => 'select-answer']) !!}
{{-- {!! Form::hidden('answer_type', $answers->first()->question->questionType->name, []) !!}--}}
@elseif($question->questionType->name == 'Textarea') @foreach($question->answers as $answer)
{!! Form::textarea('value[' . $answer->id . ']', null, ['class' => 'textarea-answer transition question-textarea', 'placeholder' => 'WRITE YOUR ANSWER HERE']) !!} {{-- {!! Form::hidden('answer_type', $answer->question->questionType->name, []) !!}--}}
@endforeach @elseif($question->questionType->name == 'Checkbox') @elseif($question->questionType->name == 'Statement Importance')
@foreach($question->answers as $answer) @foreach($answer->statements as $key => $statement)

{{ $statement->text }}

{!! Form::text('ranges[' . $key . ']', null, ['class' => '']) !!} {{--
--}} {{--
--}} {{--{!! Form::select('ranges[]', $rangeArray, null, ['class' => 'select-answer']) !!}--}} {{--
--}} {{----}} {{--
--}} {{-- {!! Form::hidden('answer_type', $answers->first()->question->questionType->name, []) !!}--}} {{--
--}} {{--
--}} {{----}}

{{ $statement->text }}

@endforeach @endforeach
@if($question->additional_info) {{----}} {{--dd($question->additional_info);--}} {{--$explodedInfo = explode(',', $question->additional_info);--}} {{--
    --}} {{--@foreach($explodedInfo as $item)--}} {{--
  • --}} {{--{{ $item }}--}} {{--
  • --}} {{--@endforeach--}} {{--
--}}
{{ $question->additional_info }}
@endif @endif
@if($question->number < 13) @if(Auth::user()->reanswer == 1) {!! Form::submit('Save', ['class' => 'form-control-app button-app button-app-two transition pull-right']) !!} @else {!! Form::submit('Next', ['class' => 'form-control-app button-app button-app-two transition pull-right']) !!} @endif @else @if(Auth::user()->reanswer == 1) {!! Form::submit('Save', ['class' => 'form-control-app button-app button-app-two transition pull-right']) !!} @else {!! Form::submit('Finish', ['class' => 'form-control-app button-app button-app-two transition pull-right']) !!} @endif @endif
@endsection