implement Questtype ?Choiceinput?

This commit is contained in:
coderkun 2014-04-11 22:38:10 +02:00
commit 0210a421ce
5 changed files with 361 additions and 0 deletions

View file

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

View file

@ -0,0 +1,12 @@
<form method="post">
<?php foreach($texts as $i => &$text) : ?>
<?php if($i > 0) : ?>
<select name="answers[<?=$i-1?>]" disabled="disabled">
<?php foreach($choiceLists[$i-1]['values'] as &$choice) : ?>
<option value="<?=$choice['id']?>" <?php if(array_key_exists('answer', $choiceLists[$i-1]) && $choiceLists[$i-1]['answer'] == $choice['id']) : ?>selected="selected"<?php endif ?>><?=$choice['text']?></option>
<?php endforeach ?>
</select>
<?php endif ?>
<?=\hhu\z\Utils::t($text)?>
<?php endforeach ?>
</form>