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

make corrected marker non-editable

parent e6eef47f
No related branches found
No related tags found
1 merge request!10add feedback and corrected status to assignment attempt, fixes #282
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
if ($assignment_attempt) {
$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['corrected']);
if ($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['corrector_id'] = $GLOBALS['user']->id;
$options['correction_time'] = time();
}
$assignment_attempt->options = $options;
......@@ -1238,7 +1239,7 @@ class SolutionsController extends StudipController
}
}
if ($feedback === '') {
if ($feedback === '' && !$corrected) {
PageLayout::postSuccess(_vips('Der Kommentar zur Bewertung wurde entfernt.'));
} else {
PageLayout::postSuccess(_vips('Der Kommentar zur Bewertung wurde gespeichert.'));
......@@ -1476,6 +1477,7 @@ class SolutionsController extends StudipController
$this->user_id = $GLOBALS['user']->id;
$this->released = $assignment->releaseStatus($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?
if ($this->released == 0) {
......@@ -2328,7 +2330,8 @@ function get_solutions($assignment, $view)
$solvers[$user_id] = [
'type' => 'single',
'id' => $user_id,
'user_id' => $user_id
'user_id' => $user_id,
'feedback' => $attempt->options['feedback']
];
}
......
......@@ -69,6 +69,7 @@
<? $max_points = $assignment->test->getTotalPoints(); ?>
<? $reached_points = $assignment->getUserPoints($user_id); ?>
<? $feedback = $assignment->getUserFeedback($user_id); ?>
<? $assignment_attempt = $assignment->getAssignmentAttempt($user_id); ?>
<div class="exercise">
<h2>
<?= _vips('Gesamtpunktzahl') ?>
......@@ -89,6 +90,10 @@
<?= formatReady($feedback) ?>
<? 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>
<? setlocale(LC_NUMERIC, 'C') ?>
<? endif ?>
......
......@@ -115,6 +115,9 @@
<?= Icon::create('arr_1right', 'clickable', ['class' => 'solution-open', 'title' => _vips('Aufgaben anzeigen')]) ?>
<?= Icon::create('arr_1down', 'clickable', ['class' => 'solution-close', 'title' => _vips('Aufgaben verstecken')]) ?>
<?= htmlReady($solver['name']) ?>
<? if ($solver['feedback']): ?>
<?= tooltipIcon(kill_format($solver['feedback'])) ?>
<? endif ?>
</a>
<? if ($solver['type'] == 'single') : ?>
......
......@@ -113,4 +113,8 @@
</div>
<? 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') ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment