implement Questtype ?Choiceinput?
This commit is contained in:
parent
ca94d18acd
commit
0210a421ce
5 changed files with 361 additions and 0 deletions
15
questtypes/choiceinput/html/quest.tpl
Normal file
15
questtypes/choiceinput/html/quest.tpl
Normal 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>
|
||||
12
questtypes/choiceinput/html/submission.tpl
Normal file
12
questtypes/choiceinput/html/submission.tpl
Normal 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue