protected function log_result($timesplittingid, $score, $dir = false, $info = false, $evaluationmode = 'configuration') {
        global $DB, $USER;

        $log = new \stdClass();
        $log->modelid = $this->get_id();
        $log->version = $this->model->version;
        $log->evaluationmode = $evaluationmode;
        $log->target = $this->model->target;
        $log->indicators = $this->model->indicators;
        $log->timesplitting = $timesplittingid;
        $log->dir = $dir;
        if ($info) {
            // Ensure it is not an associative array.
            $log->info = json_encode(array_values($info));
        }
        $log->score = $score;
        $log->timecreated = time();
        $log->usermodified = $USER->id;

        return $DB->insert_record('analytics_models_log', $log);
    }
protected function log_result($timesplittingid, $score, $dir = false, $info = false, $evaluationmode = 'configuration') {
        global $DB, $USER;

        $log = new \stdClass();
        $log->modelid = $this->get_id();
        $log->version = $this->model->version;
        $log->evaluationmode = $evaluationmode;
        $log->target = $this->model->target;
        $log->indicators = $this->model->indicators;
        $log->timesplitting = $timesplittingid;
        $log->dir = $dir;
        if ($info) {
            // Ensure it is not an associative array.
            $log->info = json_encode(array_values($info));
        }
        $log->score = $score;
        $log->timecreated = time();
        $log->usermodified = $USER->id;

        return $DB->insert_record('analytics_models_log', $log);
    }
protected function log_result ( $ timesplittingid , $ score , $ dir = false , $ info = false , $ evaluationmode = 'configuration' ) { global $ DB , $ USER ; $ log = new \ stdClass ( ) ; $ log -> modelid = $ this -> get_id ( ) ; $ log -> version = $ this -> model -> version ; $ log -> evaluationmode = $ evaluationmode ; $ log -> target = $ this -> model -> target ; $ log -> indicators = $ this -> model -> indicators ; $ log -> timesplitting = $ timesplittingid ; $ log -> dir = $ dir ; if ( $ info ) { // Ensure it is not an associative array. $ log -> info = json_encode ( array_values ( $ info ) ) ; } $ log -> score = $ score ; $ log -> timecreated = time ( ) ; $ log -> usermodified = $ USER -> id ; return $ DB -> insert_record ( 'analytics_models_log' , $ log ) ; }
Log the evaluation results in the database.

@param string $timesplittingid
@param float $score
@param string $dir
@param array $info
@param string $evaluationmode
@return int The inserted log id
Log the evaluation results in the database .