BBnepal-Accounts/application/views/teacher/TF-grade-exam-details.php

143 lines
5.3 KiB
PHP
Raw Permalink Normal View History

2024-07-10 12:43:19 +00:00
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_teacher/css/style2.css">
<main class="common_margin" id="main">
<div class="main-inner-content main-wrap">
<div class="class-head">
<a href="<?php echo base_url().'teacher/teacher_grades'; ?>" style="text-decoration-line: none;color: inherit;">
<h3 class="common-heading"> <i class="fas fa-long-arrow-alt-left"></i>Student Grades </h3> </a>
<div class="date-month-picker">
<!-- <input type="month" id="start" name="start" min="2018-03" value="2018-05"> -->
<div class="calendar-main test-exam-datepicker">
<div class="calendar-cover" id="calendar">
<!-- <div class="calendar-date-year">
<img src="<?= base_url(); ?>assets_student/images/calendar2.png">
</div>
<div id="Datepicker1" ></div> -->
</div>
</div>
</div>
</div>
<div class="stud-dev-wrap stud-dev-wrap-new">
<div class="stud-wrap-left">
<?php if (isset($session_results) && $session_results != '') {
foreach ($session_results as $key => $value) {
?>
<div class="stud-row-one">
<h6><?php echo $value['e_name'] .' '. $value['bs_date'] ?></h6>
<input type="button" class="phy-evlauate" value="View Grades" onclick="get_grades(<?php echo $value['exam_id'] .','. $value['classroom_id']; ?>)">
</div>
<?php } } ?>
</div>
<div class="stud-wrap-right" style="display: none;">
<div class="stud-exam-detail-header"></div>
<div class="student-info-wrap">
<h6>Name</h6>
<h6>Grades</h6>
</div>
<ul class="stud-info-list">
</ul>
</div>
</div>
</div>
<?php if (!isset($session_results) && $session_results == '') {
?>
<div class="no_data_div">
<div class="No_data">
<span>
<h5>No Student Grades</h5></span>
</div>
<?php } ?>
</div>
</div>
</main>
<script>
$('#start').on('change', function(){
var date = $(this).val();
var cls_id = <?php echo $classroom_id ? $classroom_id : 0; ?>;
// alert($(this).val());
$.ajax({
url: '<?php echo base_url() ?>teacher/get_datewises_exam_details/'+cls_id+'/'+ date,
type:'POST',
success: function(result) {
let header_one = '';
console.log(result.length);
var res = JSON.parse(result);
if (res.length === 0) {
$('.stud-row-one').hide();
ul_data = '<div class="stud-row-one"><h6>No Data Found</h6></div>';
$('.stud-wrap-left').append(ul_data);
}else{
$.each(res, function(index, value){
header_one +='<div class="stud-row-one"><h6>'+value['e_name'] +' - '+ moment(value['exam_date']).format('MMMM-YYYY') +'</h6><input type="button" class="phy-evlauate" value="View Grades" onclick="get_grades('+ value['exam_id']+','+value['classroom_id'] +')"></div>';
});
// $('.eval-wrap-right').html(ul_data);
$('.stud-wrap-left').html(header_one);
}
}
});
});
function get_grades(exam_id, $clas_id)
{
$.ajax({
url: '<?php echo base_url() ?>teacher/get_exam_grade_details/'+exam_id+'/'+$clas_id,
type:'POST',
success: function(result) {
let header_one = '';
var res = JSON.parse(result);
console.log(res);
if (res.length=== 0) {
ul_data = '<div class="stud-evalutaion-detail-header">No Data Found</div><ul class="eval-sub"></ul>';
$('.eval-wrap-right').append(ul_data);
}else{
$('.stud-wrap-right').show();
console.log(res.length)
$.each(res, function(index, value){
// console.log(value['question_id']);
// ul_data = '<div class="stud-exam-detail-header">'+ value['e_name'] +'</div><ul class="stud-info-list"></ul>';
$('.stud-exam-detail-header').text(value['e_name']);
header_one +='<li><p>'+ value['name'] +'</p><div class="end-btn-grd"><a href="<?php echo base_url() ?>teacher/teacher_grade_details/'+ value['student_id'] +'/'+ value['exam_id']+'"><input type="button" class="list-end-btn" value="View Grade"></a></div></li>';
});
// $('.eval-wrap-right').html(ul_data);
$('.stud-info-list').html(header_one);
}
}
});
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>