version 1.148, 2005/04/19 15:44:40
|
version 1.150, 2005/10/04 18:27:32
|
Line 869 sub populate_student_table {
|
Line 869 sub populate_student_table {
|
my $dbh = &Apache::lonmysql::get_dbh(); |
my $dbh = &Apache::lonmysql::get_dbh(); |
my $request = 'INSERT IGNORE INTO '.$student_table. |
my $request = 'INSERT IGNORE INTO '.$student_table. |
"(student,section,status) VALUES "; |
"(student,section,status) VALUES "; |
my $classlist = &get_classlist($courseid); |
my $cdom = $env{'course.'.$courseid.'.domain'}; |
|
my $cnum = $env{'course.'.$courseid.'.num'}; |
|
my $classlist = &get_classlist($cdom,$cnum); |
my $student_count=0; |
my $student_count=0; |
while (my ($student,$data) = each %$classlist) { |
while (my ($student,$data) = each %$classlist) { |
my ($section,$status) = ($data->[&CL_SECTION()], |
my ($section,$status) = ($data->[&CL_SECTION()], |
Line 1280 sub store_student_data {
|
Line 1282 sub store_student_data {
|
$num_parameters ++; |
$num_parameters ++; |
if ($sql_parameter !~ /''/) { |
if ($sql_parameter !~ /''/) { |
$store_parameters_command .= $sql_parameter; |
$store_parameters_command .= $sql_parameter; |
$rows_stored++; |
#$rows_stored++; |
} |
} |
} |
} |
} |
} |
Line 1314 sub store_student_data {
|
Line 1316 sub store_student_data {
|
$rows_stored++; |
$rows_stored++; |
} |
} |
} |
} |
|
if (! $rows_stored) { return ($returnstatus, undef); } |
$store_parameters_command =~ s|,\n$||; |
$store_parameters_command =~ s|,\n$||; |
$store_performance_command =~ s|,\n$||; |
$store_performance_command =~ s|,\n$||; |
my $start = Time::HiRes::time; |
my $start = Time::HiRes::time; |
Line 2696 Retrieve the classist of a given class o
|
Line 2699 Retrieve the classist of a given class o
|
information is returned from the classlist.db file and, if needed, |
information is returned from the classlist.db file and, if needed, |
from the students environment. |
from the students environment. |
|
|
Optional arguments are $cid, $cdom, and $cnum (course id, course domain, |
Optional arguments are $cdom, and $cnum (course domain, |
and course number, respectively). Any omitted arguments will be taken |
and course number, respectively). If either is ommitted the course |
from the current environment ($env{'request.course.id'}, |
will be taken from the current environment ($env{'request.course.id'}, |
$env{'course.'.$cid.'.domain'}, and $env{'course.'.$cid.'.num'}). |
$env{'course.'.$cid.'.domain'}, and $env{'course.'.$cid.'.num'}). |
|
|
Returns a reference to a hash which contains: |
Returns a reference to a hash which contains: |
Line 2726 sub CL_TYPE { return 8; }
|
Line 2729 sub CL_TYPE { return 8; }
|
sub CL_LOCKEDTYPE { return 9; } |
sub CL_LOCKEDTYPE { return 9; } |
|
|
sub get_classlist { |
sub get_classlist { |
my ($cid,$cdom,$cnum) = @_; |
my ($cdom,$cnum) = @_; |
$cid = $cid || $env{'request.course.id'}; |
my $cid = $cdom.'_'.$cnum; |
$cdom = $cdom || $env{'course.'.$cid.'.domain'}; |
if (!defined($cdom) || !defined($cnum)) { |
$cnum = $cnum || $env{'course.'.$cid.'.num'}; |
$cid = $env{'request.course.id'}; |
|
$cdom = $env{'course.'.$cid.'.domain'}; |
|
$cnum = $env{'course.'.$cid.'.num'}; |
|
} |
my $now = time; |
my $now = time; |
# |
# |
my %classlist=&Apache::lonnet::dump('classlist',$cdom,$cnum); |
my %classlist=&Apache::lonnet::dump('classlist',$cdom,$cnum); |