@extends('admin.layouts.master') @section('content')
{!! Form::model($row,[ 'method' => 'PUT', 'route' => [\App\Helpers\Helper::adminPrefix() . '.update', $row], 'name' => 'user-form', 'id' => 'user-form', 'autocomplete' => 'off' ]) !!}

{{ __('Edit') }} {{ \App\Helpers\Helper::pagePrefix(2) }}

Cancel
{!! Form::label('title', 'Title :', ['class' => 'control-label']) !!} {!! Form::textarea('title', old('title', $row->title), ['class' => $errors->has('title') ? 'form-control is-invalid' : 'form-control', 'id' => 'title', 'placeholder' => 'Question', 'rows' => 8]) !!} @if ($errors->has('title')) {{ $errors->first('title') }} @endif
{!! Form::label('status', 'Active :', ['class' => 'control-label']) !!}
{!! Form::radio('status', '1', ($row->active == 1 ? true : false), ['id' => 'statuson']) !!} {!! Form::label('statuson', 'Yes') !!}
{!! Form::radio('status', '0', ($row->active != 1 ? true : false), ['id' => 'statusoff']) !!} {!! Form::label('statusoff', 'No') !!}
{!! Form::label('point', 'Point :', ['class' => 'control-label']) !!} {!! Form::number('point', old('point', $row->point), ['class' => $errors->has('point') ? 'form-control is-invalid' : 'form-control', 'id' => 'point']) !!} @if ($errors->has('point')) {{ $errors->first('point') }} @endif
@if ($errors->has('correct'))
{{ $errors->first('correct') }}
@endif
@foreach ($row->options as $option)
{!! Form::label('choice['.$option->id.']', 'Choice'.$option->id.' :', ['class' => 'control-label']) !!} {!! Form::text('choice['.$option->id.']', old('choice['.$option->id.']', $option->title), ['class' => $errors->has('choice.'.$option->id) ? 'form-control is-invalid' : 'form-control', 'id' => 'choice'.$option->id, 'placeholder' => 'Choice '.$option->id]) !!} @if ($errors->has('choice.'.$option->id)) {{ $errors->first('choice.'.$option->id) }} @endif
{!! Form::label('correct['.$option->id.']', 'Correct :', ['class' => 'control-label']) !!}
{!! Form::radio('correct['.$option->id.']', '1', ($option->correct == 1 ? true : false), ['id' => 'correct'.$option->id.'on', '']) !!} {!! Form::label('correct'.$option->id.'on', 'Yes') !!}
@endforeach
{!! Form::close() !!}
@endsection @section('script') @endsection