Skip to content
Snippets Groups Projects
Commit 1be4ab35 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

make corrected marker non-editable

parent fd07556b
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !10. Comments created here will be created in the context of that merge request.
...@@ -1218,19 +1218,20 @@ class SolutionsController extends StudipController ...@@ -1218,19 +1218,20 @@ class SolutionsController extends StudipController
if ($assignment_attempt) { if ($assignment_attempt) {
$options = $assignment_attempt->options; $options = $assignment_attempt->options;
if ($corrected && !$options['corrected']) {
$feedback .= Studip\Markup::markAsHtml('<p>' . htmlReady(sprintf(_('Bewertung wurde am %s von %s bestätigt.'), date('d.m.Y'), get_fullname())) . '</p>');
}
unset($options['feedback']); unset($options['feedback']);
unset($options['corrected']);
if ($feedback !== '') { if ($feedback !== '') {
$options['feedback'] = $feedback; $options['feedback'] = $feedback;
} }
if ($corrected) { if (!$corrected) {
unset($options['corrected']);
unset($options['corrector_id']);
unset($options['correction_time']);
} else if (!$options['corrected']) {
$options['corrected'] = $corrected; $options['corrected'] = $corrected;
$options['corrector_id'] = $GLOBALS['user']->id;
$options['correction_time'] = time();
} }
$assignment_attempt->options = $options; $assignment_attempt->options = $options;
...@@ -1238,7 +1239,7 @@ class SolutionsController extends StudipController ...@@ -1238,7 +1239,7 @@ class SolutionsController extends StudipController
} }
} }
if ($feedback === '') { if ($feedback === '' && !$corrected) {
PageLayout::postSuccess(_vips('Der Kommentar zur Bewertung wurde entfernt.')); PageLayout::postSuccess(_vips('Der Kommentar zur Bewertung wurde entfernt.'));
} else { } else {
PageLayout::postSuccess(_vips('Der Kommentar zur Bewertung wurde gespeichert.')); PageLayout::postSuccess(_vips('Der Kommentar zur Bewertung wurde gespeichert.'));
...@@ -1476,6 +1477,7 @@ class SolutionsController extends StudipController ...@@ -1476,6 +1477,7 @@ class SolutionsController extends StudipController
$this->user_id = $GLOBALS['user']->id; $this->user_id = $GLOBALS['user']->id;
$this->released = $assignment->releaseStatus($this->user_id); $this->released = $assignment->releaseStatus($this->user_id);
$this->feedback = $assignment->getUserFeedback($this->user_id); $this->feedback = $assignment->getUserFeedback($this->user_id);
$this->assignment_attempt = $assignment->getAssignmentAttempt($this->user_id);
// Security check -- is assignment really accessible for students? // Security check -- is assignment really accessible for students?
if ($this->released == 0) { if ($this->released == 0) {
...@@ -2328,7 +2330,8 @@ function get_solutions($assignment, $view) ...@@ -2328,7 +2330,8 @@ function get_solutions($assignment, $view)
$solvers[$user_id] = [ $solvers[$user_id] = [
'type' => 'single', 'type' => 'single',
'id' => $user_id, 'id' => $user_id,
'user_id' => $user_id 'user_id' => $user_id,
'feedback' => $attempt->options['feedback']
]; ];
} }
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
<? $max_points = $assignment->test->getTotalPoints(); ?> <? $max_points = $assignment->test->getTotalPoints(); ?>
<? $reached_points = $assignment->getUserPoints($user_id); ?> <? $reached_points = $assignment->getUserPoints($user_id); ?>
<? $feedback = $assignment->getUserFeedback($user_id); ?> <? $feedback = $assignment->getUserFeedback($user_id); ?>
<? $assignment_attempt = $assignment->getAssignmentAttempt($user_id); ?>
<div class="exercise"> <div class="exercise">
<h2> <h2>
<?= _vips('Gesamtpunktzahl') ?> <?= _vips('Gesamtpunktzahl') ?>
...@@ -89,6 +90,10 @@ ...@@ -89,6 +90,10 @@
<?= formatReady($feedback) ?> <?= formatReady($feedback) ?>
<? endif ?> <? endif ?>
<? if ($assignment_attempt->options['corrected']): ?>
<?= htmlReady(sprintf(_('Bewertung wurde am %s von %s bestätigt.'), date('d.m.Y', $assignment_attempt->options['correction_time']), get_fullname($assignment_attempt->options['corrector_id']))) ?>
<? endif ?>
</div> </div>
<? setlocale(LC_NUMERIC, 'C') ?> <? setlocale(LC_NUMERIC, 'C') ?>
<? endif ?> <? endif ?>
......
...@@ -115,6 +115,9 @@ ...@@ -115,6 +115,9 @@
<?= Icon::create('arr_1right', 'clickable', ['class' => 'solution-open', 'title' => _vips('Aufgaben anzeigen')]) ?> <?= Icon::create('arr_1right', 'clickable', ['class' => 'solution-open', 'title' => _vips('Aufgaben anzeigen')]) ?>
<?= Icon::create('arr_1down', 'clickable', ['class' => 'solution-close', 'title' => _vips('Aufgaben verstecken')]) ?> <?= Icon::create('arr_1down', 'clickable', ['class' => 'solution-close', 'title' => _vips('Aufgaben verstecken')]) ?>
<?= htmlReady($solver['name']) ?> <?= htmlReady($solver['name']) ?>
<? if ($solver['feedback']): ?>
<?= tooltipIcon(kill_format($solver['feedback'])) ?>
<? endif ?>
</a> </a>
<? if ($solver['type'] == 'single') : ?> <? if ($solver['type'] == 'single') : ?>
......
...@@ -113,4 +113,8 @@ ...@@ -113,4 +113,8 @@
</div> </div>
<? endif ?> <? endif ?>
<? if ($assignment_attempt->options['corrected']): ?>
<?= htmlReady(sprintf(_('Bewertung wurde am %s von %s bestätigt.'), date('d.m.Y', $assignment_attempt->options['correction_time']), get_fullname($assignment_attempt->options['corrector_id']))) ?>
<? endif ?>
<? setlocale(LC_NUMERIC, 'C') ?> <? setlocale(LC_NUMERIC, 'C') ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment