Admin can login to access private pages (such as add courses)
This commit is contained in:
parent
0d084a69e3
commit
ec1ed49996
12 changed files with 221 additions and 24 deletions
|
|
@ -121,6 +121,11 @@ class Question
|
|||
$this->getNormalId();
|
||||
}
|
||||
|
||||
public function getAddedTime()
|
||||
{
|
||||
return $this->added_time;
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
|
|
@ -143,6 +148,11 @@ class Question
|
|||
return $this->validated;
|
||||
}
|
||||
|
||||
public function isValidation()
|
||||
{
|
||||
return $this->id == md5($this->added_time.$this->validator) && $this->validator != $this->writer;
|
||||
}
|
||||
|
||||
public function getCourse()
|
||||
{
|
||||
return Course::getCourse($this->course);
|
||||
|
|
@ -185,6 +195,28 @@ class Question
|
|||
$this->writer = $writer->getId();
|
||||
}
|
||||
|
||||
public function convert()
|
||||
{
|
||||
foreach (Course::getCourses() as $c)
|
||||
{
|
||||
if ($c->getCode() == $this->course)
|
||||
{
|
||||
$this->course = $c->getId();
|
||||
return $c->getId();
|
||||
}
|
||||
}
|
||||
return $this->course;
|
||||
/*foreach (User::getUsers() as $u)
|
||||
{
|
||||
if ($u->getEmail() == $this->validator)
|
||||
{
|
||||
$this->validator = $u->getId();
|
||||
return $u->getId();
|
||||
}
|
||||
}
|
||||
return $this->validator;*/
|
||||
}
|
||||
|
||||
public function setAnswer($answers)
|
||||
{
|
||||
if ($this->answers != $answers)
|
||||
|
|
|
|||
Reference in a new issue