<commit_before><?php
use DBA\AnswerSession;

/**
 * Created by IntelliJ IDEA.
 * User: sein
 * Date: 30.03.17
 * Time: 16:30
 */
class SessionValidator {
  private $answerSession;
  
  const MALUS_ANSWER_ERROR = 0.1;
  
  /**
   * SessionValidator constructor.
   * @param $answerSession AnswerSession
   */
  public function __construct($answerSession) {
    // TODO: load some session info here
    $this->answerSession = $answerSession;
  }
  
  /**
   * @param $errorType string
   * @return float the new updated validity of the session
   */
  public function update($errorType) {
    /** @var $VALIDATORS Validator[] */
    //global $VALIDATORS;
    
    $gaussValidator = new MultivariantCrowdValidator();
    $patternValidator = new PatternValidator();
    $timeValidator = new TimeValidator();
    
    if ($this->answerSession->getIsOpen() == 0) {
      $currentValidity = $gaussValidator->validateRunning($this->answerSession, 0);
      $currentValidity = $patternValidator->validateRunning($this->answerSession, $currentValidity);
      $currentValidity = $timeValidator->validateRunning($this->answerSession, $currentValidity);
    }
    else {
      $currentValidity = $gaussValidator->validateFinished($this->answerSession, 0);
      $currentValidity = $patternValidator->validateFinished($this->answerSession, $currentValidity);
      $currentValidity = $timeValidator->validateFinished($this->answerSession, $currentValidity);
    }
    <commit_msg>currently deactivated all validators except gaussian one<commit_after><?php
use DBA\AnswerSession;

/**
 * Created by IntelliJ IDEA.
 * User: sein
 * Date: 30.03.17
 * Time: 16:30
 */
class SessionValidator {
  private $answerSession;
  
  const MALUS_ANSWER_ERROR = 0.1;
  
  /**
   * SessionValidator constructor.
   * @param $answerSession AnswerSession
   */
  public function __construct($answerSession) {
    // TODO: load some session info here
    $this->answerSession = $answerSession;
  }
  
  /**
   * @param $errorType string
   * @return float the new updated validity of the session
   */
  public function update($errorType) {
    /** @var $VALIDATORS Validator[] */
    //global $VALIDATORS;
    
    $gaussValidator = new MultivariantCrowdValidator();
    $patternValidator = new PatternValidator();
    $timeValidator = new TimeValidator();
    
    if ($this->answerSession->getIsOpen() == 0) {
      $currentValidity = $gaussValidator->validateRunning($this->answerSession, 0);
      //$currentValidity = $patternValidator->validateRunning($this->answerSession, $currentValidity);
      //$currentValidity = $timeValidator->validateRunning($this->answerSession, $currentValidity);
    }
    else {
      $currentValidity = $gaussValidator->validateFinished($this->answerSession, 0);
      //$currentValidity = $patternValidator->validateFinished($this->answerSession, $currentValidity);
      //$currentValidity = $timeValidator->validateFinished($this->answerSession, $currentValidity);
    }
    
{'fraction_non_alphanumeric': 0.1273031825795645, 'fraction_numerical': 0.010050251256281407, 'mean_word_length': 3.8870703764320784, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '7033788', 'n_tokens_mistral': 884, 'n_tokens_neox': 851, 'n_words': 180}