Skip to content
Snippets Groups Projects

Vips modification feedback, re #203

Merged Elmar Ludwig requested to merge vips-modification-feedback into master
8 files
+ 110
130
Compare changes
  • Side-by-side
  • Inline
Files
8
  • 7ac39298
    changes from review, re #203 · 7ac39298
    Elmar Ludwig authored
    - changed wording a bit (not final yet)
    - always use full-size ckeditor
    - add missing purifyHtml() calls
    - display in print view of assignment
    - rename getFeedback() to getUserFeedback()
    - move feedback out of option tag for export
+ 14
26
@@ -1378,32 +1378,8 @@ class SheetsController extends StudipController
$resets = Request::int('resets', 0);
$evaluation_mode = Request::int('evaluation_mode', 0);
$exercise_points = Request::floatArray('exercise_points');
// Feedback settings for selftest only
$selftest_threshold = Request::getArray('threshold');
$selftest_feedback = Request::getArray('feedback');
$selftest_feedback_options = [];
foreach ($selftest_threshold as $i => $threshold) {
if ($threshold != null) {
$selftest_feedback_options[] = [
'threshold' => $selftest_threshold[$i],
'feedback' => trim($selftest_feedback[$i])
];
}
}
usort($selftest_feedback_options, function($a, $b) {
if ($a['threshold'] == $b['threshold']) {
return 0;
}
if ($a['threshold'] < $b['threshold']) {
return -1;
}
return 1;
});
$assignment->options['feedback'] = $selftest_feedback_options;
$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);
@@ -1446,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
@@ -1494,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;
@@ -1527,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();
Loading