<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Analytics extends Easol_Controller {


    protected function accessRules(){
        return [
            "index"     =>  "@",
        ];
    }

    public function __construct () {
        parent::__construct();
        $config = $this->easol_module->module_config('analytics');
        $this->api_url = $config->api_url;
        $this->api_key = $config->api_key;
        $this->api_pass = $config->api_pass;
    }


    public function index() {

        $data = array();
        $filters = $this->input->get();        

        if (!$filters['PageLength']) $filters['PageLength'] = 25;
        if (!$filters['page']) $filters['page'] = 1;

        $data['limit'] = $limit = $filters['PageLength'];
        $data['offset'] = $offset = ($filters['page']) ? ($filters['page'] - 1) * $limit : 0;

        $data['filters'] = $filters;
        $data['page'] = $filters['page'];
        unset($filters['page']);
        unset($filters['PageLength']);
        

        $filter_map = ['term'=>'TermType.CodeValue', 'year'=>'Section.SchoolYear', 'educator'=>'Staff.StaffUSI', 'course'=>'Grade.LocalCourseCode'];

        $data['currentYear']            = Easol_SchoolConfiguration::getValue('CURRENT_SCHOOLYEAR');
        $data['currentTerm']            = Easol_SchoolConfiguration::getValue('CURRENT_TERMID');

        $data['userCanFilter']          = Easol_SchoolConfiguration::canFilterByEducator();

             // define required filters
        $where = array(
                        'edfi.Grade.SchoolId'   => Easol_Authentication::userdata('SchoolId'),
        );

        // define optional filters<commit_msg>Added profiler view temporary for analytics<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Analytics extends Easol_Controller {


    protected function accessRules(){
        return [
            "index"     =>  "@",
        ];
    }

    public function __construct () {
        parent::__construct();
        $config = $this->easol_module->module_config('analytics');
        $this->api_url = $config->api_url;
        $this->api_key = $config->api_key;
        $this->api_pass = $config->api_pass;
    }


    public function index() {
        $this->output->enable_profiler(TRUE);

        $data = array();
        $filters = $this->input->get();        

        if (!$filters['PageLength']) $filters['PageLength'] = 25;
        if (!$filters['page']) $filters['page'] = 1;

        $data['limit'] = $limit = $filters['PageLength'];
        $data['offset'] = $offset = ($filters['page']) ? ($filters['page'] - 1) * $limit : 0;

        $data['filters'] = $filters;
        $data['page'] = $filters['page'];
        unset($filters['page']);
        unset($filters['PageLength']);
        

        $filter_map = ['term'=>'TermType.CodeValue', 'year'=>'Section.SchoolYear', 'educator'=>'Staff.StaffUSI', 'course'=>'Grade.LocalCourseCode'];

        $data['currentYear']            = Easol_SchoolConfiguration::getValue('CURRENT_SCHOOLYEAR');
        $data['currentTerm']            = Easol_SchoolConfiguration::getValue('CURRENT_TERMID');

        $data['userCanFilter']          = Easol_SchoolConfiguration::canFilterByEducator();

             // define required filters
        $where = array(
                        'edfi.Grade.SchoolId'   => Easol_Authentication::userdata('SchoolId'),
        );

        // define optional filters
{'fraction_non_alphanumeric': 0.17172295363480253, 'fraction_numerical': 0.0028620492272467086, 'mean_word_length': 2.6596858638743455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2887762', 'n_tokens_mistral': 1023, 'n_tokens_neox': 973, 'n_words': 167}