<form id="form-nuevo">
	<input type="hidden" id="idConfiguracion" value="{{ $modulos[0]->configuracion_id }}">
	<div class="row">
		<div class="col-md-11 col-sm-12">
			<div class="row">
				<div class="col-md-4 col-sm-12">
				  <div class="form-group">
				    <select class="form-control form-control-sm" required="" id="modulo" name="modulo">
				    	<option value="">.:Módulos:.</option>
				    	@foreach ($modulos as $m)
								<option value='{{ $m->id }}'>Módulo {{ $m->nombre }}</option>
							@endforeach	    		
				    </select>
				  </div>
				</div>
				<div class="col-md-4 col-sm-12">
				  <div class="form-group">
				    <select class="form-control form-control-sm" required="" id="nivel" name="nivel">
				    	<option value="">.:Nivel:.</option>
				    	@foreach ($niveles as $n)
								<option value='{{ $n->id }}'>{{ $n->nombre }}</option>
							@endforeach	       		
				    		
				    </select>
				  </div>
				</div>
				<div class="col-md-4 col-sm-12">
				  <div class="form-group">
				    <input type="number" placeholder="No. aciertos" id="aciertos" name="aciertos" class="form-control form-control-sm">
				    <label class="text-danger">No. aciertos del estudiante <= No. aciertos.</label>
				  </div>
				</div>
			</div>
		</div>
				
		<div class="col-md-1 col-sm-12">
		  <button class="btn btn-success btn-sm btn-block" type="button" data-toggle="tooltip" data-placement="left" title="" onclick="javascript:nv_aciertos_add('25');" data-original-title="Guardar"><i class="fa fa-save"></i></button>
		</div>
	</div>
</form>


<div class="row">
	@foreach ($modulos as $m)

		<div class="col-md-6">
	    <div class="x_panel">

	      <div class=" x_title">
	        <h2>Módulo {{ $m->nombre }}</h2>
	        <div class="nav navbar-right panel_toolbox">
	        	<label class="btn-sm">
						  Total reactivos: <span class="badge badge-success" style="color: #fff;" id='ac_mod_{{ $m->id }}'>{{ $m->preguntas_count }}</span>
						</label>
	        </div>
	        <div class="clearfix"></div>
	      </div>

	      <div class="x_content">
	        <form id="form-nuevo">

	        	
						<div class="row">
							<div class="col-md-12 col-sm-12">
							  <div class="form-group">
							    <label>Mínimo de aciertos para pasar al siguiente módulo:</label>
							  </div>
							</div>
						</div>
						<div class="row">
							<div class="col-md-8 col-sm-12">
							  <div class="form-group">
							    <div class="input-group">
							      <input type="number" class="form-control form-control-sm input-group-dp"  placeholder="" value="{{ $m->min_ac }}" readonly id="minimo_{{ $m->id }}">
							      <div class="input-group-addon-dp input-group-addon-dp-green" onclick="javascript:nv_minimo({{ $m->id }})" id="addon_edit_{{ $m->id }}"><i class="fa fa-edit"></i> Editar</div>
							      <div class="input-group-addon-dp input-group-addon-dp-red" onclick="javascript:nv_minimo_update({{ $m->id }}, {{ $m->preguntas_count }})" style="display:none;" id="addon_update_{{ $m->id }}" ><i class="fa fa-save"></i> Guardar</div>
							    </div>
							  </div>
							</div>
						</div>
						

						@foreach ($m->moduloNivel as $n)
							<div class="row">
								<div class="col-md-6 col-sm-12">
								  <div class="form-group d-flex justify-content-lg-between n_aciertos" 
								  	onmouseover="this.querySelector('.n_close').style.display = 'block'" 
								  	onmouseout="this.querySelector('.n_close').style.display = 'none'" >
								    <label>{{ $n->aciertos }} Aciertos - {{ $n->nivel->nombre }}</label>
								    <span class="fa fa-close text-danger n_close" style="display:none;" 
								    	onclick="javascript: modal_mediano(
								    		'Configuración de Niveles', 
								    		'¿Esta seguro que deseas eliminar el número de aciertos para el nivel?', 
								    		'<button type=\'button\' class=\'btn btn-success\' onclick=\'nv_delete_limite({{ $n->id }});\'>Confirmar</button>')" 
								    ></span>
								  </div>
								</div>
							</div>
						@endforeach

					</form>
	      </div>
	    </div>
	  </div>
	@endforeach
	  
</div>

<div class="row mt-3">
  <div class="col-md-4 col-sm-12"></div>
  <div class="col-md-4 col-sm-12">
    <div class="row">
      <div class="col">
        <button type="button" class="btn btn-warning btn-block" onclick="javascript:ngl_consulta_regresar();" style="color: #fff;"><i class="fa fa-times"></i> Regresar</button>
      </div>
    </div>
  </div>
  <div class="col-md-4 col-sm-12"></div>
</div>