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.
SAE4.01_FORMULAIRE/Source/BusinessClass/TextQuestion.php

26 lines
587 B

<?php
namespace BusinessClass;
/**
* Définit une question qui propose d'écrire du texte en guise de réponse
*/
class TextQuestion extends Question
{
/**
* Permet de définir la manière dont la question doit s'afficher en HTML.
*
* @return string
*/
public function printStrategy(): string
{
$content = $this->getContent();
$id = $this->getId();
return "\t\t\t<div class='question'>
<label>$content</label>
<input data-id='$id' type='text' name='answers[]' />
</div>\n";
}
}