3ef3ebdfae4cd1c32c6e96117adf208696032ce0
[acontent.git] / docs / themes / default / tests / test_questions / multichoice.tmpl.php
1 <p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>
2
3 <ul style="padding: 0px; margin: 0px; list-style-type: none">
4         <?php for ($i=0; $i < $this->num_choices; $i++): ?>
5                 <li style="padding: 4px">
6                         <input type="radio" name="answers[<?php echo $this->row['question_id']; ?>]" value="<?php echo $i; ?>" id="choice_<?php echo $this->row['question_id'].'_'.$i; ?>" <?php 
7                         //Multiple choice will always have just 1 choice, thus the response is always in the array of $this->response[0]
8                         if (is_numeric($this->response[0]) && $i == $this->response[0]): ?>checked="checked"<?php endif; ?>/><label for="choice_<?php echo $this->row['question_id'].'_'.$i; ?>"><?php echo AT_print($this->row['choice_'.$i], 'tests_questions.choice_'.$i); ?></label>
9         <?php endfor; ?>
10         <li style="padding: 4px">
11                 <input type="radio" name="answers[<?php echo $this->row['question_id']; ?>]" value="-1" id="choice_<?php echo $this->row['question_id']; ?>'_x" <?php if (is_numeric($this->response[0]) && -1 == $this->response[0]): ?>checked="checked"<?php endif; ?> /><label for="choice_<?php echo $this->row['question_id']; ?>'_x"><em><?php echo _AT('leave_blank'); ?></em></label>
12         </li>
13 </ul>