當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Questionnaire::getRagScore方法代碼示例

本文整理匯總了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());
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:5,代碼來源:IGetAnAmberNarrativeWithAScoreOfFiveTest.php

示例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;
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:7,代碼來源:ScoreIsRedSpecification.php

示例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);
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:9,代碼來源:Record.php

示例5: addGlobalSubstitutions

 /**
  * @param Questionnaire $questionnaire
  */
 protected function addGlobalSubstitutions(Questionnaire $questionnaire)
 {
     $this->narrative->addSubstitution('{{FINAL_SCORE}}', $questionnaire->getRagScore()['normalized_score']);
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:7,代碼來源:ResultsNarrativeBuilder.php

示例6: testIHaveAScoreOfOne

 public function testIHaveAScoreOfOne()
 {
     $expected = array('value' => 2, 'rag' => "green", 'normalized_score' => 10);
     $this->assertEquals($expected, $this->questionnaire->getRagScore());
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:5,代碼來源:IGetAGreenNarrativeWithAScoreOfTenTest.php

示例7: testGetRagScore

 public function testGetRagScore()
 {
     $expected = array('value' => 0, 'rag' => '');
     $this->assertEquals($expected, $this->instance->getRagScore());
 }
開發者ID:TransformCore,項目名稱:HayPersistenceApi,代碼行數:5,代碼來源:QuestionnaireTest.php


注:本文中的TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire::getRagScore方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。