version 1.22, 2002/08/28 21:50:27
|
version 1.24, 2002/08/28 22:42:15
|
Line 89 Input: $courseID, $lastDownloadTime, $c
|
Line 89 Input: $courseID, $lastDownloadTime, $c
|
$courseID: The id of the course |
$courseID: The id of the course |
|
|
$lastDownloadTime: This is the date stamp for when this information was |
$lastDownloadTime: This is the date stamp for when this information was |
last gathered. If it is set to 'Not downloaded', it will gather the data |
last gathered. If it is set to Not downloaded, it will gather the data |
again, though it currently does not remove the old data. |
again, though it currently does not remove the old data. |
|
|
$c: The connection class that can determine if the browser has aborted. It |
$c: The connection class that can determine if the browser has aborted. It |
Line 103 Output: \%classlist
|
Line 103 Output: \%classlist
|
-A list of student name:domain (as keys) (known below as $name) |
-A list of student name:domain (as keys) (known below as $name) |
|
|
-A hash pointer for each student containing lastname, generation, firstname, |
-A hash pointer for each student containing lastname, generation, firstname, |
middlename, and PID : Key is $name.'studentInformation' |
middlename, and PID : Key is $name.studentInformation |
|
|
-A hash pointer to each students section data : Key is $name.section |
-A hash pointer to each students section data : Key is $name.section |
|
|
Line 125 sub DownloadClasslist {
|
Line 125 sub DownloadClasslist {
|
$Apache::lonnet::perlvar{'lonUsersDir'}); |
$Apache::lonnet::perlvar{'lonUsersDir'}); |
|
|
# Always download the information if lastDownloadTime is set to |
# Always download the information if lastDownloadTime is set to |
# 'Not downloaded', otherwise it is only downloaded if the file |
# Not downloaded, otherwise it is only downloaded if the file |
# has been updated and has a more recent date stamp |
# has been updated and has a more recent date stamp |
if($lastDownloadTime ne 'Not downloaded' && |
if($lastDownloadTime ne 'Not downloaded' && |
$lastDownloadTime >= $modifiedTime && $modifiedTime >= 0) { |
$lastDownloadTime >= $modifiedTime && $modifiedTime >= 0) { |
Line 195 $namedata: student name:domain
|
Line 195 $namedata: student name:domain
|
$courseID: The id of the course |
$courseID: The id of the course |
|
|
$lastDownloadTime: This is the date stamp for when this information was |
$lastDownloadTime: This is the date stamp for when this information was |
last gathered. If it is set to 'Not downloaded', it will gather the data |
last gathered. If it is set to Not downloaded, it will gather the data |
again, though it currently does not remove the old data. |
again, though it currently does not remove the old data. |
|
|
$WhatIWant: Regular expression used to get selected data with dump |
$WhatIWant: Regular expression used to get selected data with dump |
|
|
Output: \%courseData |
Output: \%courseData |
|
|
\%courseData: A hash pointer to the raw data from the student's course |
\%courseData: A hash pointer to the raw data from the students course |
database. |
database. |
|
|
=back |
=back |
Line 254 sub DownloadCourseInformation {
|
Line 254 sub DownloadCourseInformation {
|
These functions process all the data for all the students. Also, they |
These functions process all the data for all the students. Also, they |
are the functions that access the cache database for writing the majority of |
are the functions that access the cache database for writing the majority of |
the time. The downloading and caching were separated to reduce problems |
the time. The downloading and caching were separated to reduce problems |
with stopping downloading then can't tie hash to database later. |
with stopping downloading then can not tie hash to database later. |
|
|
=cut |
=cut |
|
|
Line 540 $cache: A hash pointer to store the data
|
Line 540 $cache: A hash pointer to store the data
|
|
|
$classlist: The hash of data collected about a student from |
$classlist: The hash of data collected about a student from |
&DownloadClasslist(). The hash contains a list of students, a pointer |
&DownloadClasslist(). The hash contains a list of students, a pointer |
to a hash of student information for each student, and each student's section |
to a hash of student information for each student, and each students section |
number. |
number. |
|
|
$courseID: The course ID |
$courseID: The course ID |
Line 661 Takes the course data downloaded for a s
|
Line 661 Takes the course data downloaded for a s
|
&DownloadCourseInformation() and breaks it up into key value pairs |
&DownloadCourseInformation() and breaks it up into key value pairs |
to be stored in the cached data. The keys are comprised of the |
to be stored in the cached data. The keys are comprised of the |
$username:$domain:$keyFromCourseDatabase. The student username:domain is |
$username:$domain:$keyFromCourseDatabase. The student username:domain is |
stored away signifying that the student's information has been downloaded and |
stored away signifying that the students information has been downloaded and |
can be reused from cached data. |
can be reused from cached data. |
|
|
=over 4 |
=over 4 |
Line 1043 $ChartDB: The name of the cache database
|
Line 1043 $ChartDB: The name of the cache database
|
|
|
Output: -1, 0, 1 |
Output: -1, 0, 1 |
|
|
-1: Couldn't tie database |
-1: Could not tie database |
0: Use cached data |
0: Use cached data |
1: New cache database created, use that. |
1: New cache database created, use that. |
|
|
Line 1095 sub DownloadStudentCourseData {
|
Line 1095 sub DownloadStudentCourseData {
|
my $title = 'LON-CAPA Statistics'; |
my $title = 'LON-CAPA Statistics'; |
my $heading = 'Download and Process Course Data'; |
my $heading = 'Download and Process Course Data'; |
my $studentCount = scalar(@$students); |
my $studentCount = scalar(@$students); |
my %cache; |
|
|
|
|
|
my $WhatIWant; |
my $WhatIWant; |
$WhatIWant = '(^version:|'; |
$WhatIWant = '(^version:|'; |
Line 1113 sub DownloadStudentCourseData {
|
Line 1111 sub DownloadStudentCourseData {
|
my $displayString; |
my $displayString; |
my $count=0; |
my $count=0; |
foreach (@$students) { |
foreach (@$students) { |
|
my %cache; |
|
|
if($c->aborted()) { return 'Aborted'; } |
if($c->aborted()) { return 'Aborted'; } |
|
|
if($status eq 'true') { |
if($status eq 'true') { |
Line 1130 sub DownloadStudentCourseData {
|
Line 1130 sub DownloadStudentCourseData {
|
|
|
if($c->aborted()) { return 'Aborted'; } |
if($c->aborted()) { return 'Aborted'; } |
|
|
if($downloadTime eq 'Not downloaded') { |
if($downloadTime ne 'Not downloaded') { |
my $courseData = |
next; |
&DownloadCourseInformation($_, $courseID, $downloadTime, |
} |
$WhatIWant); |
my $courseData = |
if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT(),0640)) { |
&DownloadCourseInformation($_, $courseID, $downloadTime, |
foreach my $key (keys(%$courseData)) { |
$WhatIWant); |
if($key =~ /^(con_lost|error|no_such_host)/i) { |
if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT(),0640)) { |
$courseData->{$_.':error'} = 'No course data for '.$_; |
foreach my $key (keys(%$courseData)) { |
last; |
if($key =~ /^(con_lost|error|no_such_host)/i) { |
} |
$courseData->{$_.':error'} = 'No course data for '.$_; |
} |
last; |
if($extract eq 'true') { |
} |
&ExtractStudentData($courseData, \%cache, \%cache, $_); |
} |
} else { |
if($extract eq 'true') { |
&ProcessStudentData(\%cache, $courseData, $_); |
&ExtractStudentData($courseData, \%cache, \%cache, $_); |
} |
} else { |
untie(%cache); |
&ProcessStudentData(\%cache, $courseData, $_); |
} else { |
} |
next; |
untie(%cache); |
} |
} else { |
} |
next; |
|
} |
} |
} |
if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } |
if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } |
|
|
Line 1172 sub DownloadStudentCourseDataSeparate {
|
Line 1173 sub DownloadStudentCourseDataSeparate {
|
|
|
&CheckForResidualDownload($courseID, $cacheDB, $students, $c); |
&CheckForResidualDownload($courseID, $cacheDB, $students, $c); |
|
|
my %cache; |
|
|
|
my $studentCount = scalar(@$students); |
my $studentCount = scalar(@$students); |
if($status eq 'true') { |
if($status eq 'true') { |
&Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); |
&Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); |
Line 1191 sub DownloadStudentCourseDataSeparate {
|
Line 1190 sub DownloadStudentCourseDataSeparate {
|
&Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); |
&Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); |
} |
} |
|
|
|
my %cache; |
my $downloadTime='Not downloaded'; |
my $downloadTime='Not downloaded'; |
if($checkDate eq 'true' && |
if($checkDate eq 'true' && |
tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { |
tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { |