IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Exam </strong> Questions</h2>
</div>
<div class="body">
<?php echo Form::open(['url' => 'school/exam/questions','class'=>'form-horizontal','id'=>'form']); ?>
<?php if(isset($template)): ?>
<h6 style="margin-left: 20px;"> Exam Details</h6>
<div class="table-responsive" style="margin: 20px;">
<table class="table table-bordered">
<thead>
<tr>
<th>Exam Name</th>
<th>Class</th>
<th>Section</th>
<th>Subject</th>
<th>Start Time</th>
<th>Duration</th>
<th>Total Marks</th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo e($template->examName); ?></td>
<td><?php echo e($template->classM->className); ?></td>
<td><?php if(isset($template->section->sectionName)): ?><?php echo e($template->section->sectionName); ?><?php else: ?> All Section <?php endif; ?></td>
<td><?php echo e($template->subjectName); ?></td>
<td><?php echo e($template->examDate); ?></td>
<td><?php echo e($template->examTime); ?></td>
<td><?php echo e($template->totalMarks); ?></td>
</tr>
</tbody>
</table>
</div>
<h6 style="margin-left: 20px;">Question Template</h6>
<div class="row clearfix" style="margin: 20px;">
<hr>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Question Type</th>
<th scope="col">Number of Questions</th>
<th scope="col">Marks</th>
</tr>
</thead>
<tbody id="total_question">
<?php $k= 1;?>
<?php $__currentLoopData = $paper; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<th scope="row"><?php echo e($k); ?></th>
<td><?php echo e($questions["$value->typeName"]); ?></td>
<td><?php echo e($value->questions); ?></td>
<td><?php echo e($value->marks); ?></td>
</tr>
<?php $k++;?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
<?php else: ?>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover js-basic-example dataTable" id="examtable">
<thead>
<tr>
<th>Exam Name</th>
<th>Class</th>
<th>Section</th>
<th>Subject</th>
<th>Start Time</th>
<th>Total Marks</th>
<th>Action</th>
<th>Question Status</th>
</tr>
</thead>
<!--<tbody>
<?php $__currentLoopData = $exams; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($value->examName); ?></td>
<td><?php echo e($value->classM->className); ?></td>
<td><?php if(isset($value->section->sectionName)): ?><?php echo e($value->section->sectionName); ?><?php else: ?> All Section <?php endif; ?></td>
<td><?php echo e($value->subjectName); ?></td>
<td><?php echo e($value->examDate); ?></td>
<td><?php echo e($value->totalMarks); ?></td>
<td>
<a href="<?php echo e(url('school/exam/addquestions/' . $value->idMcq)); ?>" class="btn btn-raised btn-primary waves-effect btn-round">Add Question</a>
<a href="<?php echo e(url('school/exam/addquestions/' . $value->idMcq.'/show')); ?>" class="btn btn-raised btn-info waves-effect btn-round">View</a>
</td>
<td>
<?php
$questions = DB::table('exam_ques_types')->where('idExam',$value->idMcq)->sum('questions');
$total = \App\ExamQuestions::where('idMcq', $value->idMcq)->count();
?>
<?php if($questions == $total): ?>
<a href="#" class="btn btn-primary waves-effect btn-round">Done</a>
<?php else: ?>
<a href="<?php echo e(url('school/exam/addquestions/' . $value->idMcq)); ?>" class="btn btn-danger waves-effect btn-round">Pending</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>-->
</table>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if(isset($show)): ?>
<?php $exampparagraph = \App\ExamParagraph::where('idMcq','=',$template->idMcq)->get();?>
<?php if(count($exampparagraph)>0): ?>
<?php $__currentLoopData = $exampparagraph; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ep): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="row clearfix">
<div class="col-sm-2">
Question Text
</div>
<div class="col-sm-10">
<?php echo e($ep->paraText); ?>
</div>
</div>
<?php $paramcq = DB::table('exam_mcq_questions')->where('idMcq',$template->idMcq)->where('idParagraph',$ep->idParagraph)->where('questionType','=','paragraph_mcq')->get();
$paramshort = DB::table('exam_mcq_questions')->where('idMcq',$template->idMcq)->where('idParagraph',$ep->idParagraph)->where('questionType','=','paragraph_short')->get();
$p = 1;
?>
<?php $__currentLoopData = $paramcq; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mques): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="row clearfix">
<div class="col-sm-10 offset-sm-2">
<div class="header">
<h2 style="float: right;">( <strong><?php echo e($mques->marks); ?> mark</strong> )</h2>
</div>
<p> Question : <?php echo e($mques->question); ?></p>
<?php if($mques->questionType == "paragraph_mcq"): ?>
<p>A. <?php echo e($mques->answerA); ?></p>
<p>B. <?php echo e($mques->answerB); ?></p>
<p>C. <?php echo e($mques->answerC); ?></p>
<p>D. <?php echo e($mques->answerD); ?></p>
<?php endif; ?>
<?php if(isset($mques->answerCorrect) && $mques->answerCorrect != null): ?>
<p>Correct Answer : <?php echo e($mques->answerCorrect); ?></p>
<?php endif; ?>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php $__currentLoopData = $paramshort; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mques): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="row clearfix">
<div class="col-sm-10 offset-sm-2">
<div class="header">
<h2 style="float: right;">( <strong><?php echo e($mques->marks); ?> mark</strong> )</h2>
</div>
<p> Question : <?php echo e($mques->question); ?></p>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php $__currentLoopData = $paper; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php $mcq = DB::table('exam_mcq_questions')->where('idMcq',$template->idMcq)->where('questionType',$value->typeName)->get();
$p = 1;
?>
<?php $__currentLoopData = $mcq; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mques): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="row clearfix">
<div class="col-sm-10 offset-sm-2">
<div class="header">
<h2 style="float: right;">( <strong><?php echo e($mques->marks); ?> mark</strong> )</h2>
</div>
<?php if($mques->questionType == "math_type"): ?>
<p>Question : <math-field id="mv_<?php echo e($p); ?>"><?php echo e($mques->question); ?></math-field></p>
<?php else: ?>
<?php if($mques->questionType != "image_image" && $mques->questionType != "images_questions" && $mques->questionType != "math_type"): ?>
<p> Question : <?php echo e($mques->question); ?></p>
<?php else: ?>
<p>Question : </p>
<img src="<?php echo e(asset('storage/schools/'.$template->idSchool.'/mcq/'.$mques->question)); ?>" alt="questions" width="100px" style="margin: 20px;" />
<?php endif; ?>
<?php endif; ?>
<?php if($mques->questionType == "paragraph_mcq" || $mques->questionType == "mcq" || $mques->questionType == "images_questions" || $mques->questionType == "paragraph_mcq"): ?>
<p>A. <?php echo e($mques->answerA); ?></p>
<p>B. <?php echo e($mques->answerB); ?></p>
<p>C. <?php echo e($mques->answerC); ?></p>
<p>D. <?php echo e($mques->answerD); ?></p>
<?php else: ?>
<?php if($mques->questionType == "question_image" || $mques->questionType == "image_image" ): ?>
<div class="row clearfix">
<div class="col-sm-5">A. <img src="<?php echo e(asset('storage/schools/'.$template->idSchool.'/mcq/'.$mques->answerA)); ?>" alt="questions" width="100px"/></div>
<div class="col-sm-5">B. <img src="<?php echo e(asset('storage/schools/'.$template->idSchool.'/mcq/'.$mques->answerB)); ?>" alt="questions" width="100px"/></div>
<div class="col-sm-5">C. <img src="<?php echo e(asset('storage/schools/'.$template->idSchool.'/mcq/'.$mques->answerC)); ?>" alt="questions" width="100px"/></div>
<div class="col-sm-5">D. <img src="<?php echo e(asset('storage/schools/'.$template->idSchool.'/mcq/'.$mques->answerD)); ?>" alt="questions" width="100px"/></div>
</div>
<?php endif; ?>
<?php if($mques->questionType == "math_type"): ?>
<p><math-field id="mva_<?php echo e($p); ?>">A. <?php echo e($mques->answerA); ?></math-field></p>
<p><math-field id="mvb_<?php echo e($p); ?>">B. <?php echo e($mques->answerB); ?></math-field></p>
<p><math-field id="mvc_<?php echo e($p); ?>">C. <?php echo e($mques->answerC); ?></math-field></p>
<p><math-field id="mvd_<?php echo e($p); ?>">D. <?php echo e($mques->answerD); ?></math-field></p>
<?php $p++; ?>
<?php endif; ?>
<?php endif; ?>
<?php if(isset($mques->answerCorrect) && $mques->answerCorrect != null): ?>
<p>Correct Answer : <?php echo e($mques->answerCorrect); ?></p>
<?php endif; ?>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php else: ?>
<?php if(isset($template)): ?>
<?php
$i = 0;
$k = $qno;?>
<?php $__currentLoopData = $paper; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($value->typeName == 'paragraph_mcq' || $value->typeName == 'paragraph_short'): ?>
<?php if($value->typeName == 'paragraph_short'): ?>
<div class="row clearfix" style="margin-top: 20px;">
<label class="col-sm-6 col-form-label">Same as Above ParaGraph (Check If Yes Otherwise Enter New Paragraph Text)</label>
<div class="col-sm-4 checkbox-inline">
<input type="checkbox" name='samepara' value="Y">
</div>
</div>
<?php endif; ?>
<div class="row clearfix" style="margin-top: 20px;">
<label class="col-sm-2 col-form-label">Paragraph MCQ Type Question</label>
<div class="col-sm-10">
<?php echo Form::textarea('mcq['.$k.'][paraText]',null,['class' => 'form-control','placeholder'=>'Enter Paragraph Text','rows' => 3]); ?>
</div>
</div>
<?php endif; ?>
<div class="row clearfix" style="margin-top: 20px;">
<input type="hidden" name="<?php echo e('mcq['.$k.'][id]'); ?>" value="<?php echo e($value->idType); ?>">
<label class="col-sm-2 col-form-label">Number <?php echo e($qno); ?> <br><?php echo e($questions[$value->typeName]); ?> </label>
<div class="col-sm-10">
<div class="form-group">
<?php if($value->typeName == "images_questions" || $value->typeName == "image_image"): ?>
<?php echo Form::file('mcq['.$k.'][questions]',null,['class' => 'form-control']); ?>
<?php else: ?>
<?php if($value->typeName == "math_type"): ?>
<math-field id="mf_<?php echo e($i+1); ?>" style="border: 1px solid #ccc!important;">
</math-field>
<input type="hidden" id="mf_input_<?php echo e($i+1); ?>" name="<?php echo e('mcq['.$k.'][questions]'); ?>">
<?php else: ?>
<?php if($value->typeName == "paragraph_mcq" || $value->typeName == "paragraph_short"): ?>
<?php echo Form::textarea('mcq['.$k.'][questionsparamcq]',null,['class' => 'form-control','placeholder'=>$questions["$value->typeName"],'rows' => 2]); ?>
<?php else: ?>
<?php echo Form::textarea('mcq['.$k.'][questions]',null,['class' => 'form-control','placeholder'=>$questions["$value->typeName"],'rows' => 2]); ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</div>
<?php if($value->typeName == "paragraph_mcq" || $value->typeName == "mcq" || $value->typeName == "images_questions" || $value->typeName == "image_image"|| $value->typeName == "question_image" ): ?>
<div class="row clearfix offset-sm-2">
<div class="col-sm-6">
<div class="form-group"> A.
<?php if($value->typeName == "question_image" || $value->typeName == "image_image"): ?>
<?php echo Form::file('mcq['.$k.'][optionsA]',null,['class' => 'form-control']); ?>
<?php else: ?>
<?php echo Form::textarea('mcq['.$k.'][optionsA]',null,['class' => 'form-control','placeholder'=>'Option A : ','rows' => 2]); ?>
<?php endif; ?>
</div>
</div>
<div class="col-sm-6">
<div class="form-group"> B.
<?php if($value->typeName == "question_image" || $value->typeName == "image_image"): ?>
<?php echo Form::file('mcq['.$k.'][optionsB]',null,['class' => 'form-control']); ?>
<?php else: ?>
<?php echo Form::textarea('mcq['.$k.'][optionsB]',null,['class' => 'form-control','placeholder'=>'Option B : ','rows' => 2]); ?>
<?php endif; ?>
</div>
</div>
<div class="col-sm-6">
<div class="form-group"> C.
<?php if($value->typeName == "question_image" || $value->typeName == "image_image"): ?>
<?php echo Form::file('mcq['.$k.'][optionsC]',null,['class' => 'form-control']); ?>
<?php else: ?>
<?php echo Form::textarea('mcq['.$k.'][optionsC]',null,['class' => 'form-control','placeholder'=>'Option C : ','rows' => 2]); ?>
<?php endif; ?>
</div>
</div>
<div class="col-sm-6">
<div class="form-group"> D.
<?php if($value->typeName == "question_image" || $value->typeName == "image_image"): ?>
<?php echo Form::file('mcq['.$k.'][optionsD]',null,['class' => 'form-control']); ?>
<?php else: ?>
<?php echo Form::textarea('mcq['.$k.'][optionsD]',null,['class' => 'form-control','placeholder'=>'Option D : ','rows' => 2]); ?>
<?php endif; ?>
</div>
</div>
</div>
<?php else: ?>
<?php if($value->typeName == "math_type" ): ?>
<div class="row clearfix offset-sm-2">
<div class="col-sm-6">
<div class="form-group">
A.
<math-field id="mf_<?php echo e($i+1); ?>_a" style="border: 1px solid #ccc!important;">
</math-field>
<?php echo Form::hidden('mcq['.$k.'][optionsA]',null,['class' => 'form-control','placeholder'=>'Option A : ','id'=>'mf_ainput_'.($i+1) ]); ?>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
B.
<math-field id="mf_<?php echo e($i+1); ?>_b" style="border: 1px solid #ccc!important;">
</math-field>
<?php echo Form::hidden('mcq['.$k.'][optionsB]',null,['class' => 'form-control','placeholder'=>'Option B : ','id'=>'mf_binput_'.($i+1)]); ?>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
C.
<math-field id="mf_<?php echo e($i+1); ?>_c" style="border: 1px solid #ccc!important;">
</math-field>
<?php echo Form::hidden('mcq['.$k.'][optionsC]',null,['class' => 'form-control','placeholder'=>'Option C : ','id'=>'mf_cinput_'.($i+1)]); ?>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
D.
<math-field id="mf_<?php echo e($i+1); ?>_d" style="border: 1px solid #ccc!important;">
</math-field>
<?php echo Form::hidden('mcq['.$k.'][optionsD]',null,['class' => 'form-control','placeholder'=>'Option D : ','id'=>'mf_dinput_'.($i+1)]); ?>
</div>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if($value->typeName == "paragraph_mcq" || $value->typeName == "mcq" || $value->typeName == "images_questions" || $value->typeName == "image_image"|| $value->typeName == "question_image"|| $value->typeName == "math_type" ): ?>
<div class="row clearfix">
<label class="col-sm-2 col-form-label">Correct Option </label>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::select('mcq['.$k.'][correct]',$options,null,['class' => 'form-control select2 show-tick ms']); ?>
</div>
</div>
</div>
<?php endif; ?>
<div class="row clearfix">
<label class="col-sm-2 col-form-label">Marks </label>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::text('mcq['.$k.'][marks]',$value->marks,['class' => 'form-control','readonly']); ?>
</div>
</div>
</div>
<hr>
<?php break; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<div class="row clearfix">
<div class="col-sm-6 offset-sm-2">
<?php if(isset($template)): ?>
<?php echo Form::submit('Add Question',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php echo Form::submit('Next Question',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php endif; ?>
<?php echo Form::close(); ?>
</div>
<div class="col-sm-12">
<label id="markserror" class="error col-sm-12" for="minmaxlength">
</label>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
<?php if(!isset($template)): ?>
$( document ).ready(function() {
if ( $.fn.dataTable.isDataTable( '#examtable' ) ) {
table = $('#examtable').DataTable();
table.destroy();
table = $('#examtable').DataTable( {
"processing": true,
"serverSide": true,
"ajax": "<?php echo e(url('school/exam/question')); ?>"
});
}
});
<?php else: ?>
$('#form').on('submit',function(e){
$.ajaxSetup({
header:$('meta[name="_token"]').attr('content')
});
$('.page-loader-wrapper').css('display','block');
var formData = new FormData($('#form')[0]);
$("#submit-btn").prop('disabled', true);
$.ajax({
type:"POST",
url: "<?php echo e(url('school/exam/questions')); ?>",
processData: false,
contentType: false,
data:formData,
timeout: 50000,
dataType: 'json',
success:function(data){
$('.page-loader-wrapper').css('display','none');
if( data[Object.keys(data)[0]] === 'SUCCESS' ){
$("#submit-btn").prop('disabled', true);
window.location.reload();
}
else { //False Case: With error msg
$("#markserror").html(data); //$msg is the id of empty msg
}
},
error: function(data){
$('.page-loader-wrapper').css('display','none');
if( data.status === 422 ) {
var errors = data.responseJSON.errors;
$('#markserror').html('<div class="alert alert-danger">'+errors+'</div>');
}
}
});
return false;
});
<?php endif; ?>
</script>
<script type="module">
//import {serialize } from 'https://unpkg.com/@cortex-js/compute-engine/dist/compute-engine.min.esm.js';
<?php if(isset($template)): ?>
<?php $__currentLoopData = $paper; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($value->typeName == "math_type"): ?>
if (document.getElementById('mf_1'))
{
const mf = document.getElementById('mf_1');
mf.setOptions({
virtualKeyboardMode: "onfocus",
virtualKeyboards: 'numeric symbols'
});
mf.addEventListener('input',(ev) => {
$('#mf_input_1').val(mf.value);
});
}
if (document.getElementById('mf_1_a'))
{
const mf = document.getElementById('mf_1_a');
mf.setOptions({
virtualKeyboardMode: "onfocus",
virtualKeyboards: 'numeric symbols'
});
mf.addEventListener('input',(ev) => {
$('#mf_ainput_1').val(mf.value);
});
}
if (document.getElementById('mf_1_b'))
{
const mf = document.getElementById('mf_1_b');
mf.setOptions({
virtualKeyboardMode: "onfocus",
virtualKeyboards: 'numeric symbols'
});
mf.addEventListener('input',(ev) => {
$('#mf_binput_1').val(mf.value);
});
}
if (document.getElementById('mf_1_c'))
{
const mf = document.getElementById('mf_1_c');
mf.setOptions({
virtualKeyboardMode: "onfocus",
virtualKeyboards: 'numeric symbols'
});
mf.addEventListener('input',(ev) => {
$('#mf_cinput_1').val(mf.value);
});
}
if (document.getElementById('mf_1_d'))
{
const mf = document.getElementById('mf_1_d');
mf.setOptions({
virtualKeyboardMode: "onfocus",
virtualKeyboards: 'numeric symbols'
});
mf.addEventListener('input',(ev) => {
$('#mf_dinput_1').val(mf.value);
});
}
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -