mirror of
https://github.com/idanoo/nzart-exam-generator
synced 2025-07-01 13:52:17 +00:00
Now shows score + wrong questions
This commit is contained in:
parent
0824aca6b9
commit
6dff0d62ab
2 changed files with 30 additions and 15 deletions
|
@ -12,7 +12,14 @@ class DataItem {
|
|||
$db = new db();
|
||||
$db->query("SELECT * FROM `".static::_getType()."` WHERE ".static::_getType()."_id = :id");
|
||||
$db->bind(":id", $id);
|
||||
return $db->getObject();
|
||||
$result = $db->single();
|
||||
if(!$result) return false;
|
||||
$className = static::_getClass();
|
||||
$obj = new $className();
|
||||
foreach ($result as $key=>$val) {
|
||||
$obj->$key = $val;
|
||||
}
|
||||
return $obj;
|
||||
}
|
||||
|
||||
private function _getAllWhere($where = false, $orderBy = false, $join = false, $limit = false) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue