<commit_before><?php

/**
 * Created by PhpStorm.
 * User: Chameera_Intern
 * Date: 9/21/2016
 * Time: 11:50 AM
 */
defined('BASEPATH') OR exit('No direct script access allowed');
class Paper extends CI_Controller
{
    public function paperlayout()
    {
        $this->load->library('session');
        if(isset($this->session->userdata['logged_in']))
        {
            $batch = $this->session->userdata['profile_data']['batch'];
            $student_id = $this->session->userdata['profile_data']['prof_user_id'];
            $this->load->model('question_model');
            $resPaperLayout = $this->question_model->getpaperLayout(date("Y-m-d"),$batch);
            if($resPaperLayout) {
                $data['single_choice'] = $resPaperLayout->single_choice;
                $data['true_false'] = $resPaperLayout->true_false;
                $data['multiple_choice'] = $resPaperLayout->multiple_choice;
                $qpwd = $resPaperLayout->quiz_password;
                $pwd_frompage = $this->input->get('quiz_pwd');

                $resPaperDownload = $this->question_model->getpaperDownload($resPaperLayout->paper_id,$student_id);
                if($resPaperDownload) {

                    $message['mas'] = "You have already Download the paper once";
                    $this->load->library('session');
                    $this->load->helper('url');
                    $this->load->view('header/head1');
                    $this->load->view('paper/NoPaperToday',$message);
                    $this->load->view('footer/footer1');
                }
                else {
                    $downloadDetails = array(
                        'layout_id' => $resPaperLayout->paper_id,
                        'student_id' => $student_id,
                        'batch_no' => $batch,
                        'download_date' => date("Y-m-d"),
                        'download_time' => date("h:i:sa"),
                    );
                    $this->question_model->insert_paperDownload($downloadDetails);

                    if ($qpwd == $pwd_frompage) {
                        $this->load->helper('url');
                        $this->load->model('question_model');
                        $data['qestiontype_id'] = $this->question_model->getquestions(1);//result of your query is stored in this ($data['progcategoryid']) variable
                        $data['gettruefalse'] = $this->question_model->getquestions(2);
                        $data['getmultiple'] = $this->question_model->getquestions(3);
                        //$this->load->view('paper/paper', $data);

                        //convert to pdf
                        $pdfFilePath = FCPATH . "/downloads/reports/aaaa.pdf";
                        $html = $this->load->view('paper/paper', $data, true); // render the view into HTML
                        $this->load->library('pdf');<commit_msg>paper generation bug fixed<commit_after><?php

/**
 * Created by PhpStorm.
 * User: Chameera_Intern
 * Date: 9/21/2016
 * Time: 11:50 AM
 */
defined('BASEPATH') OR exit('No direct script access allowed');
class Paper extends CI_Controller
{
    public function paperlayout()
    {
        $this->load->library('session');
        if(isset($this->session->userdata['logged_in']))
        {
            $batch = $this->session->userdata['profile_data']['batch'];
            $student_id = $this->session->userdata['profile_data']['prof_user_id'];
            $this->load->model('question_model');
            $resPaperLayout = $this->question_model->getpaperLayout(date("Y-m-d"),$batch);
            if($resPaperLayout) {
                $data['single_choice'] = $resPaperLayout->single_choice;
                $data['true_false'] = $resPaperLayout->true_false;
                $data['multiple_choice'] = $resPaperLayout->multiple_choice;
                $qpwd = $resPaperLayout->quiz_password;
                $pwd_frompage = $this->input->get('quiz_pwd');

                $resPaperDownload = $this->question_model->getpaperDownload($resPaperLayout->paper_id,$student_id);
                if($resPaperDownload) {

                    $message['mas'] = "You have already Download the paper once";
                    $this->load->library('session');
                    $this->load->helper('url');
                    $this->load->view('header/head1');
                    $this->load->view('paper/NoPaperToday',$message);
                    $this->load->view('footer/footer1');
                }
                else {
                    if ($qpwd == $pwd_frompage) {
                    $downloadDetails = array(
                        'layout_id' => $resPaperLayout->paper_id,
                        'student_id' => $student_id,
                        'batch_no' => $batch,
                        'download_date' => date("Y-m-d"),
                        'download_time' => date("h:i:sa"),
                    );
                    $this->question_model->insert_paperDownload($downloadDetails);


                        $this->load->helper('url');
                        $this->load->model('question_model');
                        $data['qestiontype_id'] = $this->question_model->getquestions(1);//result of your query is stored in this ($data['progcategoryid']) variable
                        $data['gettruefalse'] = $this->question_model->getquestions(2);
                        $data['getmultiple'] = $this->question_model->getquestions(3);
                        //$this->load->view('paper/paper', $data);

                        //convert to pdf
                        $pdfFilePath = FCPATH . "/downloads/reports/aaaa.pdf";
                        $html = $this->load->view('paper/paper', $data, true); // render the view into HTML
                        $this->load->library('pdf');
{'fraction_non_alphanumeric': 0.15305067218200621, 'fraction_numerical': 0.005515339538090314, 'mean_word_length': 1.799324650265316, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '798487', 'n_tokens_mistral': 1617, 'n_tokens_neox': 1495, 'n_words': 228}