Browse Source

Scoreitem as input field

master
Rogier Neeleman 9 years ago
parent
commit
8208e30a88
  1. 2
      application/controllers/Beoordelen.php
  2. 18
      application/views/user_score.php

2
application/controllers/Beoordelen.php

@ -179,6 +179,8 @@ class Beoordelen extends CI_Controller
} }
} elseif ($vraag['antwoord'] == 1) { } elseif ($vraag['antwoord'] == 1) {
$score[$i]['score'] = $this->input->post($vraag['id']); $score[$i]['score'] = $this->input->post($vraag['id']);
} elseif ($vraag['antwoord'] == 2) {
$score[$i]['score'] = $this->input->post($vraag['id']);
} }
$i++; $i++;

18
application/views/user_score.php

@ -24,11 +24,19 @@
<div class="col-xs-3 col-sm-1"> <div class="col-xs-3 col-sm-1">
<?php if ($vraag['antwoord'] == 0) { <?php if ($vraag['antwoord'] == 0) {
echo ': '.form_checkbox($vraag['id'], '1'); echo ': '.form_checkbox($vraag['id'], '1');
} else { } elseif ($vraag['antwoord'] == 1) {
for ($i=1; $i <= $vraag['score']; $i++) { for ($i=1; $i <= $vraag['score']; $i++) {
$score[$i] = $i; $score[$i] = $i;
} }
echo form_dropdown($vraag['id'], $score); echo form_dropdown($vraag['id'], $score);
} elseif ($vraag['antwoord'] == 2) {
$inputsetting = array(
'name' => $vraag['id'],
'value' => '0',
'maxlength' => '4',
'size' => '4'
);
echo ': '.form_input($inputsetting);
} ?> } ?>
</div> </div>
</div> </div>

Loading…
Cancel
Save