Can change a validated question

This commit is contained in:
Némunaire 2012-06-18 20:22:08 +02:00
commit 30c06c08e8
2 changed files with 38 additions and 13 deletions

View file

@ -160,7 +160,11 @@ class Question
public function setQuestion($question)
{
$this->question = $question;
if ($this->question != $question)
{
$this->question = $question;
$this->validated = false;
}
}
public function getAnswer()
@ -183,18 +187,22 @@ class Question
public function setAnswer($answers)
{
$this->answers = array();
if (!empty($answers))
if ($this->answers != $answers)
{
if (is_array($answers))
{
foreach ($answers as $ans)
$this->answers[] = $ans;
}
else
$this->answers[] = $answers;
}
$this->answers = array();
$this->validated = false;
if (!empty($answers))
{
if (is_array($answers))
{
foreach ($answers as $ans)
$this->answers[] = $ans;
}
else
$this->answers[] = $answers;
}
}
}
function mail_utf8($to, $subject = '(No subject)',