version 1.81.2.2, 2003/10/03 15:33:25
|
version 1.85, 2003/08/27 21:34:24
|
Line 104 sub get_sequence_assessment_data {
|
Line 104 sub get_sequence_assessment_data {
|
my $fn=$ENV{'request.course.fn'}; |
my $fn=$ENV{'request.course.fn'}; |
## |
## |
## use navmaps |
## use navmaps |
my $navmap = Apache::lonnavmaps::navmap->new($fn.".db", |
my $navmap = Apache::lonnavmaps::navmap->new(); |
$fn."_parms.db",1,0); |
|
if (!defined($navmap)) { |
if (!defined($navmap)) { |
return 'Can not open Coursemap'; |
return 'Can not open Coursemap'; |
} |
} |
Line 159 sub get_sequence_assessment_data {
|
Line 158 sub get_sequence_assessment_data {
|
} |
} |
# get the map itself, instead of BEGIN_MAP |
# get the map itself, instead of BEGIN_MAP |
$title = $previous->title(); |
$title = $previous->title(); |
|
$title =~ s/\:/\&\#058;/g; |
$symb = $previous->symb(); |
$symb = $previous->symb(); |
$src = $previous->src(); |
$src = $previous->src(); |
# pick up the filename if there is no title available |
# pick up the filename if there is no title available |
Line 187 sub get_sequence_assessment_data {
|
Line 187 sub get_sequence_assessment_data {
|
next if (! $curRes->is_problem());# && !$curRes->randomout); |
next if (! $curRes->is_problem());# && !$curRes->randomout); |
# Okay, from here on out we only deal with assessments |
# Okay, from here on out we only deal with assessments |
$title = $curRes->title(); |
$title = $curRes->title(); |
|
$title =~ s/\:/\&\#058;/g; |
$symb = $curRes->symb(); |
$symb = $curRes->symb(); |
$src = $curRes->src(); |
$src = $curRes->src(); |
my $parts = $curRes->parts(); |
my $parts = $curRes->parts(); |
Line 525 sub init_dbs {
|
Line 526 sub init_dbs {
|
{ name => 'student', |
{ name => 'student', |
type => 'VARCHAR(100)', |
type => 'VARCHAR(100)', |
restrictions => 'NOT NULL'}, |
restrictions => 'NOT NULL'}, |
|
{ name => 'classification', |
|
type => 'varchar(100)', }, |
], |
], |
'PRIMARY KEY' => ['student (100)'], |
'PRIMARY KEY' => ['student (100)'], |
'KEY' => [{ columns => ['student_id']},], |
'KEY' => [{ columns => ['student_id']},], |
Line 842 sub get_student_id {
|
Line 845 sub get_student_id {
|
$have_read_student_table = 1; |
$have_read_student_table = 1; |
} |
} |
if (! exists($ids_by_student{$student})) { |
if (! exists($ids_by_student{$student})) { |
&Apache::lonmysql::store_row($student_table,[undef,$student]); |
&Apache::lonmysql::store_row($student_table,[undef,$student,undef]); |
undef(%ids_by_student); |
undef(%ids_by_student); |
my @Result = &Apache::lonmysql::get_rows($student_table); |
my @Result = &Apache::lonmysql::get_rows($student_table); |
foreach (@Result) { |
foreach (@Result) { |
Line 872 sub get_student {
|
Line 875 sub get_student {
|
|
|
=pod |
=pod |
|
|
=item &clear_internal_caches() |
|
|
|
Causes the internal caches used in get_student_id, get_student, |
|
get_symb_id, get_symb, get_part_id, and get_part to be undef'd. |
|
|
|
Needs to be called before the first operation with the MySQL database |
|
for a given Apache request. |
|
|
|
=cut |
|
|
|
################################################ |
|
################################################ |
|
sub clear_internal_caches { |
|
$have_read_part_table = 0; |
|
undef(%ids_by_part); |
|
undef(%parts_by_id); |
|
$have_read_symb_table = 0; |
|
undef(%ids_by_symb); |
|
undef(%symbs_by_id); |
|
$have_read_student_table = 0; |
|
undef(%ids_by_student); |
|
undef(%students_by_id); |
|
} |
|
|
|
|
|
################################################ |
|
################################################ |
|
|
|
=pod |
|
|
|
=item &update_student_data() |
=item &update_student_data() |
|
|
Input: $sname, $sdom, $courseid |
Input: $sname, $sdom, $courseid |
Line 1195 sub get_student_data_from_performance_ca
|
Line 1168 sub get_student_data_from_performance_ca
|
$studentdata->{$symb}->{$base.'.awarddetail'} = $awarddetail; |
$studentdata->{$symb}->{$base.'.awarddetail'} = $awarddetail; |
$studentdata->{$symb}->{'timestamp'} = $time if (defined($time) && $time ne ''); |
$studentdata->{$symb}->{'timestamp'} = $time if (defined($time) && $time ne ''); |
} |
} |
## Get misc parameters |
|
$request = 'SELECT c.symb,a.parameter,a.value '. |
|
"FROM $student_table AS b ". |
|
"LEFT JOIN $parameters_table AS a ON b.student_id=a.student_id ". |
|
"LEFT JOIN $symb_table AS c ON c.symb_id = a.symb_id ". |
|
"WHERE student='$student'"; |
|
if (defined($symb) && $symb ne '') { |
|
$request .= " AND c.symb=".$dbh->quote($symb); |
|
} |
|
$sth = $dbh->prepare($request); |
|
$sth->execute(); |
|
if ($sth->err()) { |
|
&Apache::lonnet::logthis("Unable to execute MySQL request:"); |
|
&Apache::lonnet::logthis("\n".$request."\n"); |
|
&Apache::lonnet::logthis("error is:".$sth->errstr()); |
|
if (defined($symb) && $symb ne '') { |
|
$studentdata = $studentdata->{$symb}; |
|
} |
|
return $studentdata; |
|
} |
|
# |
|
foreach my $row (@{$sth->fetchall_arrayref}) { |
|
$rows_retrieved++; |
|
my ($symb,$parameter,$value) = (@$row); |
|
$studentdata->{$symb}->{$parameter} = $value; |
|
} |
|
# |
|
if (defined($symb) && $symb ne '') { |
if (defined($symb) && $symb ne '') { |
$studentdata = $studentdata->{$symb}; |
$studentdata = $studentdata->{$symb}; |
} |
} |