* @return bool Authentication success or failure.
*/
function user_login ($username, $password) {
- $this->connectCAS();
+ $this->connectCAS();
return phpCAS::isAuthenticated() && (trim(moodle_strtolower(phpCAS::getUser())) == $username);
}
/**
function loginpage_hook() {
global $frm;
global $CFG;
- global $SESSION, $OUTPUT;
+ global $SESSION, $OUTPUT;
$site = get_site();
$CASform = get_string("CASform","auth_cas");
$username = optional_param("username", '', PARAM_RAW);
if (!empty($username)) {
- if (strstr($SESSION->wantsurl,'ticket') || strstr($SESSION->wantsurl,'NOCAS'))
- unset($SESSION->wantsurl);
- return;
+ if (strstr($SESSION->wantsurl,'ticket') || strstr($SESSION->wantsurl,'NOCAS'))
+ unset($SESSION->wantsurl);
+ return;
}
-
- // Test si cas activ� et param�tres non remplis
- if (empty($this->config->hostname)) {
- return;
- }
+
+ // Test si cas activ� et param�tres non remplis
+ if (empty($this->config->hostname)) {
+ return;
+ }
// Connection to CAS server
- $this->connectCAS();
-
- // Gestion de la connection CAS si acc�s direct d'un ent ou autre
- if (phpCAS::checkAuthentication()) {
- $frm->username=phpCAS::getUser();
-// if (phpCAS::getUser()=='esup9992')
-// $frm->username='erhar0062';
- $frm->password="passwdCas";
- return;
- }
-
- if ($_GET["loginguest"]== true) {
- $frm->username="guest";
- $frm->password="guest";
- return;
- }
-
+ $this->connectCAS();
+
+ // Gestion de la connection CAS si acc�s direct d'un ent ou autre
+ if (phpCAS::checkAuthentication()) {
+ $frm->username=phpCAS::getUser();
+// if (phpCAS::getUser()=='esup9992')
+// $frm->username='erhar0062';
+ $frm->password="passwdCas";
+ return;
+ }
+
+ if ($_GET["loginguest"]== true) {
+ $frm->username="guest";
+ $frm->password="guest";
+ return;
+ }
+
if ($this->config->multiauth) {
$authCAS = optional_param("authCAS", '', PARAM_RAW);
if ($authCAS=="NOCAS")
include($CFG->dirroot."/auth/cas/cas_form.html");
echo $OUTPUT->footer();
exit();
- }
+ }
}
// CAS authentication
if (!phpCAS::isAuthenticated())
*/
function prelogout_hook() {
global $CFG;
- if ($this->config->logoutcas ) {
- $backurl = $CFG->wwwroot;
- $this->connectCAS();
- phpCAS::logout($backurl);
- }
+ if ($this->config->logoutcas ) {
+ $backurl = $CFG->wwwroot;
+ $this->connectCAS();
+ phpCAS::logout($backurl);
+ }
}
/**
* Connect to the cas (clientcas connection or proxycas connection
*
*/
function connectCAS() {
-
- global $PHPCAS_CLIENT;
+
+ global $PHPCAS_CLIENT;
// mode proxy CAS
if ( !is_object($PHPCAS_CLIENT) ) {
- if ($this->config->proxycas) {
- phpCAS::proxy($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri);
- }
+ if ($this->config->proxycas) {
+ phpCAS::proxy($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri);
+ }
// mode client CAS
- else {
- phpCAS::client($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri);
- }
+ else {
+ phpCAS::client($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri);
+ }
+ }
+
}
-
- }
/**
* Prints a form for configuring this authentication plugin.
*
$filter = "(& (".$this->config->user_attribute."=$username)(|";
foreach ($attrs as $attr){
if(strpos($attr, "="))
- $filter .= "($attr)";
+ $filter .= "($attr)";
else
- $filter .= "(".$this->config->memberattribute."=$attr)";
+ $filter .= "(".$this->config->memberattribute."=$attr)";
}
$filter .= "))";
//search
$result = $this->ldap_get_userlist($filter);
if (count($result)!=0)
- return true;
- }
+ return true;
+ }
return false;
}
do {
$attributes = @ldap_get_attributes($conn, $entry);
for ($j=0; $j<$attributes['count']; $j++) {
- $values = ldap_get_values_len($conn, $entry,$attributes[$j]);
+ $values = ldap_get_values_len($conn, $entry,$attributes[$j]);
if (is_array($values)) {
$fresult[$i][strtolower($attributes[$j])] = $values;
}
if ($bindresult) {
- // Set the connection counter so we can call PHP's ldap_close()
- // when we call $this->ldap_close() for the last 'open' connection.
+ // Set the connection counter so we can call PHP's ldap_close()
+ // when we call $this->ldap_close() for the last 'open' connection.
$this->ldapconns = 1;
$this->ldapconnection = $connresult;
return $connresult;
<?php
$numberofsections = array();
for ($i = 1; $i < 53; $i++){
- $numberofsections[$i] = $i;
+ $numberofsections[$i] = $i;
}
$increments = array();
for ($i = 1; $i < 11; $i++){
- $increments[$i] = $i;
+ $increments[$i] = $i;
}
if(isset($this->config)){
- $config = $this->config;
+ $config = $this->config;
} else{
- $config = get_config('blocks/section_links');
+ $config = get_config('blocks/section_links');
}
$selected = array();
<?php
for($i = 1; $i < 3; $i++){
?>
- <tr valign="top">
- <td align="right">
- <?php print_string('numsections'.$i, 'block_section_links'); ?>:
- </td>
- <td>
- <?php choose_from_menu($numberofsections, 'numsections'.$i, $selected[$i][0]); ?>
- </td>
- <td>
- <?php print_string('numsectionsdesc'.$i, 'block_section_links'); ?>
- </td>
- </tr>
- <tr valign="top">
- <td align="right">
- <?php print_string('incby'.$i, 'block_section_links'); ?>:
- </td>
- <td>
- <?php choose_from_menu($increments, 'incby'.$i, $selected[$i][1]); ?>
- </td>
- <td>
- <?php print_string('incbydesc'.$i, 'block_section_links'); ?>
- </td>
- </tr>
+ <tr valign="top">
+ <td align="right">
+ <?php print_string('numsections'.$i, 'block_section_links'); ?>:
+ </td>
+ <td>
+ <?php choose_from_menu($numberofsections, 'numsections'.$i, $selected[$i][0]); ?>
+ </td>
+ <td>
+ <?php print_string('numsectionsdesc'.$i, 'block_section_links'); ?>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right">
+ <?php print_string('incby'.$i, 'block_section_links'); ?>:
+ </td>
+ <td>
+ <?php choose_from_menu($increments, 'incby'.$i, $selected[$i][1]); ?>
+ </td>
+ <td>
+ <?php print_string('incbydesc'.$i, 'block_section_links'); ?>
+ </td>
+ </tr>
<?php }
?>
<tr>
$numberofsections = array();
for ($i = 1; $i < 53; $i++){
- $numberofsections[$i] = $i;
+ $numberofsections[$i] = $i;
}
$increments = array();
for ($i = 1; $i < 11; $i++){
- $increments[$i] = $i;
+ $increments[$i] = $i;
}
$selected = array(1 => array(22,2),
* has been resolved.
*/
YAHOO.util.Event.onDOMReady(function () {
- //TODO: remove this hack MDL-20204
+ //TODO: remove this hack MDL-20204
var animationlib = document.createElement('script');
animationlib.setAttribute('type','text/javascript');
animationlib.setAttribute('src',moodle_cfg.wwwroot+'/lib/yui/2.8.0r4/animation/animation-min.js');
echo "</table>\n"; // Tabular display of days ends
- // OK, now for the filtering display
- echo '<div class="filters"><table><tr>';
-
- // Global events
- if($SESSION->cal_show_global) {
- echo '<td class="event_global" style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
-
- // Course events
- if(!empty($SESSION->cal_show_course)) {
- echo '<td class="event_course" style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
-
- echo "</tr>\n";
-
- if(!empty($USER->id) && !has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) {
- echo '<tr>';
- // Group events
- if($SESSION->cal_show_groups) {
- echo '<td class="event_group" style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
- // User events
- if($SESSION->cal_show_user) {
- echo '<td class="event_user" style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
- echo "</tr>\n";
- }
-
- echo '</table></div>';
+ // OK, now for the filtering display
+ echo '<div class="filters"><table><tr>';
+
+ // Global events
+ if($SESSION->cal_show_global) {
+ echo '<td class="event_global" style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ }
+ else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+
+ // Course events
+ if(!empty($SESSION->cal_show_course)) {
+ echo '<td class="event_course" style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ }
+ else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+
+ echo "</tr>\n";
+
+ if(!empty($USER->id) && !has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) {
+ echo '<tr>';
+ // Group events
+ if($SESSION->cal_show_groups) {
+ echo '<td class="event_group" style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ }
+ else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+ // User events
+ if($SESSION->cal_show_user) {
+ echo '<td class="event_user" style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ }
+ else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+ echo "</tr>\n";
+ }
+
+ echo '</table></div>';
}
function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $maxevents, $courseid) {
function completion_set_progressicon_visibility(spanid,displaystatus) {
// Check if the progress icon exists
if (document.getElementById(spanid)!= null) {
- if (displaystatus=='show') {
+ if (displaystatus=='show') {
document.getElementById(spanid).style.display="block";
}
else if (displaystatus=='hide') {
document.getElementById(spanid).style.display="none";
-
+
}
else {
alert ("An error occurred when calling completion_set_progressicon_visibility() function.");
// Note, 'right side' is BEFORE content.
echo '<div class="right side">';
- if ($displaysection == $section) { // Show the zoom boxes
+ if ($displaysection == $section) { // Show the zoom boxes
echo '<a href="view.php?id='.$course->id.'&topic=0#section-'.$section.'" title="'.$strshowalltopics.'">'.
'<img src="'.$OUTPUT->pix_url('i/all') . '" class="icon" alt="'.$strshowalltopics.'" /></a><br />';
} else {
echo '<li id="section-'.$section.'" class="section main'.$sectionstyle.'" >';
- echo '<div class="left side"> '.$currenttext.'</div>';
+ echo '<div class="left side"> '.$currenttext.'</div>';
// Note, 'right side' is BEFORE content.
echo '<div class="right side">';
$endyear = $startyear + 20;
$yearsmenu = array('' => get_string('choose'));
for ($i = $startyear; $i < $endyear; $i++) {
- $yearsmenu[$i] = $i;
+ $yearsmenu[$i] = $i;
}
$ccexpiregrp = array();
$ccexpiregrp[] = &$mform->createElement('select', 'ccexpiremm', '', $monthsmenu);
$eventdata->fullmessage = $ignoredlines;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
- $eventdata->smallmessage = '';
+ $eventdata->smallmessage = '';
message_send($eventdata);
}
$eventdata->fullmessage = get_string('enrolmentnewuser', '', $a);
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
- $eventdata->smallmessage = '';
+ $eventdata->smallmessage = '';
message_send($eventdata);
}
}
$eventdata->fullmessage = $msg;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
- $eventdata->smallmessage = '';
+ $eventdata->smallmessage = '';
message_send($eventdata);
$this->log_line('Notification email sent to administrator.');
$eventdata->fullmessage = $strexpirynotifystudentsemail;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
- $eventdata->smallmessage = '';
+ $eventdata->smallmessage = '';
message_send($eventdata);
}
}
$eventdata->fullmessage = $strexpirynotifyemail;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
- $eventdata->smallmessage = '';
+ $eventdata->smallmessage = '';
message_send($eventdata);
}
}
$eventdata->fullmessage = get_string('enrolmentnewuser', '', $a);
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
- $eventdata->smallmessage = '';
+ $eventdata->smallmessage = '';
message_send($eventdata);
}
// Plan the allocation
if ($data->groupby == 'groups') {
- $numgrps = $data->number;
+ $numgrps = $data->number;
$userpergrp = floor($usercnt/$numgrps);
} else { // members
- $numgrps = ceil($usercnt/$data->number);
+ $numgrps = ceil($usercnt/$data->number);
$userpergrp = $data->number;
if (!empty($data->nosmallgroups) and $usercnt % $data->number != 0) {
}
// Save the groups data
- foreach ($groups as $key=>$group) {
+ foreach ($groups as $key=>$group) {
if (groups_get_group_by_name($courseid, $group['name'])) {
$error = get_string('groupnameexists', 'group', $group['name']);
$failed = true;
$editform->display();
if($preview !== '') {
- echo $OUTPUT->heading(get_string('groupspreview', 'group'));
+ echo $OUTPUT->heading(get_string('groupspreview', 'group'));
echo $preview;
}
function validation($data, $files) {
- global $CFG, $COURSE;
+ global $CFG, $COURSE;
$errors = parent::validation($data, $files);
if ($data['allocateby'] != 'no') {
$usercnt = count($users);
if ($data['number'] > $usercnt || $data['number'] < 1) {
- $errors['number'] = get_string('toomanygroups', 'group', $usercnt);
+ $errors['number'] = get_string('toomanygroups', 'group', $usercnt);
}
}
}
* @return array An array of the users
*/
function groups_get_potential_members($courseid, $roleid = null, $orderby = 'lastname,firstname') {
- global $DB;
+ global $DB;
$context = get_context_instance(CONTEXT_COURSE, $courseid);
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
}
$str = str_replace('@', $letter, $format);
} else {
- $str = str_replace('#', $groupnumber+1, $format);
+ $str = str_replace('#', $groupnumber+1, $format);
}
return($str);
}
<h2>Grade</h2>
<ul>
- <li><a href="help.php?module=grade&file=aggregateonlygraded.html">Aggregate only non-empty grades</a></li>
- <li><a href="help.php?module=grade&file=aggregateoutcomes.html">Include outcomes in aggregation</a></li>
- <li><a href="help.php?module=grade&file=aggregatesubcats.html">Aggregate including subcategories</a></li>
- <li><a href="help.php?module=grade&file=aggregation.html">Category aggregation</a></li>
- <li><a href="help.php?module=grade&file=aggregationcoefextra.html">Extra credit coefficient</a></li>
- <li><a href="help.php?module=grade&file=aggregationcoefextrasum.html">Act as extra credit</a></li>
- <li><a href="help.php?module=grade&file=aggregationcoefweight.html">Item weight</a></li>
- <li><a href="help.php?module=grade&file=aggregationposition.html">Aggregation position</a></li>
- <li><a href="help.php?module=grade&file=aggregationview.html">Aggregation view</a></li>
- <li><a href="help.php?module=grade&file=averagesdecimalpoints.html">Decimals in column averages</a></li>
- <li><a href="help.php?module=grade&file=averagesdisplaytype.html">Column averages display type</a></li>
- <li><a href="help.php?module=grade&file=calculation.html">Calculations</a></li>
- <li><a href="help.php?module=grade&file=category.html">Category</a></li>
- <li><a href="help.php?module=grade&file=decimalpoints.html">Overall decimal points</a></li>
- <li><a href="help.php?module=grade&file=droplow.html">Drop the lowest</a></li>
- <li><a href="help.php?module=grade&file=exceptions.html">Exceptions</a></li>
- <li><a href="help.php?module=grade&file=excluded.html">Excluded grades</a></li>
- <li><a href="help.php?module=grade&file=exportdecimalpoints.html">Export decimal points</a></li>
- <li><a href="help.php?module=grade&file=feedback.html">Feedback</a></li>
- <li><a href="help.php?module=grade&file=finalgrade.html">Final grade</a></li>
- <li><a href="help.php?module=grade&file=gradeboundary.html">Grade boundary</a></li>
- <li><a href="help.php?module=grade&file=gradedisplaytype.html">Grade display type</a></li>
- <li><a href="help.php?module=grade&file=gradeexportdisplaytype.html">Grade export display type</a></li>
- <li><a href="help.php?module=grade&file=gradeletter.html">Grade letters</a></li>
- <li><a href="help.php?module=grade&file=grademax.html">Maximum Grade</a></li>
- <li><a href="help.php?module=grade&file=grademin.html">Minimum Grade</a></li>
- <li><a href="help.php?module=grade&file=gradepass.html">Grade to pass</a></li>
- <li><a href="help.php?module=grade&file=gradetype.html">Grade type</a></li>
- <li><a href="help.php?module=grade&file=hidden.html">Hidden</a></li>
- <li><a href="help.php?module=grade&file=hiddenuntil.html">Hidden until</a></li>
- <li><a href="help.php?module=grade&file=idnumber.html">Id numbers</a></li>
- <li><a href="help.php?module=grade&file=iteminfo.html">Item info</a></li>
- <li><a href="help.php?module=grade&file=keephigh.html">Keep the highest</a></li>
- <li><a href="help.php?module=grade&file=letter.html">Letter scale</a></li>
- <li><a href="help.php?module=grade&file=linkedactivity.html">Linked activity</a></li>
- <li><a href="help.php?module=grade&file=locked.html">Locked</a></li>
- <li><a href="help.php?module=grade&file=lockedafter.html">Locked after</a></li>
- <li><a href="help.php?module=grade&file=meanselection.html">Grades selected for column averages</a></li>
- <li><a href="help.php?module=grade&file=multfactor.html">Multiplicator</a></li>
- <li><a href="help.php?module=grade&file=outcomeid.html">Outcome</a></li>
- <li><a href="help.php?module=grade&file=outcomestandard.html">Standard outcomes</a></li>
- <li><a href="help.php?module=grade&file=overridden.html">Overridden</a></li>
- <li><a href="help.php?module=grade&file=overridesitedefaultgradedisplaytype.html">Override site defaults</a></li>
- <li><a href="help.php?module=grade&file=plusfactor.html">Offset</a></li>
- <li><a href="help.php?module=grade&file=preferences.html">Set Preferences</a></li>
- <li><a href="help.php?module=grade&file=quickgrading.html">Quick grading</a></li>
- <li><a href="help.php?module=grade&file=rangesdecimalpoints.html">Decimals shown in ranges</a></li>
- <li><a href="help.php?module=grade&file=rangesdisplaytype.html">Range display type</a></li>
- <li><a href="help.php?module=grade&file=scaleid.html">Scale</a></li>
- <li><a href="help.php?module=grade&file=scalestandard.html">Standard scales</a></li>
- <li><a href="help.php?module=grade&file=showactivityicons.html">Show activity icons</a></li>
- <li><a href="help.php?module=grade&file=showaverages.html">Show averages</a></li>
- <li><a href="help.php?module=grade&file=showcalculations.html">Show calculations</a></li>
- <li><a href="help.php?module=grade&file=showeyecons.html"></a>Show show/hide icons</li>
- <li><a href="help.php?module=grade&file=showfeedback.html">Show feedback</a></li>
- <li><a href="help.php?module=grade&file=showgroups.html">Show groups</a></li>
- <li><a href="help.php?module=grade&file=showhiddenitems.html">Show hidden items</a></li>
- <li><a href="help.php?module=grade&file=showlocks.html">Show locks</a></li>
- <li><a href="help.php?module=grade&file=shownumberofgrades.html">Show number of grades</a></li>
- <li><a href="help.php?module=grade&file=showquickfeedback.html">Show quick feedback</a></li>
- <li><a href="help.php?module=grade&file=showranges.html">Show ranges</a></li>
- <li><a href="help.php?module=grade&file=showrank.html">Show rank</a></li>
- <li><a href="help.php?module=grade&file=showuseridnumber.html">Show user id numbers</a></li>
- <li><a href="help.php?module=grade&file=student.html">Student Grade Help</a></li>
- <li><a href="help.php?module=grade&file=studentsperpage.html">Students per page</a></li>
- <li><a href="help.php?module=grade&file=teacher.html">Grades</a></li>
- <li><a href="help.php?module=grade&file=userkey.html">User key</a></li>
- <li><a href="help.php?module=grade&file=weight.html">Weight</a></li>
+ <li><a href="help.php?module=grade&file=aggregateonlygraded.html">Aggregate only non-empty grades</a></li>
+ <li><a href="help.php?module=grade&file=aggregateoutcomes.html">Include outcomes in aggregation</a></li>
+ <li><a href="help.php?module=grade&file=aggregatesubcats.html">Aggregate including subcategories</a></li>
+ <li><a href="help.php?module=grade&file=aggregation.html">Category aggregation</a></li>
+ <li><a href="help.php?module=grade&file=aggregationcoefextra.html">Extra credit coefficient</a></li>
+ <li><a href="help.php?module=grade&file=aggregationcoefextrasum.html">Act as extra credit</a></li>
+ <li><a href="help.php?module=grade&file=aggregationcoefweight.html">Item weight</a></li>
+ <li><a href="help.php?module=grade&file=aggregationposition.html">Aggregation position</a></li>
+ <li><a href="help.php?module=grade&file=aggregationview.html">Aggregation view</a></li>
+ <li><a href="help.php?module=grade&file=averagesdecimalpoints.html">Decimals in column averages</a></li>
+ <li><a href="help.php?module=grade&file=averagesdisplaytype.html">Column averages display type</a></li>
+ <li><a href="help.php?module=grade&file=calculation.html">Calculations</a></li>
+ <li><a href="help.php?module=grade&file=category.html">Category</a></li>
+ <li><a href="help.php?module=grade&file=decimalpoints.html">Overall decimal points</a></li>
+ <li><a href="help.php?module=grade&file=droplow.html">Drop the lowest</a></li>
+ <li><a href="help.php?module=grade&file=exceptions.html">Exceptions</a></li>
+ <li><a href="help.php?module=grade&file=excluded.html">Excluded grades</a></li>
+ <li><a href="help.php?module=grade&file=exportdecimalpoints.html">Export decimal points</a></li>
+ <li><a href="help.php?module=grade&file=feedback.html">Feedback</a></li>
+ <li><a href="help.php?module=grade&file=finalgrade.html">Final grade</a></li>
+ <li><a href="help.php?module=grade&file=gradeboundary.html">Grade boundary</a></li>
+ <li><a href="help.php?module=grade&file=gradedisplaytype.html">Grade display type</a></li>
+ <li><a href="help.php?module=grade&file=gradeexportdisplaytype.html">Grade export display type</a></li>
+ <li><a href="help.php?module=grade&file=gradeletter.html">Grade letters</a></li>
+ <li><a href="help.php?module=grade&file=grademax.html">Maximum Grade</a></li>
+ <li><a href="help.php?module=grade&file=grademin.html">Minimum Grade</a></li>
+ <li><a href="help.php?module=grade&file=gradepass.html">Grade to pass</a></li>
+ <li><a href="help.php?module=grade&file=gradetype.html">Grade type</a></li>
+ <li><a href="help.php?module=grade&file=hidden.html">Hidden</a></li>
+ <li><a href="help.php?module=grade&file=hiddenuntil.html">Hidden until</a></li>
+ <li><a href="help.php?module=grade&file=idnumber.html">Id numbers</a></li>
+ <li><a href="help.php?module=grade&file=iteminfo.html">Item info</a></li>
+ <li><a href="help.php?module=grade&file=keephigh.html">Keep the highest</a></li>
+ <li><a href="help.php?module=grade&file=letter.html">Letter scale</a></li>
+ <li><a href="help.php?module=grade&file=linkedactivity.html">Linked activity</a></li>
+ <li><a href="help.php?module=grade&file=locked.html">Locked</a></li>
+ <li><a href="help.php?module=grade&file=lockedafter.html">Locked after</a></li>
+ <li><a href="help.php?module=grade&file=meanselection.html">Grades selected for column averages</a></li>
+ <li><a href="help.php?module=grade&file=multfactor.html">Multiplicator</a></li>
+ <li><a href="help.php?module=grade&file=outcomeid.html">Outcome</a></li>
+ <li><a href="help.php?module=grade&file=outcomestandard.html">Standard outcomes</a></li>
+ <li><a href="help.php?module=grade&file=overridden.html">Overridden</a></li>
+ <li><a href="help.php?module=grade&file=overridesitedefaultgradedisplaytype.html">Override site defaults</a></li>
+ <li><a href="help.php?module=grade&file=plusfactor.html">Offset</a></li>
+ <li><a href="help.php?module=grade&file=preferences.html">Set Preferences</a></li>
+ <li><a href="help.php?module=grade&file=quickgrading.html">Quick grading</a></li>
+ <li><a href="help.php?module=grade&file=rangesdecimalpoints.html">Decimals shown in ranges</a></li>
+ <li><a href="help.php?module=grade&file=rangesdisplaytype.html">Range display type</a></li>
+ <li><a href="help.php?module=grade&file=scaleid.html">Scale</a></li>
+ <li><a href="help.php?module=grade&file=scalestandard.html">Standard scales</a></li>
+ <li><a href="help.php?module=grade&file=showactivityicons.html">Show activity icons</a></li>
+ <li><a href="help.php?module=grade&file=showaverages.html">Show averages</a></li>
+ <li><a href="help.php?module=grade&file=showcalculations.html">Show calculations</a></li>
+ <li><a href="help.php?module=grade&file=showeyecons.html"></a>Show show/hide icons</li>
+ <li><a href="help.php?module=grade&file=showfeedback.html">Show feedback</a></li>
+ <li><a href="help.php?module=grade&file=showgroups.html">Show groups</a></li>
+ <li><a href="help.php?module=grade&file=showhiddenitems.html">Show hidden items</a></li>
+ <li><a href="help.php?module=grade&file=showlocks.html">Show locks</a></li>
+ <li><a href="help.php?module=grade&file=shownumberofgrades.html">Show number of grades</a></li>
+ <li><a href="help.php?module=grade&file=showquickfeedback.html">Show quick feedback</a></li>
+ <li><a href="help.php?module=grade&file=showranges.html">Show ranges</a></li>
+ <li><a href="help.php?module=grade&file=showrank.html">Show rank</a></li>
+ <li><a href="help.php?module=grade&file=showuseridnumber.html">Show user id numbers</a></li>
+ <li><a href="help.php?module=grade&file=student.html">Student Grade Help</a></li>
+ <li><a href="help.php?module=grade&file=studentsperpage.html">Students per page</a></li>
+ <li><a href="help.php?module=grade&file=teacher.html">Grades</a></li>
+ <li><a href="help.php?module=grade&file=userkey.html">User key</a></li>
+ <li><a href="help.php?module=grade&file=weight.html">Weight</a></li>
</ul>
$this->_elements[] =& MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true);
$this->_elements[] =& MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true);
$this->_elements[] =& MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true);
- if (right_to_left()) { // Switch order of elements for Right-to-Left
- $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true);
- $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true);
- } else {
- $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true);
- $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true);
- }
+ if (right_to_left()) { // Switch order of elements for Right-to-Left
+ $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true);
+ $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true);
+ } else {
+ $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true);
+ $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true);
+ }
// If optional we add a checkbox which the user can use to turn if on
if($this->_options['optional']) {
$this->_elements[] =& MoodleQuickForm::createElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true);
// Try with no activities
$DB->expectAt(0,'get_records_select',array('course_modules',
- 'course=42 AND completion<>'.COMPLETION_TRACKING_NONE));
+ 'course=42 AND completion<>'.COMPLETION_TRACKING_NONE));
$DB->setReturnValueAt(0,'get_records_select',array());
$result=$c->get_activities();
$this->assertEqual(array(),$result);
// Try with an activity (need to fake up modinfo for it as well)
$DB->expectAt(1,'get_records_select',array('course_modules',
- 'course=42 AND completion<>'.COMPLETION_TRACKING_NONE));
+ 'course=42 AND completion<>'.COMPLETION_TRACKING_NONE));
$DB->setReturnValueAt(1,'get_records_select',array(
13=>(object)array('id'=>13)
));
$this->assertFalse($feed->error(), "Failed to load the sample RSS file. Please check your proxy settings in Moodle. %s");
if ($feed->error()) {
- return;
+ return;
}
$this->assertEqual($feed->get_title(), 'Moodle News');
$this->assertTrue($itemone = $feed->get_item(0));
if (!$itemone) {
- return;
+ return;
}
$this->assertEqual($itemone->get_title(), 'Google HOP contest encourages pre-University students to work on Moodle');
}
function test_real_regression1() {
- $expectation = new ContainsTagWithAttribute('label', 'for', 'html_select4ac387224bf9d');
+ $expectation = new ContainsTagWithAttribute('label', 'for', 'html_select4ac387224bf9d');
$html = '<label for="html_select4ac387224bf9d">Cool menu</label><select name="mymenu" id="html_select4ac387224bf9d" class="menumymenu select"> <option value="0">Choose...</option><option value="10">ten</option><option value="c2">two</option></select>';
$this->assert($expectation, $html);
}
}
abstract class XMLStructureExpectation extends SimpleExpectation {
- /**
- * Parse a string as XML and return a DOMDocument;
- * @param $html
- * @return unknown_type
- */
+ /**
+ * Parse a string as XML and return a DOMDocument;
+ * @param $html
+ * @return unknown_type
+ */
protected function load_xml($html) {
- $prevsetting = libxml_use_internal_errors(true);
- $parser = new DOMDocument();
- if (!$parser->loadXML('<html>' . $html . '</html>')) {
- $parser = new DOMDocument();
- }
+ $prevsetting = libxml_use_internal_errors(true);
+ $parser = new DOMDocument();
+ if (!$parser->loadXML('<html>' . $html . '</html>')) {
+ $parser = new DOMDocument();
+ }
libxml_clear_errors();
- libxml_use_internal_errors($prevsetting);
- return $parser;
+ libxml_use_internal_errors($prevsetting);
+ return $parser;
}
}
/**
}
}
- $userlink = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $auser->id . '&course=' . $course->id . '">' . fullname($auser) . '</a>';
+ $userlink = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $auser->id . '&course=' . $course->id . '">' . fullname($auser) . '</a>';
$row = array($picture, $userlink, $grade, $comment, $studentmodified, $teachermodified, $status, $finalgrade);
if ($uses_outcomes) {
$row[] = $outcomes;
return false;
}
- if ($this->is_finalized($submission)) {
- return false;
- }
+ if ($this->is_finalized($submission)) {
+ return false;
+ }
if (has_capability('mod/assignment:grade', $this->context)) {
return true;
}
}
- function add_completion_rules() {
+ function add_completion_rules() {
$mform =& $this->_form;
$group=array();
obj = obj.parentNode;
}
if (obj) {
- switch (BeforeOrAfter) {
- case 'before': obj.style.marginTop = '1.8em'; break;
- case 'after': obj.style.marginBottom = '0.8em'; break;
+ switch (BeforeOrAfter) {
+ case 'before': obj.style.marginTop = '1.8em'; break;
+ case 'after': obj.style.marginBottom = '0.8em'; break;
}
}
}
class safebrowser_access_rule extends quiz_access_rule_base {
public function prevent_access() {
if (!$this->_quizobj->is_preview_user() && !quiz_check_safe_browser()) {
- return get_string('safebrowsererror', 'quiz');
+ return get_string('safebrowsererror', 'quiz');
} else {
return false;
}
include_once('lib.php');
require_once('locallib.php');
require_once('datamodels/aicclib.php');
-
- foreach ($_POST as $key => $value)
- {
- $tempkey = strtolower($key);
- $_POST[$tempkey] = $value;
- }
+
+ foreach ($_POST as $key => $value) {
+ $tempkey = strtolower($key);
+ $_POST[$tempkey] = $value;
+ }
$command = required_param('command', PARAM_ALPHA);
$sessionid = required_param('session_id', PARAM_ALPHANUM);
}
break;
case 'cmi.interactions.n.correct_responses.n.pattern':
- subel= subelement.split('.');
- subel1= 'cmi.interactions.'+subel[2];
+ subel= subelement.split('.');
+ subel1= 'cmi.interactions.'+subel[2];
if (typeof eval(subel1+'.type') == "undefined") {
errorCode="408";
*
*/
function scorm_get_sco_runtime($scormid, $scoid, $userid, $attempt=1) {
- global $DB;
+ global $DB;
$timedata = new object();
$sql = !empty($scoid) ? "userid=$userid AND scormid=$scormid AND scoid=$scoid AND attempt=$attempt" : "userid=$userid AND scormid=$scormid AND attempt=$attempt";
// we send the files as they are, no prep required
return true;
}
-
+
public function get_interactive_continue_url(){
return 'http://docs.google.com/';
}
// we send the files as they are, no prep required
return true;
}
-
+
public function get_interactive_continue_url(){
return 'http://picasaweb.google.com/';
}
if ($questionlist = explode(',', $deleteselected)) {
// for each question either hide it if it is in use or delete it
foreach ($questionlist as $questionid) {
- $questionid = (int)$questionid;
+ $questionid = (int)$questionid;
question_require_capability_on($questionid, 'edit');
if ($DB->record_exists('quiz_question_instances', array('question' => $questionid))) {
if (!$DB->set_field('question', 'hidden', 1, array('id' => $questionid))) {
function process_essay($xml, &$questions ) {
if (isset($xml["POOL"]["#"]["QUESTION_ESSAY"])) {
- $essayquestions = $xml["POOL"]["#"]["QUESTION_ESSAY"];
+ $essayquestions = $xml["POOL"]["#"]["QUESTION_ESSAY"];
}
else {
- return;
- }
+ return;
+ }
foreach ($essayquestions as $essayquestion) {
$question = $this->defaultquestion();
- $question->qtype = ESSAY;
+ $question->qtype = ESSAY;
// determine if the question is already escaped html
$ishtml = $essayquestion["#"]["BODY"][0]["#"]["FLAGS"][0]["#"]["ISHTML"][0]["@"]["value"];
$question->fraction = 0;
$questions[] = $question;
- }
+ }
}
//----------------------------------------
global $QTYPES, $DB;
$this->question = $question;
$this->qtypeobj =& $QTYPES[$this->question->qtype];
- // Validate the question category.
- if (!$category = $DB->get_record('question_categories', array('id' => $question->category))) {
- print_error('categorydoesnotexist', 'question', $returnurl);
- }
+ // Validate the question category.
+ if (!$category = $DB->get_record('question_categories', array('id' => $question->category))) {
+ print_error('categorydoesnotexist', 'question', $returnurl);
+ }
$this->category = $category;
$this->categorycontext = get_context_instance_by_id($category->contextid);
parent::moodleform($submiturl);
$this->regenerate = $regenerate;
$this->question = $question;
$this->qtypeobj =& $QTYPES[$this->question->qtype];
- // Validate the question category.
- if (!$category = $DB->get_record('question_categories', array('id' => $question->category))) {
- print_error('categorydoesnotexist', 'question', $returnurl);
- }
+ // Validate the question category.
+ if (!$category = $DB->get_record('question_categories', array('id' => $question->category))) {
+ print_error('categorydoesnotexist', 'question', $returnurl);
+ }
$this->category = $category;
$this->categorycontext = get_context_instance_by_id($category->contextid);
//get the dataset defintions for this question
}
}
- /**
- * This function get the dataset items using id as unique parameter and return an
- * array with itemnumber as index sorted ascendant
- * If the multiple records with the same itemnumber exist, only the newest one
- * i.e with the greatest id is used, the others are ignored but not deleted.
- * MDL-19210
- */
+ /**
+ * This function get the dataset items using id as unique parameter and return an
+ * array with itemnumber as index sorted ascendant
+ * If the multiple records with the same itemnumber exist, only the newest one
+ * i.e with the greatest id is used, the others are ignored but not deleted.
+ * MDL-19210
+ */
function get_database_dataset_items($definition){
- global $CFG, $DB;
- $databasedataitems = $DB->get_records_sql( // Use number as key!!
- " SELECT id , itemnumber, definition, value
- FROM {question_dataset_items}
- WHERE definition = $definition order by id DESC ", array($definition));
- $dataitems = Array();
- foreach($databasedataitems as $id => $dataitem ){
- if (!isset($dataitems[$dataitem->itemnumber])){
- $dataitems[$dataitem->itemnumber] = $dataitem ;
- }else {
- // deleting the unused records could be added here
- }
- }
- ksort($dataitems);
- return $dataitems ;
+ global $CFG, $DB;
+ $databasedataitems = $DB->get_records_sql( // Use number as key!!
+ " SELECT id , itemnumber, definition, value
+ FROM {question_dataset_items}
+ WHERE definition = $definition order by id DESC ", array($definition));
+ $dataitems = Array();
+ foreach($databasedataitems as $id => $dataitem ){
+ if (!isset($dataitems[$dataitem->itemnumber])){
+ $dataitems[$dataitem->itemnumber] = $dataitem ;
+ }else {
+ // deleting the unused records could be added here
+ }
+ }
+ ksort($dataitems);
+ return $dataitems ;
}
function save_dataset_items($question, $fromform){
* @param PARAM_ALPHA $wizardnow should be added as we are coming from question2.php
*/
function save_question($question, $form, $course) {
-
$question = default_questiontype::save_question($question, $form, $course);
return $question;
}
}
function set_data($question) {
- if (!empty($question->options) && !empty($question->options->answers)) {
+ if (!empty($question->options) && !empty($question->options->answers)) {
$answer = reset($question->options->answers);
$question->feedback = $answer->feedback;
}
<div class="answer">
<fieldset class="answer" id="generalheader">
- <legend class="ftoggler">
- <?php echo get_string('datasetnumber', 'quiz') ; ?>
- </legend>
+ <legend class="ftoggler">
+ <?php echo get_string('datasetnumber', 'quiz') ; ?>
+ </legend>
<input type="text" class="<?php echo $class; ?>" <?php echo "$readonly $nameanswer $valueanswer"; //
?> size="<?php echo $textlength;?>" />
<?php echo $feedbackimg; ?>
?>
<div class="answer">
<fieldset class="clearfix" id="generalheader">
- <legend class="ftoggler">
- <?php echo get_string('unit', 'quiz'); ?>
- </legend>
+ <legend class="ftoggler">
+ <?php echo get_string('unit', 'quiz'); ?>
+ </legend>
<input type="text" class="<?php echo $classunit; ?>" <?php echo "$readonly $nameunit $valueunit"; //
?> size="<?php echo $textlength;?>"/>
<?php echo $feedbackimgunit; ?>
?>
<div class="answer">
<fieldset class="clearfix" id="generalheader">
- <legend class="ftoggler">
- <?php echo get_string('unit', 'quiz');
- //echo $question->options->units[0]->unit ;
- ?>
- </legend>
+ <legend class="ftoggler">
+ <?php echo get_string('unit', 'quiz');
+ //echo $question->options->units[0]->unit ;
+ ?>
+ </legend>
<input type="hidden"
<?php
echo $nameunit; echo $valueunit ;
<div class="answer">
<fieldset class="clearfix" id="generalheader">
- <legend class="ftoggler">
- <?php echo get_string('datasetnumber', 'quiz'); ?>
- </legend>
+ <legend class="ftoggler">
+ <?php echo get_string('datasetnumber', 'quiz'); ?>
+ </legend>
<input type="text" class="<?php echo $class; ?>" <?php echo "$readonly $nameanswer $valueanswer"; //
?> size="<?php echo $textlength;?>"/>
<?php echo $feedbackimg; ?>
<div class="feedback">
<fieldset class="clearfix" id="generalheader">
- <legend class="ftoggler">
- <?php echo get_string('instructions', 'auth'); ?>
- </legend>
+ <legend class="ftoggler">
+ <?php echo get_string('instructions', 'auth'); ?>
+ </legend>
<div class="feedback">
<fieldset class="clearfix" id="generalheader">
- <legend class="ftoggler">
+ <legend class="ftoggler">
<?php echo get_string('validnumberformats', 'qtype_numerical');?>
- </legend>
+ </legend>
<?php echo get_string('validnumbers', 'qtype_numerical');?>
</fieldset>
</div>
// deal with user logging in
if (empty($SESSION->{$this->sessname}) && !empty($this->username) && !empty($this->password)) {
$this->ticket = $this->instance->authenticate($this->username, $this->password);
- $SESSION->{$this->sessname} = $this->ticket;
+ $SESSION->{$this->sessname} = $this->ticket;
} else {
if (!empty($SESSION->{$this->sessname})) {
- $this->ticket = $SESSION->{$this->sessname};
+ $this->ticket = $SESSION->{$this->sessname};
}
}
$this->user_session = $this->instance->createSession($this->ticket);
public function print_search($client_id) {
$str = parent::print_search($client_id);
$str .= '<label>Space: </label><br /><select name="space">';
- foreach ($this->user_session->stores as $v) {
+ foreach ($this->user_session->stores as $v) {
$str .= '<option ';
if ($v->__toString() === 'workspace://SpacesStore') {
$str .= 'selected ';
public function search($search_text) {
global $CFG;
$space = optional_param('space', 'workspace://SpacesStore', PARAM_RAW);
- $currentStore = $this->user_session->getStoreFromString($space);
+ $currentStore = $this->user_session->getStoreFromString($space);
$nodes = $this->user_session->query($currentStore, $search_text);
$ret = array();
$ret['list'] = array();
<?php
class moodle_image {
- private $imagepath;
- private $info;
- private $width;
- private $height;
- private $image;
- private $backup;
+ private $imagepath;
+ private $info;
+ private $width;
+ private $height;
+ private $image;
+ private $backup;
- function __construct($img) {
+ function __construct($img) {
if(!function_exists('imagecreatefrompng')
and !function_exists('imagecreatefromjpeg')) {
throw new moodle_exception('gdnotexist');
if(!file_exists($img) or !is_readable($img)) {
throw new moodle_exception('invalidfile');
}
-
- $this->imagepath = $img;
+
+ $this->imagepath = $img;
unset($img);
- $this->info = getimagesize($this->imagepath);
+ $this->info = getimagesize($this->imagepath);
- switch($this->info['mime']) {
+ switch($this->info['mime']) {
case 'image/jpeg':
$this->image = imagecreatefromjpeg($this->imagepath);
break;
break;
default:
break;
- }
- $this->width = imagesx($this->image);
- $this->height = imagesy($this->image);
- }
+ }
+ $this->width = imagesx($this->image);
+ $this->height = imagesy($this->image);
+ }
- function destroy() {
- imagedestroy($this->image);
- imagedestroy($this->backup);
+ function destroy() {
+ imagedestroy($this->image);
+ imagedestroy($this->backup);
return true;
- }
+ }
- function undo() {
- $this->image = $this->backup;
- return $this;
- }
+ function undo() {
+ $this->image = $this->backup;
+ return $this;
+ }
function watermark($text='', $pos=array(), $options=array()) {
global $CFG;
return $this;
}
- function rotate($angle=0, $bgcolor=0) {
- $this->image = imagerotate($this->image, $angle, $bgcolor);
- return $this;
- }
-
- function resize($w, $h, $use_resize = true) {
+ function rotate($angle=0, $bgcolor=0) {
+ $this->image = imagerotate($this->image, $angle, $bgcolor);
+ return $this;
+ }
+
+ function resize($w, $h, $use_resize = true) {
if(empty($h) && !empty($w)) {
$h = $this->height * ($w/$this->width);
}
imagealphablending($new_img, false);
imagecopyresampled($new_img /* dst */, $this->image /* src */, 0, 0, 0, 0, $w, $h, $this->width, $this->height);
$this->image = $new_img;
- return $this;
- }
+ return $this;
+ }
- function saveas($imagepath) {
- switch($this->info['mime']) {
+ function saveas($imagepath) {
+ switch($this->info['mime']) {
case 'image/jpeg':
return imagejpeg($this->image, $imagepath);
break;
break;
default:
break;
- }
+ }
if(!$this->destroy()) {
return false;
} else {
return $this;
}
- }
+ }
- function display() {
- header('Content-type: '.$this->info['mime']);
- switch($this->info['mime']) {
+ function display() {
+ header('Content-type: '.$this->info['mime']);
+ switch($this->info['mime']) {
case 'image/png':
imagepng($this->image);
break;
break;
default:
break;
- }
- $this->destroy();
- return $this;
- }
+ }
+ $this->destroy();
+ return $this;
+ }
}
$this->api = 'http://www.merlot.org/merlot/materials.rest?keywords=' . urlencode($keyword) . '&licenseKey='.$this->licensekey;
$c = new curl(array('cache'=>true, 'module_cache'=>'repository'));
$content = $c->get($this->api);
- $xml = simplexml_load_string($content);
+ $xml = simplexml_load_string($content);
foreach ($xml->results->material as $entry) {
$list[] = array(
'title'=>(string)$entry->title,
}
function id2_add_clientid(id, clientid) {
- id2clientid[id] = clientid;
+ id2clientid[id] = clientid;
}
function id2_add_itemid(id, drafitemid) {
- id2itemid[id] = drafitemid;
+ id2itemid[id] = drafitemid;
}
$this->feed_url = 'http://gdata.youtube.com/feeds/api/videos?q=' . urlencode($keyword) . '&format=5&start-index=' . $start . '&max-results=' .$max . '&orderby=' . $sort;
$c = new curl(array('cache'=>true, 'module_cache'=>'repository'));
$content = $c->get($this->feed_url);
- $xml = simplexml_load_string($content);
+ $xml = simplexml_load_string($content);
$media = $xml->entry->children('http://search.yahoo.com/mrss/');
- $links = $xml->children('http://www.w3.org/2005/Atom');
+ $links = $xml->children('http://www.w3.org/2005/Atom');
foreach ($xml->entry as $entry) {
$media = $entry->children('http://search.yahoo.com/mrss/');
$title = $media->group->title;
foreach ($courses as $course) {
print_course($course);
- }
+ }
echo $OUTPUT->box_end();
}
<div style="text-align:center;">
- <h2 style="margin-bottom:2px;">Anomaly Theme Pack</h2>
- <h3 style="margin:0">by <a href="http://newschoollearning.com" title="NewSchool Learning: Standards Based Moodle Designs">Patrick Malley</a></h3><h4 style="margin:3px">Version: 20090119</h4>
+ <h2 style="margin-bottom:2px;">Anomaly Theme Pack</h2>
+ <h3 style="margin:0">by <a href="http://newschoollearning.com" title="NewSchool Learning: Standards Based Moodle Designs">Patrick Malley</a></h3><h4 style="margin:3px">Version: 20090119</h4>
</div>
<div>
</div>
<p>The default color for this theme is green. To select a different color variant: </p>
<ol>
- <li>Remane styles_select.css to styles_green.css.</li>
- <li>Rename the styles_[color].css variant that you would like to use to styles_select.css.</li>
- <li>That's it. Where you expecting something trickier?</li>
+ <li>Remane styles_select.css to styles_green.css.</li>
+ <li>Rename the styles_[color].css variant that you would like to use to styles_select.css.</li>
+ <li>That's it. Where you expecting something trickier?</li>
</ol>
<h3 style="margin-bottom:5px; margin-top:5px;">Editing your Site Tagline</h3>
<p>Here's the code in header.html that is responsible for this (highlighted in red; found on line 58):</p>
- <code style="display:block; padding:10px; margin:10px; background:#f6f6f6; border:1px solid #eee;">
- <h1 class="headermain"><?php echo $heading ?><span style="color:#ff0000"><br /><span><?php echo $COURSE->summary //Retrieves Site Description from Front Page -> Front Page Settings ?></span></span></h1>
- </code>
+ <code style="display:block; padding:10px; margin:10px; background:#f6f6f6; border:1px solid #eee;">
+ <h1 class="headermain"><?php echo $heading ?><span style="color:#ff0000"><br /><span><?php echo $COURSE->summary //Retrieves Site Description from Front Page -> Front Page Settings ?></span></span></h1>
+ </code>
<p>If you don't want to show a tagline, simply delete the code highlighted in red above from header.html and save.</p>
<p>If you want to show a tagline, BUT would prefer your tagline to be something other than your site description, you can manually enter your Tagline into header.html in the same sort of way.</p>
<p>For example, if I wanted to display my tagline - Standards Based Moodle Designs - I would edit the above code as follows:</p>
- <code style="display:block; padding:10px; margin:10px; background:#f6f6f6; border:1px solid #eee;">
- <h1 class="headermain"><?php echo $heading ?><br /><span><span style="color:#ff0000;">Standards Based Moodle Designs</span></span></h1>
- </code>
+ <code style="display:block; padding:10px; margin:10px; background:#f6f6f6; border:1px solid #eee;">
+ <h1 class="headermain"><?php echo $heading ?><br /><span><span style="color:#ff0000;">Standards Based Moodle Designs</span></span></h1>
+ </code>
<h3 style="margin-bottom:5px; margin-top:5px;">Licensing</h3>
<div id="page">
<!-- First, let's wrap the sides -->
- <div id="wrapper-t">
- <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">
- <div id="wrapper-br">
+ <div id="wrapper-t">
+ <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">
+ <div id="wrapper-br">
<?php //Accessibility: 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
if ($home) { // This is what gets printed on the home page only
<?php echo $OUTPUT->container_start('clearfix header-home'); ?>
<div id="header-t">
- <div id="header-r">
- <div id="header-l">
- <div id="header-m" class="clearfix home">
- <h1 class="headermain"><?php echo $heading ?><br />
- <span><?php echo $COURSE->summary //Retrieves Site Description from Front Page -> Front Page Settings ?></span>
- </h1>
- <div class="headermenu"><?php echo $menu ?></div>
- </div>
- </div>
- </div>
+ <div id="header-r">
+ <div id="header-l">
+ <div id="header-m" class="clearfix home">
+ <h1 class="headermain"><?php echo $heading ?><br />
+ <span><?php echo $COURSE->summary //Retrieves Site Description from Front Page -> Front Page Settings ?></span>
+ </h1>
+ <div class="headermenu"><?php echo $menu ?></div>
+ </div>
+ </div>
+ </div>
</div>
<?php echo $OUTPUT->container_end(); ?>
?>
<?php echo $OUTPUT->container_start('clearfix header'); ?>
<div id="header-t">
- <div id="header-r">
- <div id="header-l">
- <div id="header-m" class="clearfix">
- <h1 class="headermain"><?php echo $heading ?></h1>
- <div class="headermenu"><?php echo $menu ?></div>
- </div>
- </div>
- </div>
- </div>
+ <div id="header-r">
+ <div id="header-l">
+ <div id="header-m" class="clearfix">
+ <h1 class="headermain"><?php echo $heading ?></h1>
+ <div class="headermenu"><?php echo $menu ?></div>
+ </div>
+ </div>
+ </div>
+ </div>
<?php echo $OUTPUT->container_end(); ?>
<?php } ?>
<?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
.weeks-format #right-column,
.topics-format #left-column,
.topics-format #right-column {
- width: 15.5em;
+ width: 15.5em;
}
.weeks-format,
.topics-format {
}
#course-view .section td.content ul.section.img-text {
- line-height: 22px;
+ line-height: 22px;
}
#course-view .section td.content ul.section.img-text li.activity.label {
- line-height: 16px;
- margin-bottom: 5px;
+ line-height: 16px;
+ margin-bottom: 5px;
}
.coursebox .info .name {
}
.glossarypost.continuous {
- padding: 5px;
+ padding: 5px;
}
/***
<h1 class="headermain"><?php echo $heading ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
<?php echo $OUTPUT->container_end(); ?>
- <div class="navbar clearfix">
-
+ <div class="navbar clearfix">
+
</div>
<?php } else if ($heading) { // This is what gets printed on any other page with a heading
?>
.weeks-format #right-column,
.topics-format #left-column,
.topics-format #right-column {
- width: 15.5em;
+ width: 15.5em;
}
.weeks-format,
.topics-format {
* mod/forum/view.php
**/
#mod-forum-view .unread{
- background: #FFFF6B;
+ background: #FFFF6B;
}
/***