@extends('admin.layout.master')

@section('content')
<div class="app-content  my-3 my-md-5">
				<div class="side-app">
					<div class="page-header">
						<ol class="breadcrumb">
              <li class="breadcrumb-item" aria-current="page"><a href="javascript:void(0)">Test Series Manager</a></li>
              <li class="breadcrumb-item active" aria-current="page"><a href="{{route('admin.test_series_manager.test.list', $testId)}}">Test</a></li>
							<li class="breadcrumb-item active" aria-current="page">Test Add</li>
						</ol>
					</div>
           <!-- MAIN BODY CONTENT -->
            <h1 class="pageHeadTag">Add Test</h1>

            <!-- Table -->
            <div class="card add_area">
              <div class="steps-wrap">
                <ul class="steps-item">
                  <li>
                    <a href="{{route('admin.test_series_manager.test.edit', $testId)}}">
                    <div class="step-content">
                      <p class="step">Step 1</p>
                      <p class="step-desc">Create a New Test</p>
                    </div>
                    <svg
                      class="step-img"
                      xmlns="http://www.w3.org/2000/svg"
                      width="24"
                      height="24"
                      viewBox="0 0 24 24"
                    >
                      <g transform="translate(21017.088 -1472.473)">
                        <rect
                          width="24"
                          height="24"
                          transform="translate(-21017.088 1472.473)"
                          fill="none"
                        />
                        <g transform="translate(-21013.088 1474.973)">
                          <g transform="translate(0 6.846)">
                            <path
                              d="M8,12.154a1.51,1.51,0,0,1-.683-.165A7.716,7.716,0,0,0,4,11.317a9,9,0,0,0-2.2.263,1.45,1.45,0,0,1-.358.045A1.434,1.434,0,0,1,.432,11.2,1.455,1.455,0,0,1,0,10.163V1.927A1.494,1.494,0,0,1,.888.577,7.915,7.915,0,0,1,4,0,6.685,6.685,0,0,1,8,1.095a6.69,6.69,0,0,1,4-1.095,7.853,7.853,0,0,1,3.106.577A1.494,1.494,0,0,1,16,1.927v8.236a1.437,1.437,0,0,1-1.8,1.417,9,9,0,0,0-2.2-.263,7.643,7.643,0,0,0-3.317.672A1.476,1.476,0,0,1,8,12.154Zm4-10.693a8.806,8.806,0,0,0-4,1.1v8.4a8.815,8.815,0,0,1,4-1.095,9.163,9.163,0,0,1,1.673.146.768.768,0,0,0,.134.012.734.734,0,0,0,.739-.728V2.38a.739.739,0,0,0-.581-.716A9.2,9.2,0,0,0,12.006,1.46Z"
                              transform="translate(0 0)"
                              fill=""
                            />
                          </g>
                          <ellipse
                            cx="3.296"
                            cy="3.267"
                            rx="3.296"
                            ry="3.267"
                            transform="translate(4.894)"
                            fill=""
                          />
                        </g>
                      </g>
                    </svg>
                  </a>
                  </li>
                  <li>
                    <a href="{{route('admin.test_series_manager.test.question.list', $testId)}}">
                    <div class="step-content">
                      <p class="step">Step 2</p>
                      <p class="step-desc">Add Question</p>
                    </div>
                    <svg
                      class="step-img"
                      xmlns="http://www.w3.org/2000/svg"
                      width="35"
                      height="29.002"
                      viewBox="0 0 35 29.002"
                    >
                      <path
                        d="M3.807,24.191A13,13,0,0,1,13,2a12.91,12.91,0,0,1,5.4,1.168A9,9,0,0,0,25.849,17,13.012,13.012,0,0,1,13,28,12.909,12.909,0,0,1,3.807,24.191Zm8.244-4.721a1.5,1.5,0,0,0-.5.324,1.616,1.616,0,0,0-.336.487,1.542,1.542,0,0,0,.336,1.7,1.533,1.533,0,0,0,.5.325,1.647,1.647,0,0,0,.631.112,1.594,1.594,0,0,0,.619-.112,1.685,1.685,0,0,0,.5-.325,1.538,1.538,0,0,0,.341-.492,1.573,1.573,0,0,0,0-1.212,1.7,1.7,0,0,0-.341-.487,1.6,1.6,0,0,0-.5-.324,1.47,1.47,0,0,0-.619-.121A1.535,1.535,0,0,0,12.051,19.471Zm1.771-7.939a1.1,1.1,0,0,1,.355.859,1.534,1.534,0,0,1-.193.779,2.478,2.478,0,0,1-.474.59,5.351,5.351,0,0,1-.623.5,7.107,7.107,0,0,0-.619.474,2.281,2.281,0,0,0-.475.547,1.249,1.249,0,0,0-.191.7.787.787,0,0,0,.005.107.514.514,0,0,0,.008.08s0,.008,0,.012a.046.046,0,0,0,0,.012l.2,1.454h1.911l.252-1.262a.936.936,0,0,1,.283-.5,4.829,4.829,0,0,1,.539-.457c.05-.039.1-.076.153-.115l.08-.06.005-.006c.138-.1.278-.21.424-.322a3.683,3.683,0,0,0,.635-.631,3.262,3.262,0,0,0,.481-.865,3.351,3.351,0,0,0,.187-1.188,3.312,3.312,0,0,0-.251-1.31A2.915,2.915,0,0,0,15.78,9.91a3.394,3.394,0,0,0-1.158-.643A4.835,4.835,0,0,0,13.1,9.04a5.657,5.657,0,0,0-1.123.107,4.92,4.92,0,0,0-.967.289,5.5,5.5,0,0,0-.84.426,6.069,6.069,0,0,0-.727.524l.739,1.135a.626.626,0,0,0,.576.329.683.683,0,0,0,.342-.1l.119-.063.045-.024c.066-.037.136-.074.21-.113l.029-.015a2.972,2.972,0,0,1,.546-.223,2.818,2.818,0,0,1,.8-.1A1.4,1.4,0,0,1,13.822,11.532ZM18,8a8,8,0,1,1,8,8A8.01,8.01,0,0,1,18,8Zm3.534,1.2H25.09v3.847h2.435V9.2H31.1V7.052H27.526V3.226H25.09V7.052H21.534Z"
                        transform="translate(0.5 0.5)"
                        fill=""
                        stroke="rgba(0,0,0,0)"
                        stroke-width="1"
                      />
                    </svg>
                  </a>
                  </li>
                  <li  class="active">
                    <a href="{{route('admin.test_series_manager.test.setting.add', $testId)}}">
                    <div class="step-content">
                      <p class="step">Step 3</p>
                      <p class="step-desc">Test Setting</p>
                    </div>
                    <svg
                      class="step-img"
                      xmlns="http://www.w3.org/2000/svg"
                      width="24"
                      height="24"
                      viewBox="0 0 24 24"
                    >
                      <g transform="translate(-542 -154)">
                        <rect
                          width="24"
                          height="24"
                          transform="translate(542 154)"
                          fill="rgba(0,0,0,0)"
                        />
                        <path
                          d="M561,175H547a2,2,0,0,1-2-2V159a2,2,0,0,1,2-2h4.18a2.988,2.988,0,0,1,5.64,0H561a2,2,0,0,1,2,2v14A2,2,0,0,1,561,175Zm-11-6a1,1,0,1,0,0,2h5a1,1,0,0,0,0-2Zm0-4a1,1,0,1,0,0,2h8a1,1,0,1,0,0-2Zm0-4a1,1,0,1,0,0,2h8a1,1,0,1,0,0-2Zm4-4a1,1,0,1,0,1,1A1,1,0,0,0,554,157Z"
                          fill=""
                        />
                      </g>
                    </svg>
                  </a>
                  </li>
                  <li>
                    <a href="{{route('admin.test_series_manager.test.final.review', $testId)}}">
                    <div class="step-content">
                      <p class="step">Step 4</p>
                      <p class="step-desc">Finish Test</p>
                    </div>
                    <svg
                      class="step-img"
                      xmlns="http://www.w3.org/2000/svg"
                      width="24"
                      height="24"
                      viewBox="0 0 24 24"
                    >
                      <g transform="translate(-542 -154)">
                        <rect
                          width="24"
                          height="24"
                          transform="translate(542 154)"
                          fill="rgba(0,0,0,0)"
                        />
                        <path
                          d="M561,175H547a2,2,0,0,1-2-2V159a2,2,0,0,1,2-2h4.18a2.988,2.988,0,0,1,5.64,0H561a2,2,0,0,1,2,2v14A2,2,0,0,1,561,175Zm-11-6a1,1,0,1,0,0,2h5a1,1,0,0,0,0-2Zm0-4a1,1,0,1,0,0,2h8a1,1,0,1,0,0-2Zm0-4a1,1,0,1,0,0,2h8a1,1,0,1,0,0-2Zm4-4a1,1,0,1,0,1,1A1,1,0,0,0,554,157Z"
                          fill=""
                        />
                      </g>
                    </svg>
                  </a>
                  </li>
                </ul>
                <div class="card-body">
                  <h2>Test Setting</h2>

                  @if(Session::has('errors'))
                      <div class="alert alert-danger" style="background: none; border: none;">
                        <ul class="form_validation_error">
                                @foreach ($errors->all() as $error)
                                    <li  style="color: #f00">{{ $error }}</li>
                                @endforeach
                            </ul>
                      </div>
                  @endif
                  <form action="{{route('admin.test_series_manager.test.setting.save', $testId)}}" method="post" id="test_setting_frm">
                    <input type="hidden" name="test_id" id="test_id" value="{{$testId}}">
                  {{csrf_field()}}

                  <!-- Accordian -->
                  <div class="panel-group1 mt-6" id="accordion2">
                    <div class="panel panel-default mb-4">
                      <div class="panel-heading1 ">
                        <h4 class="panel-title1">
                          <a class="accordion-toggle collapsed fs-18" data-toggle="collapse"   data-parent="#accordion2" href="#collapseOne" aria-expanded="false"
                          id="test_pattern">Test Pattern
                          </a>
                        </h4>
                      </div>
                      <div id="collapseOne" class="panel-collapse collapse" role="tabpanel"
                        aria-expanded="false">
                        <div class="panel-body">
                          <div class="t-pattern">
                            <ul class="radio-select-list">
                              <li>
                                <label class="custom-control custom-radio">
                                  <input type="radio" class="custom-control-input test_pattern_radios" name="test_pattern_radios" value="1" @if($test['test_pattern_type'] == 1 || $test['test_pattern_type'] == 0){{'checked'}}@endif/>
                                  <span class="custom-control-label">Section Wise <img src="{{asset('admin/images/info.svg')}}" class="fa fa-info" data-toggle="tooltip" data-placement="right" title="In Section wise test pattern, you can add/edit Sectional Time allotted for each subject" alt="info" width="12"/></span>
                                </label>
                              </li>
                              <li>
                                <label class="custom-control custom-radio">
                                  <input type="radio" class="custom-control-input test_pattern_radios" name="test_pattern_radios" value="2" @if($test['test_pattern_type'] == 2){{'checked'}}@endif/>
                                  <span class="custom-control-label">Subject Wise <img src="{{asset('admin/images/info.svg')}}" class="fa fa-info" data-toggle="tooltip" data-placement="right" title="In Subject wise test pattern, you can add/edit questions according to the subject chosen" alt="info" width="12"/></span>
                                </label>
                              </li>
                              <li>
                                <label class="custom-control custom-radio">
                                  <input type="radio" class="custom-control-input test_pattern_radios" name="test_pattern_radios" value="3" @if($test['test_pattern_type'] == 3){{'checked'}}@endif/>
                                  <span class="custom-control-label">Difficulty Wise <img src="{{asset('admin/images/info.svg')}}" class="fa fa-info" data-toggle="tooltip" data-placement="right" title="In Difficulty wise test pattern, you can add questions according to the degree of difficulty" alt="info" width="12"/></span>
                                </label>
                              </li>
                            </ul>
                            <div class="table-responsive">
                            <span><p id="fieldcheck" style="color: red; display: none;"></p></span>
                            <table class="table card-table table-center table-border-top text-nowrap outline-border tbl-gr-acrdn" id="section_wise">
                              <thead>
                                <tr>
                                  <th>Section Name</th>
                                  <th>No Of Questions</th>
                                  <th>Difficulty</th>
                                  <th class="subject_wise">Sectional Time (In Min.)</th>
                                  <th>
                                    Order
                                    <img src="{{asset('admin/images/info.svg')}}" width="13" class="fa fa-info" data-toggle="tooltip" data-placement="left" title="Tooltip on top"/>
                                  </th>
                                </tr>
                              </thead>
                              <tbody>
                                @if(!$testSubject->isEmpty())
                                @foreach($testSubject as $val)
                                <input type="hidden" name="subject_id[]" value="{{$val->id}}" class="subject_id">
                                <tr>
                                  <td id="name-{{$val['id']}}" class="name">{{ $val['subject'] }}</td>
                                  <td>
                                    @if($val['test_pattern_type'] > 0)
                                      <input type="text" class="tbl-input wd-45 score noq" id="score-{{$val['id']}}" value="{{$val->no_of_questions}}" name="no_of_questions[]" />
                                    @else
                                      <input type="text" class="tbl-input wd-45 score noq" id="score-{{$val['id']}}" value="{{$val->total_question_count}}" name="no_of_questions[]" />
                                    @endif
                                    

                                  </td>
                                  <td>
                                    <div class="inc-dec-group">
                                      <div class="input-group input-group-sm">
                                        <span class="input-g-label">Easy</span>
                                        <span class="input-group-btn">
                                          <button type="button" class="quantity-left-minus btn btn-number easy_minus" data-type="minus" data-field="" id="{{$val['id']}}" data-rowid="{{$val['id']}}">
                                            <span class="fa fa-minus"></span>
                                          </button>
                                        </span>
                                        <input type="hidden" name="easy_step" id="easy_step-{{$val['id']}}" value="{{$val->total_easy_question_count}}">

                                        @if($val['test_pattern_type'] > 0)
                                          <input type="text" id="easy_quantity-{{$val['id']}}" name="easy_quantity[]" class="form-control input-number easy_quantity" value="{{$val->easy}}" />
                                        @else
                                          <input type="text" id="easy_quantity-{{$val['id']}}" name="easy_quantity[]" class="form-control input-number easy_quantity" value="{{$val->total_easy_question_count}}" />
                                        @endif

                                        <span class="input-group-btn">
                                          <button type="button" class="quantity-right-plus btn btn-number easy_plus" data-type="plus" data-field="" id="{{$val['id']}}" data-rowid="{{$val['id']}}">
                                            <span class="fa fa-plus"></span>
                                          </button>
                                        </span>
                                      </div>

                                      <div class="input-group input-group-sm">
                                        <span class="input-g-label">Medium</span>
                                        <span class="input-group-btn">
                                          <button type="button" class="quantity-left-minus btn btn-number mid_minus" data-type="minus" data-field="" id="{{$val['id']}}" data-rowid="{{$val['id']}}">
                                            <span class="fa fa-minus"></span>
                                          </button>
                                        </span>
                                        <input type="hidden" name="mid_step" id="mid_step-{{$val['id']}}" value="{{$val->total_mid_question_count}}">
                                        @if($val['test_pattern_type'] > 0)
                                          <input type="text" id="medium_quantity-{{$val['id']}}" name="medium_quantity[]" class="form-control input-number medium_quantity" value="{{$val->medium}}"/>
                                        @else
                                          <input type="text" id="medium_quantity-{{$val['id']}}" name="medium_quantity[]" class="form-control input-number medium_quantity" value="{{$val->total_mid_question_count}}"/>
                                        @endif
                                        
                                        <span class="input-group-btn">
                                          <button type="button" class="quantity-right-plus btn btn-number mid_plus" data-type="plus" data-field="" id="{{$val['id']}}" data-rowid="{{$val['id']}}" >
                                            <span class="fa fa-plus"></span>
                                          </button>
                                        </span>
                                      </div>

                                      <div class="input-group input-group-sm">
                                        <span class="input-g-label">Hard</span>
                                        <span class="input-group-btn">
                                          <button type="button" class="quantity-left-minus btn btn-number hard_minus" data-type="minus" data-field="" id="{{$val['id']}}" data-rowid="{{$val['id']}}">
                                            <span class="fa fa-minus"></span>
                                          </button>
                                        </span>
                                        <input type="hidden" name="hard_step" id="hard_step-{{$val['id']}}" value="{{$val->total_hard_question_count}}">
                                        @if($val['test_pattern_type'] > 0)
                                          <input type="text" id="hard_quantity-{{$val['id']}}" name="hard_quantity[]" class="form-control input-number hard_quantity" value="{{$val->hard}}"/>
                                        @else
                                          <input type="text" id="hard_quantity-{{$val['id']}}" name="hard_quantity[]" class="form-control input-number hard_quantity" value="{{$val->total_hard_question_count}}"/>
                                        @endif
                                        <span class="input-group-btn">
                                          <button type="button" class="quantity-right-plus btn btn-number hard_plus" data-type="plus" data-field="" id="{{$val['id']}}" data-rowid="{{$val['id']}}">
                                            <span class="fa fa-plus"></span>
                                          </button>
                                        </span>
                                      </div>
                                    </div>
                                  </td>
                                  <td class="subject_wise">
                                    
                                      <input type="text" value="{{$val->section_time}}" class="tbl-input wd-70 stime" name="section_time[]" id="section_time-{{$val->id}}" />
                                    
                                  </td>
                                  <td>
                                    @if($val->test_pattern_type > 0)
                                      <input type="text" value="{{$val->order_no}}" class="tbl-input wd-45 order_no" name="order_no[]"/>
                                    @else
                                      <input type="text" value="0" class="tbl-input wd-45 order_no" name="order_no[]" />
                                    @endif
                                  </td>
                                </tr>
                                @endforeach
                                @endif
                              </tbody>
                            </table>

                            <table class="table card-table table-center table-border-top text-nowrap outline-border tbl-gr-acrdn" id="difficulty_wise" style="display: none;">
                              <thead>
                                <tr>
                                  <th>Section Name</th>
                                  <th>No Of Questions</th>
                                </tr>
                              </thead>
                              <tbody>
                                <tr>
                                  <td>Easy</td>
                                  <td>
                                    @if($test->test_pattern_type > 0)
                                      <input type="text" value="{{$test['total_easy']}}" class="tbl-input wd-45 diff_easy" name="diff_easy" id="diff_easy" />
                                    @else
                                      <input type="text" value="{{$easy}}" class="tbl-input wd-45 diff_easy" name="diff_easy" id="diff_easy" />
                                    @endif
                                    
                                  </td>
                                </tr>
                                <tr>
                                  <td>Medium</td>
                                  <td>
                                    @if($test->test_pattern_type > 0)
                                      <input type="text" value="{{$test['total_medium']}}" class="tbl-input wd-45 diff_medium" name="diff_medium" id="diff_medium" />
                                    @else
                                      <input type="text" value="{{$medium}}" class="tbl-input wd-45 diff_medium" name="diff_medium" id="diff_medium" />
                                    @endif
                                    
                                  </td>
                                </tr>
                                <tr>
                                  <td>Hard</td>
                                  <td>
                                    @if($test->test_pattern_type > 0)
                                      <input type="text" value="{{$test['total_hard']}}" class="tbl-input wd-45 diff_hard" name="diff_hard" id="diff_hard" />
                                    @else
                                      <input type="text" value="{{$hard}}" class="tbl-input wd-45 diff_hard" name="diff_hard" id="diff_hard" />
                                    @endif
                                    
                                  </td>
                                </tr>
                              </tbody>
                            </table>

                            </div>

                            <ul class="report-details">
                              <li id="report_radio">
                                <p class="repot-label font-medium">
                                  Show Section wise Test Summary
                                  <span class="text-danger">*</span>
                                </p>
                                <div class="report-data">
                                  <label class="custom-control custom-radio">
                                    <input type="radio" class="custom-control-input" name="example-radios" value="1" @if($testSubject[0]->summary_report_status == 1 || $testSubject[0]->summary_report_status == 0){{'checked'}}@endif/>
                                    <span class="custom-control-label">Yes</span>
                                  </label>
                                  <label class="custom-control custom-radio">
                                    <input type="radio" class="custom-control-input" name="example-radios" value="2" @if($testSubject[0]->summary_report_status == 2){{'checked'}}@endif/>
                                    <span class="custom-control-label">No</span>
                                  </label>
                                </div>
                              </li>
                              <li>
                                <p class="repot-label">
                                  Questions appearing in the Test
                                </p>
                                <div class="report-data">
                                    @if($test->test_pattern_type > 0)
                                      {{$test['total_questions']}} (Easy {{$test['total_easy']}} Medium {{$test['total_medium']}} Hard {{$test['total_hard']}} )
                                    @else
                                      {{$total}} (Easy {{$easy}} Medium {{$medium}} Hard {{$hard}} )
                                    @endif
                                </div>
                              </li>
                              <li>
                                <p class="repot-label">
                                  Questions available in Background <img src="{{asset('admin/images/info.svg')}}" class="fa fa-info" data-toggle="tooltip" data-placement="right" title="The questions will be grouped here according to the selected difficulty level. As the number of questions increases, each candidate will have different questions in random order.  Example- If there are 5000 questions and candidates in total are 10, System generates different set of questions according to the available selections. More the questions, more will be randomization" alt="info" width="12"/>
                                </p>
                                <div class="report-data">
                                  {{$total}} (Easy {{$easy}} Medium {{$medium}} Hard {{$hard}} )
                                </div>
                              </li>
                            </ul>


                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="panel panel-default mb-4">
                      <div class="panel-heading1 ">
                        <h4 class="panel-title1">
                          <a class="accordion-toggle collapsed fs-18" data-toggle="collapse"
                            data-parent="#accordion2" href="#collapseTwo" aria-expanded="false"
                          >Arrangement
                          </a>
                        </h4>
                      </div>
                      <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel"
                        aria-expanded="false">
                        <div class="panel-body p-0">
                          <p class="my-4 fs-14 px-4">
                            This includes intermixing of questions through shuffling and then bundling the questions for the test
                          </p>
                          <!-- <div class="group-box">
                            <div class="group-left"><p>Grouping</p></div>
                            <div class="group-right">
                              <ul class="group-item">
                                <li>
                                  <p class="group-label">
                                    Shuffle questions subject wise 
                                  </p>
                                  <div class="group-data">
                                    <label class="custom-control custom-radio">
                                      <input type="radio" class="custom-control-input" name="shuffle_question_with_subject" value="1" @if($test->shuffle_question_status == 1 || $test->shuffle_question_status == 0){{'checked'}}@endif  />
                                      <span class="custom-control-label">Yes</span>
                                    </label>
                                    <label class="custom-control custom-radio">
                                      <input type="radio" class="custom-control-input" name="shuffle_question_with_subject" value="2" @if($test->shuffle_question_status == 2){{'checked'}}@endif/>
                                      <span class="custom-control-label">No</span>
                                    </label>
                                  </div>
                                </li>
                              </ul>
                            </div>
                          </div> -->
                          <div class="group-box">
                            <div class="group-left"><p>Shuffling</p></div>
                            <div class="group-right">
                              <ul class="group-item">
                                <li>
                                  <p class="group-label">
                                    Option wise shuffling
                                  </p>
                                  <div class="group-data">
                                    <label class="custom-control custom-radio">
                                      <input type="radio" class="custom-control-input radio" name="option_wise_shuffling" value="1" @if($test->agreement_shuffling_status == 1 || $test->agreement_shuffling_status == 0){{'checked'}}@endif />
                                      <span class="custom-control-label">Yes</span>
                                    </label>
                                    <label class="custom-control custom-radio">
                                      <input type="radio" class="custom-control-input radio" name="option_wise_shuffling" value="2" @if($test->agreement_shuffling_status == 2){{'checked'}}@endif/>
                                      <span class="custom-control-label">No</span>
                                    </label>
                                  </div>
                                </li>
                              </ul>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="panel panel-default mb-4">
                      <div class="panel-heading1 ">
                        <h4 class="panel-title1">
                          <a class="accordion-toggle collapsed fs-18" data-toggle="collapse"
                            data-parent="#accordion2" href="#collapseThree" aria-expanded="false"
                          id="to">Test Options
                          </a>
                        </h4>
                      </div>
                      <div id="collapseThree" class="panel-collapse collapse" role="tabpanel"
                        aria-expanded="false">
                        <div class="panel-body">
                          <span><p id="testoptioncheck" style="color: red; display: none;"></p></span>
                          <div class="row chk-option">
                            <div class="col-md-6">
                              <label class="custom-control custom-checkbox">
                                <input type="checkbox" class="custom-control-input form_input_test test_option" name="test_option[]" value="1" @if(in_array(1, $testOptions)){{ 'checked' }} @endif />
                                <span class="custom-control-label">Allow user to move back and forward</span>
                              </label>
                            </div>
                            <div class="col-md-6">
                              <label class="custom-control custom-checkbox">
                                <input type="checkbox" class="custom-control-input form_input_test test_option" name="test_option[]" value="2" @if(in_array(2, $testOptions)){{ 'checked' }} @endif/>
                                <span class="custom-control-label">Allow user to attempt test in multiple languages</span>
                              </label>
                            </div>
                            <div class="col-md-6">
                              <label class="custom-control custom-checkbox">
                                <input type="checkbox" class="custom-control-input form_input_test test_option" name="test_option[]" value="3" @if(in_array(3, $testOptions)){{ 'checked' }} @endif/>
                                <span class="custom-control-label">Show Marks/Points for the test</span>
                              </label>
                            </div>
                            <div class="col-md-6">
                              <label class="custom-control custom-checkbox">
                                <input type="checkbox" class="custom-control-input form_input_test test_option"
                                  name="test_option[]" value="4" @if(in_array(4, $testOptions)){{ 'checked' }} @endif/>
                                <span class="custom-control-label">Show calculator</span>
                              </label>
                            </div>
                            <div class="col-md-6">
                              <label class="custom-control custom-checkbox">
                                <input type="checkbox" class="custom-control-input form_input_test test_option" name="test_option[]" value="5" @if(in_array(5, $testOptions)){{ 'checked' }} @endif/>
                                <span class="custom-control-label">Apply Partial Marking Scheme</span>
                              </label>
                            </div>

                            <div class="col-md-6">
                              <label class="custom-control custom-checkbox">
                                <input type="checkbox" class="custom-control-input form_input_test test_option" name="test_option[]" value="6" @if(in_array(6, $testOptions)){{ 'checked' }} @endif />
                                <span class="custom-control-label">Allow user to pause and resume</span>
                              </label>
                            </div>

                          </div>
                        </div>
                      </div>
                    </div>

                    <div class="panel panel-default mb-4">
                      <div class="panel-heading1 ">
                        <h4 class="panel-title1">
                          <a class="accordion-toggle collapsed fs-18" data-toggle="collapse"
                            data-parent="#accordion2" href="#collapseFour" aria-expanded="false"
                          >Candidate Setting
                          </a>
                        </h4>
                      </div>
                      <div id="collapseFour" class="panel-collapse collapse" role="tabpanel"
                        aria-expanded="false">
                        <div class="panel-body p-0">
                          <div class="st-group">
                            <div class="st-left">
                              <p>
                                Show result with Candidate as per your
                                subsequent selection
                              </p>
                            </div>
                            <div class="st-right">
                              <label class="custom-control custom-radio">
                                <input type="radio" class="custom-control-input candidate_setting" name="candidate_setting" value="1" @if($test->candidate_setting_subsequent == 1 || $test->candidate_setting_subsequent == 0){{'checked'}}@endif />
                                <span class="custom-control-label">Auto</span>
                              </label>
                              <label class="custom-control custom-radio">
                                <input type="radio" class="custom-control-input candidate_setting" name="candidate_setting" value="2" @if($test->candidate_setting_subsequent == 2){{'checked'}}@endif/>
                                <span class="custom-control-label">Manual</span>
                              </label>
                              <label class="custom-control custom-radio">
                                <input type="radio" class="custom-control-input candidate_setting" name="candidate_setting" value="3" @if($test->candidate_setting_subsequent == 3){{'checked'}}@endif/>
                                <span class="custom-control-label">Dated</span>
                              </label>
                              <div class="input-group">
                                <div class="input-group-prepend">
                                  <div class="input-group-text">
                                    <i class="fa fa-calendar tx-16 lh-0 op-6"></i>
                                  </div>
                                </div>
                                <input class="form-control input-sm fc-datepicker form_input" placeholder="DD/MM/YYYY" type="text" name="setting_date" id="setting_date" value="@if($test->candidate_setting_subsequent_date){{date('d-m-Y', strtotime($test->candidate_setting_subsequent_date))}}@endif" />
                              </div>
                            </div>
                          </div>
                          <div class="st-group">
                            <div class="st-left">
                              <p>
                                Select result Publish time as per requirement
                              </p>
                            </div>
                            <div class="st-right">
                              <label class="custom-control custom-radio">
                                <input type="radio" class="custom-control-input" name="calculation" value="1" @if($test->calculate_ranking_status == 1 || $test->calculate_ranking_status == 0){{'checked'}}@endif/>
                                <span class="custom-control-label">Yes</span>
                              </label>
                              <label class="custom-control custom-radio">
                                <input type="radio" class="custom-control-input" name="calculation" value="2" @if($test->calculate_ranking_status == 2){{'checked'}}@endif/>
                                <span class="custom-control-label">No</span>
                              </label>
                            </div>
                          </div>
                          <div class="st-group">
                            <div class="st-left">
                              <p>
                                Show details of Top Performer to the candidate 
                              </p>
                            </div>
                            <div class="st-right">
                              <label class="custom-control custom-radio">
                                <input type="radio" class="custom-control-input" name="top_performer" value="1" @if($test->top_performer_status == 1 || $test->top_performer_status == 0){{'checked'}}@endif/>
                                <span class="custom-control-label">Yes</span>
                              </label>
                              <label class="custom-control custom-radio">
                                <input type="radio" class="custom-control-input form_input" name="top_performer" value="2" @if($test->top_performer_status == 2){{'checked'}}@endif/>
                                <span class="custom-control-label">No</span>
                              </label>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>

                    <div class="panel panel-default mb-4">
                      <div class="panel-heading1 ">
                        <h4 class="panel-title1">
                          <a class="accordion-toggle collapsed fs-18" data-toggle="collapse"
                            data-parent="#accordion2" href="#collapseFive"
                            aria-expanded="false" id="ma">
                            Multiple Attempt
                          </a>
                        </h4>
                      </div>
                      <div id="collapseFive" class="panel-collapse collapse" role="tabpanel"
                        aria-expanded="false">
                        <div class="panel-body p-0">
                          <div class="st-group">
                            <div class="st-left">
                              <p>
                                Allow the candidate to attempt the test multiple times
                              </p>
                            </div>
                            <div class="st-right">
                              <label class="custom-control custom-radio">
                                <input type="radio" class="custom-control-input form_input multiple_attemp" name="multiple_attemp" value="1"  @if($test->multiple_attemp_status == 1 || $test->multiple_attemp_status == 0){{'checked'}}@endif/>
                                <span class="custom-control-label">Yes</span>
                              </label>
                              <label class="custom-control custom-radio">
                                <input type="radio" class="custom-control-input form_input multiple_attemp" name="multiple_attemp" value="2" @if($test->multiple_attemp_status == 2){{'checked'}}@endif/>
                                <span class="custom-control-label">No</span>
                              </label>

                              <input type="number" min="0" value="{{$test->mutliple_attemp}}" placeholder="0" class="form-control input-sm num-field form_inputs" name="mutliple_attemp_digit" id="mutliple_attemp_digit" />
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="test-footer">
                    <button class="btn btn-outline-primary btn-pill btn-streach font-book mt-7 fs-14 test_setting_back">Back</button>
                    <button class="btn btn-primary btn-streach font-book mt-7 fs-14  ml-3 test_setting_add">Next</button>
                  </div>
                  </form>

                </div>
              </div>
            </div>
            <!-- //Table -->
            <!--// MAIN BODY CONTENT -->
		</div>
	</div>

  
@endsection
@section('scripts')
<script>
  $(function(){
    $('.saveModalValue').click();
  })
  CKEDITOR.replace( 'portal_data');
  CKEDITOR.replace( 'test_data');
</script>
<script type="text/javascript">
  var test_id = $('#test_id').val();
  var base_url = "{{ url('') }}";
  var test_dutation ="{{$test['duration']}}";
  var question_total = '{{$total}}';
  var db_question_total = '{{$test->total_questions}}';
  var shuffle = '{{$test->agreement_shuffling_status}}';
  var multiple_attemp = "{{$test['multiple_attemp_status']}}";
  var link = base_url + "/admin/test_series_manager/test/question/list/" +test_id;
</script>
<script type="text/javascript" src="{{asset('js/test_setting.js?v='.time())}}"></script>
 
@endsection

