@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)">Package Management</a></li>
							<li class="breadcrumb-item" aria-current="page"><a href="{{route('admin.quiz.list')}}">Quiz Manager</a></li>
							<li class="breadcrumb-item active" aria-current="page"><a href="javascript:void(0)">Question</a></li>
						</ol>
					</div>
					<!-- MAIN BODY CONTENT -->
            <h1>Question</h1>

            <!-- Table -->
            <div class="card">
              <div class="steps-wrap">
                
                <div class="card-body">
                  <h2>Add Question</h2>
                  <!-- TOP 3 BOX -->
                  <div class="row d-flex">
                    <div class="col-lg-4">
                      <div class="details-box box-q red text-center">
                        <svg
                          class="box-q-icon"
                          xmlns="http://www.w3.org/2000/svg"
                          width="47"
                          height="40"
                          viewBox="0 0 47 40"
                        >
                          <circle cx="20" cy="20" r="20" fill="" />
                          <rect
                            width="4.016"
                            height="4.017"
                            transform="translate(18.074 30.124)"
                            fill="#fff"
                          />
                          <path
                            d="M838.066,299.033a8.033,8.033,0,1,0-16.066,0h4.017a4.016,4.016,0,1,1,8.033,0,3.925,3.925,0,0,1-1.185,2.831l-2.49,2.531a8.084,8.084,0,0,0-2.35,5.683v1h4.017a6.835,6.835,0,0,1,2.35-5.683l1.807-1.848A6.389,6.389,0,0,0,838.066,299.033Z"
                            transform="translate(-809.951 -284.976)"
                            fill="#fff"
                          />
                          <circle
                            cx="11.5"
                            cy="11.5"
                            r="11.5"
                            transform="translate(24 17)"
                            fill="#fff"
                          />
                          <path
                            d="M945.432,961.414a1.68,1.68,0,0,0-2.4.017l-8.137,8.154-3.915-3.915a1.7,1.7,0,0,0-2.4,0l-.153.153a1.7,1.7,0,0,0,0,2.4l5.26,5.261a1.7,1.7,0,0,0,2.4,0l9.5-9.516a1.7,1.7,0,0,0,0-2.4l-.153-.153Z"
                            transform="translate(-899.989 -939.964)"
                            fill=""
                          />
                        </svg>
                        <p class="box-q-desc">
                          Directly add questions from the question bank. The
                          selected set of questions will be associated to the
                          test
                        </p>
                        <a href="{{route('admin.quiz.question.vault.list', base64_encode($quizDetails->id))}}"><button class="btn btn-primary btn-streach font-book fs-16">
                          Select Question
                        </button></a>
                      </div>
                    </div>
                    <div class="col-lg-4">
                      <div class="details-box box-q orange text-center">
                        <svg
                          class="box-q-icon"
                          xmlns="http://www.w3.org/2000/svg"
                          width="47"
                          height="40"
                          viewBox="0 0 47 40"
                        >
                          <circle cx="20" cy="20" r="20" fill="" />
                          <rect
                            width="4.016"
                            height="4.017"
                            transform="translate(18.074 30.124)"
                            fill="#fff"
                          />
                          <path
                            d="M838.066,299.033a8.033,8.033,0,1,0-16.066,0h4.017a4.016,4.016,0,1,1,8.033,0,3.925,3.925,0,0,1-1.185,2.831l-2.49,2.531a8.084,8.084,0,0,0-2.35,5.683v1h4.017a6.835,6.835,0,0,1,2.35-5.683l1.807-1.848A6.389,6.389,0,0,0,838.066,299.033Z"
                            transform="translate(-809.951 -284.976)"
                            fill="#fff"
                          />
                          <circle
                            cx="11.5"
                            cy="11.5"
                            r="11.5"
                            transform="translate(24 17)"
                            fill="#fff"
                          />
                          <path
                            d="M945.432,961.414a1.68,1.68,0,0,0-2.4.017l-8.137,8.154-3.915-3.915a1.7,1.7,0,0,0-2.4,0l-.153.153a1.7,1.7,0,0,0,0,2.4l5.26,5.261a1.7,1.7,0,0,0,2.4,0l9.5-9.516a1.7,1.7,0,0,0,0-2.4l-.153-.153Z"
                            transform="translate(-899.989 -939.964)"
                            fill=""
                          />
                        </svg>
                        <p class="box-q-desc">
                          Add questions by importing an excel sheet.The sheet
                          will provide a streamlined access to import numerous
                          questions in a single go.
                        </p>
                        <a href="{{route('admin.quiz.question.import', base64_encode($quizDetails->id))}}"><button class="btn btn-primary btn-streach font-book fs-16">Import From XLS</button></a>
                      </div>
                    </div>
                    <div class="col-lg-4">
                      <div class="details-box box-q blue text-center">
                        <svg
                          class="box-q-icon"
                          xmlns="http://www.w3.org/2000/svg"
                          width="44.252"
                          height="40"
                          viewBox="0 0 44.252 40"
                        >
                          <g transform="translate(-0.163 -0.191)">
                            <g transform="translate(0 0)">
                              <path
                                d="M20,40A20,20,0,0,1,5.858,5.858,20,20,0,0,1,34.142,34.142,19.869,19.869,0,0,1,20,40Zm-.316-15.428a2.4,2.4,0,0,0-1.695.675,2.3,2.3,0,0,0-.5.729,2.251,2.251,0,0,0-.182.9,2.3,2.3,0,0,0,.182.912,2.276,2.276,0,0,0,.5.735,2.3,2.3,0,0,0,.75.486,2.5,2.5,0,0,0,.945.175,2.463,2.463,0,0,0,.932-.175,2.381,2.381,0,0,0,.756-.486,2.225,2.225,0,0,0,.506-.735,2.3,2.3,0,0,0,.183-.912,2.238,2.238,0,0,0-.689-1.634,2.478,2.478,0,0,0-.756-.492A2.383,2.383,0,0,0,19.684,24.572Zm.243-12.2a2.12,2.12,0,0,1,1.464.48,1.654,1.654,0,0,1,.534,1.289,2.24,2.24,0,0,1-.318,1.209,4.309,4.309,0,0,1-.776.918,9.348,9.348,0,0,1-.986.769,7.85,7.85,0,0,0-.952.756,3.1,3.1,0,0,0-.668.891,1.882,1.882,0,0,0-.135,1.154l.3,2.174H21.25l.378-1.89a1.525,1.525,0,0,1,.438-.756,7.7,7.7,0,0,1,.81-.681c.3-.223.633-.475.986-.75a5.512,5.512,0,0,0,.952-.958,4.967,4.967,0,0,0,.715-1.3,5.039,5.039,0,0,0,.284-1.776,4.893,4.893,0,0,0-.385-1.964,4.25,4.25,0,0,0-1.1-1.512,4.98,4.98,0,0,0-1.735-.966A7.289,7.289,0,0,0,20.3,9.114a8.613,8.613,0,0,0-1.681.156,7.936,7.936,0,0,0-1.451.432,8.553,8.553,0,0,0-1.263.641,9.481,9.481,0,0,0-1.086.783l1.107,1.7a.933.933,0,0,0,.864.5,1.021,1.021,0,0,0,.513-.148c.17-.1.366-.206.6-.33a4.834,4.834,0,0,1,.823-.331A4.116,4.116,0,0,1,19.927,12.368Z"
                                transform="translate(0.163 0.192)"
                                fill=""
                              />
                            </g>
                            <path
                              d="M2071.109,1739.858v5.036h5.4v5.814h5.481V1739l-5.481-2.949v3.811Z"
                              transform="translate(-2042.096 -1732.697)"
                              fill="#f5f5f5"
                              stroke="#f5f5f5"
                              stroke-width="1.2"
                            />
                            <path
                              d="M9.7-8.842v5.79h5.41V.194H9.7v5.82H6.011V.194H.63V-3.052H6.011v-5.79Z"
                              transform="translate(29.31 11.101)"
                              fill=""
                            />
                          </g>
                        </svg>
                        <p class="box-q-desc">
                          This is to associate new questions in the created
                          test.You can create questions of type; multiple
                          choice, multiple options, true false, fill in the
                          blanks, match following and match matrix.
                        </p>
                        <a href="{{route('admin.quiz.question.add', base64_encode($quizDetails->id))}}"><button class="btn btn-primary btn-streach font-book fs-16">Add Question</button></a>
                      </div>
                    </div>
                  </div>
                  <!-- TOP 3 BOX END -->
                  <div class="details-box mt-8">
                    <div class="card-header-scroll mb-4">
                      <div class="row">
                        <div class="col-lg-3"><h2>Questions</h2></div>
                        <div class="col-lg-9">
                          <div class="filter-group-scroll">
                            <div class="owl-carousel owl-theme filter">
                              <div class="item">
                                <select name="subject_filter" id="subject_filter" class="form-control filters search_filter" data-id="subject">
                                  <option value="" selected>Subject</option>
                                  @if($subjects)
                                    @foreach($subjects as $subject)
                                        <option value="{{$subject->subject_id}}">{{$subject->subjectByQuizSubject->subject}}</option>
                                    @endforeach
                                  @endif
                                </select>
                              </div>
                              <div class="item">
                                <select name="chapter_filter" id="chapter_filter" class="form-control filters search_filter" data-id="chapter">
                                  <option value="" selected>Chapter</option>
                                </select>
                              </div>
                              <div class="item">
                                <select name="topic_filter" id="topic_filter" class="form-control filters search_filter" data-id="topic">
                                  <option value="" selected>Topic</option>
                                </select>
                              </div>
                              <div class="item">
                                <select name="question_type_filter" id="question_type_filter" class="form-control search_filter">
                                  <option value="" selected>Question Type</option>
                                  <option value="1">Multiple choise</option>
                                </select>
                              </div>
                              <div class="item">
                                <select name="difficulty_level_filter" id="difficulty_level_filter" class="form-control search_filter">
                                  <option value="" selected>Difficulty Level</option>
                                  <option value="1">Easy</option>
                                  <option value="2">Medium</option>
                                  <option value="3">Hard</option>
                                </select>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <!-- Table -->
                    <p class="text-right font-bold mb-2 total_question">
                      Total No of Questions: {{$questiontotalRecord}}
                    </p>
                    <div class="table-responsive">
                      <table class="table card-table table-vcenter text-nowrap" id="quiz-question">
                        <thead>
                          <tr>
                            <th width="40">
                              <label class="custom-control custom-checkbox">
                                <input type="checkbox" class="custom-control-input all_chk" name="example-checkbox1" value="1"/>
                                <span class="custom-control-label"></span>
                              </label>
                            </th>
                            <th width="60">S.No</th>
                            <th>Question Details</th>
                            <th width="130">
                              <div class="dropdown">
                                <button class="btn btn-custom-toggle dropdown-toggle btn-block" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Positive</button>
                                <div  class="dropdown-menu custom-dropdown-menu" aria-labelledby="dropdownMenuButton" >
                                  <p class="dropdown-item">
                                    <input type="text" class="form-control" />
                                  </p>
                                  <a href="javascript:void(0)" class="dropdown-item text-center font-book fs-14 text-danger positiveApply" data-type="positive">Apply Now</a>
                                </div>
                              </div>
                            </th>
                            <th width="130">
                              <div class="dropdown">
                                <button class="btn btn-custom-toggle dropdown-toggle btn-block" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Negative</button>
                                <div  class="dropdown-menu custom-dropdown-menu" aria-labelledby="dropdownMenuButton" >
                                  <p class="dropdown-item">
                                    <input type="text" class="form-control" />
                                  </p>
                                  <a href="javascript:void(0)" class="dropdown-item text-center font-book fs-14 text-danger negativeApply" data-type="negative">Apply Now</a>
                                </div>
                              </div>
                            </th>
                            <th width="40">
                              <a href="javascript:void(0)" class="action-btn reverse all_delete">
                                <img src="{{asset('admin/images/bin.svg')}}" alt="" />
                              </a>
                            </th>
                          </tr>
                        </thead>
                        
                      </table>
                    </div>
                    <!-- Table end -->
                  </div>
                  <span id="testDetails-id" data-id="{{base64_encode($quizDetails->id)}}" style="display: none;"></span>
                  <div class="test-footer">
                    <a href="{{route('admin.quiz.list')}}"><button class="btn btn-outline-primary btn-pill btn-streach font-book mt-6 fs-14">Back </button></a>
                    @if($quizDetails->status < 3)
                    <butto class="btn btn-primary btn-streach font-book mt-6 fs-14  ml-3 publish_quiz">Publish Quiz</button>
                    @endif
                  </div>
                </div>
              </div>
            </div>
            <!-- //Table -->
            <!--// MAIN BODY CONTENT -->
				</div>
			</div>
@endsection
@section('scripts')
<script type="text/javascript">
	var quiz_question_data = "{{route('admin.quiz.question.list', base64_encode($quizDetails->id))}}"; 
  @if(Session::has('success'))
            Swal.fire('{{ Session::get('success') }}');
  @endif
</script>
<script type="text/javascript" src="{{asset('js/quiz_question.js?v='.time())}}"></script>
@endsection
