| Línea 6... |
Línea 6... |
| 6 |
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
|
6 |
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
|
| Línea 7... |
Línea 7... |
| 7 |
|
7 |
|
| Línea 8... |
Línea 8... |
| 8 |
class mod_choice_mod_form extends moodleform_mod {
|
8 |
class mod_choice_mod_form extends moodleform_mod {
|
| 9 |
|
9 |
|
| Línea 10... |
Línea 10... |
| 10 |
function definition() {
|
10 |
function definition() {
|
| Línea 11... |
Línea 11... |
| 11 |
global $CFG, $CHOICE_SHOWRESULTS, $CHOICE_PUBLISH, $CHOICE_DISPLAY, $DB;
|
11 |
global $CFG, $DB;
|
| 12 |
|
12 |
|
| Línea 24... |
Línea 24... |
| 24 |
$mform->addRule('name', null, 'required', null, 'client');
|
24 |
$mform->addRule('name', null, 'required', null, 'client');
|
| 25 |
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
|
25 |
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
|
| Línea 26... |
Línea 26... |
| 26 |
|
26 |
|
| Línea 27... |
Línea 27... |
| 27 |
$this->standard_intro_elements(get_string('description', 'choice'));
|
27 |
$this->standard_intro_elements(get_string('description', 'choice'));
|
| - |
|
28 |
|
| - |
|
29 |
$mform->addElement('select', 'display', get_string("displaymode", "choice"), [
|
| - |
|
30 |
CHOICE_DISPLAY_HORIZONTAL => get_string('displayhorizontal', 'choice'),
|
| Línea 28... |
Línea 31... |
| 28 |
|
31 |
CHOICE_DISPLAY_VERTICAL => get_string('displayvertical', 'choice'),
|
| 29 |
$mform->addElement('select', 'display', get_string("displaymode","choice"), $CHOICE_DISPLAY);
|
32 |
]);
|
| Línea 30... |
Línea 33... |
| 30 |
|
33 |
|
| Línea 92... |
Línea 95... |
| 92 |
$mform->disabledIf('showpreview', 'timeopen[enabled]');
|
95 |
$mform->disabledIf('showpreview', 'timeopen[enabled]');
|
| Línea 93... |
Línea 96... |
| 93 |
|
96 |
|
| 94 |
//-------------------------------------------------------------------------------
|
97 |
//-------------------------------------------------------------------------------
|
| Línea 95... |
Línea 98... |
| 95 |
$mform->addElement('header', 'resultshdr', get_string('results', 'choice'));
|
98 |
$mform->addElement('header', 'resultshdr', get_string('results', 'choice'));
|
| - |
|
99 |
|
| - |
|
100 |
$mform->addElement('select', 'showresults', get_string("publish", "choice"), [
|
| - |
|
101 |
CHOICE_SHOWRESULTS_NOT => get_string('publishnot', 'choice'),
|
| - |
|
102 |
CHOICE_SHOWRESULTS_AFTER_ANSWER => get_string('publishafteranswer', 'choice'),
|
| - |
|
103 |
CHOICE_SHOWRESULTS_AFTER_CLOSE => get_string('publishafterclose', 'choice'),
|
| - |
|
104 |
CHOICE_SHOWRESULTS_ALWAYS => get_string('publishalways', 'choice'),
|
| - |
|
105 |
]);
|
| - |
|
106 |
|
| - |
|
107 |
$mform->addElement('select', 'publish', get_string("privacy", "choice"), [
|
| - |
|
108 |
CHOICE_PUBLISH_ANONYMOUS => get_string('publishanonymous', 'choice'),
|
| Línea 96... |
Línea -... |
| 96 |
|
- |
|
| 97 |
$mform->addElement('select', 'showresults', get_string("publish", "choice"), $CHOICE_SHOWRESULTS);
|
109 |
CHOICE_PUBLISH_NAMES => get_string('publishnames', 'choice'),
|
| Línea 98... |
Línea 110... |
| 98 |
|
110 |
]);
|
| Línea 99... |
Línea 111... |
| 99 |
$mform->addElement('select', 'publish', get_string("privacy", "choice"), $CHOICE_PUBLISH);
|
111 |
|