[system] / trunk / wwmoodle / wwassignment4 / moodle / mod / wwassignment / db / upgrade.php Repository:
ViewVC logotype

View of /trunk/wwmoodle/wwassignment4/moodle/mod/wwassignment/db/upgrade.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5683 - (download) (as text) (annotate)
Sat May 24 02:34:08 2008 UTC (11 years, 9 months ago) by gage
File size: 2569 byte(s)
removed code that tried to import all grades from webwork on upgrades

the moodle -- webwork link might not be made in which case this
operation would fail

    1 <?php  //$Id: upgrade.php,v 1.3 2008-05-24 02:34:08 gage Exp $
    2 
    3 // This file keeps track of upgrades to
    4 // the assignment module
    5 //
    6 // Sometimes, changes between versions involve
    7 // alterations to database structures and other
    8 // major things that may break installations.
    9 //
   10 // The upgrade function in this file will attempt
   11 // to perform all the necessary actions to upgrade
   12 // your older installtion to the current version.
   13 //
   14 // If there's something it cannot do itself, it
   15 // will tell you what you need to do.
   16 //
   17 // The commands in here will all be database-neutral,
   18 // using the functions defined in lib/ddllib.php
   19 
   20 function xmldb_wwassignment_upgrade($oldversion=0) {
   21 
   22     global $CFG, $THEME, $db;
   23 
   24     $result = true;
   25 
   26 /// And upgrade begins here. For each one, you'll need one
   27 /// block of code similar to the next one. Please, delete
   28 /// this comment lines once this file start handling proper
   29 /// upgrade code.
   30 
   31 /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
   32 ///     $result = result of "/lib/ddllib.php" function calls
   33 /// }
   34 
   35 //===== 1.9.0 upgrade line ======//
   36     notify("running 1.9 upgrade");
   37     if ($result && $oldversion < 2008042072) {
   38 
   39       /// Define field grade to be added to wwassignment
   40         //$table = new XMLDBTable('wwassignment');
   41         //$field = new XMLDBField('grade');
   42         //$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'webwork_set');
   43 
   44       /// Launch add field grade
   45         //$result = $result && add_field($table, $field);
   46 
   47       /// Define field timemodified to be added to wwassignment
   48       $table = new XMLDBTable('wwassignment');
   49         $field = new XMLDBField('timemodified');
   50         $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'webwork_set');
   51 
   52         /// Launch add field timemodified
   53         $result = $result && add_field($table, $field);
   54 
   55         // can't do this until you are connected to webwork -- which you won't be on initial upgrades
   56         // add this either to wwlink block or to configuration
   57 
   58         //notify('Processing assignment grades, this may take a while if there are many assignments...', 'notifysuccess');
   59         // change grade typo to text if no grades MDL-13920
   60         //require_once $CFG->dirroot.'/mod/wwassignment/lib.php';
   61         // too much debug output
   62         //$db->debug = false;
   63         //wwassignment_update_grades();
   64         //$db->debug = true;
   65     }
   66 
   67     return $result;
   68 }
   69 ?>
   70 

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9