Skip to content
Snippets Groups Projects
Commit 1f9adffb authored by Viktoria Wiebe's avatar Viktoria Wiebe
Browse files

make result visible for lecturers only, scale widths equal, and other minor fixes

parent 2b968264
No related branches found
No related tags found
No related merge requests found
......@@ -635,3 +635,17 @@ button.vips_file_upload:hover {
padding: 6px 10px;
width: 100%;
}
.ls-scale-col {
text-align: center;
}
@media (min-width: 768px) {
.ls-item-col {
width: 45%;
}
table td.ls-scale-col {
width: 5%;
text-align: center;
}
}
\ No newline at end of file
......@@ -18,8 +18,7 @@ class ls_exercise extends Exercise
*/
public static function getTypeIcon($role = Icon::DEFAULT_ROLE)
{
// TODO change icon
return Icon::create('likert', $role);
return Icon::create('question-likert', $role);
}
/**
......@@ -93,6 +92,7 @@ class ls_exercise extends Exercise
$this->task['group'][] = $task;
}
}
sort($categories);
$this->task['categories'] = $categories;
}
......@@ -297,7 +297,7 @@ class ls_exercise extends Exercise
if (!$this->task) {
$this->task['scale'] = 5;
$this->task['labels'] = ['0' => ''];
$this->task['scalepoints'] = array_fill(0, 4, 1);
$this->task['scalepoints'] = array_fill(0, 5, 1);
$this->task['group'][0]['answers'] = array_fill(0, 5, ['text' => '', 'score' => 2, 'category' => 1]);
}
......
......@@ -20,9 +20,9 @@
<tbody class="dynamic_list" role="list">
<? foreach ($task['answers'] as $key => $entry): ?>
<tr role="listitem">
<td class="dynamic_counter"> <?= htmlReady($entry['text']) ?></td>
<td class="dynamic_counter ls-item-col"> <?= htmlReady($entry['text']) ?></td>
<? for ($i = 0; $i < $exercise->task['scale']; $i++): ?>
<td style="text-align: center;">
<td class="ls-scale-col">
<? if($response[$group][$key] == $i): ?>
<?= Assets::img(vips_image_url('choice_checked.svg')) ?>
<? endif ?>
......
<div class="hgroup">
<label>
<?= _vips('Skala Stufen') ?>
<input type="number" id="scale-length" name="scale" min="<?= htmlReady((int) $exercise->task['scale']) ?>"
value="<?= htmlReady((int) $exercise->task['scale']) ?>">
<input type="number" id="scale-length" name="scale" min="<?= htmlReady($exercise->task['scale']) ?>"
value="<?= htmlReady($exercise->task['scale']) ?>">
</label>
</div>
......
......@@ -13,9 +13,12 @@
<td><?= htmlReady($category) ?></td>
<td>
<? foreach ($exercise->task['group'] as $group => $answers): ?>
<? if (count($exercise->task['group']) > 1): ?><?= sprintf(_vips('Block %s'), $group+1) ?>: <? endif ?>
<? if (count($exercise->getCategoryItems($category, $group)) > 0): ?>
<? if (count($exercise->task['group']) > 1): ?>
<?= sprintf(_vips('Block %s'), $group+1) ?>:
<? endif ?>
<?= implode(", ", $exercise->getCategoryItems($category, $group)) ?>
<? endif ?>
<? endforeach ?>
</td>
<td>
......
......@@ -20,9 +20,9 @@
<tbody>
<? foreach ($task['answers'] as $key => $entry): ?>
<tr role="listitem">
<td><?= htmlReady($entry['text']) ?></td>
<td class="ls-item-col"><?= htmlReady($entry['text']) ?></td>
<? for ($i = 0; $i < $exercise->task['scale']; $i++): ?>
<td style="text-align: center;">
<td class="ls-scale-col">
<input type="radio" name="answer[<?= $group ?>][<?= $key ?>]" value="<?= $i ?>"
<? if($response[$group][$key] === $i): ?>checked<? endif ?>>
</td>
......
......@@ -56,7 +56,9 @@
<div class="description">
<? if ($exercise->type === 'ls_exercise'): ?>
<? if ($GLOBALS['perm']->have_perm('dozent')): ?>
<?= $this->render_partial('exercises/ls_exercise/evaluation') ?>
<? endif ?>
<? else: ?>
<?= sprintf(_vips('Erreichte Punkte: %s von %s'), (float) $reached_points, (float) $max_points) ?>
<? endif ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment