本文整理汇总了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());
}