PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/mod/lesson/essay_form.php

https://bitbucket.org/synergylearning/campusconnect
PHP | 68 lines | 22 code | 15 blank | 31 comment | 1 complexity | d6ac8cb69de652336e8b47861c12830e MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, LGPL-3.0, GPL-3.0, LGPL-2.1, Apache-2.0, BSD-3-Clause, AGPL-3.0
  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. * Essay grading form
  18. *
  19. * @package mod
  20. * @subpackage lesson
  21. * @copyright 2009 Sam Hemelryk
  22. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23. **/
  24. /**
  25. * Include formslib if it has not already been included
  26. */
  27. defined('MOODLE_INTERNAL') || die();
  28. require_once($CFG->libdir.'/formslib.php');
  29. /**
  30. * Essay grading form
  31. *
  32. * @copyright 2009 Sam Hemelryk
  33. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  34. **/
  35. class essay_grading_form extends moodleform {
  36. public function definition() {
  37. $mform = $this->_form;
  38. $mform->addElement('header', 'formheader', get_string('question', 'lesson'));
  39. $mform->addElement('hidden', 'id');
  40. $mform->setType('id', PARAM_INT);
  41. $mform->addElement('hidden', 'attemptid');
  42. $mform->setType('attemptid', PARAM_INT);
  43. $mform->addElement('hidden', 'mode', 'update');
  44. $mform->setType('mode', PARAM_ALPHA);
  45. $mform->addElement('static', 'question', get_string('question', 'lesson'));
  46. $mform->addElement('static', 'studentanswer', get_string('studentresponse', 'lesson', fullname($this->_customdata['user'], true)));
  47. $mform->addElement('textarea', 'response', get_string('comments', 'lesson'), array('rows'=>'15', 'cols'=>'60'));
  48. $mform->setType('response', PARAM_TEXT);
  49. $mform->addElement('select', 'score', get_string('essayscore', 'lesson'), $this->_customdata['scoreoptions']);
  50. $mform->setType('score', PARAM_INT);
  51. $this->add_action_buttons(get_string('cancel'), get_string('savechanges'));
  52. }
  53. }