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/result/review','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">
<label class="col-sm-2 col-form-label">Class </label>
<div class="col-sm-4">
<div class="form-group">
<?php echo Form::select('idExam',$exams,null,['class' => 'form-control select2 show-tick ms','required'=>'required']); ?>
</div>
</div>
</div>
<?php endif; ?>
<input type="hidden" name="student" value="<?php echo e($students->idStudent); ?>">
<input type="hidden" name="idMcq" value="<?php echo e($template->idMcq); ?>">
<?php if(isset($template)): ?>
<?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(); ?>
<?php
$response = DB::table('exam_mcq_response')->where('idQuestion',$mques->idQuestions)->where('idStudent',$students->idStudent)->first();
?>
<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 == "mcq" || $mques->questionType == "images_questions"): ?>
<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; ?>
<?php if(isset($response)): ?>
<?php if($response->response == "NA"): ?>
<p style="color: blue;"><?php echo e($students->firstName); ?> Answer : </p>
<?php else: ?>
<?php if($mques->questionType == "image_long"): ?>
<a href='<?php echo e(asset('storage/schools/'.$template->idSchool.'/mcq/mcq_'.$students->idStudent.'_result_'.$mques->idQuestions.'.jpg')); ?>' class="btn btn-raised btn-info waves-effect btn-round" target="_blank">View Image</a>
<?php else: ?>
<p style="color: blue;"><?php echo e($students->firstName); ?> Answer : <?php echo e($response->response); ?></p>
<?php endif; ?>
<?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['.$mques->idQuestions.'][marks]',$response->marks,['class' => 'form-control']); ?>
</div>
</div>
</div>
<?php endif; ?>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<div class="row clearfix">
<div class="col-sm-6 offset-sm-2">
<?php echo Form::submit('Publish Result',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php echo Form::close(); ?>
</div>
<div class="col-sm-12">
<label id="markserror" class="error col-sm-12" for="minmaxlength">
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
<?php if(!isset($template)): ?>
var examID = -1;
$(document).ready(function() {
$('select[name="idExam"]').on('change', function() {
examID = $(this).val();
});
});
$('#form').on('submit',function(e){
$("#submit-btn").prop('disabled', true);
if (examID > 0) {
window.location = "<?php echo e(url('school/exam/addquestions')); ?>"+"/"+examID;
}
return false;
});
<?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/result/review')); ?>",
processData: false,
contentType: false,
data:formData,
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 = "<?php echo e(url('school/exam/result/review?idExam='.$template->idMcq)); ?>";
}
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>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -