version 1.45, 2003/02/13 14:49:16
|
version 1.46, 2003/02/13 22:52:48
|
Line 293 sub get_sequence_assessment_data {
|
Line 293 sub get_sequence_assessment_data {
|
&Apache::lonnet::logthis('filename = '.$fn); |
&Apache::lonnet::logthis('filename = '.$fn); |
## |
## |
## use navmaps |
## use navmaps |
my $navmap = Apache::lonnavmaps::navmap->new($fn.".bd",$fn."_parms.db",1,0); |
my $navmap = Apache::lonnavmaps::navmap->new($fn.".db",$fn."_parms.db", |
|
1,0); |
if (!defined($navmap)) { |
if (!defined($navmap)) { |
return 'Can not open Coursemap'; |
return 'Can not open Coursemap'; |
} |
} |
Line 1346 sub DownloadStudentCourseData {
|
Line 1347 sub DownloadStudentCourseData {
|
|
|
sub DownloadStudentCourseDataSeparate { |
sub DownloadStudentCourseDataSeparate { |
my ($students,$checkDate,$cacheDB,$extract,$status,$courseID,$r,$c)=@_; |
my ($students,$checkDate,$cacheDB,$extract,$status,$courseID,$r,$c)=@_; |
my $residualFile = '/home/httpd/perl/tmp/'.$courseID.'DownloadFile.db'; |
my $residualFile = $Apache::lonnet::tmpdir.$courseID.'DownloadFile.db'; |
my $title = 'LON-CAPA Statistics'; |
my $title = 'LON-CAPA Statistics'; |
my $heading = 'Download Course Data'; |
my $heading = 'Download Course Data'; |
|
|
Line 1427 sub DownloadStudentCourseDataSeparate {
|
Line 1428 sub DownloadStudentCourseDataSeparate {
|
sub CheckForResidualDownload { |
sub CheckForResidualDownload { |
my ($cacheDB,$extract,$status,$courseID,$r,$c)=@_; |
my ($cacheDB,$extract,$status,$courseID,$r,$c)=@_; |
|
|
my $residualFile = '/home/httpd/perl/tmp/'.$courseID.'DownloadFile.db'; |
my $residualFile = $Apache::lonnet::tmpdir.$courseID.'DownloadFile.db'; |
if(!-e $residualFile) { |
if(!-e $residualFile) { |
return 'OK'; |
return 'OK'; |
} |
} |
Line 1491 sub CheckForResidualDownload {
|
Line 1492 sub CheckForResidualDownload {
|
return 'OK'; |
return 'OK'; |
} |
} |
|
|
|
|
|
################################################ |
|
################################################ |
|
|
|
=pod |
|
|
|
=item &get_current_state($sname,$sdom,$symb,$courseid); |
|
|
|
Retrive the current status of a students performance. $sname and |
|
$sdom are the only required parameters. If $symb is undef the results |
|
of a &Apache::lonnet::currentdump() will be returned. |
|
If $courseid is undef it will be retrieved from the environment. |
|
|
|
The return structure is based on &Apache::lonnet::currentdump. If |
|
$symb is unspecified, all the students data is returned in a hash of |
|
the form: |
|
( |
|
symb1 => { param1 => value1, param2 => value2 ... }, |
|
symb2 => { param1 => value1, param2 => value2 ... }, |
|
) |
|
|
|
If $symb is specified, a hash of |
|
( |
|
param1 => value1, |
|
param2 => value2, |
|
) |
|
is returned. |
|
|
|
Eventually this routine will cache the results locally. |
|
|
|
If no data is found for $symb, or if the student has not performance data, |
|
an empty list is returned. |
|
|
|
=cut |
|
|
|
################################################ |
|
################################################ |
|
|
|
sub get_current_state { |
|
my ($sname,$sdom,$symb,$courseid)=@_; |
|
return undef if (! defined($sname) || ! defined($sdom)); |
|
$courseid = $ENV{'request.course.id'} if (! defined($courseid)); |
|
# For a first pass, just get a currentdump and return the requested |
|
# results |
|
my @tmp = &Apache::lonnet::currentdump($courseid,$sdom,$sname); |
|
if (! ((scalar(@tmp) > 0) && ($tmp[0] !~ /^error:/)) ) { |
|
&Apache::lonnet::logthis('error getting data for '.$sname.':'.$sdom. |
|
'in course '.$courseid); |
|
return (); |
|
} |
|
my %student_data = @tmp; |
|
if (! defined($symb)) { |
|
return %student_data; |
|
} elsif (exists($student_data{$symb})) { |
|
return %{$student_data{$symb}}; |
|
} else { |
|
return (); |
|
} |
|
} |
|
|
################################################ |
################################################ |
################################################ |
################################################ |
|
|