コード例 #1
0
 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"));
 }
コード例 #2
0
 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);
 }