--- loncom/interface/loncoursedata.pm 2008/11/20 21:22:21 1.190 +++ loncom/interface/loncoursedata.pm 2015/03/10 05:13:11 1.193.6.1 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.190 2008/11/20 21:22:21 jms Exp $ +# $Id: loncoursedata.pm,v 1.193.6.1 2015/03/10 05:13:11 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -56,6 +56,17 @@ use Apache::lonmysql(); use LONCAPA; use Digest::MD5(); +=pod + +=head2 make_into_hash + +Turn a colon separated string into a hash and return a reference +to it. Numbering from 0 even elements are keys and odd elements +are values e.g. a:b:c:d creates a hash like + a => b, c =>d + +=cut + sub make_into_hash { my $values = shift; my %tmp = map { &unescape($_); } split(':',$values); @@ -436,8 +447,17 @@ sub init_dbs { return 0; } +=pod + +=head2 delete_caches +Drops all of the tables in the local mysql cache associated with the +specified course id. +TODO: The drops should be pushed into lonmysql to further isolate +mysql code from other modules. + +=cut sub delete_caches { my $courseid = shift; $courseid = $env{'request.course.id'} if (! defined($courseid)); @@ -1231,6 +1251,7 @@ sub ensure_current_data { } my $student_id = &get_student_id($sname,$sdom); + &get_students_groupids($student_id); my @Result = &Apache::lonmysql::get_rows($student_table, "student_id ='$student_id'"); my $data = undef; @@ -1257,6 +1278,7 @@ sub ensure_current_full_data { ($sdom,$sname,$courseid.'.db',$getuserdir); # my $student_id = &get_student_id($sname,$sdom); + &get_students_groupids($student_id); my @Result = &Apache::lonmysql::get_rows($student_table, "student_id ='$student_id'"); my $updatetime;