-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint.php
564 lines (519 loc) · 26 KB
/
print.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* print a printview of evaluation-items
*
* @author Andreas Grabs
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package mod_evaluation
*/
require_once("../../config.php");
require_once("lib.php");
global $USER, $DB;
/* used only once to migrate data from evaluation tables
$e_from_f = optional_param('e_from_f', false, PARAM_INT); // copy globl evaluations forem evaluation tables to evaluation tables
if( $e_from_f)
{ evaluation_copy_from_evaluation(); // in lib.php, use with care
exit;
}*/
$id = required_param('id', PARAM_INT);
$courseid = optional_param('courseid', false, PARAM_INT); // Course where this evaluation is mapped to - used for return link.
$teacherid = optional_param('teacherid', false, PARAM_INT);
$department = optional_param('department', false, PARAM_TEXT);
$daily_progress =
optional_param('daily_progress', false, PARAM_INT); // show daily evaluation completions from start to end of evaluation
$logViews = optional_param('logViews', false, PARAM_INT); // show log views from Moodle log
$logsubject = optional_param('logsubject', 'AllActivities', PARAM_TEXT); // subject for log views from Moodle log
$course_of_studiesID = optional_param('course_of_studiesID', false, PARAM_INT);
$showCourses_of_studies = optional_param('showCourses_of_studies', false, PARAM_INT);
$showCourses = optional_param('showCourses', false, PARAM_INT); // show all courses of evaluation>id
$reminder = optional_param('reminder', false, PARAM_INT); // show option to participate in evaluation completion
$showTeacher = optional_param('showTeacher', false, PARAM_INT); // show all courses for teacher by user->id
$showResults = optional_param('showResults', false, PARAM_INT); // show list of courses with evaluation results
$_SESSION["notevaluated"] = optional_param('notevaluated', "", PARAM_ALPHA); // show courses that have not been evaluated
$showEvaluations = optional_param('showEvaluations', false, PARAM_INT); // show list of courses with evaluation results
$sortBy = optional_param('sortBy', "", PARAM_ALPHA); // sort order for showResults
$autofill = optional_param('autofill', false, PARAM_INT); // evaluation_autofill_item_studiengang
$showTeacherResults = optional_param('showTeacherResults', false, PARAM_INT); // show list of teachers with evaluation results
$showCompare = optional_param('showCompare', false, PARAM_INT); // compare all results with filter results
$showPrivUsers = optional_param('showPrivUsers', false, PARAM_INT); // show privileged users
$Chart = optional_param('Chart', false, PARAM_ALPHANUM);
if (!isset($_SESSION["Chart"])) {
$_SESSION["Chart"] = "line";
}
if (empty($Chart)) {
$Chart = $_SESSION["Chart"];
} else {
$_SESSION["Chart"] = $Chart;
}
$PAGE->set_url('/mod/evaluation/print.php', array('id' => $id, 'courseid' => $courseid));
list($course, $cm) = get_course_and_cm_from_cmid($id, 'evaluation');
require_course_login($course, true, $cm);
$evaluation = $PAGE->activityrecord;
$evaluationstructure = new mod_evaluation_structure($evaluation, $cm, $courseid);
list($isPermitted, $CourseTitle, $CourseName, $SiteEvaluation) =
evaluation_check_Roles_and_Permissions($courseid, $evaluation, $cm);
if ($course_of_studiesID) {
$course_of_studies = evaluation_get_course_of_studies_from_evc($course_of_studiesID, $evaluation);
}
$a = new stdClass();
$ev_name = ev_get_tr($evaluation->name);
$PAGE->set_pagelayout('popup');
// Print the page header.
//$strevaluations = get_string("modulenameplural", "evaluation");
//$evaluation_url = new moodle_url('/mod/evaluation/index.php', array('id'=>$course->id));
//$PAGE->navbar->add($strevaluations, $evaluation_url);
//$PAGE->navbar->add(format_string($ev_name));
$PAGE->set_title($ev_name);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
print '<div id="LoginAs" class="LoginAs d-print-none"></div><span style="clear:both;"><br></span>';
evaluation_LoginAs();
// Print the main part of the page.
$icon = '<img src="pix/icon120.png" height="30" alt="' . $ev_name . '">';
echo $OUTPUT->heading($icon . " " . format_string($ev_name));
// show return button
$goBack = html_writer::tag('button', ev_get_string('back'),
array('class' => "d-print-none", 'style' => 'color:white;background-color:black;text-align:center;',
'type' => 'button', 'onclick' => 'window.history.back();'));
// 'type' => 'button','onclick'=>'(window.history.back()?window.history.back():window.close());'));
if (defined('EVALUATION_OWNER')) {
if (is_bool($showResults) === false) {
print showEvaluationCourseResults($evaluation, $showResults, $sortBy, $id, $courseid);
//echo $OUTPUT->footer();
evaluation_footer();
$printWidth = "135vw";
require_once("print.js.php");
exit;
}
if (is_bool($showTeacherResults) === false) {
print showEvaluationTeacherResults($evaluation, $showTeacherResults, $sortBy, $id, $courseid);
evaluation_footer();
$printWidth = "135vw";
require_once("print.js.php");
exit;
}
if ($showPrivUsers){
echo $goBack;
echo evPrintButton();
echo "\n<p> </p>\n";
print ev_set_privileged_users(true);
evaluation_footer();
$printWidth = "135vw";
require_once("print.js.php");
exit;
}
}
if ($showCompare) {
require_once("compare_results.inc.php");
evaluation_compare_results($evaluation, $courseid, $teacherid, $course_of_studiesID, $department);
evaluation_footer();
// logging: error invalid course module id ??? (March 2022)
// evaluation_trigger_module_statistics($evaluation, $cm, $courseid);
// load js to handle printing
$printWidth = "90vw"; //100vw
require_once("print.js.php");
exit;
}
if ($autofill and
is_siteadmin()) { //evaluation_autofill_item_studiengang($autofill); // in lib.php, use with care, check item-no template and studiengang item before calling
if (!$evaluation->teamteaching) {
echo "<hr>\n";
echo "<br><hr>evaluation_autofill_field_teacherid für Evaluation ID $evaluation->id:<br>\n";
//evaluation_autofill_field_teacherid($evaluation,true);
evaluation_autofill_duplicate_field_teacherid($evaluation, false);
echo "<br>Autofill wurde abgearbeitet!<hr>\n";
}
evaluation_footer();
exit;
}
if ($logViews) {
if (!defined('EVALUATION_OWNER')) {
print "<p style=\\" . get_string('you_have_no_permission', 'evaluation') .
"</#000000>";
print $OUTPUT->footer();
exit;
}
$date = get_string('date');
$responses = "views";
echo '<h1 style="display:inline;display:inlinecolor:#000000;text-align:left;font-weight:bolder;">' .
get_string('usageReport', "evaluation") . "</h1><br>\n";
// all log data for this evaluation
$subjects = array('AllActivities' => get_string('AllActivities', 'evaluation'),
'submittedEvaluations' => get_string('submittedEvaluations', 'evaluation'),
'overview' => get_string('overview', 'evaluation'),
'analysis' => get_string('analysis', 'evaluation'), 'analysisExport' => "Excel Export",
'statistics' => get_string('statistics', 'evaluation'), 'show_entries' => get_string('show_entries', 'evaluation'),
'viewsglobalEvaluationInstances' => get_string('viewsglobalEvaluationInstances', 'evaluation')
);
$goBack = html_writer::tag('a', "Zurück", array('class' => "d-print-none",
'style' => 'color:white;background-color:black;text-align:center;',
'href' => '/mod/evaluation/view.php?id=' . $id));
echo $goBack;
echo evPrintButton();
$a->logexpiry = get_config('logstore_standard')->loglifetime;
echo '<br>' . ev_get_string('analysis_of_logs',$a) . "<br>\n";
foreach ($subjects as $key => $subject) {
if ($key == $logsubject) {
$Style = 'margin:3px 5px;font-weight:bold;color:teal;background-color:white;text-decoration:underline;';
} else {
$Style = 'margin:3px 5px;font-weight:bold;color:white;background-color:teal;';
}
echo '<div style="float:left;' . $Style . '">';
print html_writer::tag('a', $subject,
array('style' => $Style, 'href' => 'print.php?id=' . $cm->id . '&logViews=1&logsubject=' . $key));
echo "</div>\n";
}
echo '<div style="display:block;clear:both;"></div>' . "\n";
$AllActivities = "contextinstanceid = $cm->id";
$submittedEvaluations = "action = 'submitted' AND contextinstanceid = $cm->id ";
$overview = "action = 'viewed' AND contextinstanceid = $cm->id";
$analysis = "action = 'analysed' AND contextinstanceid = $cm->id";
$analysisExport = "action = 'analysedExported' AND contextinstanceid = $cm->id";
$statistics = "action = 'statistics' AND contextinstanceid = $cm->id";
$show_entries = "action = 'entries' AND contextinstanceid = $cm->id ";
$viewsglobalEvaluationInstances =
"action = 'viewed' AND contextinstanceid = $evaluation->course and eventname like '%instance_list%'";
$filter = ${$logsubject};
$site_admins = evaluation_get_siteadmins();
$query = "SELECT to_char(to_timestamp(timecreated),'YYYY-MM-DD Dy') AS \"$date\",
COUNT(to_char(to_timestamp(timecreated),'YYYY-MM-DD Dy')) AS \"$responses\"
FROM {logstore_standard_log}
WHERE component='mod_evaluation' AND $filter AND userid NOT IN ($site_admins)
GROUP BY to_char(to_timestamp(timecreated),'YYYY-MM-DD Dy')
ORDER BY to_char(to_timestamp(timecreated),'YYYY-MM-DD Dy') ASC";
//echo "Query: $query" ;
$results = $DB->get_records_sql($query);
$NumResults = safeCount($results);
if ($logsubject != "viewsglobalEvaluationInstances" and $evaluation->timeopen and $evaluation->timeclose) {
echo "<b>" . get_string('evaluation_period', 'evaluation') . "</b>: " . date("d.m.Y", $evaluation->timeopen)
. " - " . date("d.m.Y", $evaluation->timeclose)
. " (" . total_evaluation_days($evaluation) . " " . get_string("days") . ")<br>\n";
}
// if no results
if (empty($NumResults)) {
print "<p style=\"color:red;font-weight:bold;align:center;\">" . get_string('no_data', 'evaluation') . "</p>";
print $OUTPUT->footer();
exit;
}
//echo "Log Data: ".nl2br(var_export($AllResults,true));
//echo "site admins: ".evaluation_get_siteadmins().'<br>';
$results2 = $results;
usort($results2, function($a, $b) {
global $responses;
if ($a->{$responses} == $b->{$responses}) {
return 0;
}
return ($a->{$responses} > $b->{$responses} ? -1 : 1);
});
$days = total_evaluation_days($evaluation);
$views = 0;
foreach ($results as $result) {
$views += $result->$responses;
}
$average = round($views / $NumResults);
$median = $results2[intval($NumResults / 2)]->{$responses};
$modus = $results2[0]->{$responses};
$date = get_string('date');
echo ev_get_string('activities_per_day') . ": <b>" . ev_get_string('average')
. "</b>: " . evaluation_number_format($average) . " - <b>" . ev_get_string('median') . "</b>: "
. evaluation_number_format($median) . " - <b>" . ev_get_string('modus') . "</b>: "
. evaluation_number_format($modus) . ".<br>\n";
$a->numresults = $NumResults;
echo ev_get_string('numactivitydays',$a) ."<br>\n";
echo "<b>" . ev_get_string('total_activities') ."</b>: <b>" . evaluation_number_format($views) . "</b>\n";
echo '<div style="width:89%;">';
$data = $results2 = array();
$count = $replies = $Modus = $Median = 0;
foreach ($results as $result) {
$replies += $result->{$responses};
$Modus = ($result->{$responses} > $Modus ? $result->{$responses} : $Modus);
$results2[] = $result->{$responses};
sort($results2);
$Median = $results2[round(($count) / 2)];
$data['labels'][$count] = $result->{$date};
$data['series'][$count] = $result->{$responses};
$data['series_labels'][$count] = $result->{$responses};
$data['average'][$count] = round($replies / ($count + 1));
$data['median'][$count] = $Median;
$data['modus'][$count] = $Modus;
$count++;
}
// draw line chart
$chart = new \core\chart_bar();
$series = new \core\chart_series(format_string(get_string("pageviews", "evaluation")), $data['series']);
$seriesAvg = new \core\chart_series(get_string("average", "evaluation"), $data["average"]);
$seriesMed = new \core\chart_series(ev_get_string('median'), $data["median"]);
$seriesMod = new \core\chart_series(ev_get_string('modus'), $data["modus"]);
$seriesAvg->set_type(\core\chart_series::TYPE_LINE); // Set the series type to line chart.
$seriesMed->set_type(\core\chart_series::TYPE_LINE);
$seriesMod->set_type(\core\chart_series::TYPE_LINE);
$seriesAvg->set_smooth(true);
$seriesMed->set_smooth(true);
$seriesMod->set_smooth(true); // Calling set_smooth() passing true as parameter, will display smooth lines.
$series->set_labels($data['series_labels']);
$chart->add_series($series);
$chart->add_series($seriesAvg);
$chart->add_series($seriesMed);
$chart->add_series($seriesMod);
$chart->set_labels($data['labels']);
echo $OUTPUT->render($chart);
echo '</div>';
evaluation_footer();
// load js to handle printing
$printWidth = "100vw"; //100vw
require_once("print.js.php");
exit;
}
echo $goBack;
echo evPrintButton();
echo "<br>\n";
if ($showTeacher) {
if (defined('EVALUATION_OWNER') or $showTeacher == $USER->id) //OR !empty($_SESSION["LoggedInAs"]) )
{
$myEvaluations = get_evaluation_participants($evaluation, $showTeacher);
//print nl2br(var_export($myEvaluations));
$teacherEvaluations = evaluation_countCourseEvaluations($evaluation, $myEvaluations, "teacher", $showTeacher);
$courseEvaluations = evaluation_countCourseEvaluations($evaluation, $myEvaluations, false, false);
//if ( is_siteadmin() ) { print nl2br("$teacherEvaluations - $courseEvaluations<hr>"); }
if ((!evaluation_is_open($evaluation) or $evaluation->teamteaching) and $teacherEvaluations < $courseEvaluations) {
print show_user_evaluation_courses($evaluation, $myEvaluations, $id, true, true, true);
print "<h3>" . ev_get_string('results_for_all_evaluated_teachers') . "</h3>\n";
}
print show_user_evaluation_courses($evaluation, $myEvaluations, $id, true, false, false);
print '<a href="analysis_course.php?id=' . $id . '&teacherid=' . $showTeacher
. '" target="teacher"><b>' . "Auswertung" . "</b></a> \n";
print '<a href="print.php?showCompare=1&id=' . $id . '&teacherid=' . $showTeacher
. '" target="teacher"><b>' . "Statistik" . "</b></a> \n";
if (empty($_SESSION["LoggedInAs"])) {
print '<a href="/user/profile.php?id=' . $showTeacher . '" target="teacher"><b>' . "Profilseite ansehen" .
"</b></a><br>\n\n";
}
}
} // show all results, but currently not used instead used showresults/showEvaluationCourseResults()
else if (false and $showEvaluations) {
list($isPermitted, $CourseTitle, $CourseName, $SiteEvaluation) =
evaluation_check_Roles_and_Permissions($courseid, $evaluation, $cm, true);
if (0 and defined('EVALUATION_OWNER')) {
print "<h3>" . ev_get_string('results_for_all_participating_courses') . "</h3>\n";
$SiteEvaluations = get_evaluation_participants($evaluation, -1); //($Userid = -1) );
print show_user_evaluation_courses($evaluation, $SiteEvaluations, $id, true, false, false);
}
} else if ($reminder and $courseid) {
$fullname = ($USER->alternatename ? $USER->alternatename : $USER->firstname) . " " . $USER->lastname;
$myCourse = get_course($courseid);
echo "<h2>" . ev_get_string('course') . ": ". $myCourse->fullname . "</h2><br>\n";
echo "<h3>" . ev_get_string('good_day') . $fullname . "<br>" . ev_get_string('you_havent_yet_participated_for_this_course') . "</h3><br><br>\n";
?>
<button><a href="/mod/evaluation/view.php?id=<?php echo $id ?>" style="font-size:125%;color:white;background-color:black;">" . ev_get_string('i_want_participate_now') . "</a></button>
<button><a href="/course/view.php?id=<?php echo $courseid ?>" style="font-size:125%;color:white;background-color:black;">"
. ev_get_string('back_to_course') . "</a></button>
<?php
} else if ($daily_progress) {
if (!defined('EVALUATION_OWNER')) {
echo $goBack;
print "<p style=\"color:red;font-weight:bold;align:center;\">" . get_string('you_have_no_permission', 'evaluation') .
"</p>";
print $OUTPUT->footer();
exit;
}
$responses = get_string('completed_evaluations', "evaluation");
echo '<h1 style="color:darkgreen;text-align:left;font-weight:bolder;">' . get_string("statistics") . " " . $responses .
"</h1><br>\n";
$completed_responses = evaluation_countCourseEvaluations($evaluation); //$evaluationstructure->count_completed_responses();
if (!$completed_responses) {
echo $OUTPUT->notification(get_string('no_responses_yet', 'mod_evaluation'));
echo $OUTPUT->footer();
flush();
exit;
}
//$results = evaluation_daily_progress( $evaluation, "ASC" );
//global $DB;
$query = "SELECT to_char(to_timestamp(timemodified),'YYYY-MM-DD Dy') as \"" . get_string('date') . "\",
COUNT(to_char(to_timestamp(timemodified),'YYYY-MM-DD Dy')) AS \"$responses\"
FROM {evaluation_completed}
WHERE evaluation=$evaluation->id
GROUP BY to_char(to_timestamp(timemodified),'YYYY-MM-DD Dy')
ORDER BY to_char(to_timestamp(timemodified),'YYYY-MM-DD Dy') ASC;";
$results = $DB->get_records_sql($query);
$numresults = safeCount($results) ?: 1;
$average = round($completed_responses / ($numresults - 1 + (date("H") / 24)));
$results2 = $results;
usort($results2, function($a, $b) {
global $responses;
if ($a->{$responses} == $b->{$responses}) {
return 0;
}
return ($a->{$responses} > $b->{$responses} ? -1 : 1);
});
// print nl2br(var_export($results2));
$median = $results2[intval($numresults / 2)]->{$responses};
$modus = $results2[0]->{$responses};
$dayC = round(remaining_evaluation_days($evaluation)); //+round(date("H")/24,4) );
$prognosis = "";
$date = get_string('date');
$a->remaining_days = '<span style="color:darkgreen;font-weight:bolder;">' . $dayC . "</span>";
$prognosisval = round($completed_responses + (($completed_responses / $numresults) * $dayC));
if ($dayC >= 1) {
$prognosis = ". " . ev_get_string('prognosis') .": " . '<span style="color:darkgreen;font-weight:bolder;">'
. $prognosisval . "</span>";
$days = ". " . ev_get_string('remaining_days',$a);
} else {
$days = "";
}
echo ev_get_string('submissions_per_day') . ": <b>" . ev_get_string('average')
. "</b>: " . $average . " - <b>" . ev_get_string('median') . "</b>: "
. $median . " - <b>" . ev_get_string('modus') . "</b>: "
. $modus . ".<br>\n";
$a->numresults = $numresults;
$a->completed_responses = $completed_responses;
echo ev_get_string('numsubmissiondays',$a) . $days ."<br>\n";
echo "<b>" . ev_get_string('completed_responses') ."</b>: <b>" . $completed_responses . "</b>"
. $prognosis . ".\n";
// echo "Abgaben erfolgten an <b>" . $numresults . " Tagen</b>$days.<br>\n";
// echo "<b>Summe $responses</b>: <b>" . $completed_responses . "</b>" . $prognosis . "\n";
echo '<div style="width:89%;">';
$data = $results2 = array();
$count = $replies = $Modus = $Median = 0;
foreach ($results as $result) {
$replies += $result->{$responses};
$Modus = ($result->{$responses} > $Modus ? $result->{$responses} : $Modus);
$results2[] = $result->{$responses};
sort($results2);
$Median = $results2[round(($count) / 2)];
$data['labels'][$count] = $result->{$date};
$data['series'][$count] = $result->{$responses};
$data['series_labels'][$count] = $result->{$responses};
$data['average'][$count] = round($replies / ($count + 1));
$data['median'][$count] = $Median;
$data['modus'][$count] = $Modus;
$count++;
}
// draw line chart
$chart = new \core\chart_bar();
$series = new \core\chart_series(format_string(get_string("submittedEvaluations", "evaluation")), $data['series']);
$seriesAvg = new \core\chart_series(ev_get_string("average"), $data["average"]);
$seriesMed = new \core\chart_series(ev_get_string("median"), $data["median"]);
$seriesMod = new \core\chart_series(ev_get_string("modus"), $data["modus"]);
$seriesAvg->set_type(\core\chart_series::TYPE_LINE); // Set the series type to line chart.
$seriesMed->set_type(\core\chart_series::TYPE_LINE); // Set the series type to line chart.
$seriesMod->set_type(\core\chart_series::TYPE_LINE); // Set the series type to line chart.
$seriesAvg->set_smooth(true);
$seriesMed->set_smooth(true);
$seriesMod->set_smooth(true); // Calling set_smooth() passing true as parameter, will display smooth lines.
$series->set_labels($data['series_labels']);
$chart->add_series($series);
$chart->add_series($seriesAvg);
$chart->add_series($seriesMed);
$chart->add_series($seriesMod);
$chart->set_labels($data['labels']);
echo $OUTPUT->render($chart);
//echo '</div></div><div style="clear:both;"> </div>';
echo '</div>';
echo "<br>" . $goBack;
evaluation_footer();
// load js to handle printing
$printWidth = "100vw"; //100vw
require_once("print.js.php");
exit;
} else if ($showCourses_of_studies) // show list course_of_studies
{
list($sg_filter, $courses_filter) = get_evaluation_filters($evaluation);
echo '<h1 style="color:darkred;display:inline;text-align:left;font-weight:bolder;">'
. get_string("course_of_studies_selected", "evaluation") . '</h1>';
echo "<br>";
if (empty($sg_filter) and !empty($courses_filter)) {
$sg_filter = evaluation_get_course_of_studies_from_courseids($courses_filter);
}
if (!empty($sg_filter)) {
$selected = $sg_filter; //explode("\n", $evaluation->filter_course_of_studies);
sort($selected);
print "\n<ol><b>\n";
foreach ($selected as $studiengang) {
print "<li>" . $studiengang . "</li>\n";
}
print "\n</b></ol>\n";
} else {
print "<br><b>" . get_string("all") . "</b>";
}
echo '<hr><h1 style="color:darkred;text-align:left;font-weight:bolder;">' .
get_string("course_of_studies_list", "evaluation") . " " . get_evaluation_semester($evaluation) . "</h1><br>\n";
$all_course_studies = evaluation_get_course_studies($evaluation, true);
print "\n<ol><b>\n";
foreach ($all_course_studies as $studiengang) {
print "<li>" . $studiengang->course_of_studies . "</li>\n";
}
print "\n</b></ol>\n";
} else if ($showCourses) // show list courses
{
echo '<h1 style="color:darkred;display:inline;text-align:left;font-weight:bolder;">'
. get_string("courses_selected", "evaluation") . '</h1>';
echo "<br>";
if (!empty($evaluation->filter_courses)) {
$selected = explode("\n", $evaluation->filter_courses);
print "\n<ol>\n";
foreach ($selected as $courseid) {
$query = "SELECT id, fullname, shortname
FROM {course} AS course
WHERE id = $courseid";
$result = $DB->get_record_sql($query);
print "<li>" . $courseid . ' <a href="/course/view.php?id="' . $courseid . '"><b>' . $result->fullname .
"</b></a></li>\n";
}
print "\n</ol>\n";
} else {
print "<br><b>" . get_string("all") . "</b>";
}
/*echo '<hr><h1 style="color:darkred;text-align:left;font-weight:bolder;">'.
get_string("courses_list","evaluation"). " " .get_evaluation_semester($evaluation). "</h1><br>\n";
$all_courses = evaluation_participating_courses($evaluation;
print "\n<ol>\n";
foreach ( $all_courses AS $courseid )
{ $query = "SELECT id, fullname, shortname
FROM {course} AS course
WHERE id = $courseid";
$result = $DB->get_record_sql($query);
print "<li>" . $courseid . ' <a href="/course/view.php?id="'.$courseid.'"><b>'.$result->fullname ."</b></a></li>\n";
}
print "\n</ol>\n";
*/
} else // show form preview
{
echo '<h1 style="color:darkred;display:inline;text-align:left;font-weight:bolder;">' . get_string('preview') . '</h1><br>';
echo "<br>" . get_string("course", "evaluation") . ": <span style=\"font-size:12pt;font-weight:bold;\">Muster Kurs</span>";
if ($evaluation->teamteaching) {
print "<h3><b>" . get_string('evaluate_teacher', 'evaluation', "Alice Salomon") . "</b></h3>\n";
}
$form = new mod_evaluation_complete_form(mod_evaluation_complete_form::MODE_PRINT, $evaluationstructure,
'evaluation_print_form');
$form->display();
}
//echo $OUTPUT->continue_button($continueurl);
echo "<br>" . $goBack;
// Finish the page.
//echo $OUTPUT->footer();
evaluation_footer();
// load js to handle printing
$printWidth = "116vw"; //100vw
require_once("print.js.php");
function evaluation_footer($footer = "") {
global $OUTPUT;
if (empty($footer)) {
$footer = $OUTPUT->footer();
}
//print "</div>\n";
print $footer;
}