- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
$query =
'SELECT * ' .
'FROM `requests` ' .
'WHERE `requests`.`uid` = \'' . mysql_escape_string($uid) . '\' ' .
'AND `requests`.`status` = 0 ' .
'';
$requests = $this->execQuery($query);
if ( !$requests) {
$this->lastError = 'Error getting user\'s data. ';
return false;
} else {
$questions = $this->findAllQuestions();
foreach ($requests as $n => $request) {
$requests[$n]['quiz'] = unserialize(
unserialize($request['quiz'])
);
foreach ($requests[$n]['quiz'] as $qid => $answer) {
$currentQuestion = &$requests[$n]['quiz'][$qid];
$currentQuestion = array();
$currentQuestion['qid'] = $qid;
if (is_array($questions[$qid]['answers'])) {
$currentQuestion['question'] = $questions[$qid]['question'];
$currentQuestion['aid'] = $answer;
$currentQuestion['answer'] = $questions[$qid]['answers'][$answer]['answer'];;
} else {
$currentQuestion['question'] = $questions[$qid]['question'];
$currentQuestion['aid'] = null;
$currentQuestion['answer'] = $answer;
}
}
}
}
return $requests;
}