allow NULL-values for answers for Questtype ?Multiple Choice?
This commit is contained in:
parent
94f6a892f1
commit
89b2bee286
1 changed files with 3 additions and 2 deletions
|
|
@ -81,12 +81,13 @@
|
|||
// Get answers
|
||||
$userAnswers = $this->getUserAnswers($quest['id'], $question['id']);
|
||||
$answers = $this->Multiplechoice->getAnswersOfQuestion($question['id']);
|
||||
var_dump($userAnswers);
|
||||
var_dump($answers);
|
||||
|
||||
// Match answers with user answers
|
||||
foreach($answers as &$answer)
|
||||
{
|
||||
if(is_null($answer['tick'])) {
|
||||
continue;
|
||||
}
|
||||
if($answer['tick']) {
|
||||
if(!array_key_exists($answer['pos']-1, $userAnswers)) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue