관리-도구
편집 파일: quizzes.php
<?php global $mysqli; $total_sub_quiz=0; $training_ob=$this->load('training_control'); $course_control = $this->load("course_control"); $quiz_stud_ob=$this->load('quiz_stud_control'); $all_course = $training_ob->getCourse(); $page_count=1; if(isset($_GET['page_count']) && is_numeric($_GET['page_count'])) { $page_count=(int)$_GET['page_count']; } $course_id= (int) (isset( $_GET['cfcourse_id'] ) && is_numeric( $_GET['cfcourse_id'] ) ) ?$mysqli->real_escape_string( $_GET['cfcourse_id'] ):false; $filter= (int) (isset( $_GET['cfcourse_filter'] ) ) ?$mysqli->real_escape_string( $_GET['cfcourse_filter'] ):false; $content_id= (int) (isset( $_GET['cfcontent_id'] ) && is_numeric( $_GET['cfcontent_id'] ) ) ?$mysqli->real_escape_string( $_GET['cfcontent_id'] ):false; $all_content = $training_ob->getAllContents( $course_id,"quiz"); ob_start(); echo '<div class="col-lg-2 "> '.createSearchBoxBydate().' </div> <div class="col-lg-2 my-3 my-lg-0 "> <div class="position-relative"> <button class="w-100 btn dropdown-toggle btn-sm btn-block" id="cf-course-filter-btn">'.t('Filter').'</button> <div class="mx-auto " id="cf-course-open-filter"> <div class="mb-3"> <select id="cf-course-selec-course" class="form-control form-control-sm""> <option value="all">'.t('All Courses').'</option>'; foreach($all_course as $course) { if( $course_id == $course['id'] ) { echo '<option value='.$course['id'].' selected>'.$course['title'].'</option>'; }else{ echo '<option value='.$course['id'].' >'.$course['title'].'</option>'; } } echo '</select> </div> <div class="mb-3"> <select id="cf-course-selec-content" class="form-control form-control-sm"> <option value="all">'.t('All Quizzes').'</option>'; foreach( $all_content as $lecture ) { if( $content_id == $lecture['id'] ) { echo '<option value="'.$lecture['id'].'" selected>'.base64_decode($lecture['title']).'</option>'; }else{ echo '<option value="'.$lecture['id'].'" >'.base64_decode($lecture['title']).'</option>'; } } echo '</select> </div> <div class="mb-3"> <select id="cf-course-filter-comment" class="form-control form-control-sm"> <option value="all" '. ($filter=="all"?"selected":"") .' >'.t('All submitted quiz').'</option> <option value="r" '. ($filter=="r"?"selected":"") .'>'.t('Replied quiz').'</option> <option value="nr" '. ($filter=="nr"?"selected":"") .'>'.t('Not replied quiz').'</option> <option value="cq" '. ($filter=="cq"?"selected":"") .'>'.t('Checked quiz').'</option> <option value="uncq" '. ($filter=="uncq"?"selected":"") .'>'.t('Unchecked quiz').'</option> </select> </div> </div> </div> </div> <div class="col-lg-3"> '.showRecordCountSelection().' </div> <div class="col-lg-2 ">'.arranger(array('id'=>'date')).' </div> <div class="col-lg-3 "> <div class="mb-3"> <div class="input-group input-group-sm"> <div class="input-group-prepend "> <span class="input-group-text"><i class="fas fa-search"></i></span> </div> <input type="text" class="form-control form-control-sm" placeholder="'.t('Filter with student name, quiz name, course name').'" onkeyup="searchPaymentMethods(this.value)"> </div> </div> </div>'; $table_manager=ob_get_clean(); $max_leads_limit=(int)get_option('qfnl_max_records_per_page'); $total_sub_quiz=$quiz_stud_ob->getSubQuizzesCount( $course_id ); $quizzes=$quiz_stud_ob->getAllSubQuizzes( $total_sub_quiz, $max_leads_limit, $page_count, $course_id,$content_id,"one",$filter ); $install_url = get_option('install_url'); ?> <div class="container-fluid pb-3"> <div class="row page-titles mb-4"> <div class="col-md-5 align-self-center"> <h4 class="text-themecolor" id="commoncontainerid"><?= t('Quiz'); ?></h4> </div> <div class="col-md-7"> <span class="cf-coruse-go-back" id="cf-course-get-back-t" style="float: right; color: rgb(31, 87, 202); font-size: 16px; margin-top: 10px; cursor: pointer;"><i class="fas fa-arrow-alt-circle-left"></i> <?= t('Go back'); ?></span> </div> </div> <div id="cf-course-all-quiz"> <div class="mx-1 mx-sm-3"> <div class="row"> <?=$table_manager; ?> </div> </div> <div class="pt-3 pb-1"> <div class="row"> <div class="col-md-3 px-1 ps-3 "> <select name="" id="cf-course-bulk-action-quiz" class="form-control form-control-sm"> <option value="-1"><?= t('Bulk Action'); ?></option> <option value="del"><?= t('Delete'); ?></option> <option value="ch"><?= t('Checked'); ?></option> <option value="uch"><?= t('Unchecked'); ?></option> <option value="rep"><?= t('Reply'); ?></option> </select> </div> <div class="col-md-1 px-1 px-sm-1 "> <button class="btn btn-outline-secondary btn-sm" id="cf-course-bulk-quiz-btn"><?= t('Apply'); ?></button> </div> <div class="col-md-7 px-1 "> <span class="text text-danger cf-course-bulk-show"> <?= t('Please choose one action.'); ?> </span> </div> </div> </div> <div class="pb-2 border mt-2 bg-white br-rounded " id="cf-course-mcomment"> <div class="pb-2"> <div class="row"> <div class="col-sm-12 "> <div class="table-responsive"> <table class="table table-striped text-center"> <thead> <tr> <th width="3%">#</th> <th> <span class="cf-course-custom-check"> <input type="checkbox" id='cf-checkforall' > <label for="cf-checkforall"></label> </span> <?= t('Student Name'); ?> </th> <th><?= t('Course Name'); ?></th> <th><?= t('Quiz Name'); ?></th> <th><?= t('Response'); ?></th> <th><?= t('Submitted on'); ?></th> </tr> </thead> <tbody id="quizkeywordsearchresult"> <!-- keyword search --> <?php $count=1; if(isset($_GET['page_count'])) { $page_count=(int)$_GET['page_count']; $count=($page_count*$max_leads_limit)-$max_leads_limit; ++$count; } if($quizzes!=null) { if( count($quizzes) > 0 ) { $counting=0; $odd_even=0; foreach( $quizzes as $data ){ $counting++; $qr_id = $data['id']; $name = $data['name']; $course_name = $data['course_name']; $quiz_name = stripslashes( $data['quiz_name']); if($odd_even==0){ $trclass="cf-course-odd-tr"; $odd_even=1; } else if($odd_even==1){ $trclass="cf-course-even-tr"; $odd_even=0; } ?> <tr class='cf-course-hover-comemnt <?=$trclass; ?> cf-course-parent-quizzes' id='cf-course-comment-row-<?= $qr_id ?>' > <td width="3%"><?= $counting; ?></td> <td width="20%"> <span class="cf-course-custom-check"> <input type="checkbox" class="cf-bulk-check" value="<?=$qr_id ?>" id='cf-bulk-check-<?=$qr_id ?>' data-quiz="<?= $quiz_name; ?>" data-course="<?= $course_name; ?>" data-name="<?= $data['name']; ?>" data-email="<?= $data['email']; ?>" data-sub-quiz-id="<?=$qr_id; ?>" > <label class="cf-bulk-check-for" for="cf-bulk-check-<?=$qr_id ?>"><?php echo $data['name']; ?> <span class="text-info cf-course-read-check text-sm" style="opacity:<?= ( $data['checked']=='1')?'1':'0'; ?>"><i class='fas fa-check'></i></span></label> </span> </td> <td width="20%"><?= $course_name ?></td> <td width="%"><?= $quiz_name ?> <div class="cf-course-actions p-1"> <a href="javascript:void(0)" data-id="<?= $qr_id ?>" data-check="<?= $data['checked']; ?>" class="text-primary cf-course-check-quiz text-sm"><?= t(( $data['checked']=="1")?"Checked":"Not checked"); ?></a> | <a href="javascript:void(0)" data-id="<?= $qr_id ?>" class="text-success cf-course-delete-quiz text-sm"><?=t('Delete'); ?></a> | <a href="javascript:void(0)" data-quiz="<?= $quiz_name; ?>" data-course="<?= $course_name; ?>" data-name="<?= $data['name']; ?>" data-email="<?= $data['email']; ?>" data-sub-quiz-id="<?=$qr_id; ?>" class="text-warning cf-course-reply-quiz text-sm" id="cf-course-quiz-reply-<?= $qr_id ?>"> <?= t(( $data['reply']=="1")?"Replied":"Reply"); ?> </a> </div> </td> <td width="15%"> <a href="javascript:void(0)" class="cf-course-show-one-quiz" data-mid="<?= $data['member_id']; ?>" data-qrid="<?= $qr_id; ?>" data-cid="<?= $data['course_id']; ?>" ><?=t('Check Quiz'); ?> <i class="fas fa-eye cf-course-show-one-quiz" data-mid="<?= $data['member_id']; ?>" data-qrid="<?= $qr_id; ?>" data-cid="<?= $data['course_id']; ?>"></i></a> </td> <td width="17%" class='text-right'><?php echo date( "d-M-Y h:ia", strtotime($data['submitted_on'])); ?></td> </tr> <?php } } } ?> <!-- /keyword search --> </tbody> <tfoot> <tr> <td colspan="7" class="total-data" ><center> <?= t('Total Submitted Quizzes'); ?>: <?=$total_sub_quiz; ?></center></td> </tr> </tfoot> </table> <!-- for students result data --> <div class="col-sm-12 mt-1 text-right"> <form method="post"><button type="submit" class="btn theme-button" name="quizto_csv" value="<?php if(isset($_GET['product_id'])){ echo $_GET['product_id']; }else{echo 0;} ?>"><i class="fas fa-file-download"></i> <?php w('Export to CSV'); ?></button></form> </div> <!-- for students data with question and answer --> <div class="col-sm-12 mt-1 text-right"> <form method="post"><button type="submit" class="btn theme-button" name="quizto_csv_an" value="<?php if(isset($_GET['product_id'])){ echo $_GET['product_id']; }else{echo 0;} ?>"><i class="fas fa-file-download"></i> <?php w('Export to CSV with question'); ?></button></form> </div> </div> </div> </div> <div class="col-md-12 row nopadding"> <div class="col-sm-6 mt-4"> <?php $next_page_url="index.php?page=cfcourse_quiz_response&page_count"; $page_count=($page_count<2)? 0:$page_count; echo createPager( $total_sub_quiz,$next_page_url,$page_count); ?> </div> </div> </div> </div> </div> <div id="cf-course-one-quiz"> </div> <div class="row mb-4"> <div class="col-md-12"> <span id="cf-course-get-back-b" class="cf-coruse-go-back" style="float: left;color: rgb(31, 87, 202);font-size: 16px;margin-top: 10px;cursor: pointer;margin-left: 23px;"><i class="fas fa-arrow-alt-circle-left"></i> <?= t('Go back'); ?></span> </div> </div> </div> <!-- Modal --> <!-- The cf_course_drip_model --> <div id="cf_course_one-assing_model" class="cf_course_drip_model p-0 m-0" style="background-color:#000000c9;z-index:99;" > <div class="w-75 mx-auto"> <div class=" bg-light " > <form id="cf-course-all-quiz-reply" class="cf-course-all-quiz-reply" > <div class="cf_course_drip_model-content p-4 w-100" > <div class="alert alert-info"> <span class="cf-course-close-drip cf-course-close-btn ">×</span> <h2 id="cf-course-delete-he"><?= t('Send Mail') ?></h2> </div> <div class="row"> <div class="col-md-6"> <div class="mb-3"> <label class="text-primary "><?= t('Shortcodes'); ?></label> <div class="card-body border rounded" style="font-size:0.9em;"> <div class="text-sm"> <?= t('Use'); ?> <span class="cf-course-label-5">{name}</span> <?= t('as student name'); ?> </div> <div class="text-sm"><?= t('Use'); ?> <span class="cf-course-label-5">{course_name}</span><?= t('as course name'); ?> </div> <div class="text-sm"> <?= t('Use'); ?> <span class="cf-course-label-5">{quiz_name}</span> <?= t('as quiz name'); ?> </div> </div> </div> <div class="mb-3 my-2"> <label class="text-primary ">Group Size</label> <input type="number" id="cf-course-quiz-groupSize" name="group_size" value="3" class="form-control"> </div> </div> <div class="col-md-6 pt-0"> <div class="cf_course_drip_model-body pt-0"> <div class="cf-course-dis-form"> <input type="hidden" name="name" id="cf-course-all-quiz-name" value="" /> <input type="hidden" name="email" id="cf-course-all-quiz-email" value="" /> <input type="hidden" name="cname" id="cf-course-all-quiz-course" value="" /> <input type="hidden" name="qname" id="cf-course-all-quiz-response" value="" /> <input type="hidden" name="bulk" value="reply_quiz_bulk" /> <input type="hidden" name="aid" id="cf-course-all-quiz-id" value="" /> <input type="hidden" name="len" id="cf-course-all-quiz-len" value="" /> <div class="mb-3"> <label class="text-primary" class="cf-course-label-5"><?= t('Subject'); ?></label> <input type="text" name="title" class="form-control" required> </div> <div class="mb-3"> <label class="text-primary" class="cf-course-label-5"><?= t('Content'); ?></label> <textarea id="cf-course-quiz-allreply" class="cf-course-one-reply mb-3" ></textarea> </div> </div> </div> <div class="modal-footr px-4 pb-3"> <div id="cfcourse-fetch-all-sent-email" class="cfcourse-fetch-all-sent-email ms-3"></div> <div class="py-3"> <button type="submit" class="btn btn-success btn-sm" id="cf--cquiz-one-reply"><?= t('Send Email'); ?></button> <button type="button" class="btn btn-primary cf-course-close-btn btn-sm float-right "><?= t('Close'); ?></button> </div> <div id="cf-course-a-oerror_m" class="ajax_response alert-danger ms-2 " ></div> <div id="cf-course-a-osuccess_m" class="ajax_response alert-success ms-2 " ></div> </div> </div> </div> </div> </form> </div> </div> </div> <!--Model end --> <input type="hidden" id="cfcourse_ajax" value="<?php echo get_option('install_url')."/index.php?page=ajax"; ?>"> <div id="mycf_course_drip_delete_quiz" class="cf_course_drip_model" style="border-radius:5px"> <!-- cf_course_drip_model content --> <div class="cf_course_model_w_anim"> <div class="alert alert-info pb-1 mb-0 "> <span class="cf-course-close-drip cf-course-close-drip-btn">×</span> <h5 id="cf-course-delete-he "><?= t('Please Confirm'); ?></h5> </div> <div class="cf_course_drip_model-body py-3 cf_course_drip_model-del-body"> <?= t('Do you really want to delete this quiz response?'); ?> </div> <input type="hidden" id="cf-course-delete-quiz" value=""> <input type="hidden" id="cf-course-quiz-bulkaction" value=""> <input type="hidden" id="cf-course-quiz-bulkval" value=""> <div class="modal-footer"> <button type="button" class="btn btn-primary btn-sm cf-course-close-drip-btn"><?= t('Cancel'); ?></button> <button type="button" class="btn btn-danger btn-sm cf-course-remove-quiz"><?= t('Delete'); ?></button> </div> </div> </div> <div id="cf-course-snackbar-admin"><?= t('Quiz Response Deleted'); ?>.</div> <script> function searchPaymentMethods(search) { var ob=new OnPageSearch(search,"#quizkeywordsearchresult"); ob.url=window.location.href; ob.search(); } </script>