MDL-33785 theme_base: RTL fixes added to style/filemanager.css
[moodle.git] / mod / assign / renderer.php
CommitLineData
bbd0e548
DW
1<?php
2// This file is part of Moodle - http://moodle.org/
3//
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.
8//
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.
13//
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/>.
16
17/**
18 * This file contains a renderer for the assignment class
19 *
20 * @package mod_assign
21 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 */
24
25defined('MOODLE_INTERNAL') || die();
26
27/** Include locallib.php */
28require_once($CFG->dirroot . '/mod/assign/locallib.php');
29
30
31/**
32 * A custom renderer class that extends the plugin_renderer_base and is used by the assign module.
33 *
34 * @package mod_assign
35 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
36 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
37 */
38class mod_assign_renderer extends plugin_renderer_base {
39
40 /**
41 * rendering assignment files
42 *
43 * @param context $context
44 * @param int $userid
45 * @param string $filearea
46 * @param string $component
47 * @return string
48 */
49 public function assign_files(context $context, $userid, $filearea, $component) {
50 return $this->render(new assign_files($context, $userid, $filearea, $component));
51 }
52
53 /**
54 * rendering assignment files
55 *
56 * @param assign_files $tree
57 * @return string
58 */
59 public function render_assign_files(assign_files $tree) {
60 $this->htmlid = 'assign_files_tree_'.uniqid();
61 $this->page->requires->js_init_call('M.mod_assign.init_tree', array(true, $this->htmlid));
62 $html = '<div id="'.$this->htmlid.'">';
63 $html .= $this->htmllize_tree($tree, $tree->dir);
64 $html .= '</div>';
65
66 if ($tree->portfolioform) {
67 $html .= $tree->portfolioform;
68 }
69 return $html;
70 }
71
72 /**
73 * Utility function to add a row of data to a table with 2 columns. Modified
74 * the table param and does not return a value
75 *
76 * @param html_table $table The table to append the row of data to
77 * @param string $first The first column text
78 * @param string $second The second column text
79 * @return void
80 */
81 private function add_table_row_tuple(html_table $table, $first, $second) {
82 $row = new html_table_row();
83 $cell1 = new html_table_cell($first);
84 $cell2 = new html_table_cell($second);
85 $row->cells = array($cell1, $cell2);
86 $table->data[] = $row;
87 }
88
bf78ebd6
DW
89 /**
90 * Render a grading error notification
91 * @param assign_quickgrading_result $result The result to render
92 * @return string
93 */
94 public function render_assign_quickgrading_result(assign_quickgrading_result $result) {
2a4fbc32
SH
95 $url = new moodle_url('/mod/assign/view.php', array('id' => $result->coursemoduleid, 'action'=>'grading'));
96
bf78ebd6
DW
97 $o = '';
98 $o .= $this->output->heading(get_string('quickgradingresult', 'assign'), 4);
bf78ebd6 99 $o .= $this->output->notification($result->message);
2a4fbc32 100 $o .= $this->output->continue_button($url);
bf78ebd6
DW
101 return $o;
102 }
103
bbd0e548
DW
104 /**
105 * Render the generic form
106 * @param assign_form $form The form to render
107 * @return string
108 */
109 public function render_assign_form(assign_form $form) {
110 $o = '';
bf78ebd6
DW
111 if ($form->jsinitfunction) {
112 $this->page->requires->js_init_call($form->jsinitfunction, array());
113 }
bbd0e548
DW
114 $o .= $this->output->box_start('boxaligncenter ' . $form->classname);
115 $o .= $this->moodleform($form->form);
116 $o .= $this->output->box_end();
117 return $o;
118 }
119
120 /**
121 * Render the user summary
122 *
123 * @param assign_user_summary $summary The user summary to render
124 * @return string
125 */
126 public function render_assign_user_summary(assign_user_summary $summary) {
127 $o = '';
128
129 if (!$summary->user) {
130 return;
131 }
132 $o .= $this->output->container_start('usersummary');
133 $o .= $this->output->box_start('boxaligncenter usersummarysection');
134 $o .= $this->output->user_picture($summary->user);
135 $o .= $this->output->spacer(array('width'=>30));
136 $o .= $this->output->action_link(new moodle_url('/user/view.php',
137 array('id' => $summary->user->id,
138 'course'=>$summary->courseid)),
139 fullname($summary->user, $summary->viewfullnames));
140 $o .= $this->output->box_end();
141 $o .= $this->output->container_end();
142
143 return $o;
144 }
145
146 /**
147 * Render the submit for grading page
148 *
149 * @param assign_submit_for_grading_page $page
150 * @return string
151 */
152 public function render_assign_submit_for_grading_page($page) {
153 $o = '';
154
155 $o .= $this->output->container_start('submitforgrading');
156 $o .= $this->output->heading(get_string('submitassignment', 'assign'), 3);
157 $o .= $this->output->spacer(array('height'=>30));
158
159 $cancelurl = new moodle_url('/mod/assign/view.php', array('id' => $page->coursemoduleid));
160 if (count($page->notifications)) {
161 // At least one of the submission plugins is not ready for submission
162
163 $o .= $this->output->heading(get_string('submissionnotready', 'assign'), 4);
164
165 foreach ($page->notifications as $notification) {
166 $o .= $this->output->notification($notification);
167 }
168
169 $o .= $this->output->continue_button($cancelurl);
170 } else {
171 // All submission plugins ready - confirm the student really does want to submit for marking
172 $continueurl = new moodle_url('/mod/assign/view.php', array('id' => $page->coursemoduleid,
173 'action' => 'confirmsubmit',
174 'sesskey' => sesskey()));
175 $o .= $this->output->confirm(get_string('confirmsubmission', 'mod_assign'), $continueurl, $cancelurl);
176 }
177 $o .= $this->output->container_end();
178
179
180 return $o;
181 }
182
183 /**
184 * Page is done - render the footer
185 *
186 * @return void
187 */
188 public function render_footer() {
189 return $this->output->footer();
190 }
191
192 /**
193 * render the header
194 *
195 * @param assign_header $header
196 * @return string
197 */
198 public function render_assign_header(assign_header $header) {
199 $o = '';
200
201 if ($header->subpage) {
202 $this->page->navbar->add($header->subpage);
203 }
204
205 $this->page->set_title(get_string('pluginname', 'assign'));
206 $this->page->set_heading($header->assign->name);
207
208 $o .= $this->output->header();
a1e54f4d
DW
209 if ($header->preface) {
210 $o .= $header->preface;
211 }
bbd0e548
DW
212 $o .= $this->output->heading(format_string($header->assign->name,false, array('context' => $header->context)));
213
214 if ($header->showintro) {
215 $o .= $this->output->box_start('generalbox boxaligncenter', 'intro');
216 $o .= format_module_intro('assign', $header->assign, $header->coursemoduleid);
217 $o .= $this->output->box_end();
218 }
219
220 return $o;
221 }
222
223 /**
224 * render a table containing the current status of the grading process
225 *
226 * @param assign_grading_summary $summary
227 * @return string
228 */
229 public function render_assign_grading_summary(assign_grading_summary $summary) {
230 // create a table for the data
231 $o = '';
232 $o .= $this->output->container_start('gradingsummary');
233 $o .= $this->output->heading(get_string('gradingsummary', 'assign'), 3);
234 $o .= $this->output->box_start('boxaligncenter gradingsummarytable');
235 $t = new html_table();
236
237 // status
238 $this->add_table_row_tuple($t, get_string('numberofparticipants', 'assign'),
239 $summary->participantcount);
240
241 // drafts
242 if ($summary->submissiondraftsenabled) {
243 $this->add_table_row_tuple($t, get_string('numberofdraftsubmissions', 'assign'),
244 $summary->submissiondraftscount);
245 }
246
247 // submitted for grading
248 if ($summary->submissionsenabled) {
249 $this->add_table_row_tuple($t, get_string('numberofsubmittedassignments', 'assign'),
250 $summary->submissionssubmittedcount);
251 }
252
253 $time = time();
254 if ($summary->duedate) {
255 // due date
256 // submitted for grading
257 $duedate = $summary->duedate;
258 $this->add_table_row_tuple($t, get_string('duedate', 'assign'),
259 userdate($duedate));
260
261 // time remaining
262 $due = '';
263 if ($duedate - $time <= 0) {
264 $due = get_string('assignmentisdue', 'assign');
265 } else {
266 $due = format_time($duedate - $time);
267 }
268 $this->add_table_row_tuple($t, get_string('timeremaining', 'assign'), $due);
269 }
270
271 // all done - write the table
272 $o .= html_writer::table($t);
273 $o .= $this->output->box_end();
274
275 // link to the grading page
d9a88f42
DW
276 $o .= $this->output->container_start('submissionlinks');
277 $o .= $this->output->action_link(new moodle_url('/mod/assign/view.php',
bbd0e548
DW
278 array('id' => $summary->coursemoduleid,
279 'action'=>'grading')),
d9a88f42
DW
280 get_string('viewgrading', 'assign'));
281 $o .= $this->output->container_end();
bbd0e548
DW
282
283 // close the container and insert a spacer
284 $o .= $this->output->container_end();
285
286 return $o;
287 }
288
289 /**
290 * render a table containing all the current grades and feedback
291 *
292 * @param assign_feedback_status $status
293 * @return string
294 */
295 public function render_assign_feedback_status(assign_feedback_status $status) {
296 global $DB, $CFG;
297 $o = '';
298
299 $o .= $this->output->container_start('feedback');
300 $o .= $this->output->heading(get_string('feedback', 'assign'), 3);
301 $o .= $this->output->box_start('boxaligncenter feedbacktable');
302 $t = new html_table();
303
304 $row = new html_table_row();
305 $cell1 = new html_table_cell(get_string('grade'));
306 $cell2 = new html_table_cell($status->gradefordisplay);
307 $row->cells = array($cell1, $cell2);
308 $t->data[] = $row;
309
310 $row = new html_table_row();
311 $cell1 = new html_table_cell(get_string('gradedon', 'assign'));
312 $cell2 = new html_table_cell(userdate($status->gradeddate));
313 $row->cells = array($cell1, $cell2);
314 $t->data[] = $row;
315
316 if ($status->grader) {
317 $row = new html_table_row();
318 $cell1 = new html_table_cell(get_string('gradedby', 'assign'));
319 $cell2 = new html_table_cell($this->output->user_picture($status->grader) . $this->output->spacer(array('width'=>30)) . fullname($status->grader));
320 $row->cells = array($cell1, $cell2);
321 $t->data[] = $row;
322 }
323
324 foreach ($status->feedbackplugins as $plugin) {
325 if ($plugin->is_enabled() && $plugin->is_visible() && !$plugin->is_empty($status->grade)) {
326 $row = new html_table_row();
327 $cell1 = new html_table_cell($plugin->get_name());
328 $pluginfeedback = new assign_feedback_plugin_feedback($plugin, $status->grade, assign_feedback_plugin_feedback::SUMMARY, $status->coursemoduleid, $status->returnaction, $status->returnparams);
329 $cell2 = new html_table_cell($this->render($pluginfeedback));
330 $row->cells = array($cell1, $cell2);
331 $t->data[] = $row;
332 }
333 }
334
335
336 $o .= html_writer::table($t);
337 $o .= $this->output->box_end();
338
339 $o .= $this->output->container_end();
340 return $o;
341 }
342
343 /**
344 * render a table containing the current status of the submission
345 *
346 * @param assign_submission_status $status
347 * @return string
348 */
349 public function render_assign_submission_status(assign_submission_status $status) {
350 $o = '';
351 $o .= $this->output->container_start('submissionstatustable');
352 $o .= $this->output->heading(get_string('submissionstatusheading', 'assign'), 3);
353 $time = time();
354
355 if ($status->allowsubmissionsfromdate &&
356 $time <= $status->allowsubmissionsfromdate) {
357 $o .= $this->output->box_start('generalbox boxaligncenter submissionsalloweddates');
358 if ($status->alwaysshowdescription) {
359 $o .= get_string('allowsubmissionsfromdatesummary', 'assign', userdate($status->allowsubmissionsfromdate));
360 } else {
361 $o .= get_string('allowsubmissionsanddescriptionfromdatesummary', 'assign', userdate($status->allowsubmissionsfromdate));
362 }
363 $o .= $this->output->box_end();
364 }
365 $o .= $this->output->box_start('boxaligncenter submissionsummarytable');
366
367 $t = new html_table();
368
369 $row = new html_table_row();
370 $cell1 = new html_table_cell(get_string('submissionstatus', 'assign'));
371 if ($status->submission) {
372 $cell2 = new html_table_cell(get_string('submissionstatus_' . $status->submission->status, 'assign'));
373 $cell2->attributes = array('class'=>'submissionstatus' . $status->submission->status);
374 } else {
375 if (!$status->submissionsenabled) {
376 $cell2 = new html_table_cell(get_string('noonlinesubmissions', 'assign'));
377 } else {
378 $cell2 = new html_table_cell(get_string('nosubmission', 'assign'));
379 }
380 }
381 $row->cells = array($cell1, $cell2);
382 $t->data[] = $row;
383
384 // status
385 if ($status->locked) {
386 $row = new html_table_row();
387 $cell1 = new html_table_cell();
388 $cell2 = new html_table_cell(get_string('submissionslocked', 'assign'));
389 $cell2->attributes = array('class'=>'submissionlocked');
390 $row->cells = array($cell1, $cell2);
391 $t->data[] = $row;
392 }
393
394 // grading status
395 $row = new html_table_row();
396 $cell1 = new html_table_cell(get_string('gradingstatus', 'assign'));
397
398 if ($status->graded) {
399 $cell2 = new html_table_cell(get_string('graded', 'assign'));
400 $cell2->attributes = array('class'=>'submissiongraded');
401 } else {
402 $cell2 = new html_table_cell(get_string('notgraded', 'assign'));
403 $cell2->attributes = array('class'=>'submissionnotgraded');
404 }
405 $row->cells = array($cell1, $cell2);
406 $t->data[] = $row;
407
408
409 $duedate = $status->duedate;
410 if ($duedate >= 1) {
411 $row = new html_table_row();
412 $cell1 = new html_table_cell(get_string('duedate', 'assign'));
413 $cell2 = new html_table_cell(userdate($duedate));
414 $row->cells = array($cell1, $cell2);
415 $t->data[] = $row;
416
417 // time remaining
418 $row = new html_table_row();
419 $cell1 = new html_table_cell(get_string('timeremaining', 'assign'));
420 if ($duedate - $time <= 0) {
421 if (!$status->submission || $status->submission != ASSIGN_SUBMISSION_STATUS_SUBMITTED) {
422 if ($status->submissionsenabled) {
423 $cell2 = new html_table_cell(get_string('overdue', 'assign', format_time($time - $duedate)));
424 $cell2->attributes = array('class'=>'overdue');
425 } else {
426 $cell2 = new html_table_cell(get_string('duedatereached', 'assign'));
427 }
428 } else {
429 if ($status->submission->timemodified > $duedate) {
430 $cell2 = new html_table_cell(get_string('submittedlate', 'assign', format_time($status->submission->timemodified - $duedate)));
431 $cell2->attributes = array('class'=>'latesubmission');
432 } else {
433 $cell2 = new html_table_cell(get_string('submittedearly', 'assign', format_time($status->submission->timemodified - $duedate)));
434 $cell2->attributes = array('class'=>'earlysubmission');
435 }
436 }
437 } else {
438 $cell2 = new html_table_cell(format_time($duedate - $time));
439 }
440 $row->cells = array($cell1, $cell2);
441 $t->data[] = $row;
442 }
443
444 // last modified
445 if ($status->submission) {
446 $row = new html_table_row();
447 $cell1 = new html_table_cell(get_string('timemodified', 'assign'));
448 $cell2 = new html_table_cell(userdate($status->submission->timemodified));
449 $row->cells = array($cell1, $cell2);
450 $t->data[] = $row;
451
452 foreach ($status->submissionplugins as $plugin) {
453 if ($plugin->is_enabled() && $plugin->is_visible() && !$plugin->is_empty($status->submission)) {
454 $row = new html_table_row();
455 $cell1 = new html_table_cell($plugin->get_name());
456 $pluginsubmission = new assign_submission_plugin_submission($plugin, $status->submission, assign_submission_plugin_submission::SUMMARY, $status->coursemoduleid, $status->returnaction, $status->returnparams);
457 $cell2 = new html_table_cell($this->render($pluginsubmission));
458 $row->cells = array($cell1, $cell2);
459 $t->data[] = $row;
460 }
461 }
462 }
463
464
465 $o .= html_writer::table($t);
466 $o .= $this->output->box_end();
467
468 // links
469 if ($status->canedit) {
470 $o .= $this->output->single_button(new moodle_url('/mod/assign/view.php',
471 array('id' => $status->coursemoduleid, 'action' => 'editsubmission')), get_string('editsubmission', 'assign'), 'get');
472 }
473
474 if ($status->cansubmit) {
475 // submission.php
476 $o .= $this->output->single_button(new moodle_url('/mod/assign/view.php',
477 array('id' => $status->coursemoduleid, 'action'=>'submit')), get_string('submitassignment', 'assign'), 'get');
478 $o .= $this->output->box_start('boxaligncenter submithelp');
479 $o .= get_string('submitassignment_help', 'assign');
480 $o .= $this->output->box_end();
481 }
482
483 $o .= $this->output->container_end();
484 return $o;
485 }
486
487 /**
488 * render a submission plugin submission
489 *
490 * @param assign_submission_plugin_submission $submissionplugin
491 * @return string
492 */
493 public function render_assign_submission_plugin_submission(assign_submission_plugin_submission $submissionplugin) {
494 $o = '';
495
496 if ($submissionplugin->view == assign_submission_plugin_submission::SUMMARY) {
497 $icon = $this->output->pix_icon('t/preview', get_string('view' . substr($submissionplugin->plugin->get_subtype(), strlen('assign')), 'mod_assign'));
498 $link = '';
499 $showviewlink = false;
500 $summary = $submissionplugin->plugin->view_summary($submissionplugin->submission, $showviewlink);
501 if ($showviewlink) {
502 $link = $this->output->action_link(
503 new moodle_url('/mod/assign/view.php',
504 array('id' => $submissionplugin->coursemoduleid,
505 'sid'=>$submissionplugin->submission->id,
506 'plugin'=>$submissionplugin->plugin->get_type(),
507 'action'=>'viewplugin' . $submissionplugin->plugin->get_subtype(),
508 'returnaction'=>$submissionplugin->returnaction,
509 'returnparams'=>http_build_query($submissionplugin->returnparams))),
510 $icon);
511
512 $link .= $this->output->spacer(array('width'=>15));
513 }
514
515 $o .= $link . $summary;
516 } else if ($submissionplugin->view == assign_submission_plugin_submission::FULL) {
517 $o .= $this->output->box_start('boxaligncenter submissionfull');
518 $o .= $submissionplugin->plugin->view($submissionplugin->submission);
519 $o .= $this->output->box_end();
520 }
521
522 return $o;
523 }
524
525 /**
526 * render the grading table
527 *
528 * @param assign_grading_table $table
529 * @return string
530 */
531 public function render_assign_grading_table(assign_grading_table $table) {
532 $o = '';
533 $o .= $this->output->box_start('boxaligncenter gradingtable');
534 $this->page->requires->js_init_call('M.mod_assign.init_grading_table', array());
535 $this->page->requires->string_for_js('nousersselected', 'assign');
536 $this->page->requires->string_for_js('batchoperationconfirmlock', 'assign');
537 $this->page->requires->string_for_js('batchoperationconfirmunlock', 'assign');
538 $this->page->requires->string_for_js('batchoperationconfirmreverttodraft', 'assign');
539 $this->page->requires->string_for_js('editaction', 'assign');
540 // need to get from prefs
541 $o .= $this->flexible_table($table, $table->get_rows_per_page(), true);
542 $o .= $this->output->box_end();
543
544 return $o;
545 }
546
547 /**
548 * Render a feedback plugin feedback
549 *
550 * @param assign_feedback_plugin_feedback $feedbackplugin
551 * @return string
552 */
553 public function render_assign_feedback_plugin_feedback(assign_feedback_plugin_feedback $feedbackplugin) {
554 $o = '';
555
556 if ($feedbackplugin->view == assign_feedback_plugin_feedback::SUMMARY) {
557 $icon = $this->output->pix_icon('t/preview', get_string('view' . substr($feedbackplugin->plugin->get_subtype(), strlen('assign')), 'mod_assign'));
558 $link = '';
559 $showviewlink = false;
560 $summary = $feedbackplugin->plugin->view_summary($feedbackplugin->grade, $showviewlink);
561 if ($showviewlink) {
562 $link = $this->output->action_link(
563 new moodle_url('/mod/assign/view.php',
564 array('id' => $feedbackplugin->coursemoduleid,
565 'gid'=>$feedbackplugin->grade->id,
566 'plugin'=>$feedbackplugin->plugin->get_type(),
567 'action'=>'viewplugin' . $feedbackplugin->plugin->get_subtype(),
568 'returnaction'=>$feedbackplugin->returnaction,
569 'returnparams'=>http_build_query($feedbackplugin->returnparams))),
570 $icon);
571 $link .= $this->output->spacer(array('width'=>15));
572 }
573
574 $o .= $link . $summary;
575 } else if ($feedbackplugin->view == assign_feedback_plugin_feedback::FULL) {
576 $o .= $this->output->box_start('boxaligncenter feedbackfull');
577 $o .= $feedbackplugin->plugin->view($feedbackplugin->grade);
578 $o .= $this->output->box_end();
579 }
580
581 return $o;
582 }
583
584
585
586 /**
587 * Internal function - creates htmls structure suitable for YUI tree.
588 *
589 * @param assign_files $tree
590 * @param array $dir
591 * @return string
592 */
593 protected function htmllize_tree(assign_files $tree, $dir) {
594 global $CFG;
595 $yuiconfig = array();
596 $yuiconfig['type'] = 'html';
597
598 if (empty($dir['subdirs']) and empty($dir['files'])) {
599 return '';
600 }
601
602 $result = '<ul>';
603 foreach ($dir['subdirs'] as $subdir) {
559276b1 604 $image = $this->output->pix_icon(file_folder_icon(), $subdir['dirname'], 'moodle', array('class'=>'icon'));
bbd0e548
DW
605 $result .= '<li yuiConfig=\''.json_encode($yuiconfig).'\'><div>'.$image.' '.s($subdir['dirname']).'</div> '.$this->htmllize_tree($tree, $subdir).'</li>';
606 }
607
608 foreach ($dir['files'] as $file) {
609 $filename = $file->get_filename();
bbd0e548
DW
610 if ($CFG->enableplagiarism) {
611 require_once($CFG->libdir.'/plagiarismlib.php');
612 $plagiarsmlinks = plagiarism_get_links(array('userid'=>$file->get_userid(), 'file'=>$file, 'cmid'=>$tree->cm->id, 'course'=>$tree->course));
613 } else {
614 $plagiarsmlinks = '';
615 }
559276b1 616 $image = $this->output->pix_icon(file_file_icon($file), $filename, 'moodle', array('class'=>'icon'));
bbd0e548
DW
617 $result .= '<li yuiConfig=\''.json_encode($yuiconfig).'\'><div>'.$image.' '.$file->fileurl.' '.$plagiarsmlinks.$file->portfoliobutton.'</div></li>';
618 }
619
620 $result .= '</ul>';
621
622 return $result;
623 }
624
625 /**
626 * Helper method dealing with the fact we can not just fetch the output of flexible_table
627 *
628 * @param flexible_table $table The table to render
629 * @param int $rowsperpage How many assignments to render in a page
630 * @param bool $displaylinks - Whether to render links in the table (e.g. downloads would not enable this)
631 * @return string HTML
632 */
633 protected function flexible_table(flexible_table $table, $rowsperpage, $displaylinks) {
634
635 $o = '';
636 ob_start();
637 $table->out($rowsperpage, $displaylinks);
638 $o = ob_get_contents();
639 ob_end_clean();
640
641 return $o;
642 }
643
644 /**
645 * Helper method dealing with the fact we can not just fetch the output of moodleforms
646 *
647 * @param moodleform $mform
648 * @return string HTML
649 */
650 protected function moodleform(moodleform $mform) {
651
652 $o = '';
653 ob_start();
654 $mform->display();
655 $o = ob_get_contents();
656 ob_end_clean();
657
658 return $o;
659 }
660
661}
662