本文整理匯總了PHP中TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire::getRagScore方法的典型用法代碼示例。如果您正苦於以下問題:PHP Questionnaire::getRagScore方法的具體用法?PHP Questionnaire::getRagScore怎麽用?PHP Questionnaire::getRagScore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire
的用法示例。
在下文中一共展示了Questionnaire::getRagScore方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testIHaveAScoreOfEight
public function testIHaveAScoreOfEight()
{
$expected = array('value' => 1, 'rag' => "amber", 'normalized_score' => 5);
$this->assertEquals($expected, $this->questionnaire->getRagScore());
}
示例2: testIHaveAScoreOfThree
public function testIHaveAScoreOfThree()
{
$expected = array('value' => 0, 'rag' => "red", 'normalized_score' => 3);
$this->assertEquals($expected, $this->questionnaire->getRagScore());
}
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:5,代碼來源:IGetARedRagAndScoreOfThreeBecauseISmokeTest.php
示例3: isSatisfiedBy
/**
* @inheritDoc
*/
public static function isSatisfiedBy(Questionnaire $questionnaire)
{
return $questionnaire->getRagScore()['normalized_score'] <= QuestionnaireScore::RED_CUTOFF;
}
示例4: extractRagScore
/**
* @param Questionnaire $questionnaire
* @return array
*/
protected function extractRagScore(Questionnaire $questionnaire)
{
$ragScore = $questionnaire->getRagScore();
return array('ragRating' => $ragScore['rag'], 'questionnaireScore' => $ragScore['value'], 'normalizedQuestionnaireScore' => !empty($ragScore['normalized_score']) ? $ragScore['normalized_score'] : null);
}
示例5: addGlobalSubstitutions
/**
* @param Questionnaire $questionnaire
*/
protected function addGlobalSubstitutions(Questionnaire $questionnaire)
{
$this->narrative->addSubstitution('{{FINAL_SCORE}}', $questionnaire->getRagScore()['normalized_score']);
}
示例6: testIHaveAScoreOfOne
public function testIHaveAScoreOfOne()
{
$expected = array('value' => 2, 'rag' => "green", 'normalized_score' => 10);
$this->assertEquals($expected, $this->questionnaire->getRagScore());
}
示例7: testGetRagScore
public function testGetRagScore()
{
$expected = array('value' => 0, 'rag' => '');
$this->assertEquals($expected, $this->instance->getRagScore());
}