version 1.183, 2007/10/03 18:22:50
|
version 1.189, 2008/11/17 14:16:55
|
Line 30
|
Line 30
|
|
|
=head1 NAME |
=head1 NAME |
|
|
loncoursedata |
Apache::loncoursedata |
|
|
=head1 SYNOPSIS |
=head1 SYNOPSIS |
|
|
Line 64 use Digest::MD5();
|
Line 64 use Digest::MD5();
|
This section contains all the functions that get data from other servers |
This section contains all the functions that get data from other servers |
and/or itself. |
and/or itself. |
|
|
=cut |
|
|
|
################################################ |
|
################################################ |
|
|
|
=pod |
|
|
|
=item &make_into_hash($values); |
=item &make_into_hash($values); |
|
|
Returns a reference to a hash as described by $values. $values is |
Returns a reference to a hash as described by $values. $values is |
Line 930 sub populate_student_table {
|
Line 923 sub populate_student_table {
|
$dbh->do($request); |
$dbh->do($request); |
if ($dbh->err()) { |
if ($dbh->err()) { |
&Apache::lonnet::logthis("error ".$dbh->errstr(). |
&Apache::lonnet::logthis("error ".$dbh->errstr(). |
" occured executing \n". |
" occurred executing \n". |
$request); |
$request); |
} |
} |
return; |
return; |
Line 983 sub populate_groupnames_table {
|
Line 976 sub populate_groupnames_table {
|
$dbh->do($request); |
$dbh->do($request); |
if ($dbh->err()) { |
if ($dbh->err()) { |
&Apache::lonnet::logthis("error ".$dbh->errstr(). |
&Apache::lonnet::logthis("error ".$dbh->errstr(). |
" occured executing \n". |
" occurred executing \n". |
$request); |
$request); |
} |
} |
return; |
return; |
Line 1053 sub populate_students_groups_table {
|
Line 1046 sub populate_students_groups_table {
|
$dbh->do($request); |
$dbh->do($request); |
if ($dbh->err()) { |
if ($dbh->err()) { |
&Apache::lonnet::logthis("error ".$dbh->errstr(). |
&Apache::lonnet::logthis("error ".$dbh->errstr(). |
" occured executing \n". |
" occurred executing \n". |
$request); |
$request); |
} |
} |
return; |
return; |
Line 1112 Input: $sname, $sdom, $courseid
|
Line 1105 Input: $sname, $sdom, $courseid
|
|
|
Output: $returnstatus |
Output: $returnstatus |
|
|
$returnstatus is a string describing any errors that occured. 'okay' is the |
$returnstatus is a string describing any errors that occurred. 'okay' is the |
default. |
default. |
|
|
This subroutine loads a students data using lonnet::dump and inserts |
This subroutine loads a students data using lonnet::dump and inserts |
Line 1126 a description of the error.
|
Line 1119 a description of the error.
|
|
|
Once the "fulldump" tables are updated, the tables used for chart and |
Once the "fulldump" tables are updated, the tables used for chart and |
spreadsheet (which hold only the current state of the student on their |
spreadsheet (which hold only the current state of the student on their |
homework, not historical data) are updated. If all updates have occured |
homework, not historical data) are updated. If all updates have occurred |
successfully, $student_table is updated to reflect the time of the update. |
successfully, $student_table is updated to reflect the time of the update. |
|
|
Notice we do not insert the data and immediately query it. This means it |
Notice we do not insert the data and immediately query it. This means it |
Line 1398 Input: $sname, $sdom, $courseid
|
Line 1391 Input: $sname, $sdom, $courseid
|
|
|
Output: $returnstatus, \%student_data |
Output: $returnstatus, \%student_data |
|
|
$returnstatus is a string describing any errors that occured. 'okay' is the |
$returnstatus is a string describing any errors that occurred. 'okay' is the |
default. |
default. |
\%student_data is the data returned by a call to lonnet::currentdump. |
\%student_data is the data returned by a call to lonnet::currentdump. |
|
|
Line 1669 sub ensure_current_data {
|
Line 1662 sub ensure_current_data {
|
# |
# |
# Get the update time for the user |
# Get the update time for the user |
my $updatetime = 0; |
my $updatetime = 0; |
|
my $getuserdir = 1; |
my $modifiedtime = &Apache::lonnet::GetFileTimestamp |
my $modifiedtime = &Apache::lonnet::GetFileTimestamp |
($sdom,$sname,$courseid.'.db', |
($sdom,$sname,$courseid.'.db',$getuserdir); |
$Apache::lonnet::perlvar{'lonUsersDir'}); |
|
# |
# |
if ($modifiedtime == -1) { |
if ($modifiedtime == -1) { |
return ('no data',undef); |
return ('no data',undef); |
Line 1721 sub ensure_current_full_data {
|
Line 1714 sub ensure_current_full_data {
|
&ensure_tables_are_set_up($courseid); |
&ensure_tables_are_set_up($courseid); |
# |
# |
# Get the update time for the user |
# Get the update time for the user |
|
my $getuserdir = 1; |
my $modifiedtime = &Apache::lonnet::GetFileTimestamp |
my $modifiedtime = &Apache::lonnet::GetFileTimestamp |
($sdom,$sname,$courseid.'.db', |
($sdom,$sname,$courseid.'.db',$getuserdir); |
$Apache::lonnet::perlvar{'lonUsersDir'}); |
|
# |
# |
my $student_id = &get_student_id($sname,$sdom); |
my $student_id = &get_student_id($sname,$sdom); |
my @Result = &Apache::lonmysql::get_rows($student_table, |
my @Result = &Apache::lonmysql::get_rows($student_table, |
Line 2209 sub populate_weight_table {
|
Line 2202 sub populate_weight_table {
|
$dbh->do($request); |
$dbh->do($request); |
if ($dbh->err()) { |
if ($dbh->err()) { |
&Apache::lonnet::logthis("error ".$dbh->errstr(). |
&Apache::lonnet::logthis("error ".$dbh->errstr(). |
" occured executing \n". |
" occurred executing \n". |
$request); |
$request); |
} |
} |
return; |
return; |
Line 3100 sub CL_STATUS { return 7; }
|
Line 3093 sub CL_STATUS { return 7; }
|
sub CL_TYPE { return 8; } |
sub CL_TYPE { return 8; } |
sub CL_LOCKEDTYPE { return 9; } |
sub CL_LOCKEDTYPE { return 9; } |
sub CL_GROUP { return 10; } |
sub CL_GROUP { return 10; } |
|
sub CL_PERMANENTEMAIL { return 11; } |
|
sub CL_ROLE { return 12; } |
|
sub CL_EXTENT { return 13; } |
|
sub CL_PHOTO { return 14; } |
|
sub CL_THUMBNAIL { return 15; } |
|
|
sub get_classlist { |
sub get_classlist { |
my ($cdom,$cnum) = @_; |
my ($cdom,$cnum) = @_; |