public function buildScore(NodeInterface $input, NodeInterface $item, RecordViewInterface $record)
 {
     $initialScore = $record->value("score");
     $modifier = 100 - abs($record->value("inputRate") - $record->value("outputRate"));
     $contribRate = $initialScore + $initialScore / 100 * $modifier;
     return new SingleScore($contribRate, $record->value("reason"));
 }
Ejemplo n.º 2
0
 public function buildScore(NodeInterface $input, NodeInterface $item, RecordViewInterface $record)
 {
     return new SingleScore($record->get('score') * 10);
 }
 public function buildScore(NodeInterface $input, NodeInterface $item, RecordViewInterface $record)
 {
     $score = $record->hasValue($this->scoreResultName()) ? $record->value($this->scoreResultName()) : $this->defaultScore();
     $reason = $record->hasValue($this->reasonResultName()) ? $record->value($this->reasonResultName()) : null;
     return new SingleScore($score, $reason);
 }