CEHD Customizations

Customizations for COURSES14

PHP Settings

Set max_input_vars = 5000 (default is 1000, 5000 may not be completely necessary, but works)

With a limit of 1000, manual backups may fail for complex courses since the number of options when making a backup is proportional to the number of topics, quizzes, assignments, etc.  1000 failed for Bob Hall's 435/635 course.

 

CAS Auth

To increase the reliability of the login process, we are using the UIN rather than the NetID from the CAS payload. To make this happen, the following changes were made to the CAS module.

auth/cas/CAS/CAS/client.php

 Beginning around line 1455
 // CEHD Customization. Changed "user" to "tamuEduPersonUIN"
 Original
   if ( sizeof($user_elements = $success_elements[0]->get_elements_by_tagname("user")) == 0) {
 Modified To
   if ( sizeof($user_elements = $success_elements[0]->get_elements_by_tagname("tamuEduPersonUIN")) == 0) {

 Beginning around line 2574
 // CEHD Customization. Changed "user" to "tamuEduPersonUIN"
 Original
   if ( sizeof($arr = $tree_response->get_elements_by_tagname("user")) == 0) {
 Modified To
   if ( sizeof($arr = $tree_response->get_elements_by_tagname("tamuEduPersonUIN")) == 0) {

LDAP Fix

Moodle's CAS plugin presumes the existence of an LDAP server to check against.  The only consequence of this we have found is that it prevents the changing the username of a CAS user (since it assumes the user is in a LDAP DB and hence shouldn't be changed through Moodle).  This hack prevents that check so username changes can be performed.  Note.  There is little reason for the username to change (since we are using the UIN rather than Net ID-- see above -- but it is handy for testing purposes to be able to change the username=uin of a user.

To allow changing the username of a CAS user, comment out the check in auth/ldap/auth.php

function user_update($olduser, $newuser) {
    global $USER;
// CEHD. CAS builds on the LDAP library.  But, there is no reason to disallow username changes for CAS users in our case.
//
//    if (isset($olduser->username) and isset($newuser->username) and $olduser->username != $newuser->username) {
//        error_log($this->errorlogtag.get_string('renamingnotallowed', 'auth_ldap'));
//        return false;
//    }

CAS Language Update

Replace the language strings in auth/cas/lang/en/auth_cas.php for accessCAS and accessNOCAS with

  • $string['accesCAS'] = 'Login for Texas A&M Students, Faculty and Staff';
    $string['accesNOCAS'] = 'Login for others';
     

Add IP Address to Quiz Attempts Report

moodle/mod/quiz/report/attemptreport_table.php

Changed function base_sql (function begins at approx line 345)

Appended the IP address to the SELECT list

// CEHD Customization to display IP address on quiz attempts report
$fields .= ', log.ip as ipaddress';
 

Joined the Log table (where the IP address is stored) to the query

// CEHD Customization
$from .= " LEFT JOIN {log} log ON (
                     quiza.quiz=log.info
                     AND log.userid=u.id AND module='quiz'
                     AND action='attempt'
                     AND time BETWEEN quiza.timestart-1 AND quiza.timestart+8
)";
// END CEHD Customization

We have seen a pretty large discrepancy between the quiz attempt time and the log time so have had to use a big time cushion.

moodle/mod/quiz/report/attemptreport.php

Altered function add_time_columns (function begins at approx line 217)

Added these lines to display the IP address in the table just prior to the time start/finish columns

$columns[] = 'ipaddress';   // CEHD Customization
$headers[] = "IP Address";  // CEHD Customization
 

The Remaining Sections No Longer Appear to be Necessary

Correct Button Display (Skipping on 5/28/2013.  This may have been fixed since may 2012)

Apply Patch: http://tracker.moodle.org/secure/attachment/27782/patch.patch (5/29/2012)

  • I am skipping the 3rd part of the patch because it appears the file has changed with the latest upgrade.

 

Certificate Module (Skipping on 5/28/2013.  This may have been fixed since may 2012)

Awaiting confirmation from Michelle that this resolved the problem.

Edit mod/certificate/lib.php

Change
function certificate_issue($course, $certrecord, $cm) {
    global $USER, $DB, $certificate;

to
function certificate_issue($course, $certificate, $certrecord, $cm) {
    global $USER, $DB;

  • This patch no longer seems necessary with the latest upgrade of this module