[LON-CAPA-cvs] cvs: modules /gci londocsgci.pm

gci gci@source.lon-capa.org
Fri, 25 Dec 2009 00:49:35 -0000


gci		Fri Dec 25 00:49:35 2009 EDT

  Modified files:              
    /modules/gci	londocsgci.pm 
  Log:
  - Customization for GCI_3.
    - Accommodate filename format used for GCI2004_73 problem.
  
  
Index: modules/gci/londocsgci.pm
diff -u modules/gci/londocsgci.pm:1.6 modules/gci/londocsgci.pm:1.7
--- modules/gci/londocsgci.pm:1.6	Mon Dec 21 15:51:29 2009
+++ modules/gci/londocsgci.pm	Fri Dec 25 00:49:35 2009
@@ -2,7 +2,7 @@
 # Custom Edit Course Routines for Assembly of Valid Concept Tests from
 # Geoscience Concept Inventory. 
 #
-# $Id: londocsgci.pm,v 1.6 2009/12/21 15:51:29 gci Exp $
+# $Id: londocsgci.pm,v 1.7 2009/12/25 00:49:35 gci Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -153,13 +153,13 @@
 
 sub fullurl {
    my ($item)=@_;
-   unless ($item=~/^\_/) { $item='_'.$item; }
+   unless ($item=~/\_/) { $item='_'.$item; }
    return $path.'/'.$version.'/GCI'.$item.'.problem';
 }
 
 sub item_from_url {
     my ($url)=@_;
-    if ($url =~ m{\Q$path\E/\Q$version\E/GCI_([^.]+)\.problem$}) {
+    if ($url =~ m{\Q$path\E/\Q$version\E/GCI_?([^.]+)\.problem$}) {
         return $1;
     }
 }
@@ -408,7 +408,7 @@
           my $url  = &LONCAPA::map::qtunescape(&fullurl($allprobs[$idx]));
           if (($revreqs{$allprobs[$idx]}) && 
               ($chosenproblems{$revreqs{$allprobs[$idx]}})) {
-              my $probnum = $allprobs[$idx].'_'.$revreqs{$allprobs[$idx]};
+              my $probnum = '_'.$allprobs[$idx].'_'.$revreqs{$allprobs[$idx]};
               $url = &LONCAPA::map::qtunescape(&fullurl($probnum));
           } elsif ($prereqs{$allprobs[$idx]}) {
               next;