@extends('backend.layouts.app') @section('title', __('labels.backend.questions.title').' | '.app_name()) @section('content') {!! Form::open(['method' => 'POST', 'route' => ['admin.questions.store'], 'files' => true,]) !!}

@lang('labels.backend.questions.create')

{!! Form::label('question', trans('labels.backend.questions.fields.question').'*', ['class' => 'control-label']) !!} {!! Form::textarea('question', old('question'), ['class' => 'form-control ', 'placeholder' => '', 'required' => '']) !!}

@if($errors->has('question'))

{{ $errors->first('question') }}

@endif
{!! Form::label('question_image', trans('labels.backend.questions.fields.question_image'), ['class' => 'control-label']) !!} {!! Form::file('question_image', ['class' => 'form-control', 'style' => 'margin-top: 4px;']) !!} {!! Form::hidden('question_image_max_size', 8) !!} {!! Form::hidden('question_image_max_width', 4000) !!} {!! Form::hidden('question_image_max_height', 4000) !!}

@if($errors->has('question_image'))

{{ $errors->first('question_image') }}

@endif
{!! Form::label('score', trans('labels.backend.questions.fields.score').'*', ['class' => 'control-label']) !!} {!! Form::number('score', old('score', 1), ['class' => 'form-control', 'placeholder' => '', 'required' => '']) !!}

@if($errors->has('score'))

{{ $errors->first('score') }}

@endif
{!! Form::label('tests', trans('labels.backend.questions.fields.tests'), ['class' => 'control-label']) !!} {!! Form::select('tests[]', $tests, old('tests'), ['class' => 'form-control select2', 'multiple' => 'multiple']) !!}

@if($errors->has('tests'))

{{ $errors->first('tests') }}

@endif
@for ($question=1; $question<=4; $question++)
{!! Form::label('option_text_' . $question, trans('labels.backend.questions.fields.option_text').'*', ['class' => 'control-label']) !!} {!! Form::textarea('option_text_' . $question, old('option_text'), ['class' => 'form-control ', 'rows' => 3]) !!}

@if($errors->has('option_text_' . $question))

{{ $errors->first('option_text_' . $question) }}

@endif
{!! Form::label('explanation_' . $question, trans('labels.backend.questions.fields.option_explanation'), ['class' => 'control-label']) !!} {!! Form::textarea('explanation_' . $question, old('explanation_'.$question), ['class' => 'form-control ', 'rows' => 3]) !!}

@if($errors->has('explanation_' . $question))

{{ $errors->first('explanation_' . $question) }}

@endif
{!! Form::label('correct_' . $question, trans('labels.backend.questions.fields.correct'), ['class' => 'control-label']) !!} {!! Form::hidden('correct_' . $question, 0) !!} {!! Form::checkbox('correct_' . $question, 1, false, []) !!}

@if($errors->has('correct_' . $question))

{{ $errors->first('correct_' . $question) }}

@endif
@endfor
{!! Form::submit(trans('strings.backend.general.app_save'), ['class' => 'btn btn-danger mb-4 form-group']) !!}
{!! Form::close() !!} @stop