PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/tool/qeupgradehelper/extracttestcase_form.php

https://bitbucket.org/moodle/moodle
PHP | 73 lines | 32 code | 14 blank | 27 comment | 1 complexity | 9553b3a1733f905c8fcedeb3cc77d794 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.1, BSD-3-Clause, MIT, GPL-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. * Settings form for extracttestcase.php.
  18. *
  19. * @package tool
  20. * @subpackage qeupgradehelper
  21. * @copyright 2009 The Open University
  22. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23. */
  24. defined('MOODLE_INTERNAL') || die();
  25. require_once($CFG->libdir . '/formslib.php');
  26. /**
  27. * Options form.
  28. * @copyright 2009 The Open University
  29. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  30. */
  31. class tool_qeupgradehelper_extract_options_form extends moodleform {
  32. public function definition() {
  33. $mform = $this->_form;
  34. $behaviour = array(
  35. 'deferredfeedback' => 'Deferred feedback',
  36. 'adaptive' => 'Adaptive',
  37. 'adaptivenopenalty' => 'Adaptive (no penalties)',
  38. );
  39. $qtypes = core_component::get_plugin_list('qtype');
  40. foreach ($qtypes as $qtype => $notused) {
  41. $qtypes[$qtype] = get_string($qtype, 'qtype_' . $qtype);
  42. }
  43. $mform->addElement('header', 'h1', 'Either extract a specific question_session');
  44. $mform->addElement('text', 'attemptid', 'Quiz attempt id', array('size' => '10'));
  45. $mform->setType('attemptid', PARAM_INT);
  46. $mform->addElement('text', 'questionid', 'Question id', array('size' => '10'));
  47. $mform->setType('questionid', PARAM_INT);
  48. $mform->addElement('header', 'h2', 'Or find and extract an example by type');
  49. $mform->addElement('select', 'behaviour', 'Behaviour', $behaviour);
  50. $mform->setType('behaviour', PARAM_ALPHA);
  51. $mform->addElement('text', 'statehistory', 'State history', array('size' => '10'));
  52. $mform->setType('statehistory', PARAM_RAW);
  53. $mform->addElement('select', 'qtype', 'Question type', $qtypes);
  54. $mform->setType('qtype', PARAM_PLUGIN);
  55. $mform->addElement('text', 'extratests', 'Extra conditions', array('size' => '50'));
  56. $mform->setType('extratests', PARAM_RAW);
  57. $this->add_action_buttons(false, 'Create test case');
  58. }
  59. }