[LON-CAPA-cvs] cvs: modules /gerd/harvesting lonindexer.pm
www
www at source.lon-capa.org
Sat Jul 7 17:44:41 EDT 2012
www Sat Jul 7 21:44:41 2012 EDT
Modified files:
/modules/gerd/harvesting lonindexer.pm
Log:
Reading the map inside of recommender
Index: modules/gerd/harvesting/lonindexer.pm
diff -u modules/gerd/harvesting/lonindexer.pm:1.1 modules/gerd/harvesting/lonindexer.pm:1.2
--- modules/gerd/harvesting/lonindexer.pm:1.1 Thu Jun 28 20:06:08 2012
+++ modules/gerd/harvesting/lonindexer.pm Sat Jul 7 21:44:41 2012
@@ -5,7 +5,7 @@
#
# MODIFY $datapath VARIABLE FOR LOCATION OF DATA FILES
#
-# $Id: lonindexer.pm,v 1.1 2012/06/28 20:06:08 www Exp $
+# $Id: lonindexer.pm,v 1.2 2012/07/07 21:44:41 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -64,6 +64,7 @@
use Apache::lonlocal;
use Apache::lonsource();
use Apache::groupsort();
+use LONCAPA::map();
use GDBM_File;
use LONCAPA qw(:match);
@@ -89,6 +90,24 @@
# =================================================================================
#
+# Read what already was in the folder
+#
+
+sub mapread {
+ my ($coursenum,$coursedom,$map)=@_;
+ &LONCAPA::map::mapread('/uploaded/'.$coursedom.'/'.$coursenum.'/'.$map);
+ my @basket=();
+ foreach my $res (@LONCAPA::map::resources) {
+ my ($title,$id)=split(/\:/,$res);
+ if ($id=~/\/res\//) {
+ push(@basket,$id);
+ }
+ }
+ return @basket;
+}
+
+#
+#
# Return the resources that the resources in the argument are associated with
# by having been used in the same folder
# Takes an array of resource keys, returns a hash with resource keys as keys
More information about the LON-CAPA-cvs
mailing list