version 1.69, 2003/04/18 19:05:30
|
version 1.72, 2003/05/27 15:48:12
|
Line 209 sub LoadDiscussion {
|
Line 209 sub LoadDiscussion {
|
return \%Discuss; |
return \%Discuss; |
} |
} |
|
|
|
################################################ |
|
################################################ |
|
|
|
=pod |
|
|
|
=item &GetUserName(username,userdomain) |
|
|
|
Returns a hash with the following entries: |
|
'firstname', 'middlename', 'lastname', 'generation', and 'fullname' |
|
|
|
'fullname' is the result of &Apache::loncoursedata::ProcessFullName. |
|
|
|
=cut |
|
|
|
################################################ |
|
################################################ |
|
sub GetUserName { |
|
my ($username,$userdomain) = @_; |
|
$username = $ENV{'user.name'} if (! defined($username)); |
|
$userdomain = $ENV{'user.domain'} if (! defined($username)); |
|
my %userenv = &Apache::lonnet::get('environment', |
|
['firstname','middlename','lastname','generation'], |
|
$userdomain,$username); |
|
$userenv{'fullname'} = &ProcessFullName($userenv{'lastname'}, |
|
$userenv{'generation'}, |
|
$userenv{'firstname'}, |
|
$userenv{'middlename'}); |
|
return %userenv; |
|
} |
|
|
|
################################################ |
|
################################################ |
|
|
=pod |
=pod |
|
|
=item &ProcessFullName() |
=item &ProcessFullName() |
Line 219 is Lastname generation, firstname middle
|
Line 252 is Lastname generation, firstname middle
|
|
|
=cut |
=cut |
|
|
|
################################################ |
|
################################################ |
sub ProcessFullName { |
sub ProcessFullName { |
my ($lastname, $generation, $firstname, $middlename)=@_; |
my ($lastname, $generation, $firstname, $middlename)=@_; |
my $Str = ''; |
my $Str = ''; |
Line 579 sub init_dbs {
|
Line 614 sub init_dbs {
|
|
|
=pod |
=pod |
|
|
|
=item &delete_caches() |
|
|
|
=cut |
|
|
|
################################################ |
|
################################################ |
|
sub delete_caches { |
|
my $courseid = shift; |
|
$courseid = $ENV{'request.course.id'} if (! defined($courseid)); |
|
# |
|
&setup_table_names($courseid); |
|
# |
|
my $dbh = &Apache::lonmysql::get_dbh(); |
|
foreach my $table ($symb_table,$part_table,$student_table, |
|
$updatetime_table,$performance_table, |
|
$parameters_table ){ |
|
my $command = 'DROP TABLE '.$table.';'; |
|
$dbh->do($command); |
|
if ($dbh->err) { |
|
&Apache::lonnet::logthis($command.' resulted in error: '.$dbh->errstr); |
|
} |
|
} |
|
return; |
|
} |
|
|
|
################################################ |
|
################################################ |
|
|
|
=pod |
|
|
=item &get_part_id() |
=item &get_part_id() |
|
|
Get the MySQL id of a problem part string. |
Get the MySQL id of a problem part string. |
Line 1121 sub get_current_state {
|
Line 1186 sub get_current_state {
|
return () if (! defined($sname) || ! defined($sdom)); |
return () if (! defined($sname) || ! defined($sdom)); |
# |
# |
my ($status,$data) = &ensure_current_data($sname,$sdom,$courseid); |
my ($status,$data) = &ensure_current_data($sname,$sdom,$courseid); |
|
&Apache::lonnet::logthis |
|
('sname = '.$sname. |
|
' domain = '.$sdom. |
|
' status = '.$status. |
|
' data is '.(defined($data)?'defined':'undefined')); |
# |
# |
if (defined($data)) { |
if (defined($data)) { |
if (defined($symb)) { |
if (defined($symb)) { |