$result->details = null;
$result->status = null;
$result->link = null;
-
+
if (empty($CFG->passwordsaltmain)) {
$result->status = REPORT_SECURITY_WARNING;
$result->info = get_string('check_passwordsaltmain_warning', 'report_security');
$sql = "SELECT DISTINCT r.*
FROM {role} r
JOIN {role_capabilities} rc ON rc.roleid = r.id
- WHERE rc.capability = :capability
- AND rc.contextid = :contextid
+ WHERE rc.capability = :capability
+ AND rc.contextid = :contextid
AND rc.permission = :permission";
$systemroles = $DB->get_records_sql($sql, $params);
$sql = "SELECT DISTINCT r.*, rc.contextid
FROM {role} r
JOIN {role_capabilities} rc ON rc.roleid = r.id
- WHERE rc.capability = :capability
- AND rc.contextid <> :contextid
+ WHERE rc.capability = :capability
+ AND rc.contextid <> :contextid
AND rc.permission = :permission";
$overriddenroles = $DB->get_records_sql($sql, $params);
foreach($allowedusers as $user) {
echo print_collapsible_region_start('', 'usersettings'.$user->id,$user->firstname." ".$user->lastname.", ".$user->email,false,true,true);
-
+
//user settings form
$contents = "<div class=\"fcontainer clearfix\">";
$form = new html_form();
echo $OUTPUT->form($form, $contents);
echo print_collapsible_region_end(true);
-
+
}
echo "</span>";
// this needs to happen before restore_setup_for_check
// which for some reason reads the session
$SESSION->restore =& $restore;
- // rename the things that are called differently
+ // rename the things that are called differently
$SESSION->restore->restore_course_files = $restore->course_files;
$SESSION->restore->restore_site_files = $restore->site_files;
$SESSION->restore->backup_version = $restore->info->backup_backup_version;
$increments[$i] = $i;
}
-$selected = array(1 => array(22,2),
+$selected = array(1 => array(22,2),
2 => array(40,5));
for($i = 1; $i < 3; $i++){
- $configs[] = new admin_setting_configselect('numsections'.$i, get_string('numsections'.$i, 'block_section_links'),
+ $configs[] = new admin_setting_configselect('numsections'.$i, get_string('numsections'.$i, 'block_section_links'),
get_string('numsectionsdesc'.$i, 'block_section_links'),
$selected[$i][0], $numberofsections);
- $configs[] = new admin_setting_configselect('incby'.$i, get_string('incby'.$i, 'block_section_links'),
+ $configs[] = new admin_setting_configselect('incby'.$i, get_string('incby'.$i, 'block_section_links'),
get_string('incbydesc'.$i, 'block_section_links'),
$selected[$i][1], $increments);
}
-
+
foreach ($configs as $config) {
$config->plugin = 'blocks/section_links';
$settings->add($config);
}
-
-?>
/**
* This class is used to parse lib/file/file_types.mm which help get file
- * extensions by file types.
+ * extensions by file types.
* The file_types.mm file can be edited by freemind in graphic environment.
*
* @package moodlecore
return false;
}
include_once("$CFG->dirroot/mod/$name/lib.php");
-
+
$function = $name.'_supports';
} else {
if (!$dir = get_plugin_directory($type, $name)) {
throw new coding_exception("Unsupported plugin type or name ($type/$name)");
}
-
+
$libfile = $dir.'/lib.php';
if (file_exists($libfile)) {
include_once($libfile);
}
-
+
$function = $type.'_'.$name.'_supports';
}
$contextlevel = 10;
}
$depth = 0;
-
+
/**
* We always want to load the front page activities into the tree, these
* will appear at the bottom of the opening (site) node.
if (!$dir = theme_config::find_theme_location($themename)) {
return null;
}
-
+
$THEME = new object();
$THEME->name = $themename;
$THEME->dir = $dir;
//legacy theme - needs to be upgraded - upgrade info is displayed on the admin settings page
return null;
}
-
+
return $dir;
}
<?php
-/*
+/*
* This script can set environment variables in the current session
*/
$SESSION->flashversion = $flashversion;
}
}
-
-?>
if (!$show_all and $complete_sessions == 0) {
- echo $OUTPUT->heading(get_string('no_complete_sessions_found', 'chat') .
+ echo $OUTPUT->heading(get_string('no_complete_sessions_found', 'chat') .
' <a href="report.php?id='.$cm->id.'&show_all=1">' .
get_string('list_all_sessions', 'chat') .
'</a>');
if ($result && $oldversion < 2009111701) {
require_once($CFG->libdir . '/commentlib.php');
upgrade_set_timeout(60*20);
-
+
/// Define table data_comments to be dropped
$table = new xmldb_table('data_comments');
//-------------------------------------------------------------------------------
$mform->addElement('header', 'aftersubmithdr', get_string('after_submit', 'feedback'));
-
+
$mform->addElement('editor', 'page_after_submit', get_string("page_after_submit", "feedback"), null, null);
$mform->setType('page_after_submit', PARAM_RAW);
/**
* Capability definitions for the forum module.
- *
+ *
* The capabilities are loaded into the database table when the module is
* installed or updated. Whenever the capability definitions are updated,
* the module version number should be bumped up.
if (!$subscribers = $DB->get_records_sql($fields.$from.' WHERE '.$wherecondition.$order, $params)) {
$subscribers = array();
}
-
+
return array(get_string("existingsubscribers", 'forum') => $subscribers);
}
/**
* Set tracking option for the forum.
- *
+ *
* @package mod-forum
* @copyright 2005 mchurch
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package mod-forum
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
+ */
require_once('../../config.php');
require_once('lib.php');
/**
* A custom renderer class that extends the moodle_renderer_base and
* is used by the forum module.
- *
+ *
* @package mod-forum
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
$table->set_classes(array('subscribertable','boxaligncenter'));
$table->data = array(html_table_row::make(array($existingcell, $actioncell, $potentialcell)));
$output .= $this->output->table($table);
-
+
$output .= $this->output_end_tag('form');
return $output;
}
$output .= $this->output->box_end();
return $output;
}
-
+
}
\ No newline at end of file
* @package mod-forum
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
+ */
require_once("../../config.php");
require_once("lib.php");
/**
* This function returns "items" record array to be used to build the rss feed
* for a Type=posts forum
- *
+ *
* @param object $forum
* @param int $newsince
*/
* @package mod-forum
* @copyright 2005 mchurch
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
+ */
require_once("../../config.php");
require_once("lib.php");
/**
* Subscribe to or unsubscribe from a forum.
- *
+ *
* @package mod-forum
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or late
*/
-
+
$capabilities = array(
'mod/lesson:edit' => array(
*
* Please do not forget to use upgrade_set_timeout()
* before any action that may take longer time to finish.
- *
+ *
* @package lesson
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 o
}
if ($result && $oldversion < 2009120400) {
-
+
/**
* Move any media files associated with the lesson to use the new file
* API methods and structures.
$i++;
upgrade_set_timeout(60); // set up timeout, may also abort execution
$pbar->update($i, $count, "Migrating lesson mediafiles - $i/$count.");
-
+
$filepath = $CFG->dataroot.'/'.$lesson->course.'/'.$CFG->moddata.'/lesson/'.$lesson->mediafile;
if (!is_readable($filepath)) {
//file missing??
$qtype = $editpage->qtype;
$edit = true;
} else {
- $edit = false;
+ $edit = false;
}
$jumpto = lesson_page::get_jumptooptions($pageid, $lesson);
// this is used by endofbranch, cluster, and endofcluster to skip the creation form.
// IT SHOULD ALWAYS CALL require_sesskey();
$mform->construction_override($pageid, $lesson);
-
+
$defaultpage = new stdClass;
$defaultpage->id = $cm->id;
$defaultpage->pageid = $pageid;
// Required for messaging framework
$eventdata->component = 'mod_lesson';
$eventdata->name = 'graded_essay';
-
+
message_send($eventdata);
$essayinfo->sent = 1;
$attempt->useranswer = serialize($essayinfo);
$lesson = new lesson($lesson);
}
$manager = lesson_page_type_manager::get($lesson);
-
+
$timenow = time();
switch ($question->qtype) {
case LESSON_PAGE_SHORTANSWER:
// extract package content
$packer = get_file_packer('application/zip');
$package->extract_to_storage($packer, $context->id, 'lesson_imported_files', $lesson->id, '/');
-
+
$fs = get_file_storage();
if ($files = $fs->get_area_files($context->id, 'lesson_imported_files', $lesson->id)) {
*/
function lesson_grade_item_delete($lesson) {
global $CFG;
-
+
}
if (!$cminfo->uservisible) {
return false;
}
-
+
$fileareas = lesson_get_file_areas();
if (!array_key_exists($filearea, $fileareas)) {
return false;
* These properties are calculated
* @property int $firstpageid Id of the first page of this lesson (prevpageid=0)
* @property int $lastpageid Id of the last page of this lesson (nextpageid=0)
- *
+ *
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$messages = $SESSION->lesson_messages[$this->properties->id];
unset($SESSION->lesson_messages[$this->properties->id]);
}
-
+
return $messages;
}
}
return $this->firstpageid;
}
-
+
/**
* Returns the id of the last page of this lesson. (nextpageid = 0)
* @return int
foreach ($attempts as $attempt) {
$seenpages[$attempt->pageid] = $attempt->pageid;
}
-
+
}
// get the lesson pages
/**
* Creates a new lesson_page within the database and returns the correct pagetype
* object to use to interact with the new lesson
- *
+ *
* @final
* @static
* @param object $properties
}
return false;
}
-
+
/**
* Checks to see if a page has been answered previously
* @param int $nretakes
$this->answers = $answers;
return $answers;
}
-
+
/**
* This method MUST be overriden by all question page types, or page types that
* wish to score a page.
* $result = parent::check_answer();
* </code>
* before modifiying it as required.
- *
+ *
* @return stdClass
*/
public function check_answer() {
/**
* True if the page uses a custom option
- *
+ *
* Should be override and set to true if the page uses a custom option.
- *
+ *
* @return bool
*/
public function has_option() {
return false;
}
-
+
/**
* Returns the maximum number of answers for this page given the maximum number
* of answers permitted by the lesson.
}
return $properties;
}
-
+
/**
* Returns an array of options to display whn choosing the jumpto for a page/answer
* @static
if ($pageid == 0) {
return $jump;
}
-
+
$pages = $lesson->load_all_pages();
if ($pages[$pageid]->qtype == LESSON_PAGE_BRANCHTABLE || $lesson->is_sub_page_of_type($pageid, array(LESSON_PAGE_BRANCHTABLE), array(LESSON_PAGE_ENDOFBRANCH, LESSON_PAGE_CLUSTER))) {
$jump[LESSON_UNSEENBRANCHPAGE] = get_string("unseenpageinbranch", "lesson");
* @property int $timemodified A timestamp of when the answer was modified
* @property string $answer The answer itself
* @property string $response The response the user sees if selecting this answer
- *
+ *
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Finds and loads all lesson page types in mod/lesson/pagetypes
- *
+ *
* @param lesson $lesson
*/
public function load_lesson_types(lesson $lesson) {
$this->types[$pagetype->typeid] = $pagetype;
}
}
-
+
}
/**
$this->course = $course;
parent::moodleform_mod($current, $section, $cm, $course);
}
-
+
function definition() {
global $CFG, $COURSE, $DB;
if ($this->lesson->slideshow) {
$output .= $renderer->slideshow_end();
}
-
+
return $output;
}
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
**/
-
+
/** End of Branch page */
define("LESSON_PAGE_ENDOFBRANCH", "21");
$jumpto = lesson_unseen_branch_jump($this->lesson, $USER->id);
} elseif ($jumpto == LESSON_CLUSTERJUMP) {
-
+
if (!$canmanage) {
$jumpto = $this->lesson->cluster_jump($pageid);
} else {
$jumpto = $this->properties->nextpageid;
}
}
-
+
} else if ($answer->jumpto == LESSON_NEXTPAGE) {
if ($this->properties->nextpageid == 0) {
} else if ($jumpto == LESSON_PREVIOUSPAGE) {
$jumpto = $this->properties->prevpageid;
-
+
}
redirect(new moodle_url($CFG->wwwroot.'/mod/lesson/view.php', array('id'=>$PAGE->cm->id,'pageid'=>$jumpto)));
}
}
public function update($properties) {
global $DB, $PAGE;
-
+
$properties->id = $this->properties->id;
$properties->lessonid = $this->lesson->id;
if (empty($properties->qoption)) {
print_error('cannotfindpagerecord', 'lesson');
}
}
-
+
if ($btpage->qtype == LESSON_PAGE_BRANCHTABLE) {
$newpage = new stdClass;
$newpage->lessonid = $lesson->id;
$result->noanswer = true;
return $result;
}
-
+
$answers = $this->get_answers();
foreach ($answers as $answer) {
$result->answerid = $answer->id;
if (!$data) {
redirect(new moodle_url($CFG->wwwroot.'/mod/lesson/view.php', array('id'=>$PAGE->cm->id, 'pageid'=>$this->properties->id)));
}
-
+
$response = $data->response;
if (!is_array($response)) {
$result->noanswer = true;
$options->para = false;
$i = 1;
$n = 0;
-
+
foreach ($answers as $answer) {
if ($n < 2) {
if ($answer->answer != NULL) {
if (!$data) {
redirect(new moodle_url($CFG->wwwroot.'/mod/lesson/view.php', array('id'=>$PAGE->cm->id, 'pageid'=>$this->properties->id)));
}
-
+
if ($this->properties->qoption) {
// MULTIANSWER allowed, user's answer is an array
foreach ($studentanswers as $key => $useranswer) {
$studentanswers[$key] = clean_param($useranswer, PARAM_INT);
}
-
+
// get what the user answered
$result->userresponse = implode(",", $studentanswers);
}
} else {
// only one answer allowed
-
+
if (empty($data->answerid) && !is_int($data->answerid)) {
$result->noanswer = true;
return $result;
$cells[] = "<span class=\"label\">".get_string("response", "lesson")." $i</span>";
$cells[] = format_text($answer->response, FORMAT_MOODLE, $options);
$table->data[] = html_table_row::make($cells);
-
+
$cells = array();
$cells[] = "<span class=\"label\">".get_string("score", "lesson").'</span>';
$cells[] = $answer->score;
$cells[] = "<span class=\"label\">".get_string("jump", "lesson").'</span>';
$cells[] = $this->get_jump_name($answer->jumpto);
$table->data[] = html_table_row::make($cells);
-
+
if ($i === 1){
$table->data[count($table->data)-1]->cells[0]->style = 'width:20%;';
}
$this->add_action_buttons(null, get_string("pleasecheckoneanswer", "lesson"));
}
-
+
}
\ No newline at end of file
/**
* Magic method used to pass calls otherwise meant for the standard renderer
* to it to ensure we don't go causing unnessecary greif.
- *
+ *
* @param string $method
* @param array $arguments
* @return mixed
$addquestionurl = new moodle_url($CFG->wwwroot.'/mod/lesson/editpage.php', array('id'=>$this->page->cm->id, 'pageid'=>$prevpageid));
$links[] = html_link::make($addquestionurl, get_string('addaquestionpagehere', 'lesson'));
-
+
foreach ($links as $key=>$link) {
$links[$key] = $this->output->link($link);
}
$options[$link->url->param('qtype')] = $link->text;
}
$options[0] = get_string('question', 'lesson');
-
+
$addpageurl = new moodle_url($CFG->wwwroot.'/mod/lesson/editpage.php', array('id'=>$this->page->cm->id, 'pageid'=>$page->id, 'sesskey'=>sesskey()));
$addpageselect = html_select::make_popup_form($addpageurl, 'qtype', $options, 'addpageafter'.$page->id);
$addpageselect->nothinglabel = get_string('addanewpage', 'lesson').'...';
if (has_capability('mod/lesson:manage', $context)) {
return $this->output->notification(get_string('progressbarteacherwarning2', 'lesson'));
}
-
+
if (!isset($USER->modattempts[$lesson->id])) {
// all of the lesson pages
$pages = $lesson->load_all_pages();
$ntries = 0; // may not be necessary
}
-
+
$viewedpageids = array();
if ($attempts = $lesson->get_attempts($ntries, true)) {
$viewedpageids = array_merge($viewedpageids, array_keys($attempts));
$table = new html_table();
$table->set_classes(array('progress_bar_table', 'center'));
$table->data = array(html_table_row::make($cells));
-
+
return $this->output->box($this->output->table($table), 'progress_bar');
}
$DB->delete_records('lesson_branch', array('userid' => $USER->id, 'lessonid' => $lesson->id, 'retry' => $retries));
}
- $page = $lesson->load_page($pageid);
+ $page = $lesson->load_page($pageid);
// Check if the page is of a special type and if so take any nessecary action
$newpageid = $page->callback_on_view($canmanage);
if (is_numeric($newpageid)) {
return chr(($charcode >> 0x12) + 0xF0).chr((($charcode >> 0x0C) & 0x3F) + 0x80).chr((($charcode >> 0x06) & 0x3F) + 0x80).chr(($charcode & 0x3F) + 0x80);
}
// unidentified char code !!
- return ' ';
+ return ' ';
}
function hotpot_convert_relative_urls($str, $baseurl, $filename) {
} else {
$eventtest = 'event IN (' . QUESTION_EVENTS_GRADED . ')';
}
- $states = $DB->get_records_select('question_states',
+ $states = $DB->get_records_select('question_states',
'attempt = :aid AND question = :qid AND ' . $eventtest, $params, 'seq_number ASC');
if (count($states) <= 1) {
return '';
if (!empty($SESSION->{$this->sess_tag}) // use tag to search
or !empty($SESSION->{$this->sess_text}) // use keyword to search
- or !empty($this->nsid)/*use pre-defined accound*/) {
+ or !empty($this->nsid)/*use pre-defined accound*/) {
$photos = $this->flickr->photos_search(array(
'tags'=>$SESSION->{$this->sess_tag},
'page'=>$page,
/**
* Local file don't support to link to external links
*
- * @return int
+ * @return int
*/
public function supported_returntypes() {
return FILE_INTERNAL;
public function check_login() {
return true;
}
-
+
/**
* S3 doesn't provide search
*
* @return bool
- */
+ */
public function global_search() {
return false;
}
* S3 plugins doesn't support return links of files
*
* @return int
- */
+ */
public function supported_returntypes() {
return FILE_INTERNAL;
}
<div id="wrapper-l">
<div id="wrapper-r">
<div id="wrapper-b">
-
+
<!-- Now, let's cap the corners -->
-
+
<div id="wrapper-tl">
<div id="wrapper-tr">
<div id="wrapper-bl">
protected $searchanywhere = false;
// This is used by get selected users,
protected $validatinguserids = null;
-
+
// Used to ensure we only output the search options for one user selector on
// each page.
private static $searchoptionsoutput = false;
if (!$auth = get_auth_plugin('webservice')) {
throw new webservice_access_exception('WS auth missing');
}
-
+
if (!$this->username) {
throw new webservice_access_exception('Missing username');
}