implement saving of Quest answers in database

This commit is contained in:
coderkun 2014-03-21 12:47:08 +01:00
commit 2429bb4c8f
10 changed files with 201 additions and 32 deletions

View file

@ -1,11 +1,11 @@
<form method="post">
<?php foreach($texts as $i => &$text) : ?>
<?php if($i > 0) : ?>
<input type="text" name="answers[<?=$i-1?>]" value="<?=(array_key_exists($i-1, $answers)) ? $answers[$i-1] : '' ?>" />
<input type="text" name="answers[<?=$i-1?>]" value="<?=$regexs[$i-1]['answer']?>" <?=($solved) ? 'disabled="disabled"' : '' ?>/>
<?php endif ?>
<?=\hhu\z\Utils::t($text)?>
<?php endforeach ?>
<br /><br />
<input type="submit" name="submit" value="<?=_('solve')?>" />
<input type="submit" name="submit" value="<?=_('solve')?>" <?=($solved) ? 'disabled="disabled"' : '' ?> />
</form>

View file

@ -0,0 +1,7 @@
<?php foreach($texts as $i => &$text) : ?>
<?php if($i > 0) : ?>
<span style="background-color:grey"><?=$regexs[$i-1]['answer']?></span>
<?php if($regexs[$i-1]['right']) : ?>✓<?php else: ?>✕<?php endif ?>
<?php endif ?>
<?=\hhu\z\Utils::t($text)?>
<?php endforeach ?>