Add a page to report questions
This commit is contained in:
parent
e554ed3a66
commit
63e14532f8
2 changed files with 54 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ class Question
|
|||
private $answers = array();
|
||||
private $added_time;
|
||||
private $validated = false;
|
||||
private $reported = false;
|
||||
private $validator = "";
|
||||
private $writer = "";
|
||||
|
||||
|
|
@ -22,6 +23,8 @@ class Question
|
|||
$this->added_time = $node->getAttribute("addedtime");
|
||||
if (intval($node->getAttribute("validated")))
|
||||
$this->validated = true;
|
||||
if (intval($node->getAttribute("reported")))
|
||||
$this->reported = true;
|
||||
$this->validator = $node->getAttribute("validator");
|
||||
$this->writer = $node->getAttribute("writer");
|
||||
$this->question = $node->getAttribute("question");
|
||||
|
|
@ -101,6 +104,7 @@ class Question
|
|||
|
||||
$qnode->setAttribute("xml:id", $this->id);
|
||||
$qnode->setAttribute("addedtime", $this->added_time);
|
||||
$qnode->setAttribute("reported", intval($this->reported));
|
||||
$qnode->setAttribute("validated", intval($this->validated));
|
||||
$qnode->setAttribute("validator", $this->validator);
|
||||
$qnode->setAttribute("writer", $this->writer);
|
||||
|
|
@ -126,6 +130,16 @@ class Question
|
|||
return $this->added_time;
|
||||
}
|
||||
|
||||
public function getReportId()
|
||||
{
|
||||
return md5($this->id);
|
||||
}
|
||||
|
||||
public function setReported($reported = true)
|
||||
{
|
||||
$this->reported = $reported;
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
|
|
|
|||
Reference in a new issue