Skip to content
Snippets Groups Projects

Vips modification feedback, re #203

Merged Elmar Ludwig requested to merge vips-modification-feedback into master
Files
4
+ 18
0
@@ -1378,6 +1378,8 @@ class SheetsController extends StudipController
$resets = Request::int('resets', 0);
$evaluation_mode = Request::int('evaluation_mode', 0);
$exercise_points = Request::floatArray('exercise_points');
$selftest_threshold = Request::getArray('threshold');
$selftest_feedback = Request::getArray('feedback');
$start_datetime = DateTime::createFromFormat('d.m.Y H:i', $start_date.' '.$start_time);
$end_datetime = DateTime::createFromFormat('d.m.Y H:i', $end_date.' '.$end_time);
@@ -1420,6 +1422,12 @@ class SheetsController extends StudipController
$block = null;
}
foreach ($selftest_threshold as $i => $threshold) {
if ($threshold !== '') {
$feedback[$threshold] = Studip\Markup::purifyHtml($selftest_feedback[$i]);
}
}
/*** store basic data (Grunddaten) of assignment */
if ($assignment_id) {
// check whether the exam's start time has been moved
@@ -1468,6 +1476,7 @@ class SheetsController extends StudipController
unset($assignment->options['use_groups']);
unset($assignment->options['max_tries']);
unset($assignment->options['resets']);
unset($assignment->options['feedback']);
if ($assignment_type === 'exam') {
$assignment->options['duration'] = $exam_length;
@@ -1501,6 +1510,11 @@ class SheetsController extends StudipController
if ($resets === 0) {
$assignment->options['resets'] = $resets;
}
if (isset($feedback)) {
krsort($feedback);
$assignment->options['feedback'] = $feedback;
}
}
$assignment->store();
@@ -1647,6 +1661,10 @@ class SheetsController extends StudipController
vips_require_edit_permission($assignment);
if (!isset($assignment->options['feedback'])) {
$assignment->options['feedback'] = ['' => ''];
}
$blocks = VipsBlock::findBySQL('course_id = ? ORDER BY name', [$assignment->course_id]);
$this->assignment = $assignment;
Loading