2 // This file is part of Moodle - http://moodle.org/
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 * This file contains the definition for the renderable classes for the assignment
21 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 defined('MOODLE_INTERNAL') || die();
28 * This class wraps the submit for grading confirmation page
30 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
31 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
33 class assign_submit_for_grading_page implements renderable {
34 /** @var array $notifications is a list of notification messages returned from the plugins */
35 public $notifications = array();
36 /** @var int $coursemoduleid */
37 public $coursemoduleid = 0;
38 /** @var moodleform $confirmform */
39 public $confirmform = null;
43 * @param string $notifications - Any mesages to display
44 * @param int $coursemoduleid
45 * @param moodleform $confirmform
47 public function __construct($notifications, $coursemoduleid, $confirmform) {
48 $this->notifications = $notifications;
49 $this->coursemoduleid = $coursemoduleid;
50 $this->confirmform = $confirmform;
56 * Implements a renderable message notification
58 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
59 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
61 class assign_gradingmessage implements renderable {
62 /** @var string $heading is the heading to display to the user */
64 /** @var string $message is the message to display to the user */
66 /** @var int $coursemoduleid */
67 public $coursemoduleid = 0;
71 * @param string $heading This is the heading to display
72 * @param string $message This is the message to display
73 * @param int $coursemoduleid
75 public function __construct($heading, $message, $coursemoduleid) {
76 $this->heading = $heading;
77 $this->message = $message;
78 $this->coursemoduleid = $coursemoduleid;
84 * Implements a renderable grading options form
86 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
87 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
89 class assign_form implements renderable {
90 /** @var moodleform $form is the edit submission form */
92 /** @var string $classname is the name of the class to assign to the container */
93 public $classname = '';
94 /** @var string $jsinitfunction is an optional js function to add to the page requires */
95 public $jsinitfunction = '';
99 * @param string $classname This is the class name for the container div
100 * @param moodleform $form This is the moodleform
101 * @param string $jsinitfunction This is an optional js function to add to the page requires
103 public function __construct($classname, moodleform $form, $jsinitfunction = '') {
104 $this->classname = $classname;
106 $this->jsinitfunction = $jsinitfunction;
112 * Implements a renderable user summary
113 * @package mod_assign
114 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
115 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
117 class assign_user_summary implements renderable {
118 /** @var stdClass $user suitable for rendering with user_picture and fullname(). */
120 /** @var int $courseid */
122 /** @var bool $viewfullnames */
123 public $viewfullnames = false;
124 /** @var bool $blindmarking */
125 public $blindmarking = false;
126 /** @var int $uniqueidforuser */
127 public $uniqueidforuser;
128 /** @var array $extrauserfields */
129 public $extrauserfields;
130 /** @var bool $suspendeduser */
131 public $suspendeduser;
135 * @param stdClass $user
136 * @param int $courseid
137 * @param bool $viewfullnames
138 * @param bool $blindmarking
139 * @param int $uniqueidforuser
140 * @param array $extrauserfields
141 * @param bool $suspendeduser
143 public function __construct(stdClass $user,
149 $suspendeduser = false) {
151 $this->courseid = $courseid;
152 $this->viewfullnames = $viewfullnames;
153 $this->blindmarking = $blindmarking;
154 $this->uniqueidforuser = $uniqueidforuser;
155 $this->extrauserfields = $extrauserfields;
156 $this->suspendeduser = $suspendeduser;
161 * Implements a renderable feedback plugin feedback
162 * @package mod_assign
163 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
164 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
166 class assign_feedback_plugin_feedback implements renderable {
167 /** @var int SUMMARY */
172 /** @var assign_submission_plugin $plugin */
173 public $plugin = null;
174 /** @var stdClass $grade */
175 public $grade = null;
176 /** @var string $view */
177 public $view = self::SUMMARY;
178 /** @var int $coursemoduleid */
179 public $coursemoduleid = 0;
180 /** @var string returnaction The action to take you back to the current page */
181 public $returnaction = '';
182 /** @var array returnparams The params to take you back to the current page */
183 public $returnparams = array();
186 * Feedback for a single plugin
188 * @param assign_feedback_plugin $plugin
189 * @param stdClass $grade
190 * @param string $view one of feedback_plugin::SUMMARY or feedback_plugin::FULL
191 * @param int $coursemoduleid
192 * @param string $returnaction The action required to return to this page
193 * @param array $returnparams The params required to return to this page
195 public function __construct(assign_feedback_plugin $plugin,
201 $this->plugin = $plugin;
202 $this->grade = $grade;
204 $this->coursemoduleid = $coursemoduleid;
205 $this->returnaction = $returnaction;
206 $this->returnparams = $returnparams;
212 * Implements a renderable submission plugin submission
213 * @package mod_assign
214 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
215 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
217 class assign_submission_plugin_submission implements renderable {
218 /** @var int SUMMARY */
223 /** @var assign_submission_plugin $plugin */
224 public $plugin = null;
225 /** @var stdClass $submission */
226 public $submission = null;
227 /** @var string $view */
228 public $view = self::SUMMARY;
229 /** @var int $coursemoduleid */
230 public $coursemoduleid = 0;
231 /** @var string returnaction The action to take you back to the current page */
232 public $returnaction = '';
233 /** @var array returnparams The params to take you back to the current page */
234 public $returnparams = array();
238 * @param assign_submission_plugin $plugin
239 * @param stdClass $submission
240 * @param string $view one of submission_plugin::SUMMARY, submission_plugin::FULL
241 * @param int $coursemoduleid - the course module id
242 * @param string $returnaction The action to return to the current page
243 * @param array $returnparams The params to return to the current page
245 public function __construct(assign_submission_plugin $plugin,
246 stdClass $submission,
251 $this->plugin = $plugin;
252 $this->submission = $submission;
254 $this->coursemoduleid = $coursemoduleid;
255 $this->returnaction = $returnaction;
256 $this->returnparams = $returnparams;
261 * Renderable feedback status
262 * @package mod_assign
263 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
264 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
266 class assign_feedback_status implements renderable {
268 /** @var stding $gradefordisplay the student grade rendered into a format suitable for display */
269 public $gradefordisplay = '';
270 /** @var mixed the graded date (may be null) */
271 public $gradeddate = 0;
272 /** @var mixed the grader (may be null) */
273 public $grader = null;
274 /** @var array feedbackplugins - array of feedback plugins */
275 public $feedbackplugins = array();
276 /** @var stdClass assign_grade record */
277 public $grade = null;
278 /** @var int coursemoduleid */
279 public $coursemoduleid = 0;
280 /** @var string returnaction */
281 public $returnaction = '';
282 /** @var array returnparams */
283 public $returnparams = array();
287 * @param string $gradefordisplay
288 * @param mixed $gradeddate
289 * @param mixed $grader
290 * @param array $feedbackplugins
291 * @param mixed $grade
292 * @param int $coursemoduleid
293 * @param string $returnaction The action required to return to this page
294 * @param array $returnparams The list of params required to return to this page
296 public function __construct($gradefordisplay,
304 $this->gradefordisplay = $gradefordisplay;
305 $this->gradeddate = $gradeddate;
306 $this->grader = $grader;
307 $this->feedbackplugins = $feedbackplugins;
308 $this->grade = $grade;
309 $this->coursemoduleid = $coursemoduleid;
310 $this->returnaction = $returnaction;
311 $this->returnparams = $returnparams;
316 * Renderable submission status
317 * @package mod_assign
318 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
319 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
321 class assign_submission_status implements renderable {
322 /** @var int STUDENT_VIEW */
323 const STUDENT_VIEW = 10;
324 /** @var int GRADER_VIEW */
325 const GRADER_VIEW = 20;
327 /** @var int allowsubmissionsfromdate */
328 public $allowsubmissionsfromdate = 0;
329 /** @var bool alwaysshowdescription */
330 public $alwaysshowdescription = false;
331 /** @var stdClass the submission info (may be null) */
332 public $submission = null;
333 /** @var boolean teamsubmissionenabled - true or false */
334 public $teamsubmissionenabled = false;
335 /** @var stdClass teamsubmission the team submission info (may be null) */
336 public $teamsubmission = null;
337 /** @var stdClass submissiongroup the submission group info (may be null) */
338 public $submissiongroup = null;
339 /** @var array submissiongroupmemberswhoneedtosubmit list of users who still need to submit */
340 public $submissiongroupmemberswhoneedtosubmit = array();
341 /** @var bool submissionsenabled */
342 public $submissionsenabled = false;
343 /** @var bool locked */
344 public $locked = false;
345 /** @var bool graded */
346 public $graded = false;
347 /** @var int duedate */
349 /** @var int cutoffdate */
350 public $cutoffdate = 0;
351 /** @var array submissionplugins - the list of submission plugins */
352 public $submissionplugins = array();
353 /** @var string returnaction */
354 public $returnaction = '';
355 /** @var string returnparams */
356 public $returnparams = array();
357 /** @var int courseid */
358 public $courseid = 0;
359 /** @var int coursemoduleid */
360 public $coursemoduleid = 0;
361 /** @var int the view (STUDENT_VIEW OR GRADER_VIEW) */
362 public $view = self::STUDENT_VIEW;
363 /** @var bool canviewfullnames */
364 public $canviewfullnames = false;
365 /** @var bool canedit */
366 public $canedit = false;
367 /** @var bool cansubmit */
368 public $cansubmit = false;
369 /** @var int extensionduedate */
370 public $extensionduedate = 0;
371 /** @var context context */
373 /** @var bool blindmarking - Should we hide student identities from graders? */
374 public $blindmarking = false;
375 /** @var string gradingcontrollerpreview */
376 public $gradingcontrollerpreview = '';
377 /** @var string attemptreopenmethod */
378 public $attemptreopenmethod = 'none';
379 /** @var int maxattempts */
380 public $maxattempts = -1;
385 * @param int $allowsubmissionsfromdate
386 * @param bool $alwaysshowdescription
387 * @param stdClass $submission
388 * @param bool $teamsubmissionenabled
389 * @param stdClass $teamsubmission
390 * @param int $submissiongroup
391 * @param array $submissiongroupmemberswhoneedtosubmit
392 * @param bool $submissionsenabled
393 * @param bool $locked
394 * @param bool $graded
395 * @param int $duedate
396 * @param int $cutoffdate
397 * @param array $submissionplugins
398 * @param string $returnaction
399 * @param array $returnparams
400 * @param int $coursemoduleid
401 * @param int $courseid
402 * @param string $view
403 * @param bool $canedit
404 * @param bool $cansubmit
405 * @param bool $canviewfullnames
406 * @param int $extensionduedate - Any extension to the due date granted for this user
407 * @param context $context - Any extension to the due date granted for this user
408 * @param bool $blindmarking - Should we hide student identities from graders?
409 * @param string $gradingcontrollerpreview
410 * @param string $attemptreopenmethod - The method of reopening student attempts.
411 * @param int $maxattempts - How many attempts can a student make?
413 public function __construct($allowsubmissionsfromdate,
414 $alwaysshowdescription,
416 $teamsubmissionenabled,
419 $submissiongroupmemberswhoneedtosubmit,
437 $gradingcontrollerpreview,
438 $attemptreopenmethod,
440 $this->allowsubmissionsfromdate = $allowsubmissionsfromdate;
441 $this->alwaysshowdescription = $alwaysshowdescription;
442 $this->submission = $submission;
443 $this->teamsubmissionenabled = $teamsubmissionenabled;
444 $this->teamsubmission = $teamsubmission;
445 $this->submissiongroup = $submissiongroup;
446 $this->submissiongroupmemberswhoneedtosubmit = $submissiongroupmemberswhoneedtosubmit;
447 $this->submissionsenabled = $submissionsenabled;
448 $this->locked = $locked;
449 $this->graded = $graded;
450 $this->duedate = $duedate;
451 $this->cutoffdate = $cutoffdate;
452 $this->submissionplugins = $submissionplugins;
453 $this->returnaction = $returnaction;
454 $this->returnparams = $returnparams;
455 $this->coursemoduleid = $coursemoduleid;
456 $this->courseid = $courseid;
458 $this->canedit = $canedit;
459 $this->cansubmit = $cansubmit;
460 $this->canviewfullnames = $canviewfullnames;
461 $this->extensionduedate = $extensionduedate;
462 $this->context = $context;
463 $this->blindmarking = $blindmarking;
464 $this->gradingcontrollerpreview = $gradingcontrollerpreview;
465 $this->attemptreopenmethod = $attemptreopenmethod;
466 $this->maxattempts = $maxattempts;
471 * Used to output the attempt history for a particular assignment.
473 * @package mod_assign
474 * @copyright 2012 Davo Smith, Synergy Learning
475 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
477 class assign_attempt_history implements renderable {
479 /** @var array submissions - The list of previous attempts */
480 public $submissions = array();
481 /** @var array grades - The grades for the previous attempts */
482 public $grades = array();
483 /** @var array submissionplugins - The list of submission plugins to render the previous attempts */
484 public $submissionplugins = array();
485 /** @var array feedbackplugins - The list of feedback plugins to render the previous attempts */
486 public $feedbackplugins = array();
487 /** @var int coursemoduleid - The cmid for the assignment */
488 public $coursemoduleid = 0;
489 /** @var string returnaction - The action for the next page. */
490 public $returnaction = '';
491 /** @var string returnparams - The params for the next page. */
492 public $returnparams = array();
493 /** @var bool cangrade - Does this user have grade capability? */
494 public $cangrade = false;
495 /** @var string useridlistid - Id of the useridlist stored in cache, this plus rownum determines the userid */
496 public $useridlistid = 0;
497 /** @var int rownum - The rownum of the user in the useridlistid - this plus useridlistid determines the userid */
503 * @param array $submissions
504 * @param array $grades
505 * @param array $submissionplugins
506 * @param array $feedbackplugins
507 * @param int $coursemoduleid
508 * @param string $returnaction
509 * @param array $returnparams
510 * @param bool $cangrade
511 * @param int $useridlistid
514 public function __construct($submissions,
524 $this->submissions = $submissions;
525 $this->grades = $grades;
526 $this->submissionplugins = $submissionplugins;
527 $this->feedbackplugins = $feedbackplugins;
528 $this->coursemoduleid = $coursemoduleid;
529 $this->returnaction = $returnaction;
530 $this->returnparams = $returnparams;
531 $this->cangrade = $cangrade;
532 $this->useridlistid = $useridlistid;
533 $this->rownum = $rownum;
539 * @package mod_assign
540 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
541 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
543 class assign_header implements renderable {
544 /** @var stdClass the assign record */
545 public $assign = null;
546 /** @var mixed context|null the context record */
547 public $context = null;
548 /** @var bool $showintro - show or hide the intro */
549 public $showintro = false;
550 /** @var int coursemoduleid - The course module id */
551 public $coursemoduleid = 0;
552 /** @var string $subpage optional subpage (extra level in the breadcrumbs) */
553 public $subpage = '';
554 /** @var string $preface optional preface (text to show before the heading) */
555 public $preface = '';
560 * @param stdClass $assign - the assign database record
561 * @param mixed $context context|null the course module context
562 * @param bool $showintro - show or hide the intro
563 * @param int $coursemoduleid - the course module id
564 * @param string $subpage - an optional sub page in the navigation
565 * @param string $preface - an optional preface to show before the heading
567 public function __construct(stdClass $assign,
573 $this->assign = $assign;
574 $this->context = $context;
575 $this->showintro = $showintro;
576 $this->coursemoduleid = $coursemoduleid;
577 $this->subpage = $subpage;
578 $this->preface = $preface;
583 * Renderable header related to an individual subplugin
584 * @package mod_assign
585 * @copyright 2014 Henning Bostelmann
586 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
588 class assign_plugin_header implements renderable {
589 /** @var assign_plugin $plugin */
590 public $plugin = null;
593 * Header for a single plugin
595 * @param assign_plugin $plugin
597 public function __construct(assign_plugin $plugin) {
598 $this->plugin = $plugin;
603 * Renderable grading summary
604 * @package mod_assign
605 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
606 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
608 class assign_grading_summary implements renderable {
609 /** @var int participantcount - The number of users who can submit to this assignment */
610 public $participantcount = 0;
611 /** @var bool submissiondraftsenabled - Allow submission drafts */
612 public $submissiondraftsenabled = false;
613 /** @var int submissiondraftscount - The number of submissions in draft status */
614 public $submissiondraftscount = 0;
615 /** @var bool submissionsenabled - Allow submissions */
616 public $submissionsenabled = false;
617 /** @var int submissionssubmittedcount - The number of submissions in submitted status */
618 public $submissionssubmittedcount = 0;
619 /** @var int submissionsneedgradingcount - The number of submissions that need grading */
620 public $submissionsneedgradingcount = 0;
621 /** @var int duedate - The assignment due date (if one is set) */
623 /** @var int cutoffdate - The assignment cut off date (if one is set) */
624 public $cutoffdate = 0;
625 /** @var int coursemoduleid - The assignment course module id */
626 public $coursemoduleid = 0;
627 /** @var boolean teamsubmission - Are team submissions enabled for this assignment */
628 public $teamsubmission = false;
633 * @param int $participantcount
634 * @param bool $submissiondraftsenabled
635 * @param int $submissiondraftscount
636 * @param bool $submissionsenabled
637 * @param int $submissionssubmittedcount
638 * @param int $cutoffdate
639 * @param int $duedate
640 * @param int $coursemoduleid
641 * @param int $submissionsneedgradingcount
642 * @param bool $teamsubmission
644 public function __construct($participantcount,
645 $submissiondraftsenabled,
646 $submissiondraftscount,
648 $submissionssubmittedcount,
652 $submissionsneedgradingcount,
654 $this->participantcount = $participantcount;
655 $this->submissiondraftsenabled = $submissiondraftsenabled;
656 $this->submissiondraftscount = $submissiondraftscount;
657 $this->submissionsenabled = $submissionsenabled;
658 $this->submissionssubmittedcount = $submissionssubmittedcount;
659 $this->duedate = $duedate;
660 $this->cutoffdate = $cutoffdate;
661 $this->coursemoduleid = $coursemoduleid;
662 $this->submissionsneedgradingcount = $submissionsneedgradingcount;
663 $this->teamsubmission = $teamsubmission;
668 * Renderable course index summary
669 * @package mod_assign
670 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
671 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
673 class assign_course_index_summary implements renderable {
674 /** @var array assignments - A list of course module info and submission counts or statuses */
675 public $assignments = array();
676 /** @var boolean usesections - Does this course format support sections? */
677 public $usesections = false;
678 /** @var string courseformat - The current course format name */
679 public $courseformatname = '';
684 * @param boolean $usesections - True if this course format uses sections
685 * @param string $courseformatname - The id of this course format
687 public function __construct($usesections, $courseformatname) {
688 $this->usesections = $usesections;
689 $this->courseformatname = $courseformatname;
693 * Add a row of data to display on the course index page
695 * @param int $cmid - The course module id for generating a link
696 * @param string $cmname - The course module name for generating a link
697 * @param string $sectionname - The name of the course section (only if $usesections is true)
698 * @param int $timedue - The due date for the assignment - may be 0 if no duedate
699 * @param string $submissioninfo - A string with either the number of submitted assignments, or the
700 * status of the current users submission depending on capabilities.
701 * @param string $gradeinfo - The current users grade if they have been graded and it is not hidden.
703 public function add_assign_info($cmid, $cmname, $sectionname, $timedue, $submissioninfo, $gradeinfo) {
704 $this->assignments[] = array('cmid'=>$cmid,
706 'sectionname'=>$sectionname,
708 'submissioninfo'=>$submissioninfo,
709 'gradeinfo'=>$gradeinfo);
717 * An assign file class that extends rendererable class and is used by the assign module.
719 * @package mod_assign
720 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
721 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
723 class assign_files implements renderable {
724 /** @var context $context */
726 /** @var string $context */
728 /** @var MoodleQuickForm $portfolioform */
729 public $portfolioform;
730 /** @var stdClass $cm course module */
732 /** @var stdClass $course */
738 * @param context $context
740 * @param string $filearea
741 * @param string $component
743 public function __construct(context $context, $sid, $filearea, $component) {
745 $this->context = $context;
746 list($context, $course, $cm) = get_context_info_array($context->id);
748 $this->course = $course;
749 $fs = get_file_storage();
750 $this->dir = $fs->get_area_tree($this->context->id, $component, $filearea, $sid);
752 $files = $fs->get_area_files($this->context->id,
759 if (!empty($CFG->enableportfolios)) {
760 require_once($CFG->libdir . '/portfoliolib.php');
761 if (count($files) >= 1 &&
762 has_capability('mod/assign:exportownsubmission', $this->context)) {
763 $button = new portfolio_add_button();
764 $callbackparams = array('cmid' => $this->cm->id,
767 'component' => $component);
768 $button->set_callback_options('assign_portfolio_caller',
771 $button->reset_formats();
772 $this->portfolioform = $button->to_html(PORTFOLIO_ADD_TEXT_LINK);
777 // Plagiarism check if it is enabled.
779 if (!empty($CFG->enableplagiarism)) {
780 require_once($CFG->libdir . '/plagiarismlib.php');
782 // For plagiarism_get_links.
783 $assignment = new assign($this->context, null, null);
784 foreach ($files as $file) {
786 $linkparams = array('userid' => $sid,
788 'cmid' => $this->cm->id,
789 'course' => $this->course,
790 'assignment' => $assignment->get_instance());
791 $output .= plagiarism_get_links($linkparams);
797 $this->preprocess($this->dir, $filearea, $component);
801 * Preprocessing the file list to add the portfolio links if required.
804 * @param string $filearea
805 * @param string $component
808 public function preprocess($dir, $filearea, $component) {
810 foreach ($dir['subdirs'] as $subdir) {
811 $this->preprocess($subdir, $filearea, $component);
813 foreach ($dir['files'] as $file) {
814 $file->portfoliobutton = '';
815 if (!empty($CFG->enableportfolios)) {
816 $button = new portfolio_add_button();
817 if (has_capability('mod/assign:exportownsubmission', $this->context)) {
818 $portfolioparams = array('cmid' => $this->cm->id, 'fileid' => $file->get_id());
819 $button->set_callback_options('assign_portfolio_caller',
822 $button->set_format_by_file($file);
823 $file->portfoliobutton = $button->to_html(PORTFOLIO_ADD_ICON_LINK);
833 $file->get_itemid() .
834 $file->get_filepath() .
835 $file->get_filename();
836 $url = file_encode_url("$CFG->wwwroot/pluginfile.php", $path, true);
837 $filename = $file->get_filename();
838 $file->fileurl = html_writer::link($url, $filename);