You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
956 B
44 lines
956 B
<?php
|
|
|
|
namespace BusinessClass;
|
|
|
|
/**
|
|
* Définit une question qui propose d'écrire du texte en guise de réponse
|
|
*/
|
|
class TextQuestion extends Question
|
|
{
|
|
/**
|
|
* @param string $content
|
|
* @param int $id
|
|
*/
|
|
public function __construct(int $id, string $content)
|
|
{
|
|
parent::__construct($id, $content);
|
|
}
|
|
|
|
/**
|
|
* Permet de définir la manière donc la réponse doit être traitée
|
|
*
|
|
* @return void
|
|
*/
|
|
public function responseStrategy(): void
|
|
{
|
|
echo "Implement responseStrategy() method.";
|
|
}
|
|
|
|
/**
|
|
* Permet de définir la manière dont la question doit s'afficher en HTML.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function printStrategy(): string
|
|
{
|
|
$content = $this->getContent();
|
|
|
|
return "\t\t\t<div class='question'>
|
|
<label>$content</label>
|
|
<input type='text' name='answers[]' />
|
|
</div>\n";
|
|
}
|
|
}
|