add some checks to not throw IdNotFound exception for empty Quests (fixes #9)
This commit is contained in:
parent
fed6d4a80c
commit
df7c22c8fc
7 changed files with 68 additions and 52 deletions
|
|
@ -134,12 +134,16 @@
|
|||
$correctAnswersCount += $this->isMatching($field['regex'], $field['answer']);
|
||||
}
|
||||
}
|
||||
|
||||
// Show count
|
||||
$showcount = (count($this->request->getGetParams()) > 1);
|
||||
|
||||
|
||||
// Pass data to view
|
||||
$this->set('task', $task);
|
||||
$this->set('fields', $fields);
|
||||
$this->set('count', $correctAnswersCount);
|
||||
$this->set('showcount', $showcount);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
<?php endforeach ?>
|
||||
<?=$t->t(mb_substr($task['text'], $posStart, mb_strlen($task['text'], 'UTF-8')-$posStart, 'UTF-8'))?>
|
||||
</p>
|
||||
<?php if($showcount) : ?>
|
||||
<p><?=sprintf(_('You filled %d of %d fields correctly'), $count, count($fields))?>.</p>
|
||||
<?php endif ?>
|
||||
<input type="submit" name="submit" value="<?=_('solve')?>" />
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue