]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trail...
authorPetr Skoda <skodak@moodle.org>
Sun, 1 Nov 2009 15:03:10 +0000 (15:03 +0000)
committerPetr Skoda <skodak@moodle.org>
Sun, 1 Nov 2009 15:03:10 +0000 (15:03 +0000)
115 files changed:
mod/glossary/db/access.php
mod/glossary/db/install.php
mod/glossary/db/upgrade.php
mod/glossary/formats/README.txt
mod/glossary/formats/TEMPLATE/TEMPLATE_format.php
mod/glossary/formats/continuous/continuous_format.php
mod/glossary/formats/dictionary/dictionary_format.php
mod/glossary/formats/encyclopedia/encyclopedia_format.php
mod/glossary/formats/entrylist/entrylist_format.php
mod/glossary/formats/faq/faq_format.php
mod/glossary/formats/fullwithauthor/fullwithauthor_format.php
mod/glossary/formats/fullwithoutauthor/fullwithoutauthor_format.php
mod/glossary/simpletest/test_glossary_portfolio_callers.php
mod/glossary/sql.php
mod/glossary/tabs.php
mod/glossary/version.php
mod/glossary/view.php
mod/hotpot/README.TXT
mod/hotpot/attempt.php
mod/hotpot/backuplib.php
mod/hotpot/db/access.php
mod/hotpot/db/install.php
mod/hotpot/db/upgrade.php
mod/hotpot/grade.php
mod/hotpot/hotpot-full.js
mod/hotpot/index.php
mod/hotpot/lib.php
mod/hotpot/mediaplayers/moodle/filter.php
mod/hotpot/mod_form.php
mod/hotpot/report.php
mod/hotpot/report/click/report.php
mod/hotpot/report/default.php
mod/hotpot/report/fullstat/report.php
mod/hotpot/report/overview/report.php
mod/hotpot/report/simplestat/report.php
mod/hotpot/restorelib.php
mod/hotpot/review.php
mod/hotpot/settings.php
mod/hotpot/template/default.php
mod/hotpot/template/v6.php
mod/hotpot/template/v6/djmatch6.ht_
mod/hotpot/template/v6/djmatch6.js_
mod/hotpot/template/v6/djmix6.ht_
mod/hotpot/template/v6/djmix6.js_
mod/hotpot/template/v6/fjmatch6.ht_
mod/hotpot/template/v6/fjmatch6.js_
mod/hotpot/template/v6/hp6.cs_
mod/hotpot/template/v6/hp6browsercheck.js_
mod/hotpot/template/v6/hp6card.js_
mod/hotpot/template/v6/hp6checkshortanswer.js_
mod/hotpot/template/v6/hp6objecttags.ht_
mod/hotpot/template/v6/hp6plainpage.ht_
mod/hotpot/template/v6/hp6showmessage.js_
mod/hotpot/template/v6/hp6utilities.js_
mod/hotpot/template/v6/jcloze6.ht_
mod/hotpot/template/v6/jcloze6.js_
mod/hotpot/template/v6/jcross6.ht_
mod/hotpot/template/v6/jcross6.js_
mod/hotpot/template/v6/jcross6print.ht_
mod/hotpot/template/v6/jmatch6.ht_
mod/hotpot/template/v6/jmatch6.js_
mod/hotpot/template/v6/jmix6.ht_
mod/hotpot/template/v6/jmix6.js_
mod/hotpot/template/v6/jquiz6.ht_
mod/hotpot/template/v6/jquiz6.js_
mod/hotpot/template/v6/masher.ht_
mod/hotpot/version.php
mod/hotpot/view.php
mod/label/backuplib.php
mod/label/db/install.php
mod/label/db/upgrade.php
mod/label/index.php
mod/label/lib.php
mod/label/mod_form.php
mod/label/restorelib.php
mod/label/version.php
mod/label/view.php
mod/lesson/action/addbranchtable.php
mod/lesson/action/addcluster.php
mod/lesson/action/addendofbranch.php
mod/lesson/action/addendofcluster.php
mod/lesson/action/addpage.php
mod/lesson/action/confirmdelete.php
mod/lesson/action/continue.html
mod/lesson/action/continue.php
mod/lesson/action/delete.php
mod/lesson/action/editpage.php
mod/lesson/action/insertpage.php
mod/lesson/action/move.php
mod/lesson/action/moveit.php
mod/lesson/action/updatepage.php
mod/lesson/backuplib.php
mod/lesson/db/access.php
mod/lesson/db/install.php
mod/lesson/db/upgrade.php
mod/lesson/edit.php
mod/lesson/essay.php
mod/lesson/format.php
mod/lesson/grade.php
mod/lesson/highscores.php
mod/lesson/import.php
mod/lesson/importppt.php
mod/lesson/index.php
mod/lesson/lesson.php
mod/lesson/locallib.php
mod/lesson/mediafile.php
mod/lesson/mod_form.php
mod/lesson/reformat.php
mod/lesson/report.php
mod/lesson/restorelib.php
mod/lesson/styles.php
mod/lesson/tabs.php
mod/lesson/timer.js
mod/lesson/version.php
mod/lesson/view.php

index f800926d80d3b3e6d031b0da8600f5ca87f0af81..51b72925d9446d9c8b024b766562fad5f6ec55c8 100644 (file)
@@ -186,4 +186,4 @@ $mod_glossary_capabilities = array(
 
 );
 
-?>
+
index bdedf3e4ea9a03435eb92a4ac3979bfc55bd0b8f..33ad579511aa5fc175a3d52f828436f692a1995e 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file replaces:
 //   * STATEMENTS section in db/install.xml
index 0a3b5063f8540692dc3e89422f085d4ada96204c..61e90844a400f3c5f53288003645c3bababb2001 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file keeps track of upgrades to
 // the glossary module
@@ -208,4 +208,4 @@ function xmldb_glossary_upgrade($oldversion) {
     return $result;
 }
 
-?>
+
index 7c313e34004d88ef66725e0b0cbb839b5926dc89..5c7633ecfa9969eed1b253f2b24efe1944709ca3 100644 (file)
@@ -1,13 +1,11 @@
-$Id$
-
 GLOSSARY FORMAT PLUGINS
 -----------------------
 
 Starting with Moodle 1.4, the glossary module supports a plugin
-architecture to create your own formats. This plugin system allows 
+architecture to create your own formats. This plugin system allows
 you to "invent" your own presentations for your glossary data. :-)
 
-To facilitate the creation process a TEMPLATE format has been created. 
+To facilitate the creation process a TEMPLATE format has been created.
 You should use it as the base for your own modifications (this requires
 some basic PHP skills). The template includes all the available data.
 
@@ -17,7 +15,7 @@ Please, follow these STEPS:
    For further reference in this document, we call it "THENAME".
 2.-Duplicate the TEMPLATE directory (under mod/glossary/formats/TEMPLATE).
 3.-Rename it to THENAME
-4.-Go into the THENAME directory and rename the TEMPLATE_format.php file 
+4.-Go into the THENAME directory and rename the TEMPLATE_format.php file
    to THENAME_format.php
 5.-Edit the THENAME_format.php file. Change every ocurrence of TEMPLATE to
    THENAME.
@@ -25,8 +23,8 @@ Please, follow these STEPS:
 7.-Edit (configure) your glossary. In the Format popup you'll see a new
    entry. It will be showed as "displayformatTHENAME". Select it and view
    your glossary.
-8.-Edit the THENAME_format.php. Make your format modifications and reload your 
-   web page to see them in your glossary. This file has been commented to make 
+8.-Edit the THENAME_format.php. Make your format modifications and reload your
+   web page to see them in your glossary. This file has been commented to make
    things easier to understand (further suggestions welcome!)
 9.-If you want to translate your THENAME format name to some nice name to
    be showed in the Format popup, simply, edit your lang/XX/glossary.php
index 683f482e062f03bdb3ff5487295493aeb6c4468f..b223ed32ab3344f8e382551ae82dcbc9e6326635 100755 (executable)
@@ -1,14 +1,14 @@
-<?php  // $Id$
+<?php
 
 function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1, $ratings=NULL, $aliases=true) {
     global $CFG, $USER, $DB, $OUTPUT;
-    
+
 
     $user = $DB->get_record('user', array('id'=>$entry->userid));
     $strby = get_string('writtenby', 'glossary');
 
     if ($entry) {
-    
+
         echo '<table class="glossarypost TEMPLATE">';
         echo '<tr>';
         echo '<td class="entryheader">';
@@ -32,7 +32,7 @@ function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='',
         //Comments: Configuration not supported
         echo get_string('lastedited').': '. userdate($entry->timemodified) . '<br /></span>';
 
-        //Use this function to show the approval button. It'll be shown if necessary       
+        //Use this function to show the approval button. It'll be shown if necessary
         //Comments: You can configure this parameters:
         //----Define where to show the approval button
         $approvalalign = 'right'; //Values: left, center and right (default right)
@@ -50,7 +50,7 @@ function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='',
 
         //Use this function to show the attachment. It'll be showed if necessary
         //Comments: You can configure this parameters:
-        //----Define how to show the attachment 
+        //----Define how to show the attachment
         $attachmentformat = 'html'; //Values: html (link) and NULL (inline image if possible) (default NULL)
         //----Define where to show the attachment
         $attachmentalign = 'right'; //Values: left, center and right (default right)
@@ -74,7 +74,7 @@ function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='',
         //Line separator not normally needed now.
         //echo "<br />\n";
 
-        //Use this function to show the definition 
+        //Use this function to show the definition
         //Comments: Configuration not supported
         glossary_print_entry_definition($entry, $glossary, $cm);
 
@@ -93,11 +93,11 @@ function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='',
         //    use it only if you are really sure!
         //$printicons = false;
         $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
-        
+
         echo '</td>';
         echo '</tr>';
         echo "</table>\n";
-    } else {    
+    } else {
         echo '<div style="text-align:center">';
         print_string('noentry', 'glossary');
         echo '</div>';
@@ -119,4 +119,4 @@ function glossary_print_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode=''
 
 }
 
-?>
+
index c2f13dc2ba4fffdb265219fc5b299d40b245875a..8c50003ec230d7eaa1661716f5f1f206d27b8dff 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 
 function glossary_show_entry_continuous($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1, $ratings=NULL, $aliases=false) {
 
@@ -15,7 +15,7 @@ function glossary_show_entry_continuous($course, $cm, $glossary, $entry, $mode='
     glossary_print_entry_definition($entry, $glossary, $cm);
     $entry->alias = '';
     echo '</td></tr>';
-   
+
     echo '<tr valign="top"><td class="entrylowersection">';
     $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
     echo '</td>';
@@ -34,7 +34,7 @@ function glossary_print_entry_continuous($course, $cm, $glossary, $entry, $mode=
 
     //Call to view function (without icons, ratings and aliases) and return its result
     return glossary_show_entry_continuous($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);
-    
+
 }
 
-?>
+
index 2454ed5dcc0ad3143bb1704ed9fcecbf81253264..0224eaade2b75cb8296591fb3390c34dba287845 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 
 function glossary_show_entry_dictionary($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1, $ratings=NULL, $aliases=true) {
 
@@ -34,4 +34,4 @@ function glossary_print_entry_dictionary($course, $cm, $glossary, $entry, $mode=
     return glossary_show_entry_dictionary($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);
 }
 
-?>
+
index 0fa353312033b1f107b4e04440babd27d9c015e3..cdf626fc2d20987ec7ce1f186cfd88e0e04fe356 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 
 function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode='',$hook='',$printicons=1,$ratings=NULL, $aliases=true) {
     global $CFG, $USER, $DB, $OUTPUT;
@@ -12,9 +12,9 @@ function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode
         echo '<table class="glossarypost encyclopedia" cellspacing="0">';
         echo '<tr valign="top">';
         echo '<td class="left picture">';
-        
+
         echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
-    
+
         echo '</td>';
         echo '<th class="entryheader">';
         echo '<div class="concept">';
@@ -28,11 +28,11 @@ function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode
         echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>';
 
         echo '</th>';
-        
+
         echo '<td class="entryapproval">';
         glossary_print_entry_approval($cm, $entry, $mode);
         echo '</td>';
-        
+
         echo '</tr>';
 
         echo '<tr valign="top">';
@@ -57,16 +57,16 @@ function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode
             $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$ratings, $aliases);
             echo ' ';
         }
-        
+
         echo '</td></tr>';
         echo "</table>\n";
-        
+
     } else {
         echo '<div style="text-align:center">';
         print_string('noentry', 'glossary');
         echo '</div>';
     }
-    
+
     return $return;
 }
 
@@ -78,9 +78,9 @@ function glossary_print_entry_encyclopedia($course, $cm, $glossary, $entry, $mod
     $entry->definition = '<span class="nolink">'.$entry->definition.'</span>';
 
     //Call to view function (without icons, ratings and aliases) and return its result
-    
+
     return glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode, $hook, false, false, false);
 
 }
 
-?>
+
index 66e285a16981f05a369c605405edd4293a8a32b1..a937bd202f8ff431a2c003ff8ba89458e685fadf 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 
 function glossary_show_entry_entrylist($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1, $ratings=NULL, $aliases=true) {
     global $USER;
@@ -60,4 +60,4 @@ function glossary_print_entry_entrylist($course, $cm, $glossary, $entry, $mode='
     return $return;
 }
 
-?>
+
index 03fc0001aadf44dfeb198819450fe284e360cde0..8c3b3559dd08cecd40fab94f123fc693d6868d47 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 
 function glossary_show_entry_faq($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL, $aliases=true) {
     global $USER;
@@ -57,4 +57,4 @@ function glossary_print_entry_faq($course, $cm, $glossary, $entry, $mode='', $ho
 
 }
 
-?>
+
index 33a8c09effaf7bb2d2d97db8ff5cf56c284a6f66..b8c249b9058b0d3edbc234f1aefcedfc5ccf88e1 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 
 function glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL, $aliases=true) {
     global $CFG, $USER, $DB, $OUTPUT;
@@ -11,11 +11,11 @@ function glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mo
     if ($entry) {
         echo '<table class="glossarypost fullwithauthor" cellspacing="0">';
         echo '<tr valign="top">';
-        
+
         echo '<td class="picture">';
         echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
         echo '</td>';
-        
+
         echo '<th class="entryheader">';
 
         echo '<div class="concept">';
@@ -47,7 +47,7 @@ function glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mo
         echo '<tr valign="top">';
         echo '<td class="left">&nbsp;</td>';
         echo '<td colspan="2" class="entrylowersection">';
-        
+
         $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
         echo ' ';
         echo '</td></tr>';
@@ -72,4 +72,4 @@ function glossary_print_entry_fullwithauthor($course, $cm, $glossary, $entry, $m
 
 }
 
-?>
+
index 258d4e59355a3cafb16d080dabd769590dcf4e5d..66866f8cbf69500cdae3f40e9fd784b347f67841 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 
 function glossary_show_entry_fullwithoutauthor($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL, $aliases=true) {
     global $CFG, $USER;
@@ -34,7 +34,7 @@ function glossary_show_entry_fullwithoutauthor($course, $cm, $glossary, $entry,
         echo '</td></tr>';
         echo '<tr valign="top"><td colspan="2" class="entrylowersection">';
         $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
-        
+
         echo ' ';
         echo '</td></tr>';
         echo "</table>\n";
@@ -58,4 +58,4 @@ function glossary_print_entry_fullwithoutauthor($course, $cm, $glossary, $entry,
 
 }
 
-?>
+
index 5f03ffc497433b57c08226f3866caec6301d1170..b3c55d0d517666b50448c70b86ac1469f9af9cfb 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 require_once("$CFG->libdir/simpletest/portfolio_testclass.php");
 require_once("$CFG->dirroot/mod/glossary/lib.php");
 require_once("$CFG->dirroot/$CFG->admin/generator.php");
@@ -58,4 +58,4 @@ class testGlossaryPortfolioCallers extends portfoliolib_test {
         parent::test_caller_with_plugins();
     }
 }
-?>
+
index ce30c9013a4cabefddc0b4adef3412cb100a114a..b26994ad83644822fff779671658abc9c9b25fda 100644 (file)
@@ -3,6 +3,7 @@
 /**
  * SQL.PHP
  *    This file is include from view.php and print.php
+ * @version $Id$
  * @copyright 2003
  **/
 
index fc07aeee4564701f683b09ad7eec30fa54913d1b..f4c8ea86bb192767d9254d16912ab2a941382aa2 100644 (file)
@@ -1,11 +1,11 @@
-<?php  // $Id$
+<?php
     if (!isset($sortorder)) {
         $sortorder = '';
-    }    
+    }
     if (!isset($sortkey)) {
         $sortkey = '';
     }
-    
+
     //make sure variables are properly cleaned
     $sortkey   = clean_param($sortkey, PARAM_ALPHA);// Sorted view: CREATION | UPDATE | FIRSTNAME | LASTNAME...
     $sortorder = clean_param($sortorder, PARAM_ALPHA);   // it defines the order of the sorting (ASC or DESC)
     }
 
 
-    $browserow[] = new tabobject(GLOSSARY_STANDARD_VIEW, 
+    $browserow[] = new tabobject(GLOSSARY_STANDARD_VIEW,
                                  $CFG->wwwroot.'/mod/glossary/view.php?id='.$id.'&amp;mode=letter',
                                  get_string('standardview', 'glossary'));
 
-    $browserow[] = new tabobject(GLOSSARY_CATEGORY_VIEW, 
-                                 $CFG->wwwroot.'/mod/glossary/view.php?id='.$id.'&amp;mode=cat', 
+    $browserow[] = new tabobject(GLOSSARY_CATEGORY_VIEW,
+                                 $CFG->wwwroot.'/mod/glossary/view.php?id='.$id.'&amp;mode=cat',
                                  get_string('categoryview', 'glossary'));
 
-    $browserow[] = new tabobject(GLOSSARY_DATE_VIEW, 
+    $browserow[] = new tabobject(GLOSSARY_DATE_VIEW,
                                  $CFG->wwwroot.'/mod/glossary/view.php?id='.$id.'&amp;mode=date',
                                  get_string('dateview', 'glossary'));
 
-    $browserow[] = new tabobject(GLOSSARY_AUTHOR_VIEW, 
+    $browserow[] = new tabobject(GLOSSARY_AUTHOR_VIEW,
                                  $CFG->wwwroot.'/mod/glossary/view.php?id='.$id.'&amp;mode=author',
                                  get_string('authorview', 'glossary'));
 
   <div class="entrybox">
 
 <?php
+
     if (!isset($category)) {
         $category = "";
     }
 
-    
+
     switch ($tab) {
         case GLOSSARY_CATEGORY_VIEW:
             glossary_print_categories_menu($cm, $glossary, $hook, $category);
             glossary_print_alphabet_menu($cm, $glossary, "letter", $hook, $sortkey, $sortorder);
             if ($mode == 'search' and $hook) {
                 echo "<h3>$strsearch: $hook</h3>";
-            } 
+            }
         break;
-    } 
+    }
     echo '<hr />';
 ?>
index 4a051799720ab9cd08c464ff0cb195646903e98b..7643837617d4b29e4c7c0b7b639def043276a620 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 /////////////////////////////////////////////////////////////////////////////////
 ///  Code fragment to define the version of glossary
@@ -9,4 +9,4 @@ $module->version  = 2009042006;
 $module->requires = 2009041700;  // Requires this Moodle version
 $module->cron     = 0;           // Period for cron to check this module (secs)
 
-?>
+
index 6c33f455f72049711612dbf6496daf1190fd8793..5f4a6f03e1c9d6426a67d698189e907f2e91e1e5 100644 (file)
@@ -239,7 +239,7 @@ if ($tab == GLOSSARY_APPROVAL_VIEW) {
     $PAGE->navbar->add($strwaitingapproval);
     echo $OUTPUT->header();
     echo $OUTPUT->heading($strwaitingapproval);
-} else { /// Print standard header    
+} else { /// Print standard header
     echo $OUTPUT->header();
 }
 
@@ -526,4 +526,3 @@ echo $OUTPUT->footer();
 $completion=new completion_info($course);
 $completion->set_module_viewed($cm);
 
-?>
\ No newline at end of file
index 8c8d2abf4a879d8d6c70d6e9923ce3847c87dbf7..24c4fded0a33388d3776b3cc2daa1d90e5a434dc 100644 (file)
@@ -16,7 +16,7 @@ This is v2.4.2 of the HotPot module for Moodle 1.9
    This software is provided "AS IS" without a warranty of any kind.
 
    Sponsors who have generously contributed to the development of this software:
-      - Agencia de Gestio d'Ajuts Universitaris i de Recerca (AGAUR), 
+      - Agencia de Gestio d'Ajuts Universitaris i de Recerca (AGAUR),
         Autonomous Government of Catalonia, Spain
         (via Josep M. Fontana, Universitat Pompeu Fabra)
       - Rikkyo Univeristy, Japan (via Paul Allum)
@@ -33,9 +33,9 @@ IMPORTANT NOTICE
 TO INSTALL OR UPDATE THE HOTPOT MODULE
 ======================================
 
-   You should install only this module by installing a complete Moodle 1.9 package. 
+   You should install only this module by installing a complete Moodle 1.9 package.
 
-   Similarly, the recommended way to upgrade this module is to upgrade to a complete Moodle 1.8 package. 
+   Similarly, the recommended way to upgrade this module is to upgrade to a complete Moodle 1.8 package.
 
    However, it is possible to download and unzip a complete Moodle 1.9 package and extract the "mod/hotpot" folder for use on your live Moodle 1.8 site.
 
@@ -53,7 +53,7 @@ TO USE THE HOTPOT MODULE
 
 5. On the main page for the Moodle course, confirm editing is turned on (click the "Turn editing on" button), then, in the section where you want to add the HotPot activity, select "Hot Potatoes Quiz" on the "Add an activity" drop-down menu .
 
-   If "Hot Potatoes Quiz" does not appear on the "Add an activity" menu, you may need to enable the HotPot module as follows: 
+   If "Hot Potatoes Quiz" does not appear on the "Add an activity" menu, you may need to enable the HotPot module as follows:
 
    a) from the site's front page select "Admin" then "Modules"
    b) click the "closed eye" icon for the "Hot Potatoes Quiz" module
@@ -75,9 +75,9 @@ HOT POTATOES CONDITIONS OF USE
 ** Reproduced from the Hot Potatoes site **
 
 Hot Potatoes is offered free to the educational community by the University of Victoria Humanities Computing and Media Centre (formerly the Language Centre), under certain conditions. Hot Potatoes is free for use by state educational institutions which are non-profit making, on the condition that the material produced using the program is freely available to anyone via the WWW. However, you need to purchase a licence under any of the following conditions:
-*  You do not work for a public sector educational establishment. 
-*  You charge money for access to the material you make with Hot Potatoes. 
-*  You restrict access to the material in some way. (The only exception here is if you have an account on www.hotpot.net, where you ARE allowed to use password restrictions.) 
+*  You do not work for a public sector educational establishment.
+*  You charge money for access to the material you make with Hot Potatoes.
+*  You restrict access to the material in some way. (The only exception here is if you have an account on www.hotpot.net, where you ARE allowed to use password restrictions.)
 *  You want to use the Masher program included with the Hot Potatoes suite.
 
 For more information on licences, and details on how to purchase one, check out our Website at:
index 589f1fd5ba1e8243168d1e47f31ba7453c405e30..2dbfdacc3ea1f4d9e352cdac820ec304b9c6036f 100644 (file)
             }
         }
 
-        // redirect to the next quiz or the course page 
+        // redirect to the next quiz or the course page
         redirect($next_url, get_string('resultssaved', 'hotpot'));
     }
 
@@ -459,7 +459,7 @@ function hotpot_set_attempt_details(&$attempt) {
         }
 
         // remove "correct" and "wrong" values from "ignored" values
-        $response->ignored = array_diff($response->ignored, 
+        $response->ignored = array_diff($response->ignored,
             $response->correct, $response->wrong, $oldresponse->correct, $oldresponse->wrong
         );
 
@@ -577,4 +577,4 @@ function hotpot_set_attempt_details(&$attempt) {
 //  $attempt->status = HOTPOT_STATUS_INPROGRESS;
 }
 
-?>
+
index d3d9a8af8b9ebd403b69c279b180aa805cced1b6..9cb54ebb4afbc9bdafeb45283658e5ed49330671 100644 (file)
@@ -1,4 +1,4 @@
-<?PHP //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //quiz mods
     //-----------------------------------------------------------
         $search = "/($base)([a-z]+).php\?([a-z]+)\=([0-9]+)/";
         return preg_replace($search, '$@HOTPOT*$2*$3*$4@$', $content);
     }
-?>
+
index a3983164d25c618ce566f2b060de6d013049adcc..5807d58736d1f6a7db8e9688baad5d1e2e1528d7 100644 (file)
@@ -79,4 +79,4 @@ $mod_hotpot_capabilities = array(
 
 );
 
-?>
+
index 71ecc02da8522642cfcd75ec1177d23671667129..17742a471613c179f9a52e5b6eae155b4e36293b 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file replaces:
 //   * STATEMENTS section in db/install.xml
@@ -12,6 +12,6 @@ function xmldb_hotpot_install() {
     $DB->set_field('modules', 'visible', 0, array('name'=>'hotpot'));
 
 /// Install logging support here
-    
+
 
 }
index 1fdd36f5cda4b50153476a943ecbd5d00c090e3a..1b92ac59f2e446bf67b68960aa63952d3cea1bab 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file keeps track of upgrades to the hotpot module
 //
@@ -30,4 +30,4 @@ function xmldb_hotpot_upgrade($oldversion) {
     return $result;
 }
 
-?>
+
index 5863989b4e31d952cb36302775d36ffdfb90b983..0517955c9a9998c2c557b9a81427fc9cef1464ad 100644 (file)
@@ -26,4 +26,4 @@
         redirect('view.php?id='.$cm->id);
     }
 
-?>
+
index bb66e65fd5d39159328b0021ce58476281ba0142..ba88dc2f2be27ec511c1f68b92d9dfd4a41da9ec 100644 (file)
@@ -1,27 +1,27 @@
 <!--
-// PLEASE NOTE that this version is more recent than the incorrectly 
-// numbered v6.1, dated 2003.11.17. From now on, version numbers will 
+// PLEASE NOTE that this version is more recent than the incorrectly
+// numbered v6.1, dated 2003.11.17. From now on, version numbers will
 // follow those of Hot Potatoes.
 /* hot-potatoes.js (v6.0.4.0 - 2005.02.18)
  * =======================================
  * by Gordon Bateson, February 2003
  * Copyright (c) 2003 Gordon Bateson. All Rights Reserved.
  *
- * You are hereby granted a royalty free license to use or modify this 
- * software provided that this copyright notice appears on all copies. 
+ * You are hereby granted a royalty free license to use or modify this
+ * software provided that this copyright notice appears on all copies.
  *
  * This software is provided "AS IS" without a warranty of any kind.
- * 
- * Documentation and downloads may be available from: 
+ *
+ * Documentation and downloads may be available from:
  * http://www.kanazawa-gu.ac.jp/~gordon/research/hot-potatoes/
  */
-// This JavaScript library modifies the SendResults and StartUp functions 
+// This JavaScript library modifies the SendResults and StartUp functions
 // used by hotpot v5 and v6, so that more (or less!) details about the
-// student can be input, and more details of a quiz's questions and answers 
+// student can be input, and more details of a quiz's questions and answers
 // can be submitted to the server when the quiz is finished
-// If the arrays below (Login, DB, JBC, ...) are set BEFORE calling this 
-// script, they will NOT be overwritten. Any array that is not set, will 
-// use the defaults below. This is useful if you want to use different 
+// If the arrays below (Login, DB, JBC, ...) are set BEFORE calling this
+// script, they will NOT be overwritten. Any array that is not set, will
+// use the defaults below. This is useful if you want to use different
 // settings for different quizzes.
 // ************
 //  Login Screen
@@ -29,7 +29,7 @@
 if (window.Login==null) {
        Login = new Array();
        Login[0] = true;        // Show prompt for user name
-                               // This can also be a string of user names ... 
+                               // This can also be a string of user names ...
                                // Login[0] = "Guest,Peter,Paul,Mary,Webmaster";
                                // or an array of user names (and on-screen texts) (and passwords) ...
                                // Login[0] = new Array("Guest", "001,Peter,xxxx", "002,Paul,yyyy", "003,Mary,zzzz", "Webmaster");
@@ -42,21 +42,21 @@ if (window.Login==null) {
                                //      new Array("Webmaster")
                                // );
        Login[1] = true;        // Show prompt for student's UserID
-                               // If there is no password prompt (i.e. Logon[3] is false), this value 
+                               // If there is no password prompt (i.e. Logon[3] is false), this value
                                // will be checked against the password information, if any, in Login[0]
        Login[2] = false;       // Show prompt for student's email
-       Login[3] = false;       // Show prompt for quiz password, and check this value against 
+       Login[3] = false;       // Show prompt for quiz password, and check this value against
                                // the password information, if any, in Login[0]
                                // This can also be a string required to start the quiz ...
                                // Login[3] = "password";
        Login[4] = true;        // Show prompt for the cookie expiry date
                                // If false, cookies expire at the end of the current session
        Login[5] = "guest,webmaster"
-                               // guest user names (case insensitive) ...  
-                               // Login[5] = "guest,webmaster"; 
+                               // guest user names (case insensitive) ...
+                               // Login[5] = "guest,webmaster";
                                // These users do NOT need to fill in other login fields
                                // and their quiz results are NOT added to the database
-       // the Login prompts and error messages 
+       // the Login prompts and error messages
        // are defined in the MSG array (see below)
 }
 // *********
@@ -65,25 +65,25 @@ if (window.Login==null) {
 if (window.DB==null) {
        DB = new Array();
        DB[0] = true; // append form fields to database on server
-                       // If you are NOT using BFormMail's database feature, 
+                       // If you are NOT using BFormMail's database feature,
                        // set DB[0]=false, and you can then safely ignore DB[1 to 5]
-       DB[1] = "/home/gordon/public_html/cgi/hot-potatoes-data"; 
+       DB[1] = "/home/gordon/public_html/cgi/hot-potatoes-data";
                        // append_db folder path (no trailing slash)
                        // Can be either an absolute path  e.g. "/home/gordon/public_html/cgi/hot-potatoes-data"
                        // or a relative (to CGI bin) path  e.g. "hot-potatoes-data"
-       DB[2] = "hot-potatoes"; 
+       DB[2] = "hot-potatoes";
                        // append_db file name (no extension)
                        // If left blank, the quiz file name, without extension, will be used
                        // i.e. each quiz will have its results stored in a different file.
                        // If filled in, this file will store the results for ALL quizzes.
-                       // Database files and folders must be set up BEFORE running the quiz 
+                       // Database files and folders must be set up BEFORE running the quiz
                        // must have appropriate access privileges (on Unix, use "chmod 666").
        DB[3] = ""; // append_db extension (if left blank, ".txt" will be used)
        DB[4] = ""; // db_fields (if left blank, ALL quiz fields will be sent)
        DB[5] = ""; // db_delimiter (if left blank, tab will be used)
-       DB[6] = "REMOTE_ADDR,HTTP_USER_AGENT"; 
+       DB[6] = "REMOTE_ADDR,HTTP_USER_AGENT";
                        // env_report ('REMOTE_ADDR','HTTP_USER_AGENT' and a few others)
-       // for a complete description of these fields are, see ... 
+       // for a complete description of these fields are, see ...
        // http://www.infosheet.com/stuff/BFormMail.readme
        // Switches DB[7] and DB[8] force the settings in the ResultForm
        // In v5 and v6 quizzes, these settings wil be override those in the original quiz
@@ -94,7 +94,7 @@ if (window.DB==null) {
        DB[8] = '';     // email address to which results should be sent
                        // e.g. gordon@kanazawa-gu.ac.jp
 }
-// By default the quiz's question's scores will be returned. 
+// By default the quiz's question's scores will be returned.
 // If you want more detailed information, set the flags below:
 // ********
 //  JBC
@@ -162,16 +162,16 @@ if (window.JCloze==null) {
 //     [0] : (unused)
 //     [1] : array of JCLOZE_ANSWER_TEXTs
 //     [2] : clue for this answer
-// JCLOZE_ANSWER_TEXT : 
+// JCLOZE_ANSWER_TEXT :
 //     [0] : array (seems unnecessary, just the text would be enough?)
 //             [0] : text of possible answer
 // State : array of JCLOZE_ANSWER_STATEs
-// JCLOZE_ANSWER_STATE (v5) : 
+// JCLOZE_ANSWER_STATE (v5) :
 //     [0] : clue asked for or not
 //     [1] : number of hints (show next letter) and penalties ('check' an incorrect answer)
 //     [2] : length of answer matched
 //     [3] : score for this item
-//     [4] : already answered correctly 
+//     [4] : already answered correctly
 //     [5] : answer entered in text box (right or not)
 // JCLOZE_ANSWER_STATE (v6)
 //     this.ClueGiven = false;
@@ -196,16 +196,16 @@ if (window.JCross==null) {
        JCross[8] = true;       // show number of checks
        // there are no "ignored" answers for JCross quizzes
 }
-// JCross quizzes use the following global variables: 
+// JCross quizzes use the following global variables:
 //     L : letters (of correct answers)
 //     C : clue numbers (CL in v6)
 //     G : guesses
 // 'L', 'C' ('CL') and 'G' are all 2-dimensional arrays (rows x cols)
 //
 // v5 quizzes additionally use the following single-dimension arrays
-//     A : clues for across (horizontal) words 
-//     D : clues for down (vertical) words 
-// N.B. form is only sent when all answers are correct so 
+//     A : clues for across (horizontal) words
+//     D : clues for down (vertical) words
+// N.B. form is only sent when all answers are correct so
 // you can't find out what 'wrong' answers were entered
 // ********
 //  JMatch
@@ -251,7 +251,7 @@ if (window.JMatch==null) {
 //     [0] : text
 //     [1] : tag of the F item to which it SHOULD be dragged
 //     [2] : tag of the F item to which it was dragged (initally 0)
-// N.B. form is only sent when all answers are correct so 
+// N.B. form is only sent when all answers are correct so
 // you can't find out what 'wrong' answers were entered
 // ********
 //  JMix
@@ -266,8 +266,8 @@ if (window.JMix==null) {
        JMix[5] = true;         // show number of checks
        JMix[6] = true;         // show number of hints (=show next word)
 }
-// JMix quizzes use the global variables 
-// 'Segments', 'GuessSequence' and 'Penalties' 
+// JMix quizzes use the global variables
+// 'Segments', 'GuessSequence' and 'Penalties'
 // Segments : array of JMix_QUESTIONs
 // JMix_QUESTION:
 //     [0] : text
@@ -305,7 +305,7 @@ if (window.JQuiz==null) {
 //     [0] : array (seems unnecessary, just the text would be enough?)
 //             [0] : text of possible answer
 // Status : array of JQUIZ_ANSWER_STATEs
-// JQUIZ_ANSWER_STATE : 
+// JQUIZ_ANSWER_STATE :
 //     [0] : question done or not
 //     [1] : number of wrong checks
 //     [2] : number of hints asked for
@@ -324,23 +324,23 @@ if (window.JQuiz==null) {
 //     [1] : feedback text
 //     [2] : correct answer flag (1=a correct answer, 0=a wrong answer)
 //     [3] : weighted score (as percentage) if correct
-//     [4] : flag (usually set to 1, but for hybrid answers that are not 
+//     [4] : flag (usually set to 1, but for hybrid answers that are not
 //             to be included in multiple choice options, it is set to 0)
 // State : array of JQUIZ_QUESTION_STATEs
-// JQUIZ_QUESTION_STATE : 
+// JQUIZ_QUESTION_STATE :
 //     [0] : score (-1 shows not done yet)
 //     [1] : array showing on which number try each JQUIZ_ANSWER was selected
 //     [2] : number of attempts at this question
 //     [3] : total of weighted scores of correct answers that were selected
-//             i.e. each time a correct answer is selected, 
+//             i.e. each time a correct answer is selected,
 //             its JQUIZ_ANSWER[3] weighting is added to this total
 //             so when all the correct answers have been selected, this will be 100
 //     [4] : penalties incurred for hints (score is set to zero if >= 1)
 //     [5] :   - for multiple choice, short-answer and hybrid questions, this is a
 //             comma-delimited list showing order in which answers were chosen
-//             - for multi-select fields, this is bar-delimted ('|') list of settings 
-//             showing whether each checkbox was selected ('Y') on not ('N') when the 
-//             'Check' button was clicked. The final item in the list will be the 
+//             - for multi-select fields, this is bar-delimted ('|') list of settings
+//             showing whether each checkbox was selected ('Y') on not ('N') when the
+//             'Check' button was clicked. The final item in the list will be the
 //             settings for the correct answer.
 // N.B. JBC, JMatch(v5) and JQuiz(v5) all use global variables 'I' and 'Status'
 //     JBC : I[0].length==3 && !window.RItems
@@ -624,7 +624,7 @@ function checkOK(w, n){
 function getValue(w, n, flag) {
        var obj = w.document.forms[0].elements[n];
        var TYPE = obj.type.toUpperCase(); // required for ns4 (win)
-       if (obj.options && TYPE.indexOf('SELECT')>=0){ 
+       if (obj.options && TYPE.indexOf('SELECT')>=0){
                var v = obj.options[obj.selectedIndex].value;
        } else {
                var v = obj.value;
@@ -634,7 +634,7 @@ function getValue(w, n, flag) {
                if (n=='Password' || (n=='UserID' && !Login[3])) {
                        var pwd = getPassword(w);
                        if (pwd && v!=pwd) msg = MSG[n=='Password' ? 13 : 14];
-               } 
+               }
                if (n=='UserEmail' && window.RegExp) {
                        var r = '(\\w|-)+';
                        r = r + '(\\.' + r + ')';
@@ -784,7 +784,7 @@ function SendAllResults(Score) {
                        // if this is a Netscape browser, check if the referer will be set OK
                        if (navigator.appName=='Netscape' && (location.protocol=='file:' || navigator.userAgent.indexOf('Netscape6')>=0)) {
                                // ns4 and ns7 set referer to 'file:// ...' when running a quiz offline
-                               // ns6.2 (at least) always sets referer to 'about:blank' 
+                               // ns6.2 (at least) always sets referer to 'about:blank'
                                // Netscape's setting of referer can cause BFormMail
                                // to reject the form, so encode the form data as a URL
                                var url = form.action;
@@ -931,11 +931,11 @@ function GetQuestionDetails() {
        var hp = hpVersion();
        var t = hpQuizType();
        var v = hpQuizVersion();
-       return  (t==1) ? GetJbcQuestionDetails(hp, v) : 
-               (t==2) ? GetJClozeQuestionDetails(hp, v) : 
-               (t==3) ? GetJCrossQuestionDetails(hp, v) : 
-               (t==4) ? GetJMatchQuestionDetails(hp, v) : 
-               (t==5) ? GetJMixQuestionDetails(hp, v) : 
+       return  (t==1) ? GetJbcQuestionDetails(hp, v) :
+               (t==2) ? GetJClozeQuestionDetails(hp, v) :
+               (t==3) ? GetJCrossQuestionDetails(hp, v) :
+               (t==4) ? GetJMatchQuestionDetails(hp, v) :
+               (t==5) ? GetJMixQuestionDetails(hp, v) :
                (t==6) ? GetJQuizQuestionDetails(hp, v) :
                (t==7) ? GetRhubarbDetails(hp, v) :
                (t==8) ? GetSequiturDetails(hp, v) : '';
@@ -944,7 +944,7 @@ function GetJbcQuestionDetails(hp, v) {
        qDetails = '';
        // check the quiz version
        if (hp==5 || hp==6) {
-               // get question details 
+               // get question details
                for(var q=0; q<I.length; q++) {
                        // initialize strings to hold answer details
                        var aDetails = new Array();
@@ -953,7 +953,7 @@ function GetJbcQuestionDetails(hp, v) {
                        aDetails[2] = new Array(); // ignored
                        // get answer details
                        for(var a=0; a<I[q][1].length; a++) {
-                               var i = (Status[q][1][a]=='R') ? 0 : (Status[q][1][a]=='0') ? 2 : 1; 
+                               var i = (Status[q][1][a]=='R') ? 0 : (Status[q][1][a]=='0') ? 2 : 1;
                                aDetails[i][aDetails[i].length] = (JBC[6] ? a : I[q][1][a][0]);
                        }
                        // format 'Q' (a padded, two-digit version of 'q')
@@ -1076,7 +1076,7 @@ function GetJCrossQuestionDetails(hp, v) {
                for (var row=0; row<L.length; row++) {
                        for (var col=0; col<L[row].length; col++) {
                                // increment letter count, if required
-                               if (L[row][col]) letters++; 
+                               if (L[row][col]) letters++;
                                // show answers and clues, if required
                                var q = (hp==5) ? C[row][col] : CL[row][col];
                                if (q) {
@@ -1384,7 +1384,7 @@ function GetJQuizAnswerDetails(q, flag) {
                        }
                        x[i] = a.join('+');
                }
-       } else if (x) { // multiple-choice, short-answer and hybrid 
+       } else if (x) { // multiple-choice, short-answer and hybrid
         if (x.charAt(x.length-1)==',') {
             // HP 6.0 and 6.1 (always has trailing comma)
             x = x.substring(0, x.length-1).split(',');
@@ -1577,7 +1577,7 @@ function hpClickCheck(hp, t, v, args) {
                                        if (window.MakeIndividualDropdowns) {
                                 var is_wrong = (ii!=0);
                                 g = I[i][1][ii][0];
-                            } else { 
+                            } else {
                                 var is_wrong = (ii!=i);
                                 g = I[ii][1][0][0];
                             }
@@ -1592,11 +1592,11 @@ function hpClickCheck(hp, t, v, args) {
                                        if (!HP[_guesses][i]) HP[_guesses][i] = new Array();
                                        var ii = HP[_guesses][i].length;
                                        // is this a new guess at this gap?
-                                       if (ii==0 || g!=HP[_guesses][i][ii-1]) { 
+                                       if (ii==0 || g!=HP[_guesses][i][ii-1]) {
                                                HP[_guesses][i][ii] = g;
                         if (r==1) {
                             // Rottmeier DropDown 2.4
-                            // do nothing 
+                            // do nothing
                         } else {
                                                var G = g.toUpperCase();        
                                                var ii_max = I[i][1].length;
@@ -1944,7 +1944,7 @@ function hpHiddenField(name, value, comma, forceHTML) {
                var values = value;
                var i_max = values.length;
                value = '';
-               if (comma==null) comma = ','; 
+               if (comma==null) comma = ',';
                for (var i=0; i<i_max; i++) {
                        values[i] = trim(values[i]);
                        if (values[i]!=null && values[i]!='') {
@@ -1999,8 +1999,8 @@ function getTime(obj) {
        // get year, month and day
        //      for an LMS : yyyy-mm-dd
        //      for email  : DayName MonthName dd yyyy
-       var s = is_LMS() ? 
-               obj.getFullYear() + '-' + pad(obj.getMonth()+1, 2) + '-' + pad(obj.getDate(), 2) : 
+       var s = is_LMS() ?
+               obj.getFullYear() + '-' + pad(obj.getMonth()+1, 2) + '-' + pad(obj.getDate(), 2) :
                MSG[16][obj.getDay()] + ' ' + MSG[17][obj.getMonth()] + ' ' + pad(obj.getDate(), 2) + ' ' + obj.getFullYear()
        ;
        // get hours, minutes and seconds (hh:mm:ss)
@@ -2093,7 +2093,7 @@ function getPrompt(fn) {
        // Note: netscape uses double-quote as delimiter, others use single quote
        var s = getFuncCode(fn);
        var i1 = s.indexOf('prompt') + 8;
-       var i2 = s.indexOf(s.charAt(i1-1), i1); 
+       var i2 = s.indexOf(s.charAt(i1-1), i1);
        var p = (i1>=8 && i2>i1) ? s.substring(i1, i2) : '';
        // make sure browser has decoded the unicode prompt properly
        // this check is mainly for ns4, but there may be others
@@ -2109,13 +2109,13 @@ function getPrompt(fn) {
 }
 function getStartUpCode(fn) {
        // the main initialization code comes from the StartUp function
-       //      v5 : the code before "UserName", if any, 
+       //      v5 : the code before "UserName", if any,
        //           and the code after the 2nd subsequent '}'
-       //      v6 : the code before and after 'GetUserName();' 
+       //      v6 : the code before and after 'GetUserName();'
        //           i.e. all the code except the call to 'GetUserName();'
        var s = getFuncCode(fn);
        var i1 = s.indexOf('GetUserName();');
-       if (i1>=0) { // v6 
+       if (i1>=0) { // v6
                var i2 = i1 + 14;
        } else { // v5
                var i1 = s.indexOf('UserName');
@@ -2317,7 +2317,7 @@ function hpInterceptHints() {
                if (a[0]=='ShowHint') {
                        if (a[1]=='QNum') {
                                // JQuiz v3, v5-v6[HP5]
-                               x = 'if(ShowHint)hpClick(1,QNum);'; 
+                               x = 'if(ShowHint)hpClick(1,QNum);';
                        } else {
                                // JQuiz v4
                                x = 'if(ShowHint)hpClick(1,QNum-1);'; // QNum is a global variable
@@ -2397,7 +2397,7 @@ function hpInterceptChecks() {
        //      JCross  none
        //      JMatch  HP5 v3, v5, v6: CheckAnswer(), HP5 v4: CheckResults(), HP6: CheckAnswers()
        //      JMix    CheckAnswer(CheckType)
-       //      JQuiz 
+       //      JQuiz
        //              HP5: CheckAnswer(ShowHint, QNum)
        //              HP6: CheckMCAnswer, CheckMultiSelAnswer, CheckShortAnswer
        //      Rhubarb  CheckWord(InputWord)
@@ -2440,7 +2440,7 @@ function hpInterceptChecks() {
                if (a[0]=='ShowHint') {
                        if (a[1]=='QNum') {
                                // JQuiz v3, v5-v6[HP5]
-                               x = 'if(!ShowHint&&Status[QNum][0]<1)hpClick(3,QNum);'; 
+                               x = 'if(!ShowHint&&Status[QNum][0]<1)hpClick(3,QNum);';
                        } else {
                                // JQuiz v4
                                x = 'if(!ShowHint&&State[QNum-1][0]<1)hpClick(3,QNum-1);'; // QNum is a global variable
@@ -2452,7 +2452,7 @@ function hpInterceptChecks() {
                        // Sequitur
                        x = 'if (!(CurrentNumber==TotalSegments||AllDone||Btn.innerHTML==IncorrectIndicator))hpClick(3,Chosen);';
                }
-       } else if (window.CheckWord) { 
+       } else if (window.CheckWord) {
                f = 'CheckWord';
                var a = getFuncArgs(f, true);
                if (a[0]=='InputWord') {
@@ -2492,7 +2492,7 @@ if (Array.prototype && Array.prototype.push==null) {
        Array.prototype.push = new Function("x", "this[this.length]=x");
 }
 // add attachEvent function, if required (allows HP5 v6 quizzes to run on ie5mac)
-//     NOTE: to allow v6 quizzes on ie5mac, the following code 
+//     NOTE: to allow v6 quizzes on ie5mac, the following code
 //     needs to be inserted BEFORE the Hot Potatoes javascript
 if (window.attachEvent==null) {
        window.attachEvent = new Function('evt', 'fn', 'eval("window."+evt+"="+fn)');
@@ -2534,7 +2534,7 @@ if (navigator.userAgent.indexOf("Netscape6")>=0 && window.ShowMessage) {
 // JBC uses "QForm" form, which contains elements called "FB_*_**" (* and ** start at 0)
 // JCloze uses "Cloze" form
 // JCross writes out "AnswerForm" from a variable called "GetAnswerOpener"
-//     HP5.3: uses "AnswerForm" in "BottomFrame" 
+//     HP5.3: uses "AnswerForm" in "BottomFrame"
 //     HP5.5: uses "AnswerForm" in "TopFrame", but it is only there when an answer is being input
 // JMatch uses "QForm" form, which contains elements called "sel*" (which disappear by the time the quiz is finished)
 // JMix uses "ButtonForm"
@@ -2542,14 +2542,14 @@ if (navigator.userAgent.indexOf("Netscape6")>=0 && window.ShowMessage) {
 // === v6 ===
 // JBC uses "QForm" form (elements have no name or id)
 // JCloze uses "Cloze" form (elements have no name or id)
-// JCross does not use any forms, 
+// JCross does not use any forms,
 //     HP5: has "GridDiv" in "MainDiv"
 //     HP6: has "Clues" table in "MainDiv"
 // JMatch has "MatchDiv" in "MainDiv"
 //     HP5: uses "QForm" form, which contains elements called "sel*"
 //     HP6: uses "QForm" form, which contains elements called "s*_**"
 // JMix does not use any forms, but has "SegmentDiv" in "MainDiv"
-// JQuiz 
+// JQuiz
 //     HP5: uses "QForm" form, which contains an element called "Guess"
 //     HP6: has "Questions" ordered list in "MainDiv"
 // === v6+ ===
@@ -2833,7 +2833,7 @@ function hpTimedOut() {
 }
 function hpFinished() {
        // assume false result
-       var x = false; 
+       var x = false;
        var hp = hpVersion();
        var t = hpQuizType();
        var v = hpQuizVersion();
@@ -2971,7 +2971,7 @@ function Finish(quizstatus) {
        }
 }
 // create form to send results
-if (DB[7] && DB[8] && !is_LMS()) { 
+if (DB[7] && DB[8] && !is_LMS()) {
        ResultForm = ''
                + '<html><body>'
                + '<form name="Results" action="" method="post" enctype="x-www-form-encoded">'
index ddfcfb73e265687a69d8ddc6d289e6c19f3f537f..8e6ed88cd2f2ae3ec63d09981a63b243d0ba87e8 100644 (file)
@@ -63,7 +63,7 @@
                 // do nothing (user is not diplaying this section)
             } else {
                 $hotpots[$hotpot_instance->id] = $hotpot_instance;
-            } 
+            }
         }
     }
     if (empty($hotpots)) {
         if ($concat_field) {
             $records = $DB->get_records_sql("
                 SELECT $concat_field, COUNT(*), hotpot, name
-                FROM {hotpot_questions} 
+                FROM {hotpot_questions}
                 WHERE hotpot IN ($hotpotids)
-                GROUP BY hotpot, name 
+                GROUP BY hotpot, name
                 HAVING COUNT(*) >1
             ");
             if ($records) {
     }
 
     switch ($course->format) {
-        case 'weeks' : 
+        case 'weeks' :
             $title = get_string("week");
             break;
-        case 'topics' : 
+        case 'topics' :
             $title = get_string("topic");
             break;
-        default : 
+        default :
             $title = '';
             break;
     }
     if ($title) {
-        array_push($table->head, $title); 
+        array_push($table->head, $title);
         array_push($table->align, "center");
     }
     if (has_capability('moodle/course:manageactivities', $coursecontext)) {
         array_push($table->head, $strupdate);
         array_push($table->align, "center");
     }
-    array_push($table->head, 
-        get_string("name"), 
-        get_string("quizcloses", "quiz"), 
-        get_string("bestgrade", "quiz"), 
+    array_push($table->head,
+        get_string("name"),
+        get_string("quizcloses", "quiz"),
+        get_string("bestgrade", "quiz"),
         get_string("attempts", "quiz")
     );
-    array_push($table->align, 
+    array_push($table->align,
         "left", "left", "center", "left"
     );
     if (has_capability('mod/hotpot:grade', $coursecontext)) {
             $bestscore = "&nbsp;";
 
         } else {
-          
+
             $cm = get_coursemodule_from_instance('hotpot', $hotpot->id);
             // report number of attempts and users
             $report = get_string("viewallreports","quiz", $totals[$hotpot->id]->attemptcount);
 
     // Finish the page
     echo $OUTPUT->footer();
-?>
+
index 53316c7ec56b0deb69e8f3f38f1e1bd7f8e0deb7..0561d802d8fbdfca5f6f629ea1296fd2fcdb5851 100644 (file)
@@ -282,11 +282,11 @@ function hotpot_update_events($hotpot) {
         $event->timeduration = ($hotpot->timeclose - $hotpot->timeopen);
 
         if ($event->timeduration > HOTPOT_MAX_EVENT_LENGTH) {  /// Long durations create two events
-    
+
             $event->name          = $hotpot->name.' ('.get_string('hotpotopens', 'hotpot').')';
             $event->timeduration  = 0;
             add_event($event);
-    
+
             $event->timestart    = $hotpot->timeclose;
             $event->eventtype    = 'close';
             $event->name         = $hotpot->name.' ('.get_string('hotpotcloses', 'hotpot').')';
@@ -866,7 +866,7 @@ function hotpot_get_all_instances_in_course($modulename, $course) {
     if ($rawmods = $DB->get_records_sql($query, $params)) {
 
         // cache $isteacher setting
-        
+
         $isteacher = has_capability('mod/hotpot:viewreport', get_context_instance(CONTEXT_COURSE, $course->id));
 
         $explodesection = array();
@@ -1137,7 +1137,7 @@ function hotpot_print_recent_activity($course, $isteacher, $timestart) {
         foreach ($records as $id => $record){
             if ($cm = get_coursemodule_from_instance('hotpot', $record->id, $course->id)) {
                 $context = get_context_instance(CONTEXT_MODULE, $cm->id);
-                
+
                 if (has_capability('mod/hotpot:viewreport', $context)) {
                     $href = "$CFG->wwwroot/mod/hotpot/view.php?hp=$id";
                     $name = '&nbsp;<a href="'.$href.'">'.$record->name.'</a>';
@@ -1549,7 +1549,7 @@ function hotpot_get_participants($hotpotid) {
  * it it has support for grading and scales. Commented code should be
  * modified if necessary. See forum, glossary or journal modules
  * as reference.
- * 
+ *
  * @param int $hotpotid
  * @param int $scaleid
  * @return bool
@@ -1609,7 +1609,7 @@ function hotpot_add_attempt($hotpotid) {
             $attempt->status = HOTPOT_STATUS_ABANDONED;
             $DB->update_record('hotpot_attempts', $attempt);
         }
-    }    
+    }
 
     // create and add new attempt record
     $attempt = new stdClass();
@@ -2750,7 +2750,7 @@ function hotpot_string_ids($field_value) {
 /**
  * @global object
  * @param string $str
- * @return int|string 
+ * @return int|string
  */
 function hotpot_string_id($str) {
     global $DB;
@@ -2968,7 +2968,7 @@ function hotpot_reset_userdata($data) {
 
 /**
  * Called by course/reset.php
- * 
+ *
  * @param $mform form passed by reference
  */
 function hotpot_reset_course_form_definition(&$mform) {
index c10ecd64595ed9e63411295dedcf907d11a4cc4f..0f895c56437dd87dee0bed0cdd6057c0467934d4 100644 (file)
@@ -1,13 +1,13 @@
-<?php // $id$
+<?php
 //////////////////////////////////////////////////////////////
 //  Media plugin filtering
-// 
-//  This filter will replace any links to a media file with 
+//
+//  This filter will replace any links to a media file with
 //  a media plugin that plays that media inline
 //
 //////////////////////////////////////////////////////////////
 
-/// This is the filtering function itself.  It accepts the 
+/// This is the filtering function itself.  It accepts the
 /// courseid and the text to be filtered (in HTML form).
 
 function hotpot_mediaplayer_moodle(&$hotpot, $text) {
@@ -40,7 +40,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
         $replace .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
         $replace .= '</embed>';
         $replace .= '</object>&nbsp;';
-    
+
         $text = preg_replace($search, $replace, $text);
     }
 
@@ -84,7 +84,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
 
     if ($CFG->filter_mediaplugin_enable_flv) {
         $search = '/<a(.*?)href=\"([^<]+)\.flv\"([^>]*)>(.*?)<\/a>/is';
-            
+
         $replace  = '\\0&nbsp;<object class="mediaplugin flv" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
         $replace .= ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
         $replace .= ' width="480" height="360" id="flvplayer">';
@@ -97,7 +97,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
         $replace .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
         $replace .= '</embed>';
         $replace .= '</object>&nbsp;';
-    
+
         $text = preg_replace($search, $replace, $text);
     }
 
@@ -159,7 +159,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
         $replace .= '<param name="autoplay" value="false" />';
         $replace .= '<embed src="\\2.\\3" width="240" height="180" controller="true" autoplay="false"> </embed>';
         $replace .= '</object></p>';
-        
+
         $text = preg_replace($search, $replace, $text);
     }
 
@@ -172,10 +172,10 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
         $replace .= '<param name="autoplay" value="false" />';
         $replace .= '<embed src="\\2.avi" width="240" height="180" controller="true" autoplay="false"> </embed>';
         $replace .= '</object></p>';
-    
+
         $text = preg_replace($search, $replace, $text);
     }
-    
+
     if ($CFG->filter_mediaplugin_enable_ram) {
         $search = '/<a(.*?)href=\"([^<]+)\.ram\"([^>]*)>(.*?)<\/a>/is';
 
@@ -200,7 +200,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
 
         $text = preg_replace($search, $replace, $text);
     }
-     
+
     if ($CFG->filter_mediaplugin_enable_rpm) {
         $search = '/<a(.*?)href=\"([^<]+)\.rpm\"([^>]*)>(.*?)<\/a>/is';
 
@@ -225,7 +225,7 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
 
         $text = preg_replace($search, $replace, $text);
     }
-    
+
     if ($CFG->filter_mediaplugin_enable_rm) {
         $search = '/<a(.*?)href=\"([^<]+)\.rm\"([^>]*)>(.*?)<\/a>/is';
 
@@ -253,4 +253,3 @@ function hotpot_mediaplayer_moodle(&$hotpot, $text) {
 
     return $text;
 }
-?>
\ No newline at end of file
index ce62d010c7bf7c7d3f61404fe15249af61091340..d19319065e2eb8aabbe0a4a2d17efd3a83bd43ef 100644 (file)
@@ -327,4 +327,3 @@ class mod_hotpot_mod_form extends moodleform_mod {
         return $errors;
     }
 }
-?>
\ No newline at end of file
index d9b20e073402953f8159844de131fb03a0c54744..f607febbcab5bb0225973083e24df1e7f754704d 100644 (file)
@@ -1,4 +1,4 @@
-<?PHP  // $Id$
+<?php
 
 // This script uses installed report plugins to print quiz reports
 
@@ -15,7 +15,7 @@
         }
         if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
             print_error('coursemisconf');
-        }    
+        }
         if (! $hotpot = $DB->get_record("hotpot", array("id"=>$cm->instance))) {
             print_error('invalidhotpotid', 'hotpot');
         }
     $fields = 'a.*, u.firstname, u.lastname, u.picture';
     if ($mode=='click') {
         $fields .= ', u.idnumber';
-    } else { 
-        // overview, simple and detailed reports 
+    } else {
+        // overview, simple and detailed reports
         // get last attempt record in clickreport series
         $ids = array();
         foreach ($cr_attempts as $cr_attempt) {
@@ -394,7 +394,7 @@ function hotpot_delete_selected_attempts(&$hotpot, $del) {
             }
             if (count($ids)) {
                 list($ids, $idparams) = $DB->get_in_or_equal($ids, SQL_PARAMS_NAMED, 'crid0');
-                $params = array_merge($params, $idparams); 
+                $params = array_merge($params, $idparams);
                 $select = "hotpot=:hotpotid AND clickreportid $ids";
             }
             break;
@@ -421,14 +421,14 @@ function hotpot_delete_selected_attempts(&$hotpot, $del) {
 }
 
 //////////////////////////////////////////////
-/// functions to print the report headings and 
+/// functions to print the report headings and
 /// report selector menus
 
 function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
     global $OUTPUT;
     $strmodulenameplural = get_string("modulenameplural", "hotpot");
     $strmodulename  = get_string("modulename", "hotpot");
-    
+
     $modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id);
     if (has_capability('mod/hotpot:viewreport',$modulecontext)) {
         if ($mode=='overview' || $mode=='simplestat' || $mode=='fullstat') {
@@ -446,10 +446,10 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
     $PAGE->set_heading($course->fullname);
     $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'hotpot'));
     echo $OUTPUT->header();
-    
+
     $course_context = get_context_instance(CONTEXT_COURSE, $course->id);
     if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
-        echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">' 
+        echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">'
             . get_string('seeallcoursegrades', 'grades') . '</a></div>';
     }
     echo $OUTPUT->heading($hotpot->name);
@@ -492,9 +492,9 @@ function hotpot_print_report_selector(&$course, &$hotpot, &$formdata) {
 
     // get users who have ever atetmpted this HotPot
     $users = $DB->get_records_sql("
-        SELECT 
+        SELECT
             u.id, u.firstname, u.lastname
-        FROM 
+        FROM
             {user} u,
             {hotpot_attempts} ha
         WHERE
@@ -665,4 +665,4 @@ function hotpot_get_users_by_capability(&$modulecontext, $capability) {
     }
     return $users[$capability];
 }
-?>
+
index f5fa08f3dd44ae9cb7f98808255c28a205d6b6b9..33e13202b890844d571d43fada0805d2d2de992c 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 /// Overview report just displays a big table of all the attempts
 class hotpot_report extends hotpot_default_report {
        function display(&$hotpot, &$cm, &$course, &$users, &$attempts, &$questions, &$options) {
@@ -338,7 +338,7 @@ class hotpot_report extends hotpot_default_report {
                                if (!function_exists('clean_getstring_data')) { // Moodle 1.4 (and less)
                                        $reportpercentscore = str_replace('%', '%%', $reportpercentscore);
                                }
-                               array_push($table->head, 
+                               array_push($table->head,
                                        get_string('reportthisclick', 'hotpot', get_string('reportquestionstried', 'hotpot')),
                                        get_string('reportsofar', 'hotpot', get_string('reportquestionstried', 'hotpot')),
                                        get_string('reportthisclick', 'hotpot', get_string('reportright', 'hotpot')),
@@ -426,7 +426,7 @@ class hotpot_report extends hotpot_default_report {
                $records = $DB->get_records_sql_menu("
                        SELECT userid, MIN(time) AS logouttime
                        FROM {log}
-                       WHERE userid=? AND action='logout' AND time>? 
+                       WHERE userid=? AND action='logout' AND time>?
                        GROUP BY userid
                ", array($attempt->userid, $attempt->cr_timefinish));
                if (empty($records)) {
@@ -539,4 +539,4 @@ class hotpot_report extends hotpot_default_report {
                }
        }
 } // end class
-?>
+
index 5b9e3a80c64b94d1d61e1733e56349a89a859430..249de547a74b9cd415da3f34a865fa40e1048652 100644 (file)
@@ -1,15 +1,15 @@
-<?PHP  // $Id$ 
+<?PHP  // $Id$
 
 ////////////////////////////////////////////////////////////////////
 /// Default class for report plugins
-///                                                            
-/// Doesn't do anything on it's own -- it needs to be extended.   
-/// This class displays quiz reports.  Because it is called from 
+///
+/// Doesn't do anything on it's own -- it needs to be extended.
+/// This class displays quiz reports.  Because it is called from
 /// within /mod/quiz/report.php you can assume that the page header
 /// and footer are taken care of.
-/// 
-/// This file can refer to itself as report.php to pass variables 
-/// to itself - all these will also be globally available.  You must 
+///
+/// This file can refer to itself as report.php to pass variables
+/// to itself - all these will also be globally available.  You must
 /// pass "id=$cm->id" or q=$quiz->id", and "mode=reportname".
 ////////////////////////////////////////////////////////////////////
 
@@ -17,7 +17,7 @@
 
 class hotpot_default_report {
 
-    function display($hotpot, $cm, $course, $users, $attempts, $questions, $options) {   
+    function display($hotpot, $cm, $course, $users, $attempts, $questions, $options) {
         /// This function just displays the report
         // it is replaced by the "display" functions in the scripts in the "report" folder
         return true;
@@ -68,7 +68,7 @@ class hotpot_default_report {
 
             // add $value to answers array, if it was not there
             if ($i==$i_max) {
-                $table->legend[$q]['answers'][$i] = $value; 
+                $table->legend[$q]['answers'][$i] = $value;
             }
 
             // convert $value to alphabetic index (A, B ... AA, AB ...)
@@ -98,12 +98,12 @@ class hotpot_default_report {
             foreach($table->legend as $q=>$question) {
 
                 $legend->stat[] = array(
-                    get_string('questionshort', 'hotpot', $q+1), 
+                    get_string('questionshort', 'hotpot', $q+1),
                     $question['name']
                 );
                 foreach($question['answers'] as $a=>$answer) {
                     $legend->stat[] = array(
-                        $this->dec_to_ALPHA($a), 
+                        $this->dec_to_ALPHA($a),
                         $answer
                     );
                 }
@@ -324,7 +324,7 @@ class hotpot_default_report {
 
     function print_report_finish(&$course, &$hotpot, &$options) {
         switch ($options['reportformat']) {
-            case 'txt' : 
+            case 'txt' :
                 // do nothing
                 break;
             case 'xls':
@@ -454,7 +454,7 @@ class hotpot_default_report {
                     $col = 0; // column index
                     while ($col<$table->colspan && isset($cells[$i])) {
                         if (empty($skipcol[$col])) {
-                            $cell = &$cells[$i++]; 
+                            $cell = &$cells[$i++];
                             $td = $table->td[$col];
                             if (is_object($cell)) {
                                 $text = $cell->text;
@@ -551,7 +551,7 @@ class hotpot_default_report {
     }
     function print_text_start(&$course, &$hotpot, &$options) {
         $downloadfilename = clean_filename("$course->shortname $hotpot->name.txt");
-        header("Content-Type: application/download\n"); 
+        header("Content-Type: application/download\n");
         header("Content-Disposition: attachment; filename=$downloadfilename");
         header("Expires: 0");
         header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
@@ -663,7 +663,7 @@ class hotpot_default_report {
             $this->print_excel_stat($wb, $ws, $table, $row, $options);
             $this->print_excel_foot($wb, $ws, $table, $row, $options);
         }
-    
+
         // close the workbook (and send it to the browser)
         $wb->close();
     }
@@ -684,8 +684,8 @@ class hotpot_default_report {
     function print_excel_head(&$wb, &$ws, &$table, &$row, &$options) {
         // define format properties
         $properties = array(
-            'bold'=>1, 
-            'align'=>'center', 
+            'bold'=>1,
+            'align'=>'center',
             'v_align'=>'bottom',
             'text_wrap'=>1
         );
@@ -851,4 +851,4 @@ class hotpot_default_report {
     }
 }
 
-?>
+
index 1945f6c9d938971d2f58f52a350af94f6e1141f5..0b7cbe1cf1e8c386105b23b0eaab516a56430e99 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 /// Overview report just displays a big table of all the attempts
 class hotpot_report extends hotpot_default_report {
        function display(&$hotpot, &$cm, &$course, &$users, &$attempts, &$questions, &$options) {
@@ -39,9 +39,9 @@ class hotpot_report extends hotpot_default_report {
                }
                // headings for name, attempt number, score/grade and penalties
                $table->head = array(
-                       get_string("name"), 
+                       get_string("name"),
                        hotpot_grade_heading($hotpot, $options),
-                       get_string('attempt', 'quiz'), 
+                       get_string('attempt', 'quiz'),
                );
                $table->align = array('left', 'center', 'center');
                $table->size = array(150, 80, 10);
@@ -50,8 +50,8 @@ class hotpot_report extends hotpot_default_report {
                // question headings
                $this->add_question_headings($questions, $table, 'left', 0, false, 2);
                // penalties (not always needed) and raw score
-               array_push($table->head, 
-                       get_string('penalties', 'hotpot'), 
+               array_push($table->head,
+                       get_string('penalties', 'hotpot'),
                        get_string('score', 'quiz')
                );
                array_push($table->align, 'center', 'center');
@@ -82,7 +82,7 @@ class hotpot_report extends hotpot_default_report {
                                }
                                $cells = array ($name, $grade, $attemptnumber);
                                // $name and $grade are only printed on first line per user
-                               $name = $blank; 
+                               $name = $blank;
                                $grade = $blank;
                                $start_col = count($cells);
                                foreach ($questionids as $col => $id) {
@@ -446,4 +446,4 @@ return <<<SHOWHIDE_SET
 SHOWHIDE_SET
 ;
 }
-?>
+
index 73ae4da87a356add83cc3f4ee109712d114dfb43..f69c73072a9fd562f87b282af09ce62f8837740f 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 /// Overview report just displays a big table of all the attempts
 class hotpot_report extends hotpot_default_report {
 
@@ -29,13 +29,13 @@ class hotpot_report extends hotpot_default_report {
                        $table->size[] = 10;
                        $table->wrap[] = "nowrap";
                }
-               array_push($table->head, 
-                       get_string("name"), 
+               array_push($table->head,
+                       get_string("name"),
                        hotpot_grade_heading($hotpot, $options),
-                       get_string("attempt", "quiz"), 
-                       get_string("time", "quiz"), 
-                       get_string("reportstatus", "hotpot"), 
-                       get_string("timetaken", "quiz"), 
+                       get_string("attempt", "quiz"),
+                       get_string("time", "quiz"),
+                       get_string("reportstatus", "hotpot"),
+                       get_string("timetaken", "quiz"),
                        get_string("score", "quiz")
                );
                array_push($table->align, "left", "center", "center", "left", "center", "center", "center");
@@ -96,7 +96,7 @@ class hotpot_report extends hotpot_default_report {
                                if ($is_html && is_numeric($score) && $score==$user->grade) { // best grade
                                        $score = '<span class="highlight">'.$score.'</span>';
                                }
-                               array_push($data, 
+                               array_push($data,
                                        $attemptnumber,
                                        $checkbox.$starttime,
                                        hotpot_format_status($attempt),
@@ -166,4 +166,4 @@ END_OF_JAVASCRIPT
 ;
        } // end function
 } // end class
-?>
+
index 3c17612272ae47508901e52772736b8ef3f4192f..d5a64b1298e8d9203c8dc3bd004ddc18709b5324 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 /// Overview report: displays a big table of all the attempts
 class hotpot_report extends hotpot_default_report {
        function display(&$hotpot, &$cm, &$course, &$users, &$attempts, &$questions, &$options) {
@@ -29,9 +29,9 @@ class hotpot_report extends hotpot_default_report {
                        $table->size[] = 10;
                }
                // name, grade and attempt number
-               array_push($table->head, 
+               array_push($table->head,
                        get_string("name"),
-                       hotpot_grade_heading($hotpot, $options), 
+                       hotpot_grade_heading($hotpot, $options),
                        get_string("attempt", "quiz")
                );
                array_push($table->align, "left", "center", "center");
@@ -39,8 +39,8 @@ class hotpot_report extends hotpot_default_report {
                // question headings
                $this->add_question_headings($questions, $table);
                // penalties and raw score
-               array_push($table->head, 
-                       get_string('penalties', 'hotpot'), 
+               array_push($table->head,
+                       get_string('penalties', 'hotpot'),
                        get_string('score', 'quiz')
                );
                array_push($table->align, "center", "center");
@@ -200,4 +200,4 @@ class hotpot_report extends hotpot_default_report {
                $tables[] = &$table;
        }
 } // end class
-?>
+
index 966082d3306b1b80e29ff217aa6a99c56c2a4233..d472f4420fd7a35c9f29c49504655fc04efa6f65 100644 (file)
@@ -1,17 +1,17 @@
-<?PHP //$Id$
+<?php
 //This php script contains all the stuff to restore hotpot mods
     //-----------------------------------------------------------
     // This is the "graphical" structure of the hotpot mod:
     //-----------------------------------------------------------
     //
     //                         hotpot
-    //                      (CL, pk->id, 
+    //                      (CL, pk->id,
     //                   fk->course, files)
     //                           |
     //            +--------------+---------------+
     //            |                              |
     //      hotpot_attempts             hotpot_questions
-    //       (UL, pk->id,                 (UL, pk->id, 
+    //       (UL, pk->id,                 (UL, pk->id,
     //        fk->hotpot)               fk->hotpot, text)
     //            |                              |    |
     //            +-------------------+----------+    |
@@ -40,7 +40,7 @@ require_once ("$CFG->dirroot/mod/hotpot/lib.php");
 function hotpot_restore_mods($mod, $restore) {
     //This function restores a single hotpot activity
 
-    // This function is called by "restore_create_modules" (in "backup/restorelib.php") 
+    // This function is called by "restore_create_modules" (in "backup/restorelib.php")
     // which is called by "backup/restore_execute.html" (included by "backup/restore.php")
     // $mod is an object
     //     id           : id field in 'modtype' table
@@ -129,7 +129,7 @@ function hotpot_restore_questions(&$restore, $status, &$xml, &$record) {
     // $xml is an XML tree for a hotpot record
     // $record is the newly added hotpot record
     $foreignkeys = array(
-        'hotpot'=>$record->id, 
+        'hotpot'=>$record->id,
         'text'=>'hotpot_strings'
     );
     return hotpot_restore_records(
@@ -242,7 +242,7 @@ function hotpot_restore_records(&$restore, $status, &$xml, $table, $foreign_keys
     // $record_TAG  : (optional) the name of an XML tag which starts a single record
     //    If no $record_TAG is specified, the block of records is assumed to be a single record
     // other parameters are explained in "hotpot_restore_record" below
-    
+
     $i = 0; // index for $records_TAG
     do {
         unset($xml_records);
@@ -289,10 +289,10 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
     // $foreign_keys : array of foreign keys, if any, specifed as $key=>$value
     //    $key   : the name of a field in the current $record
     //    $value : if $value is numeric, then $record->$key is set to $value.
-    //        Otherwise $value is assumed to be a table name and $record->$key 
+    //        Otherwise $value is assumed to be a table name and $record->$key
     //        is treated as a comma separated list of ids in that table
     // $more_restore : optional PHP code to be eval(uated) for each record
-    // $secondary_key : 
+    // $secondary_key :
     //    the name of the secondary key field, if any, in the current $record.
     //    If this field is specified, then the current record will only be added
     //    if the $record->$secondarykey value does not already exist in $table
@@ -302,7 +302,7 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
 
     static $table_columns = array();
     if (empty($table_columns[$table])) {
-        global $CFG, $DB; 
+        global $CFG, $DB;
         $table_columns[$table] = $DB->get_columns($table);
     }
 
@@ -345,7 +345,7 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
                                 }
                                 print "was not restored</li></ul>";
                             }
-                            $ok = false; 
+                            $ok = false;
                         }
                     }
                 }
@@ -405,7 +405,7 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
             if (isset($record->old_id)) {
                 backup_putid($restore->backup_unique_code, $table, $record->old_id, $record->id);
             }
-        } else { 
+        } else {
             // failed to add (or find) $record
             if (!defined('RESTORE_SILENTLY')) {
                 print "<ul><li>Record could not be added: table=$table</li></ul>";
@@ -455,7 +455,7 @@ function hotpot_restore_logs($restore, $log) {
         break;
         case "attempt":
         case "submit":
-        case "review": 
+        case "review":
             if ($log->cmid) {
                 //Get the new_id of the module (to recode the info field)
                 $mod = backup_getid($restore->backup_unique_code,$log->module,$log->info);
@@ -464,7 +464,7 @@ function hotpot_restore_logs($restore, $log) {
                     $attemptid = substr(strrchr($log->url,"="),1);
                     //Get the new_id of the attempt (to recode the url field)
                     $attempt = backup_getid($restore->backup_unique_code,"hotpot_attempts",$attemptid);
-                    if ($attempt) { 
+                    if ($attempt) {
                         $log->url = "review.php?id=".$log->cmid."&attempt=".$attempt->new_id;
                         $log->info = $mod->new_id;
                         $status = true;
@@ -523,4 +523,4 @@ function hotpot_decode_content_link($scriptname, $paramname, $paramvalue, &$rest
 
     return "$CFG->wwwroot/mod/hotpot/$scriptname.php?$paramname=$new_id";
 }
-?>
+
index 03e12b41712dc88d2aa44b301a85c09f3de1df3c..56e7757f5bf020d15989c71dbb5b7ff708a2ef56 100644 (file)
@@ -36,7 +36,7 @@
     }
 
     require_login($course, true, $cm);
-    
+
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
     if (!has_capability('mod/hotpot:viewreport',$context)) {
         if (!$hotpot->review) {
@@ -107,10 +107,10 @@ function hotpot_print_attempt_summary(&$hotpot, &$attempt) {
                 $value = hotpot_format_status($attempt);
                 break;
             case 'timerecorded':
-                $value = empty($attempt->timefinish) ? '-' : userdate($attempt->timefinish); 
+                $value = empty($attempt->timefinish) ? '-' : userdate($attempt->timefinish);
                 break;
             case 'timetaken':
-                $value = empty($attempt->timefinish) ? '-' : format_time($attempt->timefinish - $attempt->timestart); 
+                $value = empty($attempt->timefinish) ? '-' : format_time($attempt->timefinish - $attempt->timestart);
                 break;
             default:
                 $value = isset($attempt->$field) ? $attempt->$field : NULL;
@@ -252,4 +252,4 @@ function hotpot_print_attempt_details(&$hotpot, &$attempt) {
     print "</table>\n";
     echo $OUTPUT->box_end();
 }
-?>
+
index a84acc2906df3558535b145a1ff056eea2dfc951..0d565ed2f81ffbec2655a853f3ff534b46f520e3 100644 (file)
@@ -1,9 +1,9 @@
-<?php  //$Id$
+<?php
 
-$settings->add(new admin_setting_configcheckbox('hotpot_showtimes', get_string('showtimes', 'hotpot'), 
+$settings->add(new admin_setting_configcheckbox('hotpot_showtimes', get_string('showtimes', 'hotpot'),
                     get_string('configshowtimes', 'hotpot'), 0) );
 
 $settings->add(new admin_setting_configtext('hotpot_excelencodings', get_string('excelencodings', 'hotpot'),
                    get_string('configexcelencodings', 'hotpot'), '') );
 
-?>
+
index 04c5af88f883e44fc033715d0549005f41c5bbd6..d5776c0d11afefe80fc7bcabf54476db5ad849a6 100644 (file)
@@ -90,7 +90,7 @@ class hotpot_xml_template_default {
         $rrggbb = '/^\#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i';
         if ((
             preg_match($rgb, $x, $x_matches) ||
-            preg_match($rrggbb, $x, $x_matches) 
+            preg_match($rrggbb, $x, $x_matches)
         ) && (
             preg_match($rgb, $y, $y_matches) ||
             preg_match($rrggbb, $y, $y_matches)
@@ -105,4 +105,4 @@ class hotpot_xml_template_default {
         return $color;
     }
 }
-?>
+
index 114821319c9845aa0dc684ac31cb73f2040eb8bf..eca2d6cad91eadbcd4b5d3ddeb89636b6dcf782f 100644 (file)
@@ -1,4 +1,4 @@
-<?PHP 
+<?PHP
 
 class hotpot_xml_quiz_template extends hotpot_xml_template_default {
     // left and right items for JMatch
@@ -9,13 +9,13 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
     function hotpot_xml_quiz_template(&$parent) {
 
         $this->parent = &$parent;
-        
+
         $get_js = optional_param('js', false);
         $get_css = optional_param('css', false);
 
         if (!empty($get_css)) {
             // set $this->css
-            $this->v6_expand_StyleSheet(); 
+            $this->v6_expand_StyleSheet();
 
         } else if (!empty($get_js)) {
             // set $this->js
@@ -173,7 +173,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
         return empty($value) ? '' : ('<h3 class="ExerciseSubtitle">'.$value.'</h3>');
     }
 
-    // timer 
+    // timer
 
     function v6_expand_Timer() {
         return $this->int_value('data,timer,include-timer');
@@ -185,7 +185,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
         return $this->parent->xml_value('data,timer,seconds');
     }
 
-    // send results 
+    // send results
 
     function v6_expand_SendResults() {
         return $this->parent->xml_value('hotpot-config-file,'.$this->parent->quiztype.',send-email');
@@ -307,7 +307,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
     }
     function v6_expand_NavLightColor() {
         $color = $this->parent->xml_value('hotpot-config-file,global,nav-bar-color');
-        return $this->get_halfway_color($color, '#ffffff'); 
+        return $this->get_halfway_color($color, '#ffffff');
     }
     function v6_expand_NavShadeColor() {
         $color = $this->parent->xml_value('hotpot-config-file,global,nav-bar-color');
@@ -540,7 +540,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
             $value = strtr($value, $ENTITIES);
             if (preg_match_all($pattern, $value, $matches)) {
                 $chars = array_merge($chars, $matches[0]);
-            } 
+            }
             $i++;
         }
 
@@ -1299,7 +1299,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
                 $str .= '<p class="QuestionText">'.$question_text.'</p>';
 
                 if (
-                    $question_type==HOTPOT_JQUIZ_SHORTANSWER || 
+                    $question_type==HOTPOT_JQUIZ_SHORTANSWER ||
                     $question_type==HOTPOT_JQUIZ_HYBRID
                 ) {
                     $size = 9; // default size
@@ -1337,13 +1337,13 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
                 }
 
                 if (
-                    $question_type==HOTPOT_JQUIZ_MULTICHOICE || 
+                    $question_type==HOTPOT_JQUIZ_MULTICHOICE ||
                     $question_type==HOTPOT_JQUIZ_HYBRID ||
                     $question_type==HOTPOT_JQUIZ_MULTISELECT
                 ) {
 
                     switch ($question_type) {
-                        case HOTPOT_JQUIZ_MULTICHOICE: 
+                        case HOTPOT_JQUIZ_MULTICHOICE:
                             $str .= '<ol class="MCAnswers">'."\n";
                         break;
                         case HOTPOT_JQUIZ_HYBRID:
@@ -1510,6 +1510,6 @@ function hotpot_keypad_sort_value($char) {
     }
 
     return $sort_value;
-} 
+}
+
 
-?>
index 04a96e16869055324cc170327cd0910d409dd930..8b31025b55e0385452f66407374cc95219f8ef63 100644 (file)
@@ -5,7 +5,7 @@
 
 [strDublinCoreMetadata]
 
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
 <title>
 [strPlainTitle]
@@ -61,9 +61,9 @@
 
 </script>
 
-</head> 
+</head>
 
-<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]> 
+<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
 <!-- BeginTopNavButtons -->
 
 [inclNavButtons]
index 65a148a9472ca44ed15ce3d25b2ad0560b115e8a..143b650aafa750009eefe69fc97e35cf8f99631a 100644 (file)
@@ -54,7 +54,7 @@ var AnswersTried = '';
 FC = new Array();
 DC = new Array();
 
-function onEndDrag(){ 
+function onEndDrag(){
 //Is it dropped on any of the fixed cards?
        var Docked = false;
        var DropTarget = DroppedOnFixed(CurrDrag);
@@ -79,7 +79,7 @@ function onEndDrag(){
                DC[CurrDrag].tag = 0;
                D[CurrDrag][2] = 0;
        }
-} 
+}
 
 function DroppedOnFixed(DNum){
        var Result = -1;
@@ -143,7 +143,7 @@ function StartUp(){
        for (var i=0; i<F.length; i++){
                CardContent = F[i][0];
                FC[i] = new Card('F' + i, 10);
-               FC[i].elm.innerHTML = CardContent; 
+               FC[i].elm.innerHTML = CardContent;
                if (FC[i].GetW() > Widest){
                        Widest = FC[i].GetW();
                }
@@ -162,7 +162,7 @@ function StartUp(){
                DC[i] = new Card('D' + i, 10);
                CardContent = D[i][0];
 //             if (CardContent.indexOf('<img ') > -1){CardContent += '<br clear="all" />';} //used to be required for Navigator rendering bug with images
-               DC[i].elm.innerHTML = CardContent; 
+               DC[i].elm.innerHTML = CardContent;
                if (DC[i].GetW() > DragWidth){DC[i].SetW(DragWidth);}
                DC[i].css.cursor = 'move';
                DC[i].css.backgroundColor = '[strExBGColor]';
@@ -303,7 +303,7 @@ function CheckAnswers(){
                        TotalCorrect++;
                }
                else{
-//Change made for version 6.0.3.41: don't send wrong items home, 
+//Change made for version 6.0.3.41: don't send wrong items home,
 //show them in a more conspicuous way.
 //                     DC[i].GoHome();
                                DC[i].SetL(DC[i].GetL() + 10);
index 1fb8c7c9fc23786c789e4ef88589f0ebc7e31b79..c8bbc6b91f5062a8f5e8d1bd9c5a4e9319f0cdb8 100644 (file)
@@ -5,7 +5,7 @@
 
 [strDublinCoreMetadata]
 
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
 <title>
 [strPlainTitle]
@@ -61,9 +61,9 @@
 
 </script>
 
-</head> 
+</head>
 
-<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]> 
+<body onload="TimerStartUp()" id="TheBody" [inclScorm1.2]onunload="CheckLMSFinish()"[/inclScorm1.2]>
 <!-- BeginTopNavButtons -->
 
 [inclNavButtons]
index e568c04660612b06bf1f5b9bebe82ab36c270cb5..42e22d6b0b9c47a467e250bdf9823ebb50f9189c 100644 (file)
@@ -142,7 +142,7 @@ function GetGuessSequence(){
 }
 
 function CompDrags(a,b){
-       return a.GetL() - b.GetL(); 
+       return a.GetL() - b.GetL();
 }
 
 function FindSegment(SegID){
@@ -233,7 +233,7 @@ function CheckAnswer(CheckType){
                                        LongestCorrect[k] = TempCorrect[k];
                                }
                                HintToReturn = TempHint;
-                       } 
+                       }
                }       
        }
        if (WhichCorrect > -1){
@@ -304,7 +304,7 @@ function CheckAnswer(CheckType){
                Locked = true;
                Finished = true;
                setTimeout('Finish()', SubmissionTimeout);
-               WriteToInstructions(YourScoreIs + ' ' + Score + '%.'); 
+               WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
        }
        
 [inclScorm1.2]
@@ -329,18 +329,18 @@ var Answers = new Array();
 function doDrag(e) {
        if (CurrDrag == -1) {return};
        if (C.ie){var Ev = window.event}else{var Ev = e}
-       var difX = Ev.clientX-window.lastX; 
-       var difY = Ev.clientY-window.lastY; 
-       var newX = Cds[CurrDrag].GetL()+difX; 
-       var newY = Cds[CurrDrag].GetT()+difY; 
-       Cds[CurrDrag].SetL(newX); 
+       var difX = Ev.clientX-window.lastX;
+       var difY = Ev.clientY-window.lastY;
+       var newX = Cds[CurrDrag].GetL()+difX;
+       var newY = Cds[CurrDrag].GetT()+difY;
+       Cds[CurrDrag].SetL(newX);
        Cds[CurrDrag].SetT(newY);
-       window.lastX = Ev.clientX; 
-       window.lastY = Ev.clientY; 
+       window.lastX = Ev.clientX;
+       window.lastY = Ev.clientY;
        return false;
-} 
+}
 
-function beginDrag(e, DragNum) { 
+function beginDrag(e, DragNum) {
        CurrDrag = DragNum;
        if (C.ie){
                var Ev = window.event;
@@ -349,25 +349,25 @@ function beginDrag(e, DragNum) {
        }
        else{
                var Ev = e;
-               window.onmousemove=doDrag; 
+               window.onmousemove=doDrag;
                window.onmouseup=endDrag;
-       } 
+       }
        Cds[CurrDrag].SwapColours();
        topZ++;
        Cds[CurrDrag].css.zIndex = topZ;
-       window.lastX=Ev.clientX; 
+       window.lastX=Ev.clientX;
        window.lastY=Ev.clientY;
-       return true;  
-} 
+       return true;
+}
 
-function endDrag(e) { 
+function endDrag(e) {
        if (CurrDrag == -1) {return};
        Cds[CurrDrag].SwapColours();
        if (C.ie){document.onmousemove=null}else{window.onmousemove=null;}
        onEndDrag();    
        CurrDrag = -1;
        return true;
-} 
+}
 
 function onEndDrag(){
 //Snap to lines
index 2a22c60e528ced68a2b51666500b87f974f7b0a4..37576157a0bf3dfe47c9b800193e44a23ab06f73 100644 (file)
@@ -5,7 +5,7 @@
 
 [strDublinCoreMetadata]
 
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
 <title>
 [strPlainTitle]
index 988ac5435a5f8e416229442855e2a72bd9c1e292..f88eedbde2fa792ffc279d464da0cefe2eb312e4 100644 (file)
@@ -51,7 +51,7 @@ function StartUp(){
 [inclScorm1.2]
        initAPI(window);
        if (API != null){
-               API.LMSInitialize(''); 
+               API.LMSInitialize('');
                API.LMSSetValue('cmi.core.lesson_status', 'browsed');
                API.LMSSetValue('cmi.comments', 'This exercise has no checking or scoring features.');
                API.LMSCommit('');
index 05c9b3e700ebbedcf3483f54ed7047f76b5f9118..b23d66cee085d984123298b1107fe9a58488bc1a 100644 (file)
@@ -16,7 +16,7 @@ body{
        font-family: [strFontFace];
 [inclPageBGColor]      background-color: [strPageBGColor];[/inclPageBGColor]
        color: [strTextColor];
-[inclGraphicURL]       background-image: url([strGraphicURL]);[/inclGraphicURL] 
+[inclGraphicURL]       background-image: url([strGraphicURL]);[/inclGraphicURL]
        margin-right: 5%;
        margin-left: 5%;
        font-size: [strFontSize];
@@ -73,14 +73,14 @@ div.StdDiv{
        text-align: right;
        font-size: 150%;
        direction: rtl;
-       font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", [strFontFace]; 
+       font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", [strFontFace];
 }
 
 .CentredRTLText{
        text-align: center;
        font-size: 150%;
        direction: rtl;
-       font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", [strFontFace]; 
+       font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", [strFontFace];
 }
 
 button p.RTLText{
index b15bf7d2f64b1bd555837d760c4093c1ae848477..e9b9c56e5353f93cd65d5437c3049c2426f4834d 100644 (file)
@@ -5,7 +5,7 @@ function Client(){
 
        this.ua = navigator.userAgent;
        this.name = navigator.appName;
-       this.ver = navigator.appVersion;  
+       this.ver = navigator.appVersion;
 
 //Get data about the browser
        this.mac = (this.ver.indexOf('Mac') != -1);
index e9eb06e49f0302e84f55d854eded66d50d33e30c..7e5177c82b5167ccfe0ac3cb70d63cd64ddb9e00 100644 (file)
@@ -105,18 +105,18 @@ Card.prototype.GoHome=CardGoHome;
 function doDrag(e) {
        if (CurrDrag == -1) {return};
        if (C.ie){var Ev = window.event}else{var Ev = e}
-       var difX = Ev.clientX-window.lastX; 
-       var difY = Ev.clientY-window.lastY; 
-       var newX = DC[CurrDrag].GetL()+difX; 
-       var newY = DC[CurrDrag].GetT()+difY; 
-       DC[CurrDrag].SetL(newX); 
+       var difX = Ev.clientX-window.lastX;
+       var difY = Ev.clientY-window.lastY;
+       var newX = DC[CurrDrag].GetL()+difX;
+       var newY = DC[CurrDrag].GetT()+difY;
+       DC[CurrDrag].SetL(newX);
        DC[CurrDrag].SetT(newY);
-       window.lastX = Ev.clientX; 
-       window.lastY = Ev.clientY; 
+       window.lastX = Ev.clientX;
+       window.lastY = Ev.clientY;
        return false;
-} 
+}
 
-function beginDrag(e, DragNum) { 
+function beginDrag(e, DragNum) {
        CurrDrag = DragNum;
        if (C.ie){
                var Ev = window.event;
@@ -125,18 +125,18 @@ function beginDrag(e, DragNum) {
        }
        else{
                var Ev = e;
-               window.onmousemove=doDrag; 
+               window.onmousemove=doDrag;
                window.onmouseup=endDrag;
-       } 
+       }
        DC[CurrDrag].Highlight();
        topZ++;
        DC[CurrDrag].css.zIndex = topZ;
-       window.lastX=Ev.clientX; 
+       window.lastX=Ev.clientX;
        window.lastY=Ev.clientY;
-       return false;  
-} 
+       return false;
+}
 
-function endDrag(e) { 
+function endDrag(e) {
        if (CurrDrag == -1) {return};
        DC[CurrDrag].Unhighlight();
        if (C.ie){document.onmousemove=null}else{window.onmousemove=null;}
@@ -145,7 +145,7 @@ function endDrag(e) {
 //Need a bugfix for Opera focus problem here
        if (C.opera){FocusAButton();}
        return true;
-} 
+}
 
 var CurrDrag = -1;
 var topZ = 100;
index f3570d4d3a3e64d1edf5eabf8d50d3cc2f1c871a..54596b1404ad167775e3601ed79a5ae4537b2f57 100644 (file)
@@ -330,7 +330,7 @@ function ShowAnswers(QNum){
 //Display feedback
        ShowMessage(Ans);
        
-//Set the score for this question to 0 if no 
+//Set the score for this question to 0 if no
        if (State[QNum][0] < 1){
                State[QNum][0] = 0;
        }
index ad0e15776425f110bad19ae27b922ed87216f673..b26a448037ded3f686562208f28730b4d3fb3cdd 100644 (file)
@@ -12,7 +12,7 @@
 <param name="type" value="audio/x-pn-realaudio-plugin" />
 <param name="src" value="[strFilePath]" />
 <param name="autostart" value="false" />
-<param name="controls" value="[inclVideo]ImageWindow,[/inclVideo]ControlPanel" /> 
+<param name="controls" value="[inclVideo]ImageWindow,[/inclVideo]ControlPanel" />
 [strContent]</object>[/Real Player]
 
 [Flash Player]<object codebase="[strFilePath]" type="application/x-shockwave-flash" width="[strWidth]" height="[strHeight]" data="[strFilePath]"> <param name="movie" value="[strFilePath]" />[strContent]</object>[/Flash Player]
index 9abc49af4b0e9620f65621e5a8bb46382133fc81..ced728ad20fd86ba5e6a3f6db177afe869c41c1f 100644 (file)
@@ -3,7 +3,7 @@
        <html xmlns="http://www.w3.org/1999/xhtml"
              xml:lang="en"><head>
 
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
 <title>
 Page Title
@@ -31,7 +31,7 @@ Page Title
 </div>
 
 <div id="MainDiv" class="StdDiv">
+
 <p>Page content...</p>
 
 </div>
index 58dde4675f1a78fe9b73178c9f6e8e4c46b5c0f4..983b8e045d47ef70fd0dd8ca4795c734a59103dc 100644 (file)
@@ -54,7 +54,7 @@ function ShowElements(Show, TagName, ContainerToReverse){
                                Els[i].style.visibility = 'hidden';
                                if (C.mac && C.gecko) {Els[i].style.display = 'none';}
                        }
-               } 
+               }
                else {
                        // tagName is either input or select (that is, Form Elements)
                        // ie6 has a problem with Form elements, so manipulate those
index 2f12775229cb7b05db44125c67424e447c6b9f28..697ce366c7fa0ea814df92960fe97fea7fd1e796 100644 (file)
@@ -57,13 +57,13 @@ function GetViewportHeight(){
 
 function TopSettingWithScrollOffset(TopPercent){
        var T = Math.floor(GetViewportHeight() * (TopPercent/100));
-       return GetScrollTop() + T; 
+       return GetScrollTop() + T;
 }
 
 //CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
 var InTextBox = false;
 
-function SuppressBackspace(e){ 
+function SuppressBackspace(e){
        if (InTextBox == true){return;}
        if (C.ie) {
                thisKey = window.event.keyCode;
index ac0c84fddcd306ad7334e0019bf9945eb34166dc..9590260d9e9796ed6e5302a04c44eead17b990c3 100644 (file)
@@ -5,7 +5,7 @@
 
 [strDublinCoreMetadata]
 
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
 <title>
 [strPlainTitle]
 [/inclHint]
 
  -->
+
 <div id="ClozeDiv">
 <form id="Cloze" method="post" action="" onsubmit="return false;">
 <div class="ClozeBody">
index 3a22cce217cd2c641a6afd0a6e28a97daf9965da..52d8a5264b62a666a1d45eee3b428974f12f3139 100644 (file)
@@ -48,7 +48,7 @@ function ItemState(){
 
 var Feedback = '';
 var Correct = '[strCorrect]';
-var Incorrect = '[strIncorrect]'; 
+var Incorrect = '[strIncorrect]';
 var GiveHint = '[strGiveHint]';
 var CaseSensitive = [boolCaseSensitive];
 var YourScoreIs = '[strYourScoreIs]';
index bcaeea97680df0d2af8f363330c409b46d54d4b5..27dc7d0b9067ba5f962ebe38a4c9a9174866c9e2 100644 (file)
@@ -5,7 +5,7 @@
 
 [strDublinCoreMetadata]
 
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
 <title>
 [strPlainTitle]
 <button id="CheckButton1" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswers()">&nbsp;[strCheckCaption]&nbsp;</button>
 
  -->
+
 <table class="CrosswordGrid">
 <tbody>
 
index 26c911ff05ba3ef78c9f81b746ada818ebe1219a..6a95bf2f195fc288e30660655c511e25050984cb 100644 (file)
@@ -35,7 +35,7 @@ var Feedback = '';
 var AcrossCaption = '';
 var DownCaption = '';
 var Correct = '[strCorrect]';
-var Incorrect = '[strIncorrect]'; 
+var Incorrect = '[strIncorrect]';
 var GiveHint = '[strGiveHint]';
 var YourScoreIs = '[strYourScoreIs]';
 var BuiltGrid = '';
@@ -45,7 +45,7 @@ var Score = 0;
 var InTextBox = false;
 var Locked = false;
 var TimeOver = false;
-var CaseSensitive = [boolCaseSensitive]; 
+var CaseSensitive = [boolCaseSensitive];
 
 var InputStuff = '<form method="post" action="" onsubmit="return false;"><span class="ClueNum">[strClueNum]: </span>';
 InputStuff += '[strClue] <input onfocus="CurrentBox=this;InTextBox=true;" onblur="InTextBox=false;" id="[strBoxId]" type="edit" size="[strEditSize]" maxlength="[strMaxLength]"></input>';
@@ -88,7 +88,7 @@ function GetAnswerLength(Across,x,y){
                while ((x<L.length)&&(L[x][y].length > 0)){
                        Result += L[x][y].length;
                        x++;
-               } 
+               }
                return Result;
        }
        else{
@@ -269,7 +269,7 @@ function CheckAnswers(){
        var AllCorrect = true;
        var TotLetters = 0;
        var CorrectLetters = 0;
-       var LetterFromKey = ''; 
+       var LetterFromKey = '';
        var LetterFromGuess = '';
        
 //Check each letter
@@ -285,7 +285,7 @@ function CheckAnswers(){
                                        LetterFromKey = L[i][j].toUpperCase();
                                        LetterFromGuess = G[i][j].toUpperCase();
                                }
-                               if (LetterFromGuess != LetterFromKey){ 
+                               if (LetterFromGuess != LetterFromKey){
                                        G[i][j] = '';
 //Blank that square in the grid
                                        SetGridSquareValue(i,j,'');
index 6e74246717f92ceb3beb888105567de6118233a6..4697a97a5fc066504eeedcbb435edd6659a92b8e 100644 (file)
@@ -3,7 +3,7 @@
              xml:lang="en">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-                                                
+                                               
 <title></title>
 
 <script type="text/javascript">
index 988170eb7b61dd2f664830f24f2aed2bb1a20c14..eb301f4587156d069ac821045bdd11f2bd9536a3 100644 (file)
@@ -5,7 +5,7 @@
 
 [strDublinCoreMetadata]
 
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
 <title>
 [strPlainTitle]
index 1922189d8e2bc3218f4d0337d7a7652a357e882a..57ea886273acba6318c3a47624e725672076359d 100644 (file)
@@ -233,7 +233,7 @@ function CheckAnswers(){
                                        Parent.removeChild(Select);
                                        Parent.innerHTML = AnsText;
                                        Parent.nextSibling.innerHTML = CorrectIndicator;
-                       } 
+                       }
                        else{
                                AllDone = false;
                                Parent = Select.parentNode;
index 54c92d46dd2faa413988fc0579ead884537674a7..7f9e2997e574adc3dcb2302163bffd191181e941 100644 (file)
@@ -5,7 +5,7 @@
 
 [strDublinCoreMetadata]
 
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
 <title>
 [strPlainTitle]
index 52dbd73ac612b4acfcbbf098b943f357f2e8f1d9..7f68768a9bd32e305982aca50fd72222b3859b4a 100644 (file)
@@ -227,7 +227,7 @@ function CheckAnswer(CheckType){
                                        LongestCorrect[k] = TempCorrect[k];
                                }
                                HintToReturn = TempHint;
-                       } 
+                       }
                }       
        }
        if (WhichCorrect > -1){
@@ -311,7 +311,7 @@ function CheckAnswer(CheckType){
                Locked = true;
                Finished = true;
                setTimeout('Finish()', SubmissionTimeout);
-               WriteToInstructions(YourScoreIs + ' ' + Score + '%.'); 
+               WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
        }
 [inclScorm1.2]
        if (AllDone == true){
index 3cedaefe1f37eb7b36cc1e35c95423592f7366dd..2cb0868c6b1c719a8447d68a3486c7c0694f5e3d 100644 (file)
@@ -5,7 +5,7 @@
 
 [strDublinCoreMetadata]
 
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
 <title>
 [strPlainTitle]
 
 
 <div id="MainDiv" class="StdDiv">
+
 <div id="QNav" class="QuestionNavigation">
 
 <p style="text-align: right;">
 </div>
 
 </div>
+
 [strQuestionOutput]
 
 [inclKeypad]
index cf1a4f73cfa149c7ecdda0a4c002a7c08a221fda..4da31907eeb34593ddb1968e5ed698d9b9f507b7 100644 (file)
@@ -89,7 +89,7 @@ function CompleteEmptyFeedback(){
 }
 
 function SetUpQuestions(){
-       var AList = new Array(); 
+       var AList = new Array();
        var QList = new Array();
        var i, j;
        Qs = document.getElementById('Questions');
@@ -172,7 +172,7 @@ function SetFocusToTextbox(){
 
 function ChangeQ(ChangeBy){
 //The following line prevents moving to another question until the current
-//question is answered correctly. Uncomment it to enable this behaviour. 
+//question is answered correctly. Uncomment it to enable this behaviour.
 //     if (State[CurrQNum][0] == -1){return;}
        if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >= QArray.length)){return;}
        QArray[CurrQNum].style.display = 'none';
@@ -571,9 +571,9 @@ function CalculateOverallScore(){
                Score = Math.floor((TotalScore/TotalWeighting)*100);
        }
        else{
-//if TotalWeighting is 0, no questions so far have any value, so 
+//if TotalWeighting is 0, no questions so far have any value, so
 //no penalty should be shown.
-               Score = 100; 
+               Score = 100;
        }
 }
 
index fa795d8f30f1ad10d84f35ea6ac7101ab7cf5152..6ab4550e9143d88a5cee2f77d454b0ea91e70219 100644 (file)
@@ -3,7 +3,7 @@
        <html xmlns="http://www.w3.org/1999/xhtml"
              xml:lang="en"><head>
 
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
 <title>
 [strPlainIndexTitle]
@@ -21,7 +21,7 @@ body{
        font-family: [strFontFace];
 [inclPageBGColor]      background-color: [strPageBGColor];[/inclPageBGColor]
        color: [strTextColor];
-[inclGraphicURL]       background-image: url([strGraphicURL]);[/inclGraphicURL] 
+[inclGraphicURL]       background-image: url([strGraphicURL]);[/inclGraphicURL]
        padding-left: 5%;
        padding-right: 5%;
        font-size: [strFontSize];
index 178bab19097c31b3ff14d07b291343135cc142f7..2205619f5d880a283b7ce3f0ae2781129e32f9fa 100644 (file)
@@ -1,4 +1,4 @@
-<?PHP // $Id$
+<?php
 /////////////////////////////////////////////////////////////////////////////////
 ///  Code fragment to define the version of hotpot
 ///  This fragment is called by moodle_needs_upgrading() and /admin/index.php
@@ -13,4 +13,4 @@ $module->cron     = 0;            // period for cron to check this module (secs)
 //     DD   : day
 //     X    : point release version 1,2,3 etc
 //     Y    : increment between point releases
-?>
+
index 59a8a15527c04e9ba626b7aff59c52398d2dbd87..2e935a28acba58a7c5613fe6ecd47aa654f14c24 100644 (file)
@@ -68,7 +68,7 @@
         } else if ($hotpot->subnet && !address_in_subnet(getremoteaddr(), $hotpot->subnet)) {
             $error = get_string("subneterror", "quiz");
         // check number of attempts
-        } else if ($hotpot->attempts && $hotpot->attempts <= $DB->count_records_select('hotpot_attempts', 'hotpot=? AND userid=?', array($hotpot->id, $USER->id), 'COUNT(DISTINCT clickreportid)')) { 
+        } else if ($hotpot->attempts && $hotpot->attempts <= $DB->count_records_select('hotpot_attempts', 'hotpot=? AND userid=?', array($hotpot->id, $USER->id), 'COUNT(DISTINCT clickreportid)')) {
             $error = get_string("nomoreattempts", "quiz");
         // get password
         } else if ($hotpot->password && empty($hppassword)) {
@@ -484,4 +484,4 @@ function hotpot_feedback_teachers(&$course, &$hotpot) {
     }
     return $teacherdetails;
 }
-?>
+
index 9d996dfa359ebcee50c706cae20d94c78308104f..a69ee4fc6de37516023d503cc67f6d681494c0b8 100644 (file)
@@ -1,4 +1,4 @@
-<?php //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //label mods
 
@@ -20,7 +20,7 @@
     function label_backup_mods($bf,$preferences) {
         global $CFG, $DB;
 
-        $status = true; 
+        $status = true;
 
         ////Iterate over label table
         if ($labels = $DB->get_records ("label","course", array($preferences->backup_course=>"id"))) {
         }
         return $status;
     }
-   
+
     function label_backup_one_mod($bf,$preferences,$label) {
         global $CFG, $DB;
-    
+
         if (is_numeric($label)) {
             $label = $DB->get_record('label', array('id'=>$label));
         }
-    
+
         $status = true;
 
         //Start mod
             }
             return $info;
         }
-        
+
          //First the course data
          $info[0][0] = get_string("modulenameplural","label");
          $info[0][1] = $DB->count_records("label", array("course"=>$course));
          return $info;
-    } 
+    }
 
     ////Return an array of info (name,value)
     function label_check_backup_mods_instances($instance,$backup_unique_code) {
@@ -82,4 +82,4 @@
         return $info;
     }
 
-?>
+
index 8228a8e74c9e8aea8c29264ed85f5f5a4ef572ea..7740375bcf6467b5634f350853c8f4c2350abf99 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file replaces:
 //   * STATEMENTS section in db/install.xml
index ccedaa53b48079d5cf493b10cee5d5fd249a5b4e..7138045c2986905c0b32be926759ee978624e2c1 100644 (file)
@@ -1,6 +1,6 @@
-<?php  //$Id$
+<?php
 
-// This file keeps track of upgrades to 
+// This file keeps track of upgrades to
 // the label module
 //
 // Sometimes, changes between versions involve
@@ -79,4 +79,4 @@ function xmldb_label_upgrade($oldversion) {
     return $result;
 }
 
-?>
+
index 04f5723e8ee9f60eab310dae21bdac28c48ab535..5539df02604bf5b540aede809e8407bf23171cf2 100644 (file)
@@ -9,4 +9,4 @@ $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/label/index.php', array('id'=>
 
 redirect("$CFG->wwwroot/course/view.php?id=$id");
 
-?>
+
index 052959ef9a918f4311a024b831ff229cc62f4a4d..5b529c61b7462fa4620e4f5aa328884ad5bc45ff 100644 (file)
@@ -180,7 +180,7 @@ function label_get_types() {
 
 /**
  * This function is used by the reset_course_userdata function in moodlelib.
- * 
+ *
  * @param object $data the data submitted from the reset course.
  * @return array status array
  */
index 653e63b24616e06e7394e3eafe3b53f950430757..38e4bad6b8387e21cb3d5b84952a9f873f644a58 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 require_once ($CFG->dirroot.'/course/moodleform_mod.php');
 
 class mod_label_mod_form extends moodleform_mod {
index 513974a444190850924bc858015c04f111d367fc..7c323825d69387c64ee23fe9971cda108951d58c 100644 (file)
@@ -1,10 +1,10 @@
-<?php //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //label mods
 
-    //This is the "graphical" structure of the label mod:   
+    //This is the "graphical" structure of the label mod:
     //
-    //                       label 
+    //                       label
     //                    (CL,pk->id)
     //
     // Meaning: pk->primary key field of the table
             //traverse_xmlize($info);                                                                     //Debug
             //print_object ($GLOBALS['traverse_array']);                                                  //Debug
             //$GLOBALS['traverse_array']="";                                                              //Debug
-          
+
             //Now, build the LABEL record structure
             $label->course = $restore->course_id;
             $label->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);
             $label->intro = backup_todb($info['MOD']['#']['CONTENT']['0']['#']);
             $label->timemodified = $info['MOD']['#']['TIMEMODIFIED']['0']['#'];
+
             //The structure is equal to the db, so insert the label
             $newid = $DB->insert_record ("label",$label);
 
-            //Do some output     
+            //Do some output
             if (!defined('RESTORE_SILENTLY')) {
                 echo "<li>".get_string("modulename","label")." \"".format_string($label->name,true)."\"</li>";
             }
@@ -51,7 +51,7 @@
                 //We have the newid, update backup_ids
                 backup_putid($restore->backup_unique_code,$mod->modtype,
                              $mod->id, $newid);
-   
+
             } else {
                 $status = false;
             }
     //This function returns a log record with all the necessay transformations
     //done. It's used by restore_log_module() to restore modules log.
     function label_restore_logs($restore,$log) {
-                    
+
         $status = false;
-                    
+
         //Depending of the action, we recode different things
         switch ($log->action) {
         case "add":
         }
         return $status;
     }
-?>
+
index 778577b39da922afb1bbc887571f42399b8e7ff9..4be52cafe5ecfa4b547c411ff6841e3bbf08a26d 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 /////////////////////////////////////////////////////////////////////////////////
 ///  Code fragment to define the version of label
@@ -9,4 +9,4 @@ $module->version  = 2009080400;  // The current module version (Date: YYYYMMDDXX
 $module->requires = 2009041700;  // Requires this Moodle version
 $module->cron     = 0;           // Period for cron to check this module (secs)
 
-?>
+
index 7eb6d01e31dd7a386cdb7fe5a1e428d92a187391..e46e49fe152eb8ce1a9e5bd054a61751ba77c8aa 100644 (file)
@@ -36,4 +36,4 @@ require_login($course, true, $cm);
 
 redirect("$CFG->wwwroot/course/view.php?id=$course->id");
 
-?>
+
index 3a1460b4e2a74c2588b661570cdf86921d7ad074..11b1ba1835c7be229fc8de467f68a628148b97eb 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  *  Action for adding a branch table.  Prints an HTML form.
  *
@@ -9,7 +9,7 @@
 
     // first get the preceeding page
     $pageid = required_param('pageid', PARAM_INT);
-    
+
     // set of jump array
     $jump = array();
     $jump[0] = get_string("thispage", "lesson");
index 224acd3649ce881b066122fa4a0de42e5349eeae..7a889f2488fe5e5457cbebe968843ec7942143c4 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Action for adding a cluster page
  *
@@ -11,9 +11,9 @@
     // first get the preceeding page
     // if $pageid = 0, then we are inserting a new page at the beginning of the lesson
     $pageid = required_param('pageid', PARAM_INT);
-        
+
     $timenow = time();
-    
+
     if ($pageid == 0) {
         if (!$page = $DB->get_record("lesson_pages", array("prevpageid" => 0, "lessonid" => $lesson->id))) {
             print_error('cannotfindpagerecord', 'lesson');
     if ($pageid != 0) {
         $DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid));
     }
-    
+
     if ($pageid == 0) {
         $page->nextpageid = $page->id;
-    }        
+    }
     if ($page->nextpageid) {
         // the new page is not the last page
         $DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->nextpageid));
@@ -57,4 +57,4 @@
     $newanswerid = $DB->insert_record("lesson_answers", $newanswer);
     lesson_set_message(get_string('addedcluster', 'lesson'), 'notifysuccess');
     redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id");
-?>
+
index 96799673c0c71c3fc019d2a15621f4a951fdbc00..d3ad412a65054ec2d6c8678c56ee92f18ba54105 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Action for adding an end of branch page
  *
@@ -10,7 +10,7 @@
 
     // first get the preceeding page
     $pageid = required_param('pageid', PARAM_INT);
-    
+
     $timenow = time();
 
     // the new page is not the first page (end of branch always comes after an existing page)
         $newanswer->timecreated = $timenow;
         $newanswer->jumpto = $btpageid;
         $newanswerid = $DB->insert_record("lesson_answers", $newanswer);
-        
+
         lesson_set_message(get_string('addedanendofbranch', 'lesson'), 'notifysuccess');
     } else {
         lesson_set_message(get_string('nobranchtablefound', 'lesson'));
     }
-    
+
     redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id");
-?>
+
index cbbc7a365e5c10ebd58be076e106cd90f78b59d4..cb14cd83249de5c8ccb785366cf72f531b78b4c9 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Action for adding an end of cluster page
  *
 
     // first get the preceeding page
     $pageid = required_param('pageid', PARAM_INT);
-        
+
     $timenow = time();
-    
+
     // the new page is not the first page (end of cluster always comes after an existing page)
     if (!$page = $DB->get_record("lesson_pages", array("id" => $pageid))) {
         print_error('cannotfindpages', 'lesson');
     }
-    
+
     // could put code in here to check if the user really can insert an end of cluster
-    
+
     $newpage = new stdClass;
     $newpage->lessonid = $lesson->id;
     $newpage->prevpageid = $pageid;
index 964f7e10ae32f969fce1e8e6569a74d4517ede55..bf4613b3da9fd67cdb1209a3b37180ef2cf299d0 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  *  Action for adding a question page.  Prints an HTML form.
  *
@@ -9,7 +9,7 @@
     // first get the preceeding page
     $pageid = required_param('pageid', PARAM_INT);
     $qtype = optional_param('qtype', LESSON_MULTICHOICE, PARAM_INT);
-    
+
     // set of jump array
     $jump = array();
     $jump[0] = get_string("thispage", "lesson");
@@ -24,9 +24,9 @@
         $jump[LESSON_CLUSTERJUMP] = get_string("clusterjump", "lesson");
     }
     if (!optional_param('firstpage', 0, PARAM_INT)) {
-        $linkadd = "";      
+        $linkadd = "";
         $apageid = $DB->get_field("lesson_pages", "id", array("lessonid" => $lesson->id, "prevpageid" => 0));
-        
+
         while (true) {
             if ($apageid) {
                 $title = $DB->get_field("lesson_pages", "title", array("id" => $apageid));
@@ -58,7 +58,7 @@
       <?php
         echo '<b>'.get_string("questiontype", "lesson").":</b> \n";
         echo $OUTPUT->help_icon(moodle_help_icon::make("questiontypes", get_string("questiontype", "lesson"), "lesson"))."<br />";
-        lesson_qtype_menu($LESSON_QUESTION_TYPE, $qtype, 
+        lesson_qtype_menu($LESSON_QUESTION_TYPE, $qtype,
                           "lesson.php?id=$cm->id&amp;action=addpage&amp;pageid=".$pageid.$linkadd);
 
         if ( $qtype == LESSON_SHORTANSWER || $qtype == LESSON_MULTICHOICE ) {  // only display this option for Multichoice and shortanswer
                     echo "<tr><td><b>".get_string("wrongresponse", "lesson").":</b><br />\n";
                     print_textarea(false, 6, 70, 630, 300, "answer[$i]");
                     echo "</td></tr>\n";
-                } else {                                                
+                } else {
                     echo "<tr><td><b>".get_string("answer", "lesson")." $icorrected:</b><br />\n";
                     print_textarea(false, 6, 70, 630, 300, "answer[$i]");
                     echo "</td></tr>\n";
index 0005cba6435088c43c5f82cf2f2085e81d127639..f863725908ff6518c14b6cb0947db672fa444af5 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Action for confirming the deletion of a page
  *
@@ -25,7 +25,7 @@
             echo $title."<br />\n";
         }
     }
-    echo $OUTPUT->confirm(get_string("confirmdeletionofthispage","lesson"), 
+    echo $OUTPUT->confirm(get_string("confirmdeletionofthispage","lesson"),
          "lesson.php?action=delete&id=$cm->id&pageid=$pageid",
          "view.php?id=$cm->id");
-?>
+
index 1f78ba6d903ba67770fa9e68add0130768b59afd..ae3f8d8a9f3ecdf34eaadc1107fefbc9fb433a92 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * HTML template for continue.php
  *
@@ -8,9 +8,9 @@
 ?>
 
 <?php if ($lesson->displayleft) { // Skip navigation anchor ?>
-        
+
         <a name="maincontent" id="maincontent" title="<?php print_string('anchortitle', 'lesson') ?>"></a>
-        
+
 <?php } ?>
 
 <?php
@@ -27,7 +27,7 @@
             <form id="endoflesson" method ="post" action="<?php echo $CFG->wwwroot ?>/mod/lesson/view.php">
             <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
             <input type="hidden" name="pageid" value="<?php echo LESSON_EOL; ?>" />
-    
+
             <p align="center">
                 <?php print_string("savechangesandeol", "lesson") ?>
             </p>
             <p align="center">
                 <?php print_string("continuetoanswer", "lesson") ?>
             </p>
-    
+
             </form>
 <?php } ?>
 
 <?php if ($lesson->review && !$correctanswer && !$noanswer && !$isessayquestion) { // Review button back ?>
-    
+
             <form id="reviewback" method ="post" action="<?php echo $CFG->wwwroot ?>/mod/lesson/view.php">
             <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
             <input type="hidden" name="pageid" value="<?php echo $pageid; ?>" />
-    
+
             <p>
                 <?php lesson_print_submit_link(get_string('reviewquestionback', 'lesson'), 'reviewback'); ?>
             </p>
-    
+
             </form>
-            
+
 <?php } ?>
 
             <form id="pageform" method ="post" action="<?php echo $CFG->wwwroot ?>/mod/lesson/view.php">
index 044404aa5ed00c9a07ec7e0967a63b95fbc3c9b6..d0b4f4ae515abf4daed661322d08e8029fce8383 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Action for processing page answers by users
  *
     lesson_print_header($cm, $course, $lesson, 'view', true, $page->id);
 
     include(dirname(__FILE__).'/continue.html');
-?>
+
index 61619dcffa8aeb94f7f4070e0dc3aaeb0a29f4d4..0856c69f2afaa8de66728547d0747a4e6f3d63b0 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Action for deleting a page
  *
@@ -56,4 +56,4 @@
     }
     lesson_set_message(get_string('deletedpage', 'lesson').': '.format_string($thispage->title, true), 'notifysuccess');
     redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id");
-?>
+
index e6f27f10f57d4f452bcf6dc8863f89054f6ba689..a751597960ae82692843bef0ced08566a8b7d2ea 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  *  Action for editing a page.  Prints an HTML form.
  *
@@ -6,11 +6,11 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package lesson
  **/
+
     // get the page
     $pageid = required_param('pageid', PARAM_INT);
     $redirect = optional_param('redirect', '', PARAM_ALPHA);
-    
+
     if (!$page = $DB->get_record("lesson_pages", array("id" => $pageid))) {
         print_error('cannotfindpages', 'lesson');
     }
@@ -58,8 +58,8 @@
     <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
     <input type="hidden" name="action" value="updatepage" />
     <input type="hidden" name="pageid" value="<?php echo $pageid ?>" />
-    <input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />        
-    <input type="hidden" name="redirect" value="<?php echo $redirect ?>" />        
+    <input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
+    <input type="hidden" name="redirect" value="<?php echo $redirect ?>" />
     <input type="hidden" name="redisplay" value="0" />
     <center>
        <?php
@@ -67,7 +67,7 @@
             case LESSON_MULTICHOICE :
                 echo '<b>'.get_string("questiontype", "lesson").":</b> \n";
                 echo $OUTPUT->help_icon(moodle_help_icon::make("questiontypes", get_string("questiontype", "lesson"), "lesson"))."<br />";
-                lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype, 
+                lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype,
                                   "lesson.php?id=$cm->id&amp;action=editpage&amp;pageid=$page->id",
                                   "getElementById('editpage').redisplay.value=1;getElementById('editpage').submit();");
                 echo "<p><b><label for=\"qoption\">".get_string('multianswer', 'lesson').":</label></b> \n";
@@ -82,7 +82,7 @@
             case LESSON_SHORTANSWER :
                 echo '<b>'.get_string("questiontype", "lesson").":</b> \n";
                 echo $OUTPUT->help_icon(moodle_help_icon::make("questiontypes", get_string("questiontype", "lesson"), "lesson"))."<br />";
-                lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype, 
+                lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype,
                                   "lesson.php?id=$cm->id&amp;action=editpage&amp;pageid=$page->id",
                                   "getElementById('editpage').redisplay.value=1;getElementById('editpage').submit();");
                 echo "<p><b><label for=\"qoption\">".get_string('casesensitive', 'lesson').":</label></b> \n";
             case LESSON_NUMERICAL :
                 echo '<b>'.get_string("questiontype", "lesson").":</b> \n";
                 echo $OUTPUT->help_icon(moodle_help_icon::make("questiontypes", get_string("questiontype", "lesson"), "lesson"))."<br />";
-                lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype, 
+                lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype,
                                   "lesson.php?id=$cm->id&amp;action=editpage&amp;pageid=$page->id",
                                   "getElementById('editpage').redisplay.value=1;getElementById('editpage').submit();");
                 break;
                 echo "<input name=\"display\" type=\"checkbox\" value=\"1\" checked=\"checked\" />";
             } else {
                 echo "<input name=\"display\" type=\"checkbox\" value=\"1\" />";
-            }                
+            }
             echo get_string("displayinleftmenu", "lesson")."\n";
             echo "</center></td></tr>\n";
             echo "<tr><td><b>".get_string("branchtable", "lesson")."</b> \n";
         case LESSON_CLUSTER :
             echo "<input type=\"hidden\" name=\"qtype\" value=\"$page->qtype\" />\n";
             echo "<tr><td><b>".get_string("clustertitle", "lesson")."</b> \n";
-            break;                
+            break;
         case LESSON_ENDOFCLUSTER :
             echo "<input type=\"hidden\" name=\"qtype\" value=\"$page->qtype\" />\n";
             echo "<tr><td><b>".get_string("endofclustertitle", "lesson")."</b> \n";
-            break;                            
+            break;
         case LESSON_ENDOFBRANCH :
             echo "<input type=\"hidden\" name=\"qtype\" value=\"$page->qtype\" />\n";
             echo "<tr><td><b>".get_string("endofbranch", "lesson")."</b> \n";
             break;
         default :
             echo "<tr><td>";
-        break;             
+        break;
     }
 
     echo "</td></tr>\n";
                         echo "<tr><td><b><label for=\"edit-answer[$n]\">".get_string('answer', 'lesson')." $ncorrected:</label></b>\n";
                         if ($flags & LESSON_ANSWER_EDITOR) {
                             echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
-                                "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />"; 
+                                "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />";
                             echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                             echo "]<br />\n";
                             print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                 case LESSON_TRUEFALSE:
                 case LESSON_MULTICHOICE:
                 case LESSON_SHORTANSWER:
-                case LESSON_NUMERICAL:                    
+                case LESSON_NUMERICAL:
                     echo "<tr><td><b><label for=\"edit-answer[$n]\">".get_string('answer', 'lesson')." $nplus1:</label></b>\n";
                     if ($flags & LESSON_ANSWER_EDITOR and $page->qtype != LESSON_SHORTANSWER and $page->qtype != LESSON_NUMERICAL) {
                         echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
             $n++;
             if ($page->qtype == LESSON_ESSAY) {
                 break; // only one answer for essays
-            }                
+            }
         }
     }
     if ($page->qtype != LESSON_ENDOFBRANCH && $page->qtype != LESSON_CLUSTER && $page->qtype != LESSON_ENDOFCLUSTER) {
     // close table and form
     ?>
     </table><br />
-    <input type="button" value="<?php print_string("redisplaypage", "lesson") ?>" 
+    <input type="button" value="<?php print_string("redisplaypage", "lesson") ?>"
         onclick="getElementById('editpage').redisplay.value=1;getElementById('editpage').submit();" />
     <input type="submit" value="<?php  print_string("savepage", "lesson") ?>" />
     <input type="submit" name="cancel" value="<?php  print_string("cancel") ?>" />
index 231ee07b02ae2b0aaec72fdf598c78a5eaa23fa0..201b57e403cc3e050fd71c868975f51b8c7e48eb 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Action for processing the form from addpage action and inserts the page.
  *
@@ -14,7 +14,7 @@
     }
 
     $timenow = time();
-    
+
     $form = data_submitted();
     $newpage = new stdClass;
     $newanswer = new stdClass;
@@ -78,7 +78,7 @@
                 $newpage->display = clean_param($form->display, PARAM_INT);
             } else {
                 $newpage->display = 0;
-            }                
+            }
             $newpage->title = clean_param($form->title, PARAM_CLEANHTML);
             $newpage->contents = trim($form->contents);
             $newpage->title = $newpage->title;
                 $newpage->display = clean_param($form->display, PARAM_INT);
             } else {
                 $newpage->display = 0;
-            }                
+            }
             $newpage->title = clean_param($form->title, PARAM_CLEANHTML);
             $newpage->contents = trim($form->contents);
             $newpage->title = $newpage->title;
             }
         }
     }
-    
+
     lesson_set_message(get_string('insertedpage', 'lesson').': '.format_string($newpage->title, true), 'notifysuccess');
     redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id");
-?>
+
index 42304aed4738f9644bfad762f44885dcae085b96..39b8fad3f6c6297bf0d3f84c4330896eaf97ba99 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Action that displays an interface for moving a page
  *
@@ -6,11 +6,11 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package lesson
  **/
-   
+
     $pageid = required_param('pageid', PARAM_INT);
     $title = $DB->get_field("lesson_pages", "title", array("id" => $pageid));
     echo $OUTPUT->heading(get_string("moving", "lesson", format_string($title)));
-   
+
     $params = array ("lessonid" => $lesson->id, "prevpageid" => 0);
     if (!$page = $DB->get_record_select("lesson_pages", "lessonid = :lessonid AND prevpageid = :prevpageid", $params)) {
         print_error('cannotfindfirstpage', 'lesson');
@@ -38,4 +38,4 @@
         }
     }
     echo "</table>\n";
-?>
+
index 1114a201c4ca46836fb59d1e9bf0524edaa3e669..e28e8b670ffc7d2ebe4c92ff597d2aa1ca62e719 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Action for actually moving the page (database changes)
  *
@@ -19,7 +19,7 @@
     if (!$after) {
         // the moved page is the new first page
         $newfirstpageid = $pageid;
-        // reset $after so that is points to the last page 
+        // reset $after so that is points to the last page
         // (when the pages are in a ring this will in effect be the first page)
         if ($page->nextpageid) {
             if (!$after = $DB->get_field("lesson_pages", "id", array("lessonid" => $lesson->id, "nextpageid" => 0))) {
@@ -39,8 +39,8 @@
         }
     }
     // the rest is all unconditional...
-    
-    // second step. join pages into a ring 
+
+    // second step. join pages into a ring
     if (!$firstpageid = $DB->get_field("lesson_pages", "id", array("lessonid" => $lesson->id, "prevpageid" => 0))) {
         print_error("Moveit: firstpageid not found");
     }
@@ -67,7 +67,7 @@
     if (!$DB->set_field("lesson_pages", "prevpageid", $prevpageid, array("id" => $nextpageid))) {
         print_error("Moveit: unable to update link");
     }
-    
+
     // fourth step. insert page to be moved in new place...
     if (!$nextpageid = $DB->get_field("lesson_pages", "nextpageid", array("id" => $after))) {
         print_error("Movit: nextpageid not found");
@@ -85,7 +85,7 @@
     if (!$DB->set_field("lesson_pages", "nextpageid", $nextpageid, array("id" => $pageid))) {
         print_error("Moveit: unable to update link");
     }
-    
+
     // fifth step. break the ring
     if (!$newlastpageid = $DB->get_field("lesson_pages", "prevpageid", array("id" => $newfirstpageid))) {
         print_error("Moveit: newlastpageid not found");
@@ -98,4 +98,4 @@
     }
     lesson_set_message(get_string('movedpage', 'lesson'), 'notifysuccess');
     redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id");
-?>
+
index 2f268d38846fd9df6540cfac4dbc0595c0417c3b..1e4cbcde74903af15a960131b267156248e6446f 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Action for processing the form in editpage action and saves the page
  *
@@ -7,7 +7,7 @@
  * @package lesson
  **/
     confirm_sesskey();
-    
+
     $redirect = optional_param('redirect', '', PARAM_ALPHA);
 
     $timenow = time();
@@ -15,7 +15,7 @@
 
     $page = new stdClass;
     $page->id = clean_param($form->pageid, PARAM_INT);
-    
+
     // check to see if the cancel button was pushed
     if (optional_param('cancel', '', PARAM_ALPHA)) {
         if ($redirect == 'navigation') {
@@ -46,7 +46,7 @@
     $page->title = clean_param($form->title, PARAM_CLEANHTML);
     $page->contents = trim($form->contents);
     $page->title = $page->title;
-    
+
     $DB->update_record("lesson_pages", $page);
     if ($page->qtype == LESSON_ENDOFBRANCH || $page->qtype == LESSON_ESSAY || $page->qtype == LESSON_CLUSTER || $page->qtype == LESSON_ENDOFCLUSTER) {
         // there's just a single answer with a jump
@@ -67,7 +67,7 @@
                     $DB->delete_records("lesson_answers", array("id" => $answer->id));
                 }
             }
-        }        
+        }
         $DB->update_record("lesson_answers", $oldanswer);
     } else {
         // it's an "ordinary" page
                         }
                         if (!isset($form->responseeditor[$i])) {
                             $form->responseeditor[$i] = 0;
-                        }                        
+                        }
                         $oldanswer->flags = $form->answereditor[$i] * LESSON_ANSWER_EDITOR +
                                             $form->responseeditor[$i] * LESSON_RESPONSE_EDITOR;
                         $oldanswer->timemodified = $timenow;
                         $oldanswer->answer = NULL;
                         $DB->update_record("lesson_answers", $oldanswer);
-                    }                        
+                    }
                 } elseif (!empty($form->answerid[$i])) {
                     // need to delete blanked out answer
                     $DB->delete_records("lesson_answers", array("id" => clean_param($form->answerid[$i], PARAM_INT)));
     if ($form->redisplay) {
         redirect("$CFG->wwwroot/mod/lesson/lesson.php?id=$cm->id&amp;action=editpage&amp;pageid=$page->id&amp;redirect=$redirect");
     }
-    
+
     lesson_set_message(get_string('updatedpage', 'lesson').': '.format_string($page->title, true), 'notifysuccess');
     if ($redirect == 'navigation') {
         // takes us back to viewing the page
     } else {
         redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id");
     }
-?>
+
index 4f4a2e8be0e4edbe20df5012b04a4e4c3905591d..65c1355dbb89aa196b62bf917ca12ade4f9444ef 100644 (file)
@@ -1,4 +1,4 @@
-<?php //$Id$
+<?php
 /**
  * Lesson's backup routine
  *
@@ -6,10 +6,10 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package lesson
  **/
-    //This is the "graphical" structure of the lesson mod: 
+    //This is the "graphical" structure of the lesson mod:
     //
     //          lesson_default                  lesson ----------------------------|--------------------------|--------------------------|
-    //     (UL, pk->id,fk->courseid)         (CL,pk->id)                           |                          |                          | 
+    //     (UL, pk->id,fk->courseid)         (CL,pk->id)                           |                          |                          |
     //                                             |                               |                          |                          |
     //                                             |                         lesson_grades              lesson_high_scores         lesson_timer
     //                                             |                  (UL, pk->id,fk->lessonid)    (UL, pk->id,fk->lessonid)   (UL, pk->id,fk->lessonid)
                 }
             }
         }
-        return $status;  
+        return $status;
     }
 
     function lesson_backup_one_mod($bf,$preferences,$lesson) {
 
         global $CFG, $DB;
-    
+
         if (is_numeric($lesson)) {
             $lesson = $DB->get_record('lesson',array ('id' => $lesson));
         }
-    
+
         $status = true;
 
         //Start mod
                 //Start Attempt
                 $status =fwrite ($bf,start_tag("ATTEMPT",9,true));
                 //Print attempt contents
-                fwrite ($bf,full_tag("USERID",10,false,$attempt->userid));       
-                fwrite ($bf,full_tag("RETRY",10,false,$attempt->retry));       
-                fwrite ($bf,full_tag("CORRECT",10,false,$attempt->correct));     
+                fwrite ($bf,full_tag("USERID",10,false,$attempt->userid));
+                fwrite ($bf,full_tag("RETRY",10,false,$attempt->retry));
+                fwrite ($bf,full_tag("CORRECT",10,false,$attempt->correct));
                 fwrite ($bf,full_tag("USERANSWER",10,false,$attempt->useranswer));
-                fwrite ($bf,full_tag("TIMESEEN",10,false,$attempt->timeseen));       
+                fwrite ($bf,full_tag("TIMESEEN",10,false,$attempt->timeseen));
                 //End attempt
                 $status =fwrite ($bf,end_tag("ATTEMPT",9,true));
             }
         }
         return $status;
     }
-    
+
     // backup lesson_high_score contents (executed from backup_lesson_mods)
     function backup_lesson_high_scores($bf, $preferences, $lessonid) {
         global $CFG, $DB;
         }
         return $status;
     }
-    
+
     // backup lesson_default contents (executed from backup_lesson_mods)
     function backup_lesson_default ($bf,$preferences) {
         global $CFG, $DB;
         $default = $DB->get_record("lesson_default", array("course" => $preferences->backup_course));
         if ($default) {
             //Start mod
-            $status =fwrite ($bf,start_tag("DEFAULTS",4,true));            
+            $status =fwrite ($bf,start_tag("DEFAULTS",4,true));
             //Print default data
             fwrite ($bf,full_tag("PRACTICE",5,false,$default->practice));
             fwrite ($bf,full_tag("MODATTEMPTS",5,false,$default->modattempts));
             fwrite ($bf,full_tag("MAXHIGHSCORES",5,false,$default->maxhighscores));
             $status =fwrite ($bf,end_tag("DEFAULTS",4,true));
         }
-        return $status;  
+        return $status;
     }
-    
+
     //Return an array of info (name,value)
     function lesson_check_backup_mods($course,$user_data=false,$backup_unique_code,$instances=null) {
         if (!empty($instances) && is_array($instances) && count($instances)) {
         //Now, if requested, the user_data
         if ($user_data) {
             $info[1][0] = get_string("attempts","lesson");
-            if ($ids = lesson_attempts_ids_by_course ($course)) { 
+            if ($ids = lesson_attempts_ids_by_course ($course)) {
                 $info[1][1] = count($ids);
             } else {
                 $info[1][1] = 0;
         //Now, if requested, the user_data
         if (!empty($instance->userdata)) {
             $info[$instance->id.'1'][0] = get_string("attempts","lesson");
-            if ($ids = lesson_attempts_ids_by_instance ($instance->id)) { 
+            if ($ids = lesson_attempts_ids_by_instance ($instance->id)) {
                 $info[$instance->id.'1'][1] = count($ids);
             } else {
                 $info[$instance->id.'1'][1] = 0;
 
     // INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
 
-    //Returns an array of lesson id 
+    //Returns an array of lesson id
     function lesson_ids ($course) {
 
         global $CFG, $DB;
                                  FROM {lesson} l
                                  WHERE l.course = :course", $params);
     }
-    
+
     //Returns an array of lesson_submissions id
     function lesson_attempts_ids_by_course ($course) {
 
                                  FROM {lesson_attempts} a
                                  WHERE a.lessonid = :lessonid", $params);
     }
-?>
+
index 0c010a93244ea7f9662559b3f7f71c7e914502e3..2c3a10c410d0b7ec4bf332418dacf0d9c6d78e73 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Capability definitions for the lesson module.
  *
index 5cbf2e377d422a1c0decc9b3be1685dfe4a5f70d..37ae270d34d7965a3563dd56b1e2a1b6c1ab8169 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file replaces:
 //   * STATEMENTS section in db/install.xml
index 076ee096ac2d379220d041beef742ac66fe5cd8b..30941931f8988eb97d5508ecd5e338b080694e18 100644 (file)
@@ -1,6 +1,6 @@
-<?php  //$Id$
+<?php
 
-// This file keeps track of upgrades to 
+// This file keeps track of upgrades to
 // the lesson module
 //
 // Sometimes, changes between versions involve
@@ -56,4 +56,4 @@ function xmldb_lesson_upgrade($oldversion) {
     return $result;
 }
 
-?>
+
index 413ea21ca424e12e613990ecc87012fe838c56c1..96b96d7623e199dec0fc1f4df3fa20e9dbc646c1 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 /**
  * Provides the interface for overall authoring of lessons
  *
     $display = optional_param('display', 0, PARAM_INT);
     $mode    = optional_param('mode', get_user_preferences('lesson_view', 'collapsed'), PARAM_ALPHA);
     $pageid = optional_param('pageid', 0, PARAM_INT);
-    
+
     if ($mode != 'single') {
         set_user_preference('lesson_view', $mode);
     }
-    
+
     list($cm, $course, $lesson) = lesson_get_basics($id);
-    
+
     if ($firstpage = $DB->get_record('lesson_pages', array('lessonid' => $lesson->id, 'prevpageid' => 0))) {
         if (!$pages = $DB->get_records('lesson_pages', array('lessonid' => $lesson->id))) {
             print_error('cannotfindrecords', 'lesson');
         }
     }
-    
+
     if ($pageid) {
         if (!$singlepage = $DB->get_record('lesson_pages', array('id' => $pageid))) {
             print_error('invalidpageid', 'lesson');
@@ -48,7 +48,7 @@
 
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
     require_capability('mod/lesson:manage', $context);
-    
+
     lesson_print_header($cm, $course, $lesson, $mode);
 
     if (empty($firstpage)) {
@@ -70,7 +70,7 @@
         $pageid = $firstpage->id;
         $prevpageid = 0;
         $npages = count($pages);
-        
+
         switch ($mode) {
             case 'collapsed':
                 $table = new html_table();
@@ -81,7 +81,7 @@
                 $table->cellspacing = 0;
                 $table->cellpadding = '2px';
                 $table->data = array();
-                
+
                 while ($pageid != 0) {
                     $page = $pages[$pageid];
 
                             $jumps[] = lesson_get_jump_name($answer->jumpto);
                         }
                     }
-                    
+
                     $table->data[] = array("<a href=\"$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id&amp;mode=single&amp;pageid=".$page->id."\">".format_string($pages[$pageid]->title,true).'</a>',
                                            lesson_get_qtype_name($page->qtype),
                                            implode("<br />\n", $jumps),
                                           );
                     $pageid = $page->nextpageid;
                 }
-                
+
                 echo $OUTPUT->table($table);
                 break;
-                
+
             case 'single':
                 // Only viewing a single page in full - change some variables to display just one
                 $prevpageid = $singlepage->prevpageid;
                 $pageid     = $singlepage->id;
-                
+
                 $pages = array();
                 $pages[$singlepage->id] = $singlepage;
-                
+
             case 'full':
                 echo '<table class="boxaligncenter" cellpadding="5" border="0" style="width:80%;">
                          <tr>
                     echo "<tr><td>\n";
                     echo "<table style=\"width:100%;\" border=\"1\" class=\"generalbox\"><tr><th colspan=\"2\" scope=\"col\">".format_string($page->title)."&nbsp;&nbsp;\n";
                     lesson_print_page_actions($cm->id, $page, $npages);
-                    echo "</th></tr>\n";             
+                    echo "</th></tr>\n";
                     echo "<tr><td colspan=\"2\">\n";
                     $options = new stdClass;
                     $options->noclean = true;
                                     echo "</td></tr>\n";
                                     echo "<tr><td align=\"right\" valign=\"top\"><span class=\"label\">".get_string("response", "lesson")." $i</span>: \n";
                                     echo "</td><td>\n";
-                                    echo format_text($answer->response, FORMAT_MOODLE, $options); 
+                                    echo format_text($answer->response, FORMAT_MOODLE, $options);
                                     echo "</td></tr>\n";
-                                    break;                            
+                                    break;
                                 case LESSON_MATCHING:
                                     if ($n < 2) {
                                         if ($answer->answer != NULL) {
                                             if ($n == 0) {
                                                 echo "<tr><td align=\"right\" valign=\"top\"><span class=\"label\">".get_string("correctresponse", "lesson")."</span>: \n";
                                                 echo "</td><td>\n";
-                                                echo format_text($answer->answer, FORMAT_MOODLE, $options); 
+                                                echo format_text($answer->answer, FORMAT_MOODLE, $options);
                                                 echo "</td></tr>\n";
                                             } else {
                                                 echo "<tr><td align=\"right\" valign=\"top\"><span class=\"label\">".get_string("wrongresponse", "lesson")."</span>: \n";
                                                 echo "</td><td>\n";
-                                                echo format_text($answer->answer, FORMAT_MOODLE, $options); 
+                                                echo format_text($answer->answer, FORMAT_MOODLE, $options);
                                                 echo "</td></tr>\n";
                                             }
                                         }
                                         echo "</td></tr>\n";
                                         echo "<tr><td align=\"right\" valign=\"top\"><span class=\"label\">".get_string("matchesanswer", "lesson")." $i</span>: \n";
                                         echo "</td><td>\n";
-                                        echo format_text($answer->response, FORMAT_MOODLE, $options); 
+                                        echo format_text($answer->response, FORMAT_MOODLE, $options);
                                         echo "</td></tr>\n";
                                     }
                                     break;
                                     echo "$jumptitle</td></tr>\n";
                                 }
                             } else {
-                                if ($lesson->custom and 
-                                    $page->qtype != LESSON_BRANCHTABLE and 
+                                if ($lesson->custom and
+                                    $page->qtype != LESSON_BRANCHTABLE and
                                     $page->qtype != LESSON_ENDOFBRANCH and
-                                    $page->qtype != LESSON_CLUSTER and 
+                                    $page->qtype != LESSON_CLUSTER and
                                     $page->qtype != LESSON_ENDOFCLUSTER) {
                                     echo "<tr><td align=\"right\" style=\"width:20%;\"><span class=\"label\">".get_string("score", "lesson")." $i";
                                     echo "</span>: </td><td style=\"width:80%;\">\n";
                         $DB->set_field("lesson_pages", "prevpageid", $prevpageid, array("id" => $page->id));
                         debugging("<p>***prevpageid of page $page->id set to $prevpageid***");
                     }
-                    
+
                     if (count($pages) == 1) {
                         echo "</td></tr>";
                         break;
                     }
-                    
+
                     $prevpageid = $page->id;
                     $pageid = $page->nextpageid;
                     echo "</td></tr>";
                 echo "</table>";
                 break;
         }
-    } 
+    }
 
     echo $OUTPUT->footer();
-?>
+
index c2e105d74a307b3a27e9824e33f7eff68f3b8aaf..9c9138aa687a1a54722997232f1afb636f9a3ba7 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 /**
  * Provides the interface for grading essay questions
  *
@@ -16,7 +16,7 @@
     $mode = optional_param('mode', 'display', PARAM_ALPHA);
 
     list($cm, $course, $lesson) = lesson_get_basics($id);
-    
+
     require_login($course->id, false, $cm);
 
     $url = new moodle_url($CFG->wwwroot.'/mod/lesson/essay.php', array('id'=>$id));
@@ -27,9 +27,9 @@
     $PAGE->navbar->add(get_string('manualgrading','lesson'));
 
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
-    
+
     require_capability('mod/lesson:edit', $context);
-    
+
 /// Handle any preprocessing before header is printed - based on $mode
     switch ($mode) {
         case 'display':  // Default view - get the necessary data
@@ -43,7 +43,7 @@
                     if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) {
                         $params["groupinid"] = $cm->groupingid;
                         $sql = "SELECT DISTINCT u.*
-                                FROM {lesson_attempts} a 
+                                FROM {lesson_attempts} a
                                     INNER JOIN {user} u ON u.id = a.userid
                                     INNER JOIN {groups_members} gm ON gm.userid = u.id
                                     INNER JOIN {groupings_groups} gg ON gm.groupid = :groupinid
@@ -72,7 +72,7 @@
             break;
         case 'grade':  // Grading form - get the necessary data
             confirm_sesskey();
-            
+
             $attemptid = required_param('attemptid', PARAM_INT);
 
             if (!$attempt = $DB->get_record('lesson_attempts', array('id' => $attemptid))) {
@@ -93,9 +93,9 @@
                 if (optional_param('cancel', 0, PARAM_RAW)) {
                     redirect("$CFG->wwwroot/mod/lesson/essay.php?id=$cm->id");
                 }
-                
+
                 $attemptid = required_param('attemptid', PARAM_INT);
-                
+
                 if (!$attempt = $DB->get_record('lesson_attempts', array('id' => $attemptid))) {
                     print_error('cannotfindattempt', 'lesson');
                 }
                 $attempt->useranswer = serialize($essayinfo);
 
                 $DB->update_record('lesson_attempts', $attempt);
-                
+
                 // Get grade information
                 $grade = current($grades);
                 $gradeinfo = lesson_grade($lesson, $attempt->retry, $attempt->userid);
-                
+
                 // Set and update
                 $updategrade->id = $grade->id;
                 $updategrade->grade = $gradeinfo->grade;
                 $DB->update_record('lesson_grades', $updategrade);
                 // Log it
                 add_to_log($course->id, 'lesson', 'update grade', "essay.php?id=$cm->id", $lesson->name, $cm->id);
-                
+
                 lesson_set_message(get_string('changessaved'), 'notifysuccess');
 
                 // update central gradebook
             break;
         case 'email': // Sending an email(s) to a single user or all
             confirm_sesskey();
-            
+
             // Get our users (could be singular)
             if ($userid = optional_param('userid', 0, PARAM_INT)) {
                 $queryadd = " AND userid = :userid";
             }
             $options = new stdClass;
             $options->noclean = true;
-            
+
             foreach ($attempts as $attempt) {
                 $essayinfo = unserialize($attempt->useranswer);
                 if ($essayinfo->graded and !$essayinfo->sent) {
                     // Holds values for the essayemailsubject string for the email message
                     $a = new stdClass;
-                    
+
                     // Set the grade
                     $params = array ("lessonid" => $lesson->id, "userid" => $attempt->userid);
                     $grades = $DB->get_records_select('lesson_grades', "lessonid = :lessonid and userid = :userid", $params, 'completed', '*', $attempt->retry, 1);
                     $grade  = current($grades);
                     $a->newgrade = $grade->grade;
-                    
+
                     // Set the points
                     if ($lesson->custom) {
                         $a->earned = $essayinfo->score;
 
                     // Subject
                     $subject = get_string('essayemailsubject', 'lesson', format_string($pages[$attempt->pageid]->title,true));
-                    
+
                     $eventdata = new object();
                     $eventdata->modulename       = 'lesson';
                     $eventdata->userfrom         = $USER;
             redirect("$CFG->wwwroot/mod/lesson/essay.php?id=$cm->id");
             break;
     }
-    
+
     // Log it
     add_to_log($course->id, 'lesson', 'view grade', "essay.php?id=$cm->id", get_string('manualgrading', 'lesson'), $cm->id);
-    
+
     lesson_print_header($cm, $course, $lesson, 'essay');
-    
+
     switch ($mode) {
         case 'display':
             // Expects $user, $essayattempts and $pages to be set already
-        
+
             // Group all the essays by userid
             $studentessays = array();
             foreach ($essayattempts as $essay) {
                 // Not very nice :) but basically
-                //   this organizes the essays so we know how many 
+                //   this organizes the essays so we know how many
                 //   times a student answered an essay per try and per page
-                $studentessays[$essay->userid][$essay->pageid][$essay->retry][] = $essay;            
+                $studentessays[$essay->userid][$essay->pageid][$essay->retry][] = $essay;
             }
-            
+
             // Setup table
             $table = new html_table();
             $table->head = array(get_string('name'), get_string('essays', 'lesson'), get_string('email', 'lesson'));
                         } else {
                             $essay = end($try);
                         }
-                        
+
                         // Start processing the attempt
                         $essayinfo = unserialize($essay->useranswer);
-                        
+
                         // Different colors for all the states of an essay (graded, if sent, not graded)
                         if (!$essayinfo->graded) {
                             $class = ' class="graded"';
             $emailalllink = "<a href=\"$CFG->wwwroot/mod/lesson/essay.php?id=$cm->id&amp;mode=email&amp;sesskey=".sesskey().'">'.get_string('emailallgradedessays', 'lesson').'</a>';
 
             $table->data[] = array(' ', ' ', $emailalllink);
-            
+
             echo $OUTPUT->table($table);
             break;
         case 'grade':
                   <input type="hidden" name="id" value="'.$cm->id.'" />
                   <input type="hidden" name="mode" value="update" />
                   <input type="hidden" name="attemptid" value="'.$attemptid.'" />
-                  <input type="hidden" name="sesskey" value="'.sesskey().'" />';    
+                  <input type="hidden" name="sesskey" value="'.sesskey().'" />';
 
             // All tables will have these settings
             $originaltable = new html_table();
             $table->data[] = array(format_text($page->contents, FORMAT_MOODLE, $options));
 
             echo $OUTPUT->table($table);
-            
+
             // Now the user's answer
             $essayinfo = unserialize($attempt->useranswer);
-            
+
             $table = clone($originaltable);
             $table = new html_table();
             $table->head = array(get_string('studentresponse', 'lesson', fullname($user, true)));
                   </div>';
             break;
     }
-    
+
     echo $OUTPUT->footer();
-?>
+
index 6ac183826769004b12f20a17a3cf982ce791e99b..e09a5f07822125fda92db449c94538e02b1d45a6 100644 (file)
@@ -1,6 +1,6 @@
-<?php  // $Id$ 
+<?php  // $Id$
 /**
- * format.php  - Default format class for file imports/exports. Doesn't do 
+ * format.php  - Default format class for file imports/exports. Doesn't do
  * everything on it's own -- it needs to be extended.
  *
  * @version $Id$
@@ -32,7 +32,7 @@ class qformat_default {
 
     function importprocess($filename, $lesson, $pageid) {
         global $DB, $OUTPUT;
-        
+
     /// Processes a given file.  There's probably little need to change this
         $timenow = time();
 
@@ -45,7 +45,7 @@ class qformat_default {
             echo $OUTPUT->notification("There are no questions in this file!");
             return false;
         }
-        
+
         echo $OUTPUT->notification(get_string('importcount', 'lesson', sizeof($questions)));
 
         $count = 0;
@@ -118,7 +118,7 @@ class qformat_default {
                     // reset $pageid and put the page ID in $question, used in save_question_option()
                     $pageid = $newpageid;
                     $question->id = $newpageid;
-                    
+
                     $this->questionids[] = $question->id;
 
                     // Now to save all the answers and type-specific options
@@ -141,7 +141,7 @@ class qformat_default {
                 default :
                     echo $OUTPUT->notification(get_string('unsupportedqtype', 'lesson', $question->qtype));
             }
+
         }
         return true;
     }
@@ -164,11 +164,11 @@ class qformat_default {
     }
 
     function readquestions($lines) {
-    /// Parses an array of lines into an array of questions, 
-    /// where each item is a question object as defined by 
-    /// readquestion().   Questions are defined as anything 
+    /// Parses an array of lines into an array of questions,
+    /// where each item is a question object as defined by
+    /// readquestion().   Questions are defined as anything
     /// between blank lines.
-     
+
         $questions = array();
         $currentquestion = array();
 
@@ -197,8 +197,8 @@ class qformat_default {
 
 
     function readquestion($lines) {
-    /// Given an array of lines known to define a question in 
-    /// this format, this function converts it into a question 
+    /// Given an array of lines known to define a question in
+    /// this format, this function converts it into a question
     /// object suitable for processing and insertion into Moodle.
 
         echo "<p>This flash question format has not yet been completed!</p>";
@@ -210,7 +210,7 @@ class qformat_default {
     // returns an "empty" question
     // Somewhere to specify question parameters that are not handled
     // by import but are required db fields.
-    // This should not be overridden. 
+    // This should not be overridden.
         global $CFG;
 
         $question = new stdClass();
@@ -228,13 +228,13 @@ class qformat_default {
         $question->length = 1;
         $question->qoption = 0;
         $question->layout = 1;
-        
+
         return $question;
     }
 
     function importpostprocess() {
     /// Does any post-processing that may be desired
-    /// Argument is a simple array of question ids that 
+    /// Argument is a simple array of question ids that
     /// have just been added.
 
         return true;
@@ -242,4 +242,4 @@ class qformat_default {
 
 }
 
-?>
+
index 33a4f389100a2285593af4adb6582e9a20602706..52732c93bcfc12faa9748348976b73d6b5b845a0 100644 (file)
@@ -26,4 +26,4 @@
         redirect('view.php?id='.$cm->id);
     }
 
-?>
+
index af73634c713c0ff04d62fc0cea4e07a5baf4d45f..8fc2ecbe9b0191da0ef794240e0f5bc2580bed8e 100644 (file)
     $PAGE->set_url($url);
 
     list($cm, $course, $lesson) = lesson_get_basics($id);
-    
+
     require_login($course->id, false, $cm);
-    
+
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
-    
-    
+
+
     switch ($mode) {
         case 'add':
             // Ensure that we came from view.php
                 print_error('invalidformdata');
             }
             break;
-            
+
         case 'save':
             if (confirm_sesskey() and $form = data_submitted($CFG->wwwroot.'/mod/lesson/view.php')) {
                 $name = trim(optional_param('name', '', PARAM_CLEAN));
-                
+
                 // Make sure it is not empty
                 if (empty($name)) {
                     lesson_set_message(get_string('missingname', 'lesson'));
                     $mode = 'add';
                     break;
-                }     
+                }
                 // Check for censored words
                 $filterwords = explode(',', get_string('censorbadwords'));
                 foreach ($filterwords as $filterword) {
                 if (!$grades = $DB->get_records_select('lesson_grades', "lessonid = :lessonid", $params, 'completed')) {
                     print_error('cannotfindfirstgrade', 'lesson');
                 }
-                
-                if (!$newgrade = $DB->get_record_sql("SELECT * 
-                                                   FROM {lesson_grades} 
+
+                if (!$newgrade = $DB->get_record_sql("SELECT *
+                                                   FROM {lesson_grades}
                                                   WHERE lessonid = :lessonid
-                                                    AND userid = :userid 
+                                                    AND userid = :userid
                                                ORDER BY completed DESC", $params, true)) {
                     print_error('cannotfindnewestgrade', 'lesson');
                 }
-                
+
                 // Check for multiple submissions
                 if ($DB->record_exists('lesson_high_scores', array('gradeid' => $newgrade->id))) {
                     print_error('onpostperpage', 'lesson');
                 }
-                
+
                 // Find out if we need to delete any records
-                if ($highscores = $DB->get_records_sql("SELECT h.*, g.grade 
-                                                     FROM {lesson_grades} g, {lesson_high_scores} h 
+                if ($highscores = $DB->get_records_sql("SELECT h.*, g.grade
+                                                     FROM {lesson_grades} g, {lesson_high_scores} h
                                                     WHERE h.gradeid = g.id
                                                     AND h.lessonid = :lessonid
                                                     ORDER BY g.grade DESC", $params)) {
                     }
                     if (count($uniquescores) >= $lesson->maxhighscores) {
                         // Top scores list is full, might need to delete a score
-                        $flag = true;                
+                        $flag = true;
                         // See if the new score is already listed in the top scores list
                         // if it is listed, then dont need to delete any records
                         foreach ($highscores as $highscore) {
                             if ($newgrade->grade == $highscore->grade) {
                                 $flag = false;
                             }
-                        }    
+                        }
                         if ($flag) {
                             // Pushing out the lowest score (could be multiple records)
                             $lowscore = 0;
                 $newhighscore->nickname = $name;
 
                 $DB->insert_record('lesson_high_scores', $newhighscore);
-                
+
                 // Log it
                 add_to_log($course->id, 'lesson', 'update highscores', "highscores.php?id=$cm->id", $name, $cm->id);
-                
+
                 lesson_set_message(get_string('postsuccess', 'lesson'), 'notifysuccess');
                 redirect("$CFG->wwwroot/mod/lesson/highscores.php?id=$cm->id&amp;link=1");
             } else {
             if (!$grades = $DB->get_records_select("lesson_grades", "lessonid = :lessonid", $params, "completed")) {
                 $grades = array();
             }
-        
+
             echo $OUTPUT->heading(get_string("topscorestitle", "lesson", $lesson->maxhighscores), 4);
 
             if (!$highscores = $DB->get_records_select("lesson_high_scores", "lessonid = :lessonid", $params)) {
                     $topscores[$grade][] = $highscore->nickname;
                 }
                 krsort($topscores);
-                       
+
                 $table = new html_table();
                 $table->align = array('center', 'left', 'right');
                 $table->wrap = array();
                 $table->width = "30%";
                 $table->cellspacing = '10px';
                 $table->size = array('*', '*', '*');
-            
+
                 $table->head = array(get_string("rank", "lesson"), get_string('name'), get_string("scores", "lesson"));
-            
+
                 $printed = 0;
                 while (true) {
                     $temp = current($topscores);
                     $score = key($topscores);
                     $rank = $printed + 1;
-                    sort($temp); 
+                    sort($temp);
                     foreach ($temp as $student) {
                         $table->data[] = array($rank, $student, $score.'%');
                     }
                     $printed++;
-                    if (!next($topscores) || !($printed < $lesson->maxhighscores)) { 
+                    if (!next($topscores) || !($printed < $lesson->maxhighscores)) {
                         break;
                     }
                 }
                 echo $OUTPUT->table($table);
             }
-        
+
             if (!has_capability('mod/lesson:manage', $context)) {  // teachers don't need the links
                 echo '<div class="mdl-align">';
                 if ($link) {
             }
             break;
     }
-    
+
     echo $OUTPUT->footer();
 
-?>
+
index 2e6fdcd9e82280bd7db0e69adfa5a1f5dddea641..48a3b503bf098e2f1b44044f636e81b651175855 100644 (file)
 
     echo $OUTPUT->footer();
 
-?>
+
index 125c92c5c319c9206affeae1483150a21bc8d7ef..8e7310a2129435b699403579456350abb19b3ad4 100644 (file)
@@ -4,9 +4,9 @@
  * This is a very rough importer for powerpoint slides
  * Export a powerpoint presentation with powerpoint as html pages
  * Do it with office 2002 (I think?) and no special settings
- * Then zip the directory with all of the html pages 
+ * Then zip the directory with all of the html pages
  * and the zip file is what you want to upload
- * 
+ *
  * The script supports book and lesson.
  *
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
@@ -25,7 +25,7 @@
         $url->param('pageid', $pageid);
     }
     $PAGE->set_url($url);
-    
+
     if (! $cm = get_coursemodule_from_id('lesson', $id)) {
         print_error('invalidcoursemodule');
     }
@@ -33,7 +33,7 @@
     if (! $course = $DB->get_record("course", array("id" => $cm->course))) {
         print_error('coursemisconf');
     }
-    
+
     // allows for adaption for multiple modules
     if(! $modname = $DB->get_field('modules', 'name', array('id' => $cm->module))) {
         print_error('invalidmoduleid', '', '', $cm->module);
             echo $OUTPUT->notification(get_string("uploadnofilefound") );
 
         } else {  // Valid file is found
-            
+
             if ($rawpages = readdata($_FILES, $course->id, $modname)) {  // first try to reall all of the data in
                 $pageobjects = extract_data($rawpages, $course->id, $mod->name, $modname); // parse all the html files into objects
                 clean_temp(); // all done with files so dump em
-                                
-                $mod_create_objects = $modname.'_create_objects';  
-                $mod_save_objects = $modname.'_save_objects'; 
-                
+
+                $mod_create_objects = $modname.'_create_objects';
+                $mod_save_objects = $modname.'_save_objects';
+
                 $objects = $mod_create_objects($pageobjects, $mod->id);  // function to preps the data to be sent to DB
-                
+
                 if(! $mod_save_objects($objects, $mod->id, $pageid)) {  // sends it to DB
                     print_error('cannotsavedata');
                 }
     echo $OUTPUT->box_end();
 
     echo $OUTPUT->footer();
-    
+
 // START OF FUNCTIONS
 
 function readdata($file, $courseid, $modname) {
@@ -127,13 +127,13 @@ function readdata($file, $courseid, $modname) {
     global $CFG;
 
     // create an upload directory in temp
-    make_upload_directory('temp/'.$modname);   
+    make_upload_directory('temp/'.$modname);
 
     $base = $CFG->dataroot."/temp/$modname/";
 
     $zipfile = $_FILES["newfile"]["name"];
     $tempzipfile = $_FILES["newfile"]["tmp_name"];
-    
+
     // create our directory
     $path_parts = pathinfo($zipfile);
     $dirname = substr($zipfile, 0, strpos($zipfile, '.'.$path_parts['extension'])); // take off the extension
@@ -146,14 +146,14 @@ function readdata($file, $courseid, $modname) {
 
     // unzip it!
     unzip_file($base.$zipfile, $base, false);
-    
+
     $base = $base.$dirname;  // update the base
-    
+
     // this is the file where we get the names of the files for the slides (in the correct order too)
     $outline = $base.'/outline.htm';
-    
+
     $pages = array();
-    
+
     if (file_exists($outline) and is_readable($outline)) {
         $outlinecontents = file_get_contents($outline);
         $filenames = array();
@@ -167,9 +167,9 @@ function readdata($file, $courseid, $modname) {
             } else {
                 return false;
             }
-        }        
+        }
     } else {
-        // cannot find the outline, so grab all files that start with slide        
+        // cannot find the outline, so grab all files that start with slide
         $dh  = opendir($base);
         while (false !== ($file = readdir($dh))) {  // read throug the directory
            if ('slide' == substr($file, 0, 5)) {  // check for name (may want to check extension later)
@@ -184,31 +184,31 @@ function readdata($file, $courseid, $modname) {
 
         ksort($pages);  // order them by file name
     }
-    
+
     if (empty($pages)) {
         return false;
     }
-    
+
     return $pages;
 }
 
 function extract_data($pages, $courseid, $lessonname, $modname) {
     // this function attempts to extract the content out of the slides
     // the slides are ugly broken xml.  and the xml is broken... yeah...
-    
+
     global $CFG;
     global $matches;
 
     $extratedpages = array();
-    
+
     // directory for images
-    make_upload_directory($courseid.'/moddata/'.$modname, false);  // we store our images in a subfolder in here 
-    
+    make_upload_directory($courseid.'/moddata/'.$modname, false);  // we store our images in a subfolder in here
+
     $imagedir = $CFG->dataroot.'/'.$courseid.'/moddata/'.$modname;
-    
+
     require_once($CFG->libdir .'/filelib.php');
     $imagelink = get_file_url($courseid.'/moddata/'.$modname);
-    
+
     // try to make a unique subfolder to store the images
     $lessonname = str_replace(' ', '_', $lessonname); // get rid of spaces
     $i = 0;
@@ -222,12 +222,12 @@ function extract_data($pages, $courseid, $lessonname, $modname) {
         }
         $i++;
     }
-    
+
     foreach ($pages as $file => $content) {
         // to make life easier on our preg_match_alls, we strip out all tags except
         // for div and img (where our content is).  We want div because sometimes we
         // can identify the content in the div based on the div's class
-        
+
         $tags = '<div><img>'; // should also allow <b><i>
         $string = strip_tags($content,$tags);
         //echo s($string);
@@ -240,7 +240,7 @@ function extract_data($pages, $courseid, $lessonname, $modname) {
         //(<([\w]+)[^>]*>)([^<\\2>]*)(<\/\\2>)  original pattern
         //(<(div+)[^>]*>)[^(<div*)](<\/div>) work in progress
 
-        $path_parts = pathinfo($file);      
+        $path_parts = pathinfo($file);
         $file = substr($path_parts['basename'], 0, strpos($path_parts['basename'], '.')); // get rid of the extension
 
         $imgs = array();
@@ -257,7 +257,7 @@ function extract_data($pages, $courseid, $lessonname, $modname) {
         // this foreach keeps the style intact.  Found it doesn't help much.  But if you want back uncomment
         // this foreach and uncomment the line with the comment imgstyle in it.  Also need to comment out
         // the $page->images[]... line in the next foreach
-        /*foreach ($imgs[1] as $img) { 
+        /*foreach ($imgs[1] as $img) {
             $page->images[] = '<img '.str_replace('src="', "src=\"$imagelink/", $img).' />';
         }*/
         foreach ($imgs[2] as $img) {
@@ -265,9 +265,9 @@ function extract_data($pages, $courseid, $lessonname, $modname) {
             $page->images[] = "<img src=\"$imagelink/$img\" title=\"$img\" />";  // comment out this line if you are using the above foreach loop
         }
         for($i = 0; $i < count($matches[1]); $i++) { // go through all of our div matches
-    
-            $class = isolate_class($matches[1][$i]); // first step in isolating the class      
-        
+
+            $class = isolate_class($matches[1][$i]); // first step in isolating the class
+
             // check for any static classes
             switch ($class) {
                 case 'T':  // class T is used for Titles
@@ -293,8 +293,8 @@ function extract_data($pages, $courseid, $lessonname, $modname) {
         }
         /*if (count($page->contents) == 0) {  // didnt find anything, grab everything
                                             // potential to pull in a lot of crap
-            for($i = 0; $i < count($matches[1]); $i++) {        
-                //if($class = isolate_class($matches[1][$i])) { 
+            for($i = 0; $i < count($matches[1]); $i++) {
+                //if($class = isolate_class($matches[1][$i])) {
                     //if ($class == 'O') {
                         if ($matches[3][$i] != '&#13;') {  // odd crap generated... sigh
                             if (substr($matches[3][$i], 0, 1) == ':') {  // check for leading :    ... hate MS ...
@@ -309,9 +309,9 @@ function extract_data($pages, $courseid, $lessonname, $modname) {
         }*/
         // add the page to the array;
         $extratedpages[] = $page;
-        
+
     } // end $pages foreach loop
-    
+
     return $extratedpages;
 }
 
@@ -320,9 +320,9 @@ A recursive function to build a html list
 */
 function build_list($list, &$i, $depth) {
     global $matches; // not sure why I global this...
-    
+
     while($i < count($matches[1])) {
-    
+
         $class = isolate_class($matches[1][$i]);
 
         if (strstr($class, 'B')) {  // make sure we are still working with bullet classes
@@ -359,11 +359,11 @@ function build_list($list, &$i, $depth) {
     // end the list and return it
     $list .= '</ul>';
     return $list;
-    
+
 }
 
 /**
-Given an html tag, this function will 
+Given an html tag, this function will
 */
 function isolate_class($string) {
     if($class = strstr($string, 'class=')) { // first step in isolating the class
@@ -386,15 +386,15 @@ This function strips off the random chars that ppt puts infront of bullet lists
 */
 function ppt_clean_text($string) {
     $chop = 1; // default: just a single char infront of the content
-    
+
     // look for any other crazy things that may be infront of the content
     if (strstr($string, '&lt;') and strpos($string, '&lt;') == 0) {  // look for the &lt; in the sting and make sure it is in the front
         $chop = 4;  // increase the $chop
     }
     // may need to add more later....
-    
+
     $string = substr($string, $chop);
-    
+
     if ($string != '&#13;') {
         return $string;
     } else {
@@ -409,7 +409,7 @@ function clean_temp() {
     global $CFG;
     // this function is broken, use it to clean up later
     // should only clean up what we made as well because someone else could be importing ppt as well
-    //delDirContents($CFG->dataroot.'/temp/lesson');    
+    //delDirContents($CFG->dataroot.'/temp/lesson');
 }
 
 /**
@@ -419,7 +419,7 @@ function lesson_create_objects($pageobjects, $lessonid) {
 
     $branchtables = array();
     $branchtable = new stdClass;
-    
+
     // all pages have this info
     $page->lessonid = $lessonid;
     $page->prevpageid = 0;
@@ -430,7 +430,7 @@ function lesson_create_objects($pageobjects, $lessonid) {
     $page->display = 1;
     $page->timecreated = time();
     $page->timemodified = 0;
-    
+
     // all answers are the same
     $answer->lessonid = $lessonid;
     $answer->jumpto = LESSON_NEXTPAGE;
@@ -446,14 +446,14 @@ function lesson_create_objects($pageobjects, $lessonid) {
 
     $answer->jumpto = LESSON_PREVIOUSPAGE;
     $answer->answer = "Previous";
-    
+
     $answers[] = clone($answer);
-    
+
     $branchtable->answers = $answers;
-    
+
     $i = 1;
-    
-    foreach ($pageobjects as $pageobject) {     
+
+    foreach ($pageobjects as $pageobject) {
         $temp = prep_page($pageobject, $i);  // makes our title and contents
         $page->title = $temp->title;
         $page->contents = $temp->contents;
@@ -473,7 +473,7 @@ function book_create_objects($pageobjects, $bookid) {
 
     $chapters = array();
     $chapter = new stdClass;
-    
+
     // same for all chapters
     $chapter->bookid = $bookid;
     $chapter->pagenum = $DB->count_records('book_chapters', array('bookid'=>$bookid))+1;
@@ -481,14 +481,14 @@ function book_create_objects($pageobjects, $bookid) {
     $chapter->timemodified = time();
     $chapter->subchapter = 0;
 
-    $i = 1; 
+    $i = 1;
     foreach ($pageobjects as $pageobject) {
         $page = prep_page($pageobject, $i);  // get title and contents
         $chapter->importsrc = $pageobject->source; // add the source
         $chapter->title = $page->title;
         $chapter->content = $page->contents;
-        $chapters[] = $chapter; 
-        
+        $chapters[] = $chapter;
+
         // increment our page number and our counter
         $chapter->pagenum = $chapter->pagenum + 1;
         $i++;
@@ -504,17 +504,17 @@ function prep_page($pageobject, $count) {
     if ($pageobject->title == '') {
         $page->title = "Page $count";  // no title set so make a generic one
     } else {
-        $page->title = $pageobject->title;      
+        $page->title = $pageobject->title;
     }
-    
+
     $page->contents = '';
-    
+
     // nab all the images first
     foreach ($pageobject->images as $image) {
         $image = str_replace("\n", '', $image);
         $image = str_replace("\r", '', $image);
         $image = str_replace("'", '"', $image);  // imgstyle
-                    
+
         $page->contents .= $image;
     }
     // go through the contents array and put <p> tags around each element and strip out \n which I have found to be uneccessary
@@ -533,7 +533,7 @@ function prep_page($pageobject, $count) {
 */
 function lesson_save_objects($branchtables, $lessonid, $after) {
     global $DB;
-    
+
     // first set up the prevpageid and nextpageid
     if ($after == 0) { // adding it to the top of the lesson
         $prevpageid = 0;
@@ -546,16 +546,16 @@ function lesson_save_objects($branchtables, $lessonid, $after) {
         $prevpageid = $after;
         $nextpageid = $DB->get_field('lesson_pages', 'nextpageid', array('id' => $after));
     }
-    
+
     foreach ($branchtables as $branchtable) {
-        
+
         // set the doubly linked list
         $branchtable->page->nextpageid = $nextpageid;
         $branchtable->page->prevpageid = $prevpageid;
-        
+
         // insert the page
         $id = $DB->insert_record('lesson_pages', $branchtable->page);
-    
+
         // update the link of the page previous to the one we just updated
         if ($prevpageid != 0) {  // if not the first page
             $DB->set_field("lesson_pages", "nextpageid", $id, array("id" => $prevpageid));
@@ -566,15 +566,15 @@ function lesson_save_objects($branchtables, $lessonid, $after) {
             $answer->pageid = $id;
             $DB->insert_record('lesson_answers', $answer);
         }
-        
+
         $prevpageid = $id;
     }
-    
+
     // all done with inserts.  Now check to update our last page (this is when we import between two lesson pages)
     if ($nextpageid != 0) {  // if the next page is not the end of lesson
         $DB->set_field("lesson_pages", "prevpageid", $id, array("id" => $nextpageid));
     }
-    
+
     return true;
 }
 
@@ -583,7 +583,7 @@ function lesson_save_objects($branchtables, $lessonid, $after) {
 */
 function book_save_objects($chapters, $bookid, $pageid='0') {
     global $DB;
-    
+
     // nothing fancy, just save them all in order
     foreach ($chapters as $chapter) {
         $chapter->id = $DB->insert_record('book_chapters', $chapter);
@@ -591,4 +591,4 @@ function book_save_objects($chapters, $bookid, $pageid='0') {
     return true;
 }
 
-?>
+
index 75210af80e92fa7459a04929e0e9aee66b9338b3..d803c3b73f9517bb8be26410da32fbe00c1c79b0 100644 (file)
 
     echo $OUTPUT->footer();
 
-?>
+
index 8713bdaa551b23754b2624912f8a17213af35fef..5ec91aa4fd0fee51f6971c1caf38d242ae2948d5 100644 (file)
@@ -1,7 +1,7 @@
 <?php  // $Id: lesson.php, v 1.0 25 Jan 2004
 /**
  * Handles lesson actions
- * 
+ *
  * ACTIONS handled are:
  *    addbranchtable
  *    addendofbranch
 
     require("../../config.php");
     require("locallib.php");
-    
+
     $id     = required_param('id', PARAM_INT);         // Course Module ID
     $action = required_param('action', PARAM_ALPHA);   // Action
-    
+
     list($cm, $course, $lesson) = lesson_get_basics($id);
 
     require_login($course->id, false, $cm);
     $PAGE->navbar->add(get_string($action, 'lesson'));
 
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
-    
+
 /// Set up some general variables
     $usehtmleditor = can_use_html_editor();
-    
+
 /// Process the action
     switch ($action) {
         case 'addbranchtable':
@@ -64,5 +64,5 @@
     }
 
     echo $OUTPUT->footer();
-?>
+
+
index eb68cd4ff83dc198dd848be286592e35f2ef31d6..0ef98ef4188098ad71c13101dc3ddffadfd8604f 100644 (file)
@@ -10,7 +10,7 @@
 
 /**
 * Next page -> any page not seen before
-*/    
+*/
 if (!defined("LESSON_UNSEENPAGE")) {
     define("LESSON_UNSEENPAGE", 1); // Next page -> any page not seen before
 }
@@ -75,7 +75,7 @@ if (!defined("LESSON_CLUSTERJUMP")) {
 }
 /**
  * Undefined
- */    
+ */
 if (!defined("LESSON_UNDEFINED")) {
     define("LESSON_UNDEFINED", -99);
 }
@@ -87,7 +87,7 @@ if (!defined("LESSON_UNDEFINED")) {
  */
 if (!defined("LESSON_SHORTANSWER")) {
     define("LESSON_SHORTANSWER",   "1");
-}        
+}
 /**
  * True/False question type
  */
@@ -97,7 +97,7 @@ if (!defined("LESSON_TRUEFALSE")) {
 /**
  * Multichoice question type
  *
- * If you change the value of this then you need 
+ * If you change the value of this then you need
  * to change it in restorelib.php as well.
  */
 if (!defined("LESSON_MULTICHOICE")) {
@@ -113,7 +113,7 @@ if (!defined("LESSON_RANDOM")) {
  * Matching question type
  *
  * If you change the value of this then you need
- * to change it in restorelib.php, in mysql.php 
+ * to change it in restorelib.php, in mysql.php
  * and postgres7.php as well.
  */
 if (!defined("LESSON_MATCHING")) {
@@ -209,7 +209,7 @@ if (!defined("LESSON_RESPONSE_EDITOR")) {
 }
 
 //////////////////////////////////////////////////////////////////////////////////////
-/// Any other lesson functions go here.  Each of them must have a name that 
+/// Any other lesson functions go here.  Each of them must have a name that
 /// starts with lesson_
 
 /**
@@ -285,7 +285,7 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '', $extraedit
 }
 
 /**
- * Returns course module, course and module instance given 
+ * Returns course module, course and module instance given
  * either the course module ID or a lesson module ID.
  *
  * @param int $cmid Course Module ID
@@ -294,7 +294,7 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '', $extraedit
  **/
 function lesson_get_basics($cmid = 0, $lessonid = 0) {
     global $DB;
-    
+
     if ($cmid) {
         if (!$cm = get_coursemodule_from_id('lesson', $cmid)) {
             print_error('invalidcoursemodule');
@@ -318,7 +318,7 @@ function lesson_get_basics($cmid = 0, $lessonid = 0) {
     } else {
         print_error('invalidid', 'lesson');
     }
-    
+
     return array($cm, $course, $lesson);
 }
 
@@ -334,13 +334,13 @@ function lesson_get_basics($cmid = 0, $lessonid = 0) {
  **/
 function lesson_set_message($message, $class="notifyproblem", $align='center') {
     global $SESSION;
-    
+
     if (empty($SESSION->lesson_messages) or !is_array($SESSION->lesson_messages)) {
         $SESSION->lesson_messages = array();
     }
-    
+
     $SESSION->lesson_messages[] = array($message, $class, $align);
-    
+
     return true;
 }
 
@@ -356,19 +356,19 @@ function lesson_set_message($message, $class="notifyproblem", $align='center') {
  **/
 function lesson_print_messages() {
     global $SESSION, $OUTPUT;
-    
+
     if (empty($SESSION->lesson_messages)) {
         // No messages to print
         return true;
     }
-    
+
     foreach($SESSION->lesson_messages as $message) {
         echo $OUTPUT->notification($message[0], $message[1], $message[2]);
     }
-    
+
     // Reset
     unset($SESSION->lesson_messages);
-    
+
     return true;
 }
 
@@ -400,7 +400,7 @@ function lesson_print_submit_link($name, $form, $align = 'center', $class='stand
     $output = "<div class=\"lessonbutton $class\" $align>\n";
     $output .= "<input type=\"submit\" value=\"$name\" $align $id />";
     $output .= "</div>\n";
-    
+
     if ($return) {
         return $output;
     } else {
@@ -424,7 +424,7 @@ function lesson_print_time_remaining($starttime, $maxtime, $return = false) {
     $timeleft = $timeleft - ($hours * 3600);
     $minutes = floor($timeleft/60);
     $secs = $timeleft - ($minutes * 60);
-    
+
     if ($minutes < 10) {
         $minutes = "0$minutes";
     }
@@ -435,9 +435,9 @@ function lesson_print_time_remaining($starttime, $maxtime, $return = false) {
     $output[] = $hours;
     $output[] = $minutes;
     $output[] = $secs;
-    
+
     $output = implode(':', $output);
-    
+
     if ($return) {
         return $output;
     } else {
@@ -472,7 +472,7 @@ function lesson_print_page_actions($cmid, $page, $printmove, $printaddpage = fal
         }
         $actions[] = "<a title=\"".get_string('update')."\" href=\"$CFG->wwwroot/mod/lesson/lesson.php?id=$cmid&amp;action=editpage&amp;pageid=$page->id\">
                       <img src=\"" . $OUTPUT->old_icon_url('t/edit') . "\" class=\"iconsmall\" alt=\"".get_string('update')."\" /></a>\n";
-        
+
         $actions[] = "<a title=\"".get_string('preview')."\" href=\"$CFG->wwwroot/mod/lesson/view.php?id=$cmid&amp;pageid=$page->id\">
                       <img src=\"" . $OUTPUT->old_icon_url('t/preview') . "\" class=\"iconsmall\" alt=\"".get_string('preview')."\" /></a>\n";
 
@@ -518,33 +518,33 @@ function lesson_print_page_actions($cmid, $page, $printmove, $printaddpage = fal
  **/
 function lesson_print_add_links($cmid, $prevpageid, $return = false) {
     global $CFG;
-    
+
     $context = get_context_instance(CONTEXT_MODULE, $cmid);
-    
+
     $links = '';
     if (has_capability('mod/lesson:edit', $context)) {
         $links = array();
         $links[] = "<a href=\"$CFG->wwwroot/mod/lesson/import.php?id=$cmid&amp;pageid=$prevpageid\">".
                     get_string('importquestions', 'lesson').'</a>';
-        
+
         $links[] = "<a href=\"$CFG->wwwroot/mod/lesson/lesson.php?id=$cmid&amp;sesskey=".sesskey()."&amp;action=addcluster&amp;pageid=$prevpageid\">".
                     get_string('addcluster', 'lesson').'</a>';
-        
+
         if ($prevpageid != 0) {
             $links[] = "<a href=\"$CFG->wwwroot/mod/lesson/lesson.php?id=$cmid&amp;sesskey=".sesskey()."&amp;action=addendofcluster&amp;pageid=$prevpageid\">".
                         get_string('addendofcluster', 'lesson').'</a>';
         }
         $links[] = "<a href=\"$CFG->wwwroot/mod/lesson/lesson.php?id=$cmid&amp;action=addbranchtable&amp;pageid=$prevpageid\">".
                     get_string('addabranchtable', 'lesson').'</a>';
-        
+
         if ($prevpageid != 0) {
             $links[] = "<a href=\"$CFG->wwwroot/mod/lesson/lesson.php?id=$cmid&amp;sesskey=".sesskey()."&amp;action=addendofbranch&amp;pageid=$prevpageid\">".
                         get_string('addanendofbranch', 'lesson').'</a>';
         }
-        
+
         $links[] = "<a href=\"$CFG->wwwroot/mod/lesson/lesson.php?id=$cmid&amp;action=addpage&amp;pageid=$prevpageid\">".
                     get_string('addaquestionpagehere', 'lesson').'</a>';
-        
+
         $links = implode(" | \n", $links);
         $links = "\n<div class=\"addlinks\">\n$links\n</div>\n";
     }
@@ -575,7 +575,7 @@ function lesson_get_qtype_name($qtype) {
         case LESSON_NUMERICAL :
             return $LESSON_QUESTION_TYPE[$qtype];
             break;
-        case LESSON_BRANCHTABLE :    
+        case LESSON_BRANCHTABLE :
             return get_string("branchtable", "lesson");
             break;
         case LESSON_ENDOFBRANCH :
@@ -601,7 +601,7 @@ function lesson_get_qtype_name($qtype) {
  **/
 function lesson_get_jump_name($jumpto) {
     global $DB;
-    
+
     if ($jumpto == 0) {
         $jumptitle = get_string('thispage', 'lesson');
     } elseif ($jumpto == LESSON_NEXTPAGE) {
@@ -623,7 +623,7 @@ function lesson_get_jump_name($jumpto) {
             $jumptitle = '<strong>'.get_string('notdefined', 'lesson').'</strong>';
         }
     }
-    
+
     return format_string($jumptitle,true);
 }
 
@@ -633,20 +633,20 @@ function lesson_get_jump_name($jumpto) {
  *
  * This is only used when IMPORTING questions and is only called
  * from format.php
- * Lifted from mod/quiz/lib.php - 
+ * Lifted from mod/quiz/lib.php -
  *    1. all reference to oldanswers removed
  *    2. all reference to quiz_multichoice table removed
  *    3. In SHORTANSWER questions usecase is store in the qoption field
  *    4. In NUMERIC questions store the range as two answers
  *    5. TRUEFALSE options are ignored
  *    6. For MULTICHOICE questions with more than one answer the qoption field is true
- * 
+ *
  * @param opject $question Contains question data like question, type and answers.
  * @return object Returns $result->error or $result->notice.
  **/
 function lesson_save_question_options($question) {
     global $DB;
-    
+
     $timenow = time();
     switch ($question->qtype) {
         case LESSON_SHORTANSWER:
@@ -689,8 +689,8 @@ function lesson_save_question_options($question) {
             $answers = array();
             $maxfraction = -1;
 
-            
-            // for each answer store the pair of min and max values even if they are the same 
+
+            // for each answer store the pair of min and max values even if they are the same
             foreach ($question->answer as $key => $dataanswer) {
                 if ($dataanswer != "") {
                     $answer = new stdClass;
@@ -705,7 +705,7 @@ function lesson_save_question_options($question) {
                     // $answer->answer   = $question->min[$key].":".$question->max[$key]; original line for min/max
                     $answer->response = $question->feedback[$key];
                     $answer->id = $DB->insert_record("lesson_answers", $answer);
-                    
+
                     $answers[] = $answer->id;
                     if ($question->fraction[$key] > $maxfraction) {
                         $maxfraction = $question->fraction[$key];
@@ -738,7 +738,7 @@ function lesson_save_question_options($question) {
             }
             $true->id = $DB->insert_record("lesson_answers", $answer);
 
-            // the lie    
+            // the lie
             $answer = new stdClass;
             $answer->lessonid   = $question->lessonid;
             $answer->pageid = $question->id;
@@ -786,7 +786,7 @@ function lesson_save_question_options($question) {
                     $answer->response = $question->feedback[$key];
                     $answer->id = $DB->insert_record("lesson_answers", $answer);
                     // for Sanity checks
-                    if ($question->fraction[$key] > 0) {                 
+                    if ($question->fraction[$key] > 0) {
                         $totalfraction += $question->fraction[$key];
                     }
                     if ($question->fraction[$key] > $maxfraction) {
@@ -826,7 +826,7 @@ function lesson_save_question_options($question) {
                     $answer->pageid   = $question->id;
                     $answer->timecreated   = $timenow;
                     $answer->answer = $questiontext;
-                    $answer->response   = $answertext; 
+                    $answer->response   = $answertext;
                     if ($i == 0) {
                         // first answer contains the correct answer jump
                         $answer->jumpto = LESSON_NEXTPAGE;
@@ -915,14 +915,14 @@ function lesson_save_question_options($question) {
  *
  * returns true if jumpto page is (logically) after the pageid page or
  * if the jumpto value is a special value.  Returns false in all other cases.
- * 
+ *
  * @param int $pageid Id of the page from which you are jumping from.
  * @param int $jumpto The jumpto number.
  * @return boolean True or false after a series of tests.
  **/
 function lesson_iscorrect($pageid, $jumpto) {
     global $DB;
-    
+
     // first test the special values
     if (!$jumpto) {
         // same page
@@ -964,7 +964,7 @@ function lesson_iscorrect($pageid, $jumpto) {
  **/
 function lesson_display_branch_jumps($lessonid, $pageid) {
     global $DB;
-    
+
     if($pageid == 0) {
         // first page
         return false;
@@ -979,22 +979,22 @@ function lesson_display_branch_jumps($lessonid, $pageid) {
     if ($lessonpages[$pageid]->qtype == LESSON_BRANCHTABLE) {
         return true;
     }
-    
+
     return lesson_is_page_in_branch($lessonpages, $pageid);
 }
 
 /**
  * Checks to see if a page is a cluster page or is
- * a page that is enclosed by a cluster page and an end of cluster or end of lesson 
+ * a page that is enclosed by a cluster page and an end of cluster or end of lesson
  * May call this function: {@link lesson_is_page_in_cluster()}
- * 
+ *
  * @param int $lesson Id of the lesson to which the page belongs.
  * @param int $pageid Id of the page.
  * @return boolean True or false.
  **/
 function lesson_display_cluster_jump($lesson, $pageid) {
     global $DB;
-    
+
     if($pageid == 0) {
         // first page
         return false;
@@ -1009,16 +1009,16 @@ function lesson_display_cluster_jump($lesson, $pageid) {
     if ($lessonpages[$pageid]->qtype == LESSON_CLUSTER) {
         return true;
     }
-    
+
     return lesson_is_page_in_cluster($lessonpages, $pageid);
 
 }
 
 /**
- * Checks to see if a LESSON_CLUSTERJUMP or 
+ * Checks to see if a LESSON_CLUSTERJUMP or
  * a LESSON_UNSEENBRANCHPAGE is used in a lesson.
  *
- * This function is only executed when a teacher is 
+ * This function is only executed when a teacher is
  * checking the navigation for a lesson.
  *
  * @param int $lesson Id of the lesson that is to be checked.
@@ -1026,7 +1026,7 @@ function lesson_display_cluster_jump($lesson, $pageid) {
  **/
 function lesson_display_teacher_warning($lesson) {
     global $DB;
-    
+
     // get all of the lesson answers
     $params = array ("lessonid" => $lesson);
     if (!$lessonanswers = $DB->get_records_select("lesson_answers", "lessonid = :lessonid", $params)) {
@@ -1039,7 +1039,7 @@ function lesson_display_teacher_warning($lesson) {
             return true;
         }
     }
-    
+
     // if no answers use either of the two jumps
     return false;
 }
@@ -1051,9 +1051,9 @@ function lesson_display_teacher_warning($lesson) {
  * This will select a page randomly
  * and the page selected will be inbetween a cluster page and end of cluter or end of lesson
  * and the page selected will be a page that has not been viewed already
- * and if any pages are within a branch table or end of branch then only 1 page within 
+ * and if any pages are within a branch table or end of branch then only 1 page within
  * the branch table or end of branch will be randomly selected (sub clustering).
- * 
+ *
  * @param int $lessonid Id of the lesson.
  * @param int $userid Id of the user.
  * @param int $pageid Id of the current page from which we are jumping from.
@@ -1061,7 +1061,7 @@ function lesson_display_teacher_warning($lesson) {
  **/
 function lesson_cluster_jump($lessonid, $userid, $pageid) {
     global $DB;
-    
+
     // get the number of retakes
     if (!$retakes = $DB->count_records("lesson_grades", array("lessonid"=>$lessonid, "userid"=>$userid))) {
         $retakes = 0;
@@ -1090,7 +1090,7 @@ function lesson_cluster_jump($lessonid, $userid, $pageid) {
     }
 
     $pageid = $lessonpages[$pageid]->nextpageid; // move down from the cluster page
-    
+
     $clusterpages = array();
     while (true) {  // now load all the pages into the cluster that are not already inside of a branch table.
         if ($lessonpages[$pageid]->qtype == LESSON_ENDOFCLUSTER) {
@@ -1130,7 +1130,7 @@ function lesson_cluster_jump($lessonid, $userid, $pageid) {
             if ($flag && count($branchpages) > 0) {
                 // add branch table
                 $unseen[] = $clusterpage;
-            }        
+            }
         } else {
             // add any other type of page that has not already been viewed
             if (!array_key_exists($clusterpage->id, $seenpages)) {
@@ -1144,7 +1144,7 @@ function lesson_cluster_jump($lessonid, $userid, $pageid) {
     } else {
         return $exitjump; // seen all there is to see, leave the cluster
     }
-    
+
     if ($nextpage->qtype == LESSON_BRANCHTABLE) { // if branch table, then pick a random page inside of it
         $branchpages = lesson_pages_in_branch($lessonpages, $nextpage->id);
         return $branchpages[rand(0, count($branchpages)-1)]->id;
@@ -1155,7 +1155,7 @@ function lesson_cluster_jump($lessonid, $userid, $pageid) {
 
 /**
  * Returns pages that are within a branch table and another branch table, end of branch or end of lesson
- * 
+ *
  * @param array $lessonpages An array of lesson page objects.
  * @param int $branchid The id of the branch table that we would like the containing pages for.
  * @return array An array of lesson page objects.
@@ -1163,8 +1163,8 @@ function lesson_cluster_jump($lessonid, $userid, $pageid) {
 function lesson_pages_in_branch($lessonpages, $branchid) {
     $pageid = $lessonpages[$branchid]->nextpageid;  // move to the first page after the branch table
     $pagesinbranch = array();
-    
-    while (true) { 
+
+    while (true) {
         if ($pageid == 0) { // EOL
             break;
         } elseif ($lessonpages[$pageid]->qtype == LESSON_BRANCHTABLE) {
@@ -1175,13 +1175,13 @@ function lesson_pages_in_branch($lessonpages, $branchid) {
         $pagesinbranch[] = $lessonpages[$pageid];
         $pageid = $lessonpages[$pageid]->nextpageid;
     }
-    
+
     return $pagesinbranch;
 }
 
 /**
  * Interprets the LESSON_UNSEENBRANCHPAGE jump.
- * 
+ *
  * will return the pageid of a random unseen page that is within a branch
  *
  * @see lesson_pages_in_branch()
@@ -1192,7 +1192,7 @@ function lesson_pages_in_branch($lessonpages, $branchid) {
  **/
 function lesson_unseen_question_jump($lesson, $user, $pageid) {
     global $DB;
-    
+
     // get the number of retakes
     if (!$retakes = $DB->count_records("lesson_grades", array("lessonid"=>$lesson, "userid"=>$user))) {
         $retakes = 0;
@@ -1212,7 +1212,7 @@ function lesson_unseen_question_jump($lesson, $user, $pageid) {
     if (!$lessonpages = $DB->get_records_select("lesson_pages", "lessonid = :lessonid", $params)) {
         print_error('cannotfindpages', 'lesson');
     }
-    
+
     if ($pageid == LESSON_UNSEENBRANCHPAGE) {  // this only happens when a student leaves in the middle of an unseen question within a branch series
         $pageid = $seenpages[0];  // just change the pageid to the last page viewed inside the branch table
     }
@@ -1224,12 +1224,12 @@ function lesson_unseen_question_jump($lesson, $user, $pageid) {
         }
         $pageid = $lessonpages[$pageid]->prevpageid;
     }
-    
+
     $pagesinbranch = lesson_pages_in_branch($lessonpages, $pageid);
-    
+
     // this foreach loop stores all the pages that are within the branch table but are not in the $seenpages array
     $unseen = array();
-    foreach($pagesinbranch as $page) {    
+    foreach($pagesinbranch as $page) {
         if (!in_array($page->id, $seenpages)) {
             $unseen[] = $page->id;
         }
@@ -1262,7 +1262,7 @@ function lesson_unseen_question_jump($lesson, $user, $pageid) {
  **/
 function lesson_unseen_branch_jump($lessonid, $userid) {
     global $DB;
-    
+
     if (!$retakes = $DB->count_records("lesson_grades", array("lessonid"=>$lessonid, "userid"=>$userid))) {
         $retakes = 0;
     }
@@ -1277,10 +1277,10 @@ function lesson_unseen_branch_jump($lessonid, $userid) {
     if (!$lessonpages = $DB->get_records_select("lesson_pages", "lessonid = :lessonid", $params)) {
         print_error('cannotfindpages', 'lesson');
     }
-    
+
     // this loads all the viewed branch tables into $seen untill it finds the branch table with the flag
     // which is the branch table that starts the unseenbranch function
-    $seen = array();    
+    $seen = array();
     foreach ($seenbranches as $seenbranch) {
         if (!$seenbranch->flag) {
             $seen[$seenbranch->pageid] = $seenbranch->pageid;
@@ -1314,14 +1314,14 @@ function lesson_unseen_branch_jump($lessonid, $userid) {
 
 /**
  * Handles the random jump between a branch table and end of branch or end of lesson (LESSON_RANDOMPAGE).
- * 
+ *
  * @param int $lessonid Lesson id.
  * @param int $pageid The id of the page that we are jumping from (?)
  * @return int The pageid of a random page that is within a branch table
  **/
 function lesson_random_question_jump($lessonid, $pageid) {
     global $DB;
-    
+
     // get the lesson pages
     $params = array ("lessonid" => $lessonid);
     if (!$lessonpages = $DB->get_records_select("lesson_pages", "lessonid = :lessonid", $params)) {
@@ -1337,9 +1337,9 @@ function lesson_random_question_jump($lessonid, $pageid) {
         $pageid = $lessonpages[$pageid]->prevpageid;
     }
 
-    // get the pages within the branch    
+    // get the pages within the branch
     $pagesinbranch = lesson_pages_in_branch($lessonpages, $pageid);
-    
+
     if(count($pagesinbranch) == 0) {
         // there are no pages inside the branch, so return the next page
         return $lessonpages[$pageid]->nextpageid;
@@ -1350,7 +1350,7 @@ function lesson_random_question_jump($lessonid, $pageid) {
 
 /**
  * Check to see if a page is below a branch table (logically).
- * 
+ *
  * Will return true if a branch table is found logically above the page.
  * Will return false if an end of branch, cluster or the beginning
  * of the lesson is found before a branch table.
@@ -1362,7 +1362,7 @@ function lesson_random_question_jump($lessonid, $pageid) {
 function lesson_is_page_in_branch($pages, $pageid) {
     $pageid = $pages[$pageid]->prevpageid; // move up one
 
-    // go up the pages till branch table    
+    // go up the pages till branch table
     while (true) {
         if ($pageid == 0) {  // ran into the beginning of the lesson
             return false;
@@ -1380,7 +1380,7 @@ function lesson_is_page_in_branch($pages, $pageid) {
 
 /**
  * Check to see if a page is below a cluster page (logically).
- * 
+ *
  * Will return true if a cluster is found logically above the page.
  * Will return false if an end of cluster or the beginning
  * of the lesson is found before a cluster page.
@@ -1392,7 +1392,7 @@ function lesson_is_page_in_branch($pages, $pageid) {
 function lesson_is_page_in_cluster($pages, $pageid) {
     $pageid = $pages[$pageid]->prevpageid; // move up one
 
-    // go up the pages till branch table    
+    // go up the pages till branch table
     while (true) {
         if ($pageid == 0) {  // ran into the beginning of the lesson
             return false;
@@ -1419,13 +1419,13 @@ function lesson_is_page_in_cluster($pages, $pageid) {
                     nmanual => number of manually graded questions
                     manualpoints => point value for manually graded questions }
  */
-function lesson_grade($lesson, $ntries, $userid = 0) {  
+function lesson_grade($lesson, $ntries, $userid = 0) {
     global $USER, $DB;
 
     if (empty($userid)) {
         $userid = $USER->id;
     }
-    
+
     // Zero out everything
     $ncorrect     = 0;
     $nviewed      = 0;
@@ -1438,25 +1438,25 @@ function lesson_grade($lesson, $ntries, $userid = 0) {
     $earned       = 0;
 
     $params = array ("lessonid" => $lesson->id, "userid" => $userid, "retry" => $ntries);
-    if ($useranswers = $DB->get_records_select("lesson_attempts",  "lessonid = :lessonid AND 
+    if ($useranswers = $DB->get_records_select("lesson_attempts",  "lessonid = :lessonid AND
             userid = :userid AND retry = :retry", $params, "timeseen")) {
         // group each try with its page
         $attemptset = array();
         foreach ($useranswers as $useranswer) {
-            $attemptset[$useranswer->pageid][] = $useranswer;                                
+            $attemptset[$useranswer->pageid][] = $useranswer;
         }
-        
+
         // Drop all attempts that go beyond max attempts for the lesson
         foreach ($attemptset as $key => $set) {
             $attemptset[$key] = array_slice($set, 0, $lesson->maxattempts);
         }
-        
+
         // get only the pages and their answers that the user answered
         list($usql, $parameters) = $DB->get_in_or_equal(array_keys($attemptset));
         $parameters["lessonid"] = $lesson->id;
         $pages = $DB->get_records_select("lesson_pages", "lessonid = :lessonid AND id $usql", $parameters);
         $answers = $DB->get_records_select("lesson_answers", "lessonid = :lessonid AND pageid $usql", $parameters);
-        
+
         // Number of pages answered
         $nquestions = count($pages);
 
@@ -1486,7 +1486,7 @@ function lesson_grade($lesson, $ntries, $userid = 0) {
             // Number of times answered
             $nviewed += count($attempts);
         }
-        
+
         if ($lesson->custom) {
             $bestscores = array();
             // Find the highest possible score per page to get our total
@@ -1508,11 +1508,11 @@ function lesson_grade($lesson, $ntries, $userid = 0) {
             }
         }
     }
-    
+
     if ($total) { // not zero
         $thegrade = round(100 * $earned / $total, 5);
     }
-    
+
     // Build the grade information object
     $gradeinfo               = new stdClass;
     $gradeinfo->nquestions   = $nquestions;
@@ -1522,14 +1522,14 @@ function lesson_grade($lesson, $ntries, $userid = 0) {
     $gradeinfo->grade        = $thegrade;
     $gradeinfo->nmanual      = $nmanual;
     $gradeinfo->manualpoints = $manualpoints;
-    
+
     return $gradeinfo;
 }
 
 /**
  * Prints the on going message to the user.
  *
- * With custom grading On, displays points 
+ * With custom grading On, displays points
  * earned out of total points possible thus far.
  * With custom grading Off, displays number of correct
  * answers out of total attempted.
@@ -1551,7 +1551,7 @@ function lesson_print_ongoing_score($lesson) {
             $ntries--;
         }
         $gradeinfo = lesson_grade($lesson, $ntries);
-        
+
         $a = new stdClass;
         if ($lesson->custom) {
             $a->score = $gradeinfo->earned;
@@ -1567,7 +1567,7 @@ function lesson_print_ongoing_score($lesson) {
 
 /**
  * Prints tabs for the editing and adding pages.  Each tab is a question type.
- *  
+ *
  * @param array $qtypes The question types array (may not need to pass this because it is defined in this file)
  * @param string $selected Current selected tab
  * @param string $link The base href value of the link for the tab
@@ -1608,7 +1608,7 @@ function lesson_print_progress_bar($lesson, $course) {
     if (!$lesson->progressbar) {
         return false;
     }
-    
+
     // catch teachers
     if (has_capability('mod/lesson:manage', $context)) {
         echo $OUTPUT->notification(get_string('progressbarteacherwarning2', 'lesson'));
@@ -1626,14 +1626,14 @@ function lesson_print_progress_bar($lesson, $course) {
                 }
             }
         }
-    
+
         // current attempt number
         if (!$ntries = $DB->count_records("lesson_grades", array("lessonid"=>$lesson->id, "userid"=>$USER->id))) {
             $ntries = 0;  // may not be necessary
         }
-    
+
         $viewedpageids = array();
-    
+
         // collect all of the correctly answered questions
         $params = array ("lessonid" => $lesson->id, "userid" => $USER->id, "retry" => $ntries);
         if ($viewedpages = $DB->get_records_select("lesson_attempts", "lessonid = :lessonid AND userid = :userid AND retry = :retry AND correct = 1", $params, 'timeseen DESC', 'pageid, id')) {
@@ -1650,19 +1650,19 @@ function lesson_print_progress_bar($lesson, $course) {
         //      Pages found inside of Clusters
         // Do not filter out Cluster Page(s) because we count a cluster as one.
         // By keeping the cluster page, we get our 1
-        $validpages = array(); 
+        $validpages = array();
         while ($pageid != 0) {
             if ($pages[$pageid]->qtype == LESSON_CLUSTER) {
                 $clusterpageid = $pageid; // copy it
                 $validpages[$clusterpageid] = 1;  // add the cluster page as a valid page
                 $pageid = $pages[$pageid]->nextpageid;  // get next page
-            
+
                 // now, remove all necessary viewed paged ids from the viewedpageids array.
                 while ($pages[$pageid]->qtype != LESSON_ENDOFCLUSTER and $pageid != 0) {
                     if (in_array($pageid, $viewedpageids)) {
                         unset($viewedpageids[array_search($pageid, $viewedpageids)]);  // remove it
                         // since the user did see one page in the cluster, add the cluster pageid to the viewedpageids
-                        if (!in_array($clusterpageid, $viewedpageids)) { 
+                        if (!in_array($clusterpageid, $viewedpageids)) {
                             $viewedpageids[] = $clusterpageid;
                         }
                     }
@@ -1676,10 +1676,10 @@ function lesson_print_progress_bar($lesson, $course) {
                 $validpages[$pageid] = 1;
                 $pageid = $pages[$pageid]->nextpageid;
             }
-        }    
-    
+        }
+
         // progress calculation as a percent
-        $progress = round(count($viewedpageids)/count($validpages), 2) * 100; 
+        $progress = round(count($viewedpageids)/count($validpages), 2) * 100;
     } else {
         $progress = 100;
     }
@@ -1696,7 +1696,7 @@ function lesson_print_progress_bar($lesson, $course) {
     echo '</td>';
     echo '</tr></table>';
     echo '</div>';
-    
+
     return true;
 }
 
@@ -1710,7 +1710,7 @@ function lesson_print_progress_bar($lesson, $course) {
  **/
 function lesson_displayleftif($lesson) {
     global $CFG, $USER, $DB;
-    
+
     if (!empty($lesson->displayleftif)) {
         // get the current user's max grade for this lesson
         $params = array ("userid" => $USER->id, "lessonid" => $lesson->id);
@@ -1722,13 +1722,13 @@ function lesson_displayleftif($lesson) {
             return 0; // no grades
         }
     }
-    
+
     // if we get to here, keep the original state of displayleft lesson setting
     return $lesson->displayleft;
 }
 
 /**
- * 
+ *
  * @param $cm
  * @param $lesson
  * @param $page
@@ -1756,7 +1756,7 @@ function lesson_add_pretend_blocks($page, $cm, $lesson, $timer = null) {
 }
 
 /**
- * If there is a media file associated with this 
+ * If there is a media file associated with this
  * lesson, return a block_contents that displays it.
  *
  * @param int $cmid Course Module ID for this lesson
@@ -1776,8 +1776,8 @@ function lesson_mediafile_block_contents($cmid, $lesson) {
     $link = html_link::make($url, get_string('mediafilepopup', 'lesson'));
     $link->add_action(new popup_action('click', $link->url, $name, $options));
     $link->title = get_string('mediafilepopup', 'lesson');
-    $content .= $OUTPUT->link($link);                    
-    
+    $content .= $OUTPUT->link($link);
+
     $content .= $OUTPUT->help_icon(moodle_help_icon::make("mediafilestudent", get_string("mediafile", "lesson"), "lesson"));
 
     $bc = new block_contents();
@@ -1852,12 +1852,12 @@ function lesson_menu_block_contents($cmid, $lesson) {
 
         // Only process branch tables with display turned on
         if ($page->qtype == LESSON_BRANCHTABLE and $page->display) {
-            if ($page->id == $currentpageid) { 
+            if ($page->id == $currentpageid) {
                 $content .= '<li class="selected">'.format_string($page->title,true)."</li>\n";
             } else {
                 $content .= "<li class=\"notselected\"><a href=\"$CFG->wwwroot/mod/lesson/view.php?id=$cmid&amp;pageid=$page->id\">".format_string($page->title,true)."</a></li>\n";
             }
-            
+
         }
         $pageid = $page->nextpageid;
     }
index 2cae8242a6c25f588ab75914b8e344b1ec11b6ed..f1ba37855104f7371f5fb8b6ec81d97b71b21484 100644 (file)
     }
 
     if (is_url($lesson->mediafile)) {
-        $fullurl = $lesson->mediafile;        
+        $fullurl = $lesson->mediafile;
     } else {
         $fullurl = get_file_url($course->id .'/'. $lesson->mediafile);
     }
 
     // find the correct type and print it out
     if ($mimetype == "audio/mp3") {    // It's an MP3 audio file
-    
+
         if (!empty($THEME->resource_mp3player_colors)) {
             $c = $THEME->resource_mp3player_colors;   // You can set this up in your theme/xxx/config.php
         } else {
@@ -98,7 +98,7 @@
         echo '</div>';
 
     } else if (substr($mimetype, 0, 10) == "video/x-ms") {   // It's a Media Player file
-    
+
         echo "<div class=\"lessonmediafilecontrol\"><p>";
         echo '<object classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"';
         echo '        codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ';
         echo "</p></div>";
 
     } else if ($mimetype == "video/quicktime") {   // It's a Quicktime file
-    
+
         echo "<div class=\"lessonmediafilecontrol\"><p>";
         echo '<object classid="CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"';
         echo '        codebase="http://www.apple.com/qtactivex/qtplugin.cab" ';
         echo '</embed>';
         echo '</object>';
         echo "</p></div>";
-    
+
     //} else if ($mimetype == "application/x-shockwave-flash") {   // It's a flash file
-    
+
     //    print_error('noflash');
-    
+
     } else if ($mimetype == "audio/x-pn-realaudio") {   // It's a realmedia file
-        
+
         echo '<object id="rvocx" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="600" height="50">';
         echo "<param name=\"src\" value=\"$fullurl\">";
         echo '<param name="console" value="video">';  // not sure what the console param should equal
         echo $OUTPUT->notification(get_string('clicktodownload', 'lesson'));
         echo "<a href=\"$fullurl\">".format_string($filename).'</a>';
         echo "</p></div>";
-        
+
     }
-    
+
     function is_url($test_url) {
         // the following is barrowed from resource code.  Thanks!
         if (strpos($test_url, '://')) {     // eg http:// https:// ftp://  etc
        echo $OUTPUT->close_window_button();
        echo '</div>';
     }
-    
+
     echo $OUTPUT->footer();
-?>
+
index 5da6c9768bf810b83121222331739425521f3f07..ad677ea5f29ba8ff51913b91b29c73e2f043f027 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 /**
  * Form to define a new instance of lesson or edit an instance.
  * It is used from /course/modedit.php.
@@ -339,4 +339,4 @@ class mod_lesson_mod_form extends moodleform_mod {
         return $errors;
     }
 }
-?>
+
index cdf2577022a770eb8fea6ead0c07eb8fe8ecf148..19b983855809a13722f1dfc8fbe2c524180a4814 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * jjg7:8/9/2004
  *
@@ -10,7 +10,7 @@
 function removedoublecr($filename) {
 // This function will adjust a file in roughly Aiken style by replacing extra newlines with <br/> tags
 // so that instructors can have newlines wherever they like as long as the overall format is in Aiken
-    
+
     $filearray = file($filename);
     /// Check for Macintosh OS line returns (ie file on one line), and fix
     if (preg_match("/\r/", $filearray[0]) AND !preg_match("/\n/", $filearray[0])) {
@@ -18,7 +18,7 @@ function removedoublecr($filename) {
     } else {
         $outfile = $filearray;
     }
-    
+
     foreach ($outfile as $line) {
         // remove leading and trailing whitespace
         trim($line);
@@ -46,18 +46,18 @@ function removedoublecr($filename) {
         }
     }
     // output modified file to original
-    if ( is_writable($filename) ) { 
+    if ( is_writable($filename) ) {
 
-        if (! $handle =fopen ($filename ,'w' )) { 
+        if (! $handle =fopen ($filename ,'w' )) {
             echo "Cannot open file ($filename)" ;
-            exit; 
-        } 
+            exit;
+        }
         foreach ($outarray as $outline) {
             fwrite($handle, $outline);
         }
         fclose($handle);
-    } 
-    else { 
+    }
+    else {
         // file not writeable
     }
 }
@@ -74,17 +74,17 @@ function importmodifiedaikenstyle($filename) {
         $line = trim($line);
         // add a space at the end, quick hack to make sure words from different lines don't run together
         $line = $line. ' ';
-        
+
         // ignore lines less than 2 characters
         if (strlen($line) < 2) {
             continue;
         }
 
-        
+
         // see if we have the answer line
         if ($line[0] =='*') {
             if ($line[0] == '*') {
-                $answer_found = 1;                    
+                $answer_found = 1;
                 $line[0]="\t";
                 $line = ltrim($line);
                 $answer = $line[0];
@@ -100,11 +100,11 @@ function importmodifiedaikenstyle($filename) {
                 $outlines[$cur_pos] = $outlines[$cur_pos]."\n";
             }
 
-        
+
             $responses = 1;
             // make character uppercase
             $line[0]=strtoupper($line[0]);
-            
+
             // make entry followed by '.'
             $line[1]='.';
         }
@@ -131,13 +131,13 @@ function importmodifiedaikenstyle($filename) {
                     $np = 0;
                     // this probably could be done cleaner... it escapes me at the moment
                     while ($line[$np] == '0' OR $line[$np] == '1' OR $line[$np] == '2'
-                            OR $line[$np] == '3' OR $line[$np] == '4'  OR $line[$np] == '5' 
+                            OR $line[$np] == '3' OR $line[$np] == '4'  OR $line[$np] == '5'
                             OR $line[$np] == '6'  OR $line[$np] == '7' OR $line[$np] == '8'
                             OR $line[$np] == '9' ) {
                         $np++;
                     }
                     // grab everything after '###.'
-                    $line = substr($line, $np+1, strlen($line));                    
+                    $line = substr($line, $np+1, strlen($line));
 
                     if ($responses AND $answer_found) {
                         $responses = 0;
@@ -165,21 +165,21 @@ function importmodifiedaikenstyle($filename) {
     // output the last answer
     $answer = strtoupper($answer);
     $outlines[] = "ANSWER: $answer\n\n";
-    
+
     // output modified file to original
-    if ( is_writable($filename) ) { 
-        if (! $handle =fopen ($filename ,'w' )) { 
+    if ( is_writable($filename) ) {
+        if (! $handle =fopen ($filename ,'w' )) {
             echo "Cannot open file ($filename)" ;
-            exit; 
+            exit;
         }
         foreach ($outlines as $outline) {
             fwrite($handle, $outline);
         }
         fclose($handle);
         return true;
-    } 
-    else { 
+    }
+    else {
         return false;
     }
-}    
-?>
+}
+
index efea9a9be221653ebde4edc3bb0aced3aaac72d7..65ca73de2eca9807cb5f16f7de369c999c96b9c3 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 /**
  * Displays the lesson statistics.
  *
@@ -21,7 +21,7 @@
     if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) {
         $params["groupid"] = $cm->groupingid;
         $sql = "SELECT DISTINCT u.*
-                FROM {lesson_attempts} a 
+                FROM {lesson_attempts} a
                     INNER JOIN {user} u ON u.id = a.userid
                     INNER JOIN {groups_members} gm ON gm.userid = u.id
                     INNER JOIN {groupings_groups} gg ON gm.groupid = :groupid
                       u.id = a.userid
                 ORDER BY u.lastname";
     }
-    
+
     if (! $students = $DB->get_records_sql($sql, $params)) {
         $nothingtodisplay = true;
     }
-    
+
 // make sure people are where they should be
     require_login($course->id, false, $cm);
 
@@ -57,8 +57,8 @@
     require_capability('mod/lesson:manage', $context);
 
 /// Process any form data before fetching attempts, grades and times
-    if (has_capability('mod/lesson:edit', $context) and 
-        $form = data_submitted() and 
+    if (has_capability('mod/lesson:edit', $context) and
+        $form = data_submitted() and
         confirm_sesskey()) {
     /// Cycle through array of userids with nested arrays of tries
         if (!empty($form->attempts)) {
                 //      So, the modifier makes sure that the submitted try refers to the current try in the
                 //      database - hope this all makes sense :)
                 $modifier = 0;
-            
+
                 foreach ($tries as $try => $junk) {
                     $try -= $modifier;
-                
+
                 /// Clean up the timer table
                 $params = array ("userid" => $userid, "lessonid" => $lesson->id);
-                    $timeid = $DB->get_field_sql("SELECT id FROM {lesson_timer} 
-                                             WHERE userid = :userid AND lessonid = :lessonid 
+                    $timeid = $DB->get_field_sql("SELECT id FROM {lesson_timer}
+                                             WHERE userid = :userid AND lessonid = :lessonid
                                              ORDER BY starttime", $params, $try, 1);
-                
+
                     $DB->delete_records('lesson_timer', array('id' => $timeid));
-            
+
                 /// Remove the grade from the grades and high_scores tables
-                    $gradeid = $DB->get_field_sql("SELECT id FROM {lesson_grades} 
-                                              WHERE userid = :userid AND lessonid = :lessonid 
+                    $gradeid = $DB->get_field_sql("SELECT id FROM {lesson_grades}
+                                              WHERE userid = :userid AND lessonid = :lessonid
                                               ORDER BY completed", $params, $try, 1);
-                
+
                     $DB->delete_records('lesson_grades', array('id' => $gradeid));
                     $DB->delete_records('lesson_high_scores', array('gradeid' => $gradeid, 'lessonid' => $lesson->id, 'userid' => $userid));
-            
+
                 /// Remove attempts and update the retry number
                     $DB->delete_records('lesson_attempts', array('userid' => $userid, 'lessonid' => $lesson->id, 'retry' => $try));
                     $DB->execute("UPDATE {lesson_attempts} SET retry = retry - 1 WHERE userid = ? AND lessonid = ? AND retry > ?", array($userid, $lesson->id, $try));
-            
-                /// Remove seen branches and update the retry number    
+
+                /// Remove seen branches and update the retry number
                     $DB->delete_records('lesson_branch', array('userid' => $userid, 'lessonid' => $lesson->id, 'retry' => $try));
                     $DB->execute("UPDATE {lesson_branch} SET retry = retry - 1 WHERE userid = ? AND lessonid = ? AND retry > ?", array($userid, $lesson->id, $try));
 
     if (! $grades = $DB->get_records('lesson_grades', array('lessonid' => $lesson->id), 'completed')) {
         $grades = array();
     }
-    
+
     if (! $times = $DB->get_records('lesson_timer', array('lessonid' => $lesson->id), 'starttime')) {
         $times = array();
     }
 
     lesson_print_header($cm, $course, $lesson, $action);
-    
+
     $course_context = get_context_instance(CONTEXT_COURSE, $course->id);
     if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
-        echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">' 
+        echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">'
             . get_string('seeallcoursegrades', 'grades') . '</a></div>';
     }
 
                     } else {
                         $temp = '';
                     }
-                    
+
                     $temp .= "<a href=\"report.php?id=$cm->id&amp;action=reportdetail&amp;userid=".$try['userid'].'&amp;try='.$try['try'].'">';
                     if ($try["grade"] !== NULL) { // if NULL then not done yet
                         // this is what the link does when the user has completed the try
                    <input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n";
         }
         echo $OUTPUT->table($table);
-        
+
         if (has_capability('mod/lesson:edit', $context)) {
             echo '<br /><table width="90%" align="center"><tr><td>'.
                  '<a href="javascript: checkall();">'.get_string('selectall').'</a> / '.
                  '<a href="javascript: checknone();">'.get_string('deselectall').'</a> ';
-             
+
             $select = new html_select();
             $select->options = array('delete' => get_string('deleteselected'));
             $select->name = 'attemptaction';
             $select->selectedvalue = 0;
             $select->add_action('change', 'submit_form_by_id', array('id' => 'theform'));
-            echo $OUTPUT->select($select); 
-        
+            echo $OUTPUT->select($select);
+
             echo '</td></tr></table></form>';
         }
-        
+
         // some stat calculations
         if ($numofattempts == 0) {
             $avescore = get_string("notcompleted", "lesson");
             $answerpage = new stdClass;
             $data ='';
             $answerdata = new stdClass;
-            
+
             $answerpage->title = format_string($page->title);
-            
+
             $options = new stdClass;
             $options->noclean = true;
             $answerpage->contents = format_text($page->contents, FORMAT_MOODLE, $options);
                 $answerdata->score = NULL;
                 $answerdata->response = NULL;
             } elseif ($useranswers = $DB->get_records_select("lesson_attempts",
-                                                         "lessonid = :lessonid AND userid = :userid AND retry = :retry AND pageid = :pageid", 
+                                                         "lessonid = :lessonid AND userid = :userid AND retry = :retry AND pageid = :pageid",
                                                          array("lessonid" => $lesson->id, "userid" => $userid, "retry" => $try, "pageid" => $page->id), "timeseen")) {
                 // get the user's answer for this page
                 // need to find the right one
 
         if (!empty($userid)) {
             // if looking at a students try, print out some basic stats at the top
-            
+
                 // print out users name
                 //$headingobject->lastname = $students[$userid]->lastname;
                 //$headingobject->firstname = $students[$userid]->firstname;
                 //$headingobject->attempt = $try + 1;
                 //print_heading(get_string("studentattemptlesson", "lesson", $headingobject));
             echo $OUTPUT->heading(get_string('attempt', 'lesson', $try+1));
-            
+
             $table->head = array();
             $table->align = array("right", "left");
             $table->class = 'generaltable userinfotable';
                 $table->data[] = array(get_string("notcompleted", "lesson"));
             } else {
                 $user = $students[$userid];
-                
+
                 $gradeinfo = lesson_grade($lesson, $try, $user->id);
-                
+
                 $table->data[] = array(get_string('name').':', $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id)).fullname($user, true));
                 $table->data[] = array(get_string("timetaken", "lesson").":", format_time($timetotake));
                 $table->data[] = array(get_string("completed", "lesson").":", userdate($completed));
                 $table->data[] = array(get_string("grade", "lesson").":", $grade."%");
             }
             echo $OUTPUT->table($table);
-            
+
             // Don't want this class for later tables
             $table->set_classes();
             echo "<br />";
 /// Finish the page
     echo $OUTPUT->footer();
 
-?>
+
index 5e6a904b43ea27cc06762ef539b5ff2268021d66..c31589ab4369683b4681af3bd91dbcca3b0d8f9c 100644 (file)
@@ -1,4 +1,4 @@
-<?php //$Id$
+<?php
 /**
  * This php script contains all the stuff to restore lesson mods
  *
@@ -7,7 +7,7 @@
  * @package lesson
  **/
 
-    //This is the "graphical" structure of the lesson mod: 
+    //This is the "graphical" structure of the lesson mod:
     //
     //          lesson_default                  lesson ----------------------------|--------------------------|--------------------------|
     //     (UL, pk->id,fk->courseid)         (CL,pk->id)                           |                          |                          |
@@ -64,7 +64,7 @@
             $lesson->practice = backup_todb($info['MOD']['#']['PRACTICE']['0']['#']);
             $lesson->modattempts = backup_todb($info['MOD']['#']['MODATTEMPTS']['0']['#']);
             $lesson->usepassword = backup_todb($info['MOD']['#']['USEPASSWORD']['0']['#']);
-            $lesson->password = backup_todb($info['MOD']['#']['PASSWORD']['0']['#']);            
+            $lesson->password = backup_todb($info['MOD']['#']['PASSWORD']['0']['#']);
             $lesson->dependency = isset($info['MOD']['#']['DEPENDENCY']['0']['#'])?backup_todb($info['MOD']['#']['DEPENDENCY']['0']['#']):'';
             $lesson->conditions = isset($info['MOD']['#']['CONDITIONS']['0']['#'])?backup_todb($info['MOD']['#']['CONDITIONS']['0']['#']):'';
             $lesson->grade = backup_todb($info['MOD']['#']['GRADE']['0']['#']);
                     if (!$lessondefault) {
                         $status = lesson_default_restore_mods($info,$restore);
                     }
-                    
+
                 }
             } else {
                 $status = false;
                 backup_putid($restore->backup_unique_code,"lesson_pages", $oldid, $newid);
                 //We have to restore the lesson_answers table now (a page level table)
                 $status = lesson_answers_restore($lessonid,$newid,$page_info,$restore,$userdata);
-                
+
                 //Need to update useranswer field (which has answer id's in it)
                 //for matching and multi-answer multi-choice questions
                 if ($userdata) { // first check to see if we even have to do this
                             }
                         }
                     }
-                }        
-                
+                }
+
                 // backup branch table info for branch tables.
                 if ($status && $userdata) {
                     if (!lesson_branch_restore($lessonid,$newid,$page_info,$restore)) {
                 if ($newid) {
                     // need to store the id so we can update the useranswer
                     // field in attempts.  This is done in the lesson_pages_restore_mods
-                    backup_putid($restore->backup_unique_code,"lesson_answers", $oldid, $newid);                                 
+                    backup_putid($restore->backup_unique_code,"lesson_answers", $oldid, $newid);
 
                     if ($userdata) {
                         //We have to restore the lesson_attempts table now (a answers level table)
 
         return $status;
     }
-    
-    
-    
+
+
+
     //This function restores the lesson_branch
     function lesson_branch_restore($lessonid, $pageid, $info, $restore) {
         global $CFG, $DB;
                 if ($user) {
                     $highscore->userid = $user->new_id;
                 }
-                
+
                 //The structure is equal to the db, so insert the lesson_grade
                 $newid = $DB->insert_record ("lesson_high_scores",$highscore);
 
 
         return $status;
     }
-    
+
     //This function restores the lesson_default
     function lesson_default_restore_mods($info, $restore) {
         global $CFG, $DB;
 
                 //The structure is equal to the db, so insert the lesson_grade
                 $newid = $DB->insert_record ("lesson_default",$default);
-                
+
                 if ($newid) {
                     backup_putid($restore->backup_unique_code,'lesson_default',
                                  $restore->course_id, $newid);
                 }
-                
+
                 //Do some output
                 if (($i+1) % 50 == 0) {
                     if (!defined('RESTORE_SILENTLY')) {
     //in the restore process
     function lesson_decode_content_links ($content,$restore) {
         global $CFG;
-            
+
         $result = $content;
-                
+
         //Link to the list of lessons
-                
+
         $searchstring='/\$@(LESSONINDEX)\*([0-9]+)@\$/';
         //We look for it
         preg_match_all($searchstring,$content,$foundset);
                 if($rec->new_id) {
                     //Now replace it
                     $result= preg_replace($searchstring,$CFG->wwwroot.'/mod/lesson/index.php?id='.$rec->new_id,$result);
-                } else { 
+                } else {
                     //It's a foreign link so leave it as original
                     $result= preg_replace($searchstring,$restore->original_wwwroot.'/mod/lesson/index.php?id='.$old_id,$result);
                 }
     function lesson_decode_content_links_caller($restore) {
         global $CFG, $DB;
         $status = true;
-        
+
         //Process every lesson PAGE in the course
         if ($pages = $DB->get_records_sql("SELECT p.id, p.contents
                                              FROM {lesson_pages} p,
         }
         return $status;
     }
-?>
+
index a195aa7e5d0d36dbc2f66af54c886b428b7982a1..d175799066872b619b6d4cf402bd056b6ad2eb91 100644 (file)
@@ -1,7 +1,7 @@
 /***
  *** General styles (scope: all of lesson)
  ***/
+
 .mod-lesson .contents {
     text-align: left;
 }
  ***/
 
 /* NOTE: background color, height and width are set in the lesson settings */
-.mod-lesson .slideshow {  
+.mod-lesson .slideshow {
     overflow: auto;
-    padding-right: 16px; /* for the benefit of macIE5 only */ 
+    padding-right: 16px; /* for the benefit of macIE5 only */
     /* \ commented backslash hack - recover from macIE5 workarounds, it will ignore the following rule */
     padding-right: 0;
     padding: 15px;
 }
 
 .mod-lesson .lessonbutton a:link,
-.mod-lesson .lessonbutton a:visited, 
+.mod-lesson .lessonbutton a:visited,
 .mod-lesson .lessonbutton a:hover {
     color: #000;
     text-decoration: none;
     */
     background-color: green;
     padding: 0px;
-    margin: 0px;    
+    margin: 0px;
 }
 
 .mod-lesson .progress_bar_todo {
index 81862474125a99cc34b6b1392b83e4ec8af0bbf4..785d9522899711e3b9ea248c5c901676552abbe4 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 /**
 * Sets up the tabs used by the lesson pages for teachers.
 *
@@ -29,7 +29,7 @@
 
 /// user attempt count for reports link hover (completed attempts - much faster)
     $attemptscount = $DB->count_records('lesson_grades', array('lessonid'=>$lesson->id));
-    
+
     $row[] = new tabobject('view', "$CFG->wwwroot/mod/lesson/view.php?id=$cm->id", get_string('preview', 'lesson'), get_string('previewlesson', 'lesson', format_string($lesson->name)));
     $row[] = new tabobject('edit', "$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id", get_string('edit', 'lesson'), get_string('edit', 'moodle', format_string($lesson->name)));
     $row[] = new tabobject('reports', "$CFG->wwwroot/mod/lesson/report.php?id=$cm->id", get_string('reports', 'lesson'), get_string('viewreports2', 'lesson', $attemptscount));
@@ -61,7 +61,7 @@
         /// sub tabs for edit view (collapsed and expanded aka full)
             $inactive[] = 'edit';
             $activated[] = 'edit';
-            
+
             $row    = array();
             $row[]  = new tabobject('collapsed', "$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id&amp;mode=collapsed", get_string('collapsed', 'lesson'));
             $row[]  = new tabobject('full', "$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id&amp;mode=full", get_string('full', 'lesson'));
@@ -71,4 +71,4 @@
 
     print_tabs($tabs, $currenttab, $inactive, $activated);
 
-?>
+
index 9b0aa4f633a9ea844d2302738eeeaec689249a47..79089a15fd399629d792b537b1de03153adaa054 100644 (file)
             testlength =  parseInt(clocksettings.testlength);
         }
     }
-   
-    difference = javatime - servertime;    
+
+    difference = javatime - servertime;
     starttime = starttime + difference;
 
-    var dn = ""; 
+    var dn = "";
     var old = "";
 
-    if (document.all||document.getElementById) { 
-        document.write('<span id="LiveClockIE" style="width:'+mywidth+'px;"></span>'); 
-    } else if (document.layers) { 
+    if (document.all||document.getElementById) {
+        document.write('<span id="LiveClockIE" style="width:'+mywidth+'px;"></span>');
+    } else if (document.layers) {
         document.write('<ilayer id="ClockPosNS"><layer width="'+mywidth+'" id="LiveClockNS"></layer></ilayer>');
-    } else { 
+    } else {
         old = "true"; show_clock();
     }
-    
+
     /*function leave() {  // feable attempt to run a script when someone leaves a timed test early, failed so far
         window.onunload = window.open('http://www.google.com','','toolbar=no,menubar=no,location=no,height=500,width=500');
     }
     leave();*/
-    
+
     function show_clock() {
 
         //show clock in NS 4
@@ -72,7 +72,7 @@
         currentDate = new Date();
         current = currentDate.getTime();
         current = Math.floor(current/1000);
-        
+
         if (current > starttime + testlength) {
             myclock = '';
             myclock += '<font style="color:'+myfont_color+'; font-family:'+myfont_face+'; font-size:'+myfont_size+'pt;">';
@@ -84,8 +84,8 @@
             hours = Math.floor(timeleft/3600);
             timeleft = timeleft - (hours * 3600);
             minutes = Math.floor(timeleft/60);
-            secs = timeleft - (minutes * 60);           
-            
+            secs = timeleft - (minutes * 60);
+
             if (secs < 10) {
                 secs = "0"+secs;
             }
@@ -97,7 +97,7 @@
             myclock += hours+":"+minutes+":"+secs;
             myclock += '</font>';
         }
-        
+
         if (old == "true") {
             document.write(myclock);
             old = "die"; return;
index 2712f2686adbe31b45213c59b817a3f8e1e64277..a47018ea0157ce922502dedfaca7524fcbf88460 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
  * Code fragment to define the version of lesson
  * This fragment is called by moodle_needs_upgrading() and /admin/index.php
@@ -12,4 +12,4 @@ $module->version  = 2008112601;  // The current module version (Date: YYYYMMDDXX
 $module->requires = 2008072401;  // Requires this Moodle version
 $module->cron     = 0;           // Period for cron to check this module (secs)
 
-?>
+
index 443aae94ccd106bacdadb52984d565ddfaf87c77..e105c01be3d663ab2b6d14d0820adbab8e6d9e82 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 /**
  * This page prints a particular instance of lesson
  *
 /// Mark as viewed
     $completion=new completion_info($course);
     $completion->set_module_viewed($cm);
-?>
+