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