$mform =& $this->_form;
$mform->addElement('hidden', 'do_generation', 1);
+ $mform->setType('do_generation', PARAM_INT);
foreach ($generator->settings as $setting) {
$type = 'advcheckbox';
}
} else {
$mform->addElement('hidden', 'fulldelete', 1);
+ $mform->setType('fulldelete', PARAM_INT);
$mform->addElement('static', 'emptymessage', '', get_string('deletecategoryempty'));
}
$mform->addElement('hidden', 'delete');
+ $mform->setType('delete', PARAM_ALPHANUM);
$mform->addElement('hidden', 'sure');
+ $mform->setType('sure', PARAM_ALPHANUM);
$mform->setDefault('sure', md5(serialize($category)));
//--------------------------------------------------------------------------------
$mform->addElement('select', 'category', get_string('category'), $displaylist);
} else {
$mform->addElement('hidden', 'category', null);
+ $mform->setType('category', PARAM_INT);
}
$mform->setHelpButton('category', array('coursecategory', get_string('category')));
$mform->setDefault('category', $category->id);
$mform->setDefault('enablecompletion', $courseconfig->enablecompletion);
} else {
$mform->addElement('hidden', 'enablecompletion');
+ $mform->setType('enablecompletion', PARAM_INT);
$mform->setDefault('enablecompletion',0);
}
$mform->disabledIf('allowedmods', 'restrictmodules', 'eq', 0);
} else {
$mform->addElement('hidden', 'restrictmodules', null);
+ $mform->setType('restrictmodules', PARAM_INT);
}
if ($CFG->restrictmodulesfor == 'all') {
$mform->setDefault('allowedmods', explode(',',$CFG->defaultallowedmodules));
$mform->addElement('submit', 'unlockcompletion', get_string('unlockcompletion', 'completion'));
$mform->registerNoSubmitButton('unlockcompletion');
$mform->addElement('hidden', 'completionunlocked', 0);
+ $mform->setType('completionunlocked', PARAM_INT);
$mform->addElement('select', 'completion', get_string('completion', 'completion'),
array(COMPLETION_TRACKING_NONE=>get_string('completion_none', 'completion'),
}
} else {
$mform->addElement('hidden','group');
+ $mform->setType('group', PARAM_INT);
$mform->setConstants(array('group'=>0));
}
$mform->addElement('date_time_selector', 'date', get_string('since'), array('optional'=>true));
$mform->addElement('hidden','id');
+ $mform->setType('id', PARAM_INT);
$mform->setType('courseid', PARAM_INT);
$this->add_action_buttons(false, get_string('showrecent'));
$mform =& $this->_form;
$mform->addElement('hidden', 'reject', 0);
+ $mform->setType('reject', PARAM_INT);
$mform->addElement('header','coursedetails', get_string('coursereasonforrejecting'));
}
$mform->addElement('hidden', 'id', $COURSE->id);
+ $mform->setType('id', PARAM_INT);
$buttonarray = array();
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('resetcourse'));
}
else {
$mform->addElement('hidden', 'ccstate', '');
+ $mform->setType('ccstate', PARAM_ALPHANUM);
$mform->addElement('hidden', 'ccaddress', $USER->address);
+ $mform->setType('ccaddress', PARAM_ALPHANUM);
$mform->addElement('hidden', 'cccity', $USER->city);
+ $mform->setType('cccity', PARAM_ALPHANUM);
$mform->addElement('hidden', 'cccountry', $USER->country);
+ $mform->setType('ccountry', PARAM_ALPHA);
+ $mform->setDefault('cccountry', $USER->country);
}
}
elseif (AN_METHOD_ECHECK == $paymentmethod)
//$this->set_upload_manager(new upload_manager('importfile', false, false, null, false, 0, true, true, false));
$mform->addElement('hidden', 'action', 'upload');
+ $mform->setType('action', PARAM_ACTION);
$mform->addElement('hidden', 'id', $COURSE->id);
+ $mform->setType('id', PARAM_INT);
$scope = array();
if (($COURSE->id > 1) && has_capability('moodle/grade:manage', get_context_instance(CONTEXT_SYSTEM))) {
// hidden params
$mform->addElement('hidden', 'oldgrade');
+ $mform->setType('oldgrade', PARAM_RAW);
$mform->addElement('hidden', 'oldfeedback');
+ $mform->setType('oldfeedback', PARAM_RAW);
$mform->addElement('hidden', 'id', 0);
$mform->setType('id', PARAM_INT);
}
$mform->addElement('hidden', 'id', $COURSE->id);
+ $mform->setType('id', PARAM_INT);
$this->add_action_buttons(false, get_string('submit'));
}
// course id needs to be passed for auth purposes
$mform->addElement('hidden', 'id', optional_param('id', 0, PARAM_INT));
$mform->setType('id', PARAM_INT);
+
$mform->addElement('header', 'general', get_string('importfile', 'grades'));
$mform->disabledIf('url', 'userfile', 'noteq', '');
$this->definition();
$this->_form->addElement('hidden', 'sesskey', null); // automatic sesskey protection
+ $this->_form->setType('sesskey', PARAM_RAW);
$this->_form->setDefault('sesskey', sesskey());
$this->_form->addElement('hidden', '_qf__'.$this->_formname, null); // form submission marker
+ $this->_form->setType('_qf__'.$this->_formname, PARAM_RAW);
$this->_form->setDefault('_qf__'.$this->_formname, 1);
$this->_form->_setDefaultRuleMessages();
$mform =& $this->_form;
$mform->registerNoSubmitButton($addfieldsname);
$mform->addElement('hidden', $repeathiddenname, $repeats);
+ $mform->setType($repeathiddenname, PARAM_INT);
//value not to be overridden by submitted value
$mform->setConstants(array($repeathiddenname=>$repeats));
$namecloned = array();
}
$mform->addElement('hidden', "checkbox_controller$groupid");
+ $mform->setType("checkbox_controller$groupid", PARAM_INT);
$mform->setConstants(array("checkbox_controller$groupid" => $new_select_value));
// Locate all checkboxes for this group and set their value, IF the optional param was given
$this->registerNoSubmitButton('mform_showadvanced');
$this->addElement('hidden', 'mform_showadvanced_last');
+ $this->setType('mform_showadvanced_last', PARAM_INT);
}
}
/**
$mform =& $this->_form;
$mform->addElement('hidden', 'stage', PORTFOLIO_STAGE_CONFIG);
+ $mform->setType('stage', PARAM_INT);
$mform->addElement('hidden', 'instance', $this->_customdata['instance']->get('id'));
+ $mform->setType('instance', PARAM_INT);
if (array_key_exists('formats', $this->_customdata) && is_array($this->_customdata['formats'])) {
if (count($this->_customdata['formats']) > 1) {
} else {
$f = array_shift($this->_customdata['formats']);
$mform->addElement('hidden', 'format', $f);
+ $mform->setType('format', PARAM_RAW);
}
}
} else {
$mform->addElement('hidden', 'wait', 0);
}
+ $mform->setType('wait', PARAM_INT);
}
if (array_key_exists('plugin', $this->_customdata) && is_object($this->_customdata['plugin'])) {
$strrequired = get_string('required');
$mform->addElement('hidden', 'edit', ($this->instance) ? $this->instance->get('id') : 0);
+ $mform->setType('edit', PARAM_INT);
$mform->addElement('hidden', 'new', $this->plugin);
+ $mform->setType('new', PARAM_INT);
$mform->addElement('hidden', 'plugin', $this->plugin);
+ $mform->setType('plugin', PARAM_SAFEDIR);
if (!$this->instance) {
$insane = portfolio_instance_sanity_check($this->instance);
$this->userid = $this->_customdata['userid'];
$this->_form->addElement('hidden', 'config', $this->instance->get('id'));
+ $mform->setType('config', PARAM_INT);
$this->instance->user_config_form($this->_form, $this->userid);
$type = required_param('type', PARAM_ALPHA);
}
$mform->addElement('hidden', 'assignmenttype', $type);
+ $mform->setType('assignmenttype', PARAM_ALPHA);
$mform->setDefault('assignmenttype', $type);
$mform->addElement('hidden', 'type', $type);
+ $mform->setType('type', PARAM_ALPHA);
$mform->setDefault('type', $type);
require($CFG->dirroot.'/mod/assignment/type/'.$type.'/assignment.class.php');
// $mform->addElement('header', 'general', get_string('choose_group', 'feedback'));
// hidden elements
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'do_show');
+ $mform->setType('do-show', PARAM_INT);
// visible elements
$groups_options = array();
// hidden elements
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'completedid');
+ $mform->setType('completeid', PARAM_INT);
$mform->addElement('hidden', 'do_show');
+ $mform->setType('do_show', PARAM_INT);
$mform->addElement('hidden', 'confirmdelete');
+ $mform->setType('confirmdelete', PARAM_INT);
//-------------------------------------------------------------------------------
// buttons
// hidden elements
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'deleteitem');
+ $mform->setType('deleteitem', PARAM_INT);
$mform->addElement('hidden', 'confirmdelete');
+ $mform->setType('confirmdelete', PARAM_INT);
//-------------------------------------------------------------------------------
// buttons
// hidden elements
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'deletetempl');
+ $mform->setType('deletetempl', PARAM_INT);
$mform->addElement('hidden', 'confirmdelete');
+ $mform->setType('confirmdelete', PARAM_INT);
//-------------------------------------------------------------------------------
// buttons
// hidden elements
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'position');
+ $mform->setType('position', PARAM_INT);
//-------------------------------------------------------------------------------
// buttons
$mform->addElement('submit', 'add_item', get_string('add_item', 'feedback'));
$mform->addElement('header', '', get_string('using_templates', 'feedback'));
// hidden elements
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
// visible elements
$templates_options = array();
// hidden elements
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'do_show');
+ $mform->setType('do_show', PARAM_INT);
$mform->addElement('hidden', 'savetemplate', 1);
+ $mform->setType('savetemplate', PARAM_INT);
//headline
$mform->addElement('header', '', get_string('creating_templates', 'feedback'));
$i_form = &$item_form->get_item_form();
// $i_form->addElement('header', 'general', 'Titel');
$i_form->addElement('hidden', 'id', $id);
+$mform->setType('id', PARAM_INT);
$i_form->addElement('hidden', 'itemid', isset($item->id)?$item->id:'');
+$mform->setType('itemid', PARAM_INT);
$i_form->addElement('hidden', 'typ', $typ);
+$mform->setType('typ', PARAM_ALPHA);
$i_form->addElement('hidden', 'feedbackid', $feedback->id);
+$mform->setType('feedbackid', PARAM_INT);
$lastposition = $DB->count_records('feedback_item', array('feedback'=>$feedback->id));
$buttonarray = array();
if(!empty($item->id)){
$i_form->addElement('hidden', 'updateitem', '1');
+ $mform->setType('updateitem', PARAM_INT);
// $i_form->addElement('submit', 'update_item', get_string('update_item', 'feedback'));
$buttonarray[] = &$i_form->createElement('submit', 'update_item', get_string('update_item', 'feedback'));
}else{
$i_form->addElement('hidden', 'saveitem', '1');
+ $mform->setType('saveitem', PARAM_INT);
// $i_form->addElement('submit', 'save_item', get_string('save_item', 'feedback'));
$buttonarray[] = &$i_form->createElement('submit', 'save_item', get_string('save_item', 'feedback'));
}
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$this->requiredcheck = &$mform->addElement('hidden', 'required');
+ $mform->setType('required', PARAM_INT);
$this->itemname = &$mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$mform->addElement('hidden', 'itemname', $this->type);
+ $mform->setType('itemname', PARAM_INT);
$this->area = $mform->addElement('htmleditor', 'presentation', '', array('rows'=>20));
}
}
$multiple_submit_value = $feedback->multiple_submit ? get_string('yes') : get_string('no');
$mform->addElement('text', 'multiple_submit_static', get_string('multiple_submit', 'feedback'), array('size'=>'4','disabled'=>'disabled', 'value'=>$multiple_submit_value));
$mform->addElement('hidden', 'multiple_submit', '');
+ $mform->setType('', PARAM_INT);
$mform->setHelpButton('multiple_submit_static', array('multiplesubmit', get_string('multiple_submit', 'feedback'), 'feedback'));
}else {
$mform->addElement('selectyesno', 'multiple_submit', get_string('multiple_submit', 'feedback'));
// hidden elements
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'templateid');
+ $mform->setType('templateid', PARAM_INT);
$mform->addElement('hidden', 'do_show');
+ $mform->setType('do_show', PARAM_INT);
$mform->addElement('hidden', 'confirmadd');
+ $mform->setType('confirmadd', PARAM_INT);
//-------------------------------------------------------------------------------
// buttons
$mform->addElement('static', 'subscribemessage', get_string('subscription', 'forum'), get_string('everyoneissubscribed', 'forum'));
$mform->addElement('hidden', 'subscribe');
+ $mform->setType('subscribe', PARAM_INT);
$mform->setHelpButton('subscribemessage', array('subscription', get_string('subscription', 'forum'), 'forum'));
} else if (isset($forum->forcesubscribe)&& $forum->forcesubscribe != FORUM_DISALLOWSUBSCRIBE ||
} else if ($forum->forcesubscribe == FORUM_DISALLOWSUBSCRIBE) {
$mform->addElement('static', 'subscribemessage', get_string('subscription', 'forum'), get_string('disallowsubscribe', 'forum'));
$mform->addElement('hidden', 'subscribe');
+ $mform->setType('subscribe', PARAM_INT);
$mform->setHelpButton('subscribemessage', array('subscription', get_string('subscription', 'forum'), 'forum'));
}
if (!$glossary->usedynalink) {
$mform->addElement('hidden', 'usedynalink', $CFG->glossary_linkentries);
+ $mform->setType('usedynalink', PARAM_INT);
$mform->addElement('hidden', 'casesensitive', $CFG->glossary_casesensitive);
+ $mform->setType('casesensitive', PARAM_INT);
$mform->addElement('hidden', 'fullmatch', $CFG->glossary_fullmatch);
+ $mform->setType('fullmatch', PARAM_INT);
} else {
//-------------------------------------------------------------------------------
}
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'cmid');
+ $mform->setType('cmid', PARAM_INT);
//-------------------------------------------------------------------------------
$this->add_action_buttons();
}else{
$mform->addElement('hidden', 'globalglossary');
+ $mform->setType('globalglossary', PARAM_INT);
}
$options = array(1=>get_string('mainglossary', 'glossary'), 0=>get_string('secondaryglossary', 'glossary'));
} else {
// existing HotPot
$mform->addElement('hidden', 'namesource', HOTPOT_TEXTSOURCE_SPECIFIC);
+ $mform->setType('namesource', PARAM_RAW);
$mform->addElement('text', 'name', get_string('name'), array('size' => '40'));
}
$mform->setType('namesource', PARAM_INT);
}
if (array_key_exists($location, $HOTPOT_LOCATION)) {
$mform->addElement('hidden', 'location', $location);
+ $mform->setType('location', PARAM_RAW);
} else { // admin can select from "site" or "course" files
$mform->addElement('select', 'location', get_string('location', 'hotpot'), $HOTPOT_LOCATION);
}
} else {
// existing HotPot
$mform->addElement('hidden', 'summarysource', HOTPOT_TEXTSOURCE_SPECIFIC);
+ $mform->setType('summarysource', PARAM_RAW);
$mform->addElement('htmleditor', 'summary', get_string('summary'));
$mform->setType('summary', PARAM_RAW);
$mform->setHelpButton('summary', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton');
}
if (count($options) == 1) {
$mform->addElement('hidden', 'display');
+ $mform->setType('display', PARAM_INT);
reset($options);
$mform->setDefault('display', key($options));
} else {
$mform->setHelpButton('overallfeedbackhdr', array('overallfeedback', get_string('overallfeedback', 'quiz'), 'quiz'));
$mform->addElement('hidden', 'grade', $quizconfig->maximumgrade);
+ $mform->setType('grade', PARAM_RAW);
if (empty($this->_cm)) {
$needwarning = $quizconfig->maximumgrade == 0;
} else {
$options = array('mainfile'=>$mainfile, 'subdirs'=>0, 'maxbytes'=>0, 'maxfiles'=>-1, 'filetypes'=>'*', 'returnvalue'=>'ref_id');
- $mform->addElement('hidden', $mainfile, '', array('id'=>$mainfile.'-id'));
+ $mform->addElement('hidden', $mainfile, '', array('id'=>$mainfile.'-id')); // TODO: what is this?
+ $mform->setType('mainfile', PARAM_PATH);
$mform->addElement('filemanager', 'files', get_string('selectfiles'), null, $options);
$mform->addElement('static', '', get_string('selectedfile'), '<div id="'.$mainfile.'-label"></div>');
if (count($options) == 1) {
$mform->addElement('hidden', 'display');
+ $mform->setType('display', PARAM_INT);
reset($options);
$mform->setDefault('display', key($options));
} else {
//-------------------------------------------------------------------------------
// Hidden Settings
$mform->addElement('hidden', 'datadir', null);
+ $mform->setType('datadir', PARAM_RAW);
$mform->addElement('hidden', 'pkgtype', null);
+ $mform->setType('pkgtype', PARAM_RAW);
$mform->addElement('hidden', 'launch', null);
+ $mform->setType('launch', PARAM_RAW);
$mform->addElement('hidden', 'redirect', null);
+ $mform->setType('redirect', PARAM_RAW);
$mform->addElement('hidden', 'redirecturl', null);
+ $mform->setType('redirecturl', PARAM_RAW);
//-------------------------------------------------------------------------------
}
if (count($options) == 1) {
$mform->addElement('hidden', 'display');
+ $mform->setType('display', PARAM_INT);
reset($options);
$mform->setDefault('display', key($options));
} else {
$this->add_action_buttons(true, get_string('categorymoveto', 'quiz'));
//--------------------------------------------------------------------------------
$mform->addElement('hidden', 'delete', $currentcat);
+ $mform->setType('delete', PARAM_INT);
}
}
?>
$this->qtypeobj->custom_generator_tools_part($mform, $idx, $j);
$idx++;
$mform->addElement('hidden', "definition[$j]");
+ $mform->setType("definition[$j]", PARAM_RAW);
$mform->addElement('hidden', "itemid[$j]");
+ $mform->setType("itemid[$j]", PARAM_RAW);
$mform->addElement('static', "divider[$j]", '', '<hr />');
+ $mform->setType("divider[$j]", PARAM_RAW);
$j++;
}
$mform->addElement('header', 'updateanswershdr', get_string('answerstoleranceparam', 'qtype_datasetdependent'));
}else if ('*' === $answer->answer){
$mform->addElement('static', 'answercomment['.($this->noofitems+$key1).']', $answer->answer);
$mform->addElement('hidden', 'tolerance['.$key.']', '');
+ $mform->setType('tolerance['.$key.']', PARAM_RAW);
$mform->setAdvanced('tolerance['.$key.']',true);
$mform->addElement('hidden', 'tolerancetype['.$key.']', '');
+ $mform->setType('tolerancetype['.$key.']', PARAM_RAW);
$mform->setAdvanced('tolerancetype['.$key.']',true);
$mform->addElement('hidden', 'correctanswerlength['.$key.']', '');
+ $mform->setType('correctanswerlength['.$key.']', PARAM_RAW);
$mform->setAdvanced('correctanswerlength['.$key.']',true);
$mform->addElement('hidden', 'correctanswerformat['.$key.']', '');
+ $mform->setType('correctanswerformat['.$key.']', PARAM_RAW);
$mform->setAdvanced('correctanswerformat['.$key.']',true);
}else {
$mform->addElement('static', 'answercomment['.($this->noofitems+$key1).']', $answer->answer);
// echo "<p>question ".optional_param('multichoice', '', PARAM_RAW)." optional<pre>";print_r($this->question);echo "</pre></p>";
$label = get_string("sharedwildcards", "qtype_datasetdependent");
$mform->addElement('hidden', 'initialcategory', 1);
+ $mform->setType('initialcategory', PARAM_INT);
$html2 = $this->qtypeobj->print_dataset_definitions_category($this->question);
$mform->insertElementBefore($mform->createElement('static','listcategory',$label,$html2),'name');
$addfieldsname='updatecategory';
$mform->addGroup($addgrp1, 'addgrp1', '', ' ', false);
}else {
$mform->addElement('hidden', 'multichoice',$this->editasmultichoice);
+ $mform->setType('multichoice', PARAM_INT);
}
if ($this->editasmultichoice == 1){
}else { //editing as regular
$mform->addElement('header', 'choicehdr', get_string('regularcalculatedquestion', 'qtype_calculated'));
$mform->addElement('hidden','single', '1');
+ $mform->setType('single', PARAM_INT);
+
$mform->addElement('hidden','shuffleanswers', '1');
- $mform->addElement('hidden','answernumbering', 'abc');
+ $mform->setType('shuffleanswers', PARAM_INT);
+ $mform->addElement('hidden','answernumbering', 'abc');
+ $mform->setType('answernumbering', PARAM_SAFEDIR);
}
$creategrades = get_grade_options();
if ($this->editasmultichoice == 1){
$nounits = optional_param('nounits', 1, PARAM_INT);
$mform->addElement('hidden', 'nounits', $nounits);
+ $mform->setType('nounits', PARAM_INT);
$mform->setConstants(array('nounits'=>$nounits));
for ($i=0; $i< $nounits; $i++) {
- $mform->addElement('hidden','unit'."[$i]", optional_param('unit'."[$i]", '', PARAM_NOTAGS));
- $mform->addElement('hidden', 'multiplier'."[$i]", optional_param('multiplier'."[$i]", '', PARAM_NUMBER));
+ $mform->addElement('hidden','unit'."[$i]", optional_param('unit'."[$i]", '', PARAM_NOTAGS));
+ $mform->setType('unit'."[$i]", PARAM_NOTAGS);
+ $mform->addElement('hidden', 'multiplier'."[$i]", optional_param('multiplier'."[$i]", '', PARAM_NUMBER));
+ $mform->setType('multiplier'."[$i]", PARAM_NUMBER);
}
}else {
}
//hidden elements
$mform->addElement('hidden', 'synchronize', '');
+ $mform->setType('synchronize', PARAM_INT);
if (isset($this->question->options)&& isset($this->question->options->synchronize) ){
$mform->setDefault("synchronize", $this->question->options->synchronize);
} else {
$strquestionlabel = $this->qtypeobj->comment_header($this->nonemptyanswer);
$label = get_string("sharedwildcards", "qtype_datasetdependent");
$mform->addElement('hidden', 'initialcategory', 1);
+ $mform->setType('initialcategory', PARAM_INT);
$mform->addElement('hidden', 'reload', 1);
+ $mform->setType('reload', PARAM_INT);
$addfieldsname='updatequestion value';
$addstring=get_string("updatecategory", "qtype_calculated");
$mform->registerNoSubmitButton($addfieldsname);
$distriboptions = array('uniform' => get_string('uniform', 'qtype_datasetdependent'), 'loguniform' => get_string('loguniform', 'qtype_datasetdependent'));
$mform->addElement('hidden', "calcdistribution[$idx]", 'uniform');
+ $mform->setType("calcdistribution[$idx]", PARAM_INT);
}
$mform->removeElement('penalty');
$mform->addElement('hidden', 'defaultgrade', 0);
+ $mform->setType('defaultgrade', PARAM_RAW);
}
function qtype() {
$mform->setType('feedback', PARAM_RAW);
$mform->addElement('hidden', 'fraction', 0);
+ $mform->setType('fraction', PARAM_RAW);
//don't need this default element.
$mform->removeElement('penalty');
$mform->addElement('hidden', 'penalty', 0);
+ $mform->setType('penalty', PARAM_RAW);
}
function set_data($question) {
$mform->setType('feedback', PARAM_RAW);
$mform->addElement('hidden', 'fraction', 0);
+ $mform->setType('fraction', PARAM_RAW);
}
function set_data($question) {
$strrequired = get_string('required');
$mform->addElement('hidden', 'edit', ($this->instance) ? $this->instance->id : 0);
+ $mform->setType('edit', PARAM_INT);
$mform->addElement('hidden', 'new', $this->plugin);
+ $mform->setType('new', PARAM_FORMAT);
$mform->addElement('hidden', 'plugin', $this->plugin);
+ $mform->setType('plugin', PARAM_SAFEDIR);
$mform->addElement('hidden', 'typeid', $this->typeid);
+ $mform->setType('typeid', PARAM_INT);
$mform->addElement('hidden', 'contextid', $this->contextid);
+ $mform->setType('contextid', PARAM_INT);
$mform->addElement('text', 'name', get_string('name'), 'maxlength="100" size="30"');
$mform->addRule('name', $strrequired, 'required', null, 'client');
$strrequired = get_string('required');
$mform->addElement('hidden', 'edit', ($this->instance) ? $this->instance->get_typename() : 0);
+ $mform->setType('edit', PARAM_INT);
$mform->addElement('hidden', 'new', $this->plugin);
+ $mform->setType('new', PARAM_FORMAT);
$mform->addElement('hidden', 'plugin', $this->plugin);
+ $mform->setType('plugin', PARAM_SAFEDIR);
// let the plugin add its specific fields
if (!$this->instance) {
$mform->addElement('header', 'tag', get_string('description','tag'));
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
/// Add some extra hidden fields
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'course', $COURSE->id);
+ $mform->setType('course', PARAM_INT);
/// Print the required moodle fields first
$mform->addElement('header', 'moodle', $strgeneral);
/// Add some extra hidden fields
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'course', $COURSE->id);
+ $mform->setType('course', PARAM_INT);
/// Print the required moodle fields first
$mform->addElement('header', 'moodle', $strgeneral);
if ($extraparams) {
foreach ($extraparams as $key=>$value) {
$mform->addElement('hidden', $key, $value);
+ $mform->setType($key, PARAM_RAW);
}
}
if ($extraparams) {
foreach ($extraparams as $key=>$value) {
$mform->addElement('hidden', $key, $value);
+ $mform->setType($key, PARAM_RAW);
}
}
/// Add some extra hidden fields
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'action', 'editcategory');
+ $mform->setType('iction', PARAM_ACTION);
$mform->addElement('text', 'name', get_string('profilecategoryname', 'admin'), 'maxlength="255" size="30"');
$mform->setType('name', PARAM_MULTILANG);
/// Add some extra hidden fields
$mform->addElement('hidden', 'id');
+ $mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'action', 'editfield');
+ $mform->setType('action', PARAM_ACTION);
$mform->addElement('hidden', 'datatype', $datatype);
+ $mform->setType('datatype', PARAM_ALPHA);
$this->field->define_form($mform);
$mform =& $this->_form;
$mform->addElement('hidden', 'username', $this->username);
+ $mform->setType('username', PARAM_RAW);
$param = new stdClass();
$param->username = $this->username;
$wsuser = $DB->get_record("user", array("username" => $this->username));
$mform =& $this->_form;
$mform->addElement('hidden', 'settings', $settings);
+ $mform->setType('settings', PARAM_RAW);
$param = new stdClass();
require_once($CFG->dirroot . '/webservice/'. $settings . '/lib.php');
$mform =& $this->_form;
$mform->addElement('hidden', 'serviceid', $serviceid);
+ $mform->setType('serviceid', PARAM_INT);
$param = new stdClass();
// require_once($CFG->dirroot . '/webservice/'. $settings . '/lib.php');