本文整理汇总了PHP中Survey::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Survey::setDescription方法的具体用法?PHP Survey::setDescription怎么用?PHP Survey::setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Survey
的用法示例。
在下文中一共展示了Survey::setDescription方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSurveyName
public function testSurveyName()
{
$survey = new Survey();
$survey->setSurveyName("yesno");
$survey->setDescription('stuff');
$q = new SurveyQuestion();
$q->setType(QuestionType::YesNo());
$q->setQuestion("A question");
$survey->addQuestion($q);
//add another question
$q2 = new SurveyQuestion();
$q2->setType(QuestionType::StarRating());
$secondQuestion = "Second question";
$q2->setQuestion($secondQuestion);
$survey->addQuestion($q2);
$this->surveyManager->createSurvey($survey);
SurveyEntityManager::testClear();
$service = $this->newSurveyService();
$this->request['Body'] = "yesno";
$this->request['From'] = "1234";
$serviced = $service->service();
$this->assertTrue($serviced);
$this->request['Body'] = "no";
$this->request['From'] = "1234";
$serviced = $service->service();
$this->assertTrue($serviced);
$this->assertContains($secondQuestion, $service->getResponse()->getContent());
}
示例2: testDeleteQuestionFromSurvey
public function testDeleteQuestionFromSurvey()
{
$survey = new Survey();
$survey->setSurveyName("hi");
$survey->setDescription('stuff');
$qtypes = QuestionType::toArray();
$max = rand(4, 5);
for ($i = 0; $i < $max; ++$i) {
$q = new SurveyQuestion();
$q->setType(new QuestionType(rand(1, count($qtypes))));
$q->setQuestion("q" . $i);
$survey->addQuestion($q);
}
$this->manager->createSurvey($survey);
$toDelete = $survey->getQuestions()[rand(0, $max - 1)];
$idToDelete = $toDelete->getId();
$survey->deleteQuestion($idToDelete);
$this->manager->updateSurvey($survey);
$this->assertEquals($max - 1, count($survey->getQuestions()));
}
示例3: showEditSurveyRes
function showEditSurveyRes()
{
$displaySysAdmin = new DisplaySysAdmin();
$suid = getFromSessionParams('suid');
$content = "";
if ($suid != '') {
//edit
$survey = new Survey($suid);
$content = $displaySysAdmin->displaySuccess(Language::messageSurveyChanged(loadvar('name')));
} else {
//add survey!
if (loadvar('name') != "") {
$surveys = new Surveys();
$newsuid = $surveys->getMaximumSuid() + 1;
$_SESSION['SURVEY_MODE'] = MODE_CASI;
$_SESSION['SURVEY_LANGUAGE'] = 1;
$_SESSION['SUID'] = $newsuid;
$survey = new Survey();
$survey->setSuid($newsuid);
$survey->setObjectName($newsuid);
$survey->addVersion(Language::labelVersionCurrentName(), Language::labelVersionCurrentDescription());
$survey->setDefaultMode(MODE_CASI);
// self
$survey->setDefaultLanguage(1);
// english
$survey->setAccessType(LOGIN_ANONYMOUS);
$survey->setName(loadvar('name'));
$survey->setTitle(loadvar(SETTING_TITLE));
$survey->setDescription(loadvar(SETTING_DESCRIPTION));
/* add base section */
$section = new Section();
$section->setSuid($newsuid);
$section->setSeid(1);
$section->setName(SECTION_BASE);
$section->setPosition(1);
$section->save();
/* add base questions */
$var = new VariableDescriptive();
$var->setVsid(1);
$var->setName(VARIABLE_PRIMKEY);
$var->setAnswerType(ANSWER_TYPE_STRING);
$var->setSeid(1);
$var->setSuid($newsuid);
$var->setDescription('PRIMARY KEY');
$var->setQuestion('primary key');
$var->setMaximumLength(ANSWER_PRIMKEY_LENGTH);
$var->setTyd(-1);
$var->setPosition(1);
$var->save();
$var = new VariableDescriptive();
$var->setVsid(2);
$var->setName(VARIABLE_BEGIN);
$var->setAnswerType(ANSWER_TYPE_DATETIME);
$var->setSeid(1);
$var->setSuid($newsuid);
$var->setDescription('TIMESTAMP START');
$var->setQuestion('timestamp start');
$var->setTyd(-1);
$var->setPosition(2);
$var->save();
$var = new VariableDescriptive();
$var->setVsid(3);
$var->setName(VARIABLE_END);
$var->setAnswerType(ANSWER_TYPE_DATETIME);
$var->setSeid(1);
$var->setSuid($newsuid);
$var->setDescription('TIMESTAMP END');
$var->setQuestion('timestamp end');
$var->setTyd(-1);
$var->setPosition(3);
$var->save();
$var = new VariableDescriptive();
$var->setVsid(4);
$var->setName(VARIABLE_VERSION);
$var->setAnswerType(ANSWER_TYPE_INTEGER);
$var->setSeid(1);
$var->setSuid($newsuid);
$var->setDescription('VERSION INFO');
$var->setQuestion('version info');
$var->setTyd(-1);
$var->setPosition(4);
$var->save();
$var = new VariableDescriptive();
$var->setVsid(5);
$var->setName(VARIABLE_MODE);
$var->setAnswerType(ANSWER_TYPE_ENUMERATED);
$var->setSeid(1);
$var->setSuid($newsuid);
$var->setDescription('INTERVIEW MODE');
$var->setOptionsText("1 (CAPI) Face-to-face\r\n2 (CATI) Telephone\r\n3 (CASI) Self-administered\r\n4 (CADI) Data entry");
$var->setQuestion('interview mode');
$var->setTyd(-1);
$var->setPosition(5);
$var->save();
$var = new VariableDescriptive();
$var->setVsid(6);
$var->setName(VARIABLE_LANGUAGE);
$var->setAnswerType(ANSWER_TYPE_INTEGER);
$var->setSeid(1);
$var->setSuid($newsuid);
//.........这里部分代码省略.........
示例4: testTagCloud
public function testTagCloud()
{
$survey = new Survey();
$survey->setSurveyName("hi");
$survey->setDescription('stuff');
$q = new SurveyQuestion();
$q->setType(QuestionType::Text());
$q->setQuestion("Your Suggestions");
$survey->addQuestion($q);
$this->manager->createSurvey($survey);
$max = rand(1, 20);
for ($i = 0; $i < $max; ++$i) {
$val = $this->getRandomString();
$ans = new SurveyAnswer();
$ans->setAnswer($val);
$ans->setAnsweredBy("+12064122496");
$this->manager->addAnswer($q->getId(), $ans);
}
$answers = $this->manager->getAnswers($survey->getId());
$strArr = ReportChartFormatter::getChartData($answers->getAnswers($q->getId()), ChartFormats::TagCloud());
$this->assertNotNull($strArr);
//TODO: how the heck do i test this? I guess that it just works?
}