class course_import_groups_form extends moodleform {
- function definition() {
+ function definition() {
- global $CFG, $USER;
- $mform =& $this->_form;
- $maxuploadsize = $this->_customdata['maxuploadsize'];
- $strimportgroups = get_string("importgroups");
+ global $CFG, $USER;
+ $mform =& $this->_form;
+ $maxuploadsize = $this->_customdata['maxuploadsize'];
+ $strimportgroups = get_string("importgroups");
$this->set_upload_manager(new upload_manager('userfile', true, false, '', false, $maxuploadsize, true, true));
//$this->set_max_file_size('', $maxuploadsize);
$mform->addElement('header', 'general', '');//fill in the data depending on page params
- //later using set_data
+ //later using set_data
// buttons
$mform->addElement('hidden', 'sesskey');
- $mform->setType('sesskey', PARAM_ALPHA);
- $mform->setConstants(array('sesskey'=> $USER->sesskey));
+ $mform->setType('sesskey', PARAM_ALPHA);
+ $mform->setConstants(array('sesskey'=> $USER->sesskey));
- $mform->addElement('file', 'userfile', '');
+ $mform->addElement('file', 'userfile', '');
$mform->setHelpButton('userfile', array('attachment', get_string('attachment', 'forum'), 'forum'));
$this->add_action_buttons(false, $strimportgroups);
- }
+ }
- function validation($data) {
+ function validation($data) {
return true;
- }
+ }
}
?>
class mod_chat_mod_form extends moodleform_mod {
- function definition() {
+ function definition() {
- global $CFG;
- $mform =& $this->_form;
+ global $CFG;
+ $mform =& $this->_form;
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('chatname', 'chat'), array('size'=>'64'));
- $mform->setType('name', PARAM_TEXT);
- $mform->addRule('name', null, 'required', null, 'client');
+ $mform->setType('name', PARAM_TEXT);
+ $mform->addRule('name', null, 'required', null, 'client');
- $mform->addElement('htmleditor', 'intro', get_string('chatintro', 'chat'));
- $mform->setType('intro', PARAM_RAW);
+ $mform->addElement('htmleditor', 'intro', get_string('chatintro', 'chat'));
+ $mform->setType('intro', PARAM_RAW);
$mform->setHelpButton('intro', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton');
- $mform->addRule('intro', get_string('required'), 'required', null, 'client');
+ $mform->addRule('intro', get_string('required'), 'required', null, 'client');
$mform->addElement('date_time_selector', 'chattime', get_string('chattime', 'chat'));
$this->standard_coursemodule_elements();
$this->add_action_buttons();
- }
+ }
}
-?>
\ No newline at end of file
+?>
class mod_exercise_mod_form extends moodleform_mod {
- function definition() {
+ function definition() {
- global $CFG, $COURSE, $EXERCISE_TYPE, $EXERCISE_ASSESSMENT_COMPS;
- $mform =& $this->_form;
+ global $CFG, $COURSE, $EXERCISE_TYPE, $EXERCISE_ASSESSMENT_COMPS;
+ $mform =& $this->_form;
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('title', 'exercise'), array('size'=>'64'));
- $mform->setType('name', PARAM_TEXT);
- $mform->addRule('name', null, 'required', null, 'client');
+ $mform->setType('name', PARAM_TEXT);
+ $mform->addRule('name', null, 'required', null, 'client');
- $mform->addElement('static', 'description', get_string('description', 'exercise'), get_string('descriptionofexercise', 'exercise', $COURSE->students));
+ $mform->addElement('static', 'description', get_string('description', 'exercise'), get_string('descriptionofexercise', 'exercise', $COURSE->students));
$filesize = array();
$sizelist = array('10Kb', '50Kb', '100Kb', '500Kb', '1Mb', '2Mb', '5Mb', '10Mb', '20Mb', '50Mb');
//-------------------------------------------------------------------------------
$this->standard_coursemodule_elements();
//-------------------------------------------------------------------------------
- // buttons
+// buttons
$this->add_action_buttons();
- }
+ }
}
-?>
\ No newline at end of file
+?>
if ($post->parent) {
$crumbs[] = array('name' => format_string($toppost->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'activityinstance');
$crumbs[] = array('name' => get_string('editing', 'forum'), 'link' => '', 'type' => 'action');
- } else {
+ } else {
$crumbs[] = array('name' => format_string($toppost->subject), 'link' => '', 'type' => 'action');
}
$index = "{$CFG->prefix}{$table}_{$field}_idx";
} else {
$index = "{$table}_{$field}_idx";
- }
+ }
hotpot_db_delete_index("{$CFG->prefix}$table", $index);
// add new hotpot_questions.md5key field (and index)
$index = "{$CFG->prefix}{$table}_{$field}_idx";
} else {
$index = "{$table}_{$field}_idx";
- }
+ }
hotpot_db_delete_index("{$CFG->prefix}$table", $index);
// add new hotpot_strings.md5key field (and index)
// get best score
if (is_numeric($totals[$hotpot->id]->maxscore)) {
- $weighting = $hotpot->grade / 100;
- $precision = hotpot_get_precision($hotpot);
- $bestscore = round($totals[$hotpot->id]->maxscore * $weighting, $precision)." / $hotpot->grade";
+ $weighting = $hotpot->grade / 100;
+ $precision = hotpot_get_precision($hotpot);
+ $bestscore = round($totals[$hotpot->id]->maxscore * $weighting, $precision)." / $hotpot->grade";
} else {
$bestscore = " ";
}
print htmlspecialchars($hp->source);
break;
case 'showxmltree':
- if (isset($hp->xml)) {
- print_r($hp->xml);
- }
+ if (isset($hp->xml)) {
+ print_r($hp->xml);
+ }
break;
case 'showhtmlsource':
print htmlspecialchars($hp->html);
for ($i=0; $i<$count; $i++) {
if ($pageid) {
$styles .= str_replace('TheBody', $pageid, $matches[0][$i])."\n";
- }
+ }
$head = str_replace($matches[0][$i], '', $head);
}
}
for ($i=0; $i<$count; $i++) {
if ($pageid) {
$scripts .= str_replace('TheBody', $pageid, $matches[0][$i])."\n";
- }
+ }
$head = str_replace($matches[0][$i], '', $head);
}
}
$body = $matches[5]; // contents of first <body onload="StartUp()">...</body> block
if ($pageid) {
$body_tags = str_replace(' id="TheBody"', '', $matches[1]);
- }
+ }
// workaround to ensure javascript onload routine for quiz is always executed
// $body_tags will only be inserted into the <body ...> tag
// if it is included in the theme/$CFG->theme/header.html,
class mod_journal_mod_form extends moodleform_mod {
- function definition() {
+ function definition() {
- global $COURSE;
- $mform =& $this->_form;
+ global $COURSE;
+ $mform =& $this->_form;
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('journalname', 'journal'), array('size'=>'64'));
- $mform->setType('name', PARAM_TEXT);
- $mform->addRule('name', null, 'required', null, 'client');
+ $mform->setType('name', PARAM_TEXT);
+ $mform->addRule('name', null, 'required', null, 'client');
- $mform->addElement('htmleditor', 'intro', get_string('journalquestion', 'journal'));
- $mform->setType('intro', PARAM_RAW);
- $mform->addRule('intro', get_string('required'), 'required', null, 'client');
+ $mform->addElement('htmleditor', 'intro', get_string('journalquestion', 'journal'));
+ $mform->setType('intro', PARAM_RAW);
+ $mform->addRule('intro', get_string('required'), 'required', null, 'client');
$mform->setHelpButton('intro', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton');
$mform->addElement('format', 'format', get_string('format'));
}
//-------------------------------------------------------------------------------
- $this->standard_coursemodule_elements();
+ $this->standard_coursemodule_elements();
//-------------------------------------------------------------------------------
- // buttons
+// buttons
$this->add_action_buttons();
- }
+ }
}
-?>
\ No newline at end of file
+?>
class mod_label_mod_form extends moodleform_mod {
- function definition() {
+ function definition() {
- $mform =& $this->_form;
+ $mform =& $this->_form;
- $mform->addElement('htmleditor', 'content', get_string('labeltext', 'label'), array('size'=>'64'));
- $mform->setType('content', PARAM_RAW);
- $mform->addRule('content', get_string('required'), 'required', null, 'client');
+ $mform->addElement('htmleditor', 'content', get_string('labeltext', 'label'), array('size'=>'64'));
+ $mform->setType('content', PARAM_RAW);
+ $mform->addRule('content', get_string('required'), 'required', null, 'client');
$mform->setHelpButton('content', array('questions', 'richtext'), false, 'editorhelpbutton');
- $this->standard_hidden_coursemodule_elements();
+ $this->standard_hidden_coursemodule_elements();
$mform->addElement('modvisible', 'visible', get_string('visible'));
//-------------------------------------------------------------------------------
- // buttons
+// buttons
$this->add_action_buttons();
- }
+ }
}
-?>
\ No newline at end of file
+?>
require_once('locallib.php');
class mod_lesson_mod_form extends moodleform_mod {
- function definition() {
+ function definition() {
- global $LESSON_NEXTPAGE_ACTION, $COURSE;
- $mform =& $this->_form;
+ global $LESSON_NEXTPAGE_ACTION, $COURSE;
+ $mform =& $this->_form;
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
- $mform->setType('name', PARAM_TEXT);
- $mform->addRule('name', null, 'required', null, 'client');
+ $mform->setType('name', PARAM_TEXT);
+ $mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('selectyesno', 'timed', get_string('timed', 'lesson'));
$mform->setDefault('timed', 0);
$mform->setDefault('maxtime', 20);
$mform->addRule('maxtime', null, 'required', null, 'client');
$mform->addRule('maxtime', null, 'numeric', null, 'client');
- $mform->setType('maxtime', PARAM_INT);
+ $mform->setType('maxtime', PARAM_INT);
$numbers = array();
for ($i=20; $i>1; $i--) {
$mform->addRule('width', null, 'required', null, 'client');
$mform->addRule('width', null, 'numeric', null, 'client');
$mform->setHelpButton('width', array('width', get_string('slideshowwidth', 'lesson'), 'lesson'));
- $mform->setType('width', PARAM_INT);
+ $mform->setType('width', PARAM_INT);
$mform->addElement('text', 'height', get_string('slideshowheight', 'lesson'));
$mform->setDefault('height', 20);
$mform->addRule('height', null, 'required', null, 'client');
$mform->addRule('height', null, 'numeric', null, 'client');
$mform->setHelpButton('height', array('height', get_string('slideshowheight', 'lesson'), 'lesson'));
- $mform->setType('height', PARAM_INT);
+ $mform->setType('height', PARAM_INT);
$mform->addElement('text', 'bgcolor', get_string('slideshowbgcolor', 'lesson'));
$mform->setDefault('bgcolor', '#FFFFFF');
$mform->addRule('bgcolor', null, 'required', null, 'client');
$mform->setHelpButton('bgcolor', array('bgcolor', get_string('slideshowbgcolor', 'lesson'), 'lesson'));
- $mform->setType('bgcolor', PARAM_TEXT);
+ $mform->setType('bgcolor', PARAM_TEXT);
$mform->addElement('selectyesno', 'displayleft', get_string('displayleftmenu', 'lesson'));
$mform->setHelpButton('displayleft', array('displayleft', get_string('displayleftmenu', 'lesson'), 'lesson'));
$mform->setHelpButton('password', array('password', get_string('password', 'lesson'), 'lesson'));
$mform->setDefault('password', '');
//never displayed converted to md5
- $mform->setType('password', PARAM_RAW);
+ $mform->setType('password', PARAM_RAW);
$mform->addElement('date_time_selector', 'available', get_string('available', 'lesson'));
$mform->setDefault('available', 0);
$mform->addElement('date_time_selector', 'deadline', get_string('deadline', 'lesson'));
$mform->setDefault('deadline', 0);
- //-------------------------------------------------------------------------------
+//-------------------------------------------------------------------------------
$mform->addElement('header', '', get_string('dependencyon', 'lesson'));
$options = array(0=>get_string('none'));
$mform->addElement('text', 'timespent', get_string('timespentminutes', 'lesson'));
$mform->setDefault('timespent', 0);
- $mform->setType('timespent', PARAM_INT);
+ $mform->setType('timespent', PARAM_INT);
$mform->addElement('checkbox', 'completed', get_string('completed', 'lesson'));
$mform->setDefault('completed', 0);
$mform->addElement('text', 'gradebetterthan', get_string('gradebetterthan', 'lesson'));
$mform->setDefault('gradebetterthan', 0);
- $mform->setType('gradebetterthan', PARAM_INT);
+ $mform->setType('gradebetterthan', PARAM_INT);
//-------------------------------------------------------------------------------
$mform->addElement('header', '', get_string('mediafile', 'lesson'));
$mform->addElement('choosecoursefile', 'mediafile', get_string('mediafile', 'lesson'), array('courseid'=>$COURSE->id));
$mform->setHelpButton('mediafile', array('mediafile', get_string('mediafile', 'lesson'), 'lesson'));
$mform->setDefault('mediafile', '');
- $mform->setType('mediafile', PARAM_PATH);
+ $mform->setType('mediafile', PARAM_PATH);
$mform->addElement('selectyesno', 'mediaclose', get_string('mediaclose', 'lesson'));
$mform->setDefault('mediaclose', 0);
$mform->setDefault('mediaheight', 100);
$mform->addRule('mediaheight', null, 'required', null, 'client');
$mform->addRule('mediaheight', null, 'numeric', null, 'client');
- $mform->setType('mediaheight', PARAM_INT);
+ $mform->setType('mediaheight', PARAM_INT);
$mform->addElement('text', 'mediawidth', get_string('mediawidth', 'lesson'));
$mform->setHelpButton('mediawidth', array('mediawidth', get_string('mediawidth', 'lesson'), 'lesson'));
$mform->setDefault('mediawidth', 650);
$mform->addRule('mediawidth', null, 'required', null, 'client');
$mform->addRule('mediawidth', null, 'numeric', null, 'client');
- $mform->setType('mediawidth', PARAM_INT);
+ $mform->setType('mediawidth', PARAM_INT);
//-------------------------------------------------------------------------------
$mform->addElement('header', '', get_string('other', 'lesson'));
$mform->setDefault('maxhighscores', 10);
$mform->addRule('maxhighscores', null, 'required', null, 'client');
$mform->addRule('maxhighscores', null, 'numeric', null, 'client');
- $mform->setType('maxhighscores', PARAM_INT);
+ $mform->setType('maxhighscores', PARAM_INT);
$mform->addElement('selectyesno', 'lessondefault', get_string('lessondefault', 'lesson'));
$mform->setHelpButton('lessondefault', array('lessondefault', get_string('lessondefault', 'lesson'), 'lesson'));
$mform->setDefault('lessondefault', 0);
//-------------------------------------------------------------------------------
- $this->standard_coursemodule_elements(false);
+ $this->standard_coursemodule_elements(false);
//-------------------------------------------------------------------------------
- // buttons
+// buttons
$this->add_action_buttons();
- }
+ }
- function data_preprocessing(&$default_values){
+ function data_preprocessing(&$default_values){
if (isset($default_values['conditions'])) {
$conditions = unserialize($default_values['conditions']);
$default_values['timespent'] = $conditions->timespent;
if (isset($default_values['password'])) {
unset($default_values['password']);
}
- }
+ }
}
?>
}
}
else{
- $isvisible = true;
+ $isvisible = true;
}
if ($parents[$level]!=$sco->parent) {
if ($newlevel = array_search($sco->parent,$parents)) {
$result = $result && create_table($table);
}
- //Adding new field to table scorm
+ //Adding new field to table scorm
if ($result && $oldversion < 2007011800) {
/// Define field format to be added to data_comments
$sco = ($what == SCO_DATA) ? new stdClass() : $sco;
if (($what != SCO_ONLY) && ($scodatas = get_records('scorm_scoes_data','scoid',$id))) {
foreach ($scodatas as $scodata) {
- $sco->{$scodata->name} = $scodata->value;
+ $sco->{$scodata->name} = $scodata->value;
}
- }
+ }
elseif (($what != SCO_ONLY) && (!($scodatas = get_records('scorm_scoes_data','scoid',$id)))){
$sco->parameters = '';
}
$scorm->version = 'scorm_12';
}
require_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'lib.php');
-
$result = scorm_get_toc($user,$scorm,'structlist',$orgidentifier);
$incomplete = $result->incomplete;
<?php
if ($scorm->hidebrowse == 0) {
print_string('mode','scorm');
- echo '<input type="hidden" name="scoid" value="$sco->id" />'."\n";
+ echo '<input type="hidden" name="scoid" value="$sco->id" />'."\n";
echo ': <input type="radio" id="b" name="mode" value="browse" /><label for="b">'.get_string('browse','scorm').'</label>'."\n";
echo '<input type="radio" id="n" name="mode" value="normal" checked="checked" /><label for="n">'.get_string('normal','scorm')."</label>\n";
} else {
if ($scorm->skipview >= 1) {
$sco = current($scoes);
if (scorm_get_tracks($sco->id,$user->id) === false) {
- header('Location: player.php?a='.$scorm->id.'&scoid= '.$sco->id);
+ header('Location: player.php?a='.$scorm->id.'&scoid= '.$sco->id);
$result = true;
} else if ($scorm->skipview == 2) {
header('Location: player.php?a='.$scorm->id.'&scoid= '.$sco->id);
$mode = optional_param('mode', 'normal', PARAM_ALPHA); // navigation mode
$currentorg = optional_param('currentorg', '', PARAM_RAW); // selected organization
$newattempt = optional_param('newattempt', 'off', PARAM_ALPHA); // the user request to start a new attempt
-
+
if (!empty($id)) {
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
error("Course Module ID was incorrect");
if (!CSS.__remoteSaveRequired) {
UI.statusMsg('There are no changes that need saving!', 'chameleon-notice');
return;
- }
+ }
var css = CSS.toString(CSS.__localCSS);
var hasBorder = false;
var col = false;
var importantBorders = [];
-
+
var dec = '{\n';
for (var prop in css) {
var pseudoClasses = ['link', 'active', 'visited', 'hover', 'focus'];
while (n--) {
- var row = n % 2;
-
+ var row = n % 2;
+
var item = Util.createElement('li');
item.className = 'row' + row;
var tag = Util.createElement('span', 'chameleon-tag-name-' + n);