version 1.109, 2003/12/09 21:14:23
|
version 1.112.2.1, 2004/03/09 21:42:01
|
Line 188 sub get_sequence_assessment_data {
|
Line 188 sub get_sequence_assessment_data {
|
$title =~ s/\:/\&\#058;/g; |
$title =~ s/\:/\&\#058;/g; |
$symb = $curRes->symb(); |
$symb = $curRes->symb(); |
$src = $curRes->src(); |
$src = $curRes->src(); |
|
# Grab the filename if there is not title available |
|
if (! defined($title) || $title eq '') { |
|
($title) = ($src=~ m:/([^/]*)$:); |
|
} |
my $parts = $curRes->parts(); |
my $parts = $curRes->parts(); |
my %partdata; |
my %partdata; |
foreach my $part (@$parts) { |
foreach my $part (@$parts) { |
Line 1221 sub update_full_student_data {
|
Line 1225 sub update_full_student_data {
|
# However, there is one wrinkle: submissions which end in |
# However, there is one wrinkle: submissions which end in |
# and odd number of '\' cause insert errors to occur. |
# and odd number of '\' cause insert errors to occur. |
# Best trap this somehow... |
# Best trap this somehow... |
$value =~ s/\'/\\\'/g; |
$value = $dbh->quote($value); |
my ($offensive_string) = ($value =~ /(\\+)$/); |
|
if (length($offensive_string) % 2) { |
|
$value =~ s/\\$/\\\\/; |
|
} |
|
} |
} |
if ($field eq 'submissiongrading' || |
if ($field eq 'submissiongrading' || |
$field eq 'molecule') { |
$field eq 'molecule') { |
Line 1274 sub update_full_student_data {
|
Line 1274 sub update_full_student_data {
|
while (my ($part_id,$hash2) = each (%$hash1)) { |
while (my ($part_id,$hash2) = each (%$hash1)) { |
while (my ($resp_id,$hash3) = each (%$hash2)) { |
while (my ($resp_id,$hash3) = each (%$hash2)) { |
while (my ($transaction,$data) = each (%$hash3)) { |
while (my ($transaction,$data) = each (%$hash3)) { |
$store_command .= "('".join("','",$symb_id,$part_id, |
my $submission = $data->{'submission'}; |
$resp_id,$student_id, |
# We have to be careful with user supplied input. |
$transaction, |
# most of the time we are okay because it is escaped. |
$data->{'awarddetail'}, |
# However, there is one wrinkle: submissions which end in |
$data->{'response_specific'}, |
# and odd number of '\' cause insert errors to occur. |
$data->{'response_specific_value'}, |
# Best trap this somehow... |
$data->{'submission'})."'),"; |
$submission = $dbh->quote($submission); |
|
$store_command .= "('". |
|
join("','",$symb_id,$part_id, |
|
$resp_id,$student_id, |
|
$transaction, |
|
$data->{'awarddetail'}, |
|
$data->{'response_specific'}, |
|
$data->{'response_specific_value'}). |
|
"',".$submission."),"; |
$store_rows++; |
$store_rows++; |
} |
} |
} |
} |
Line 2063 sub get_response_data {
|
Line 2071 sub get_response_data {
|
} |
} |
my $dataset = $sth->fetchall_arrayref(); |
my $dataset = $sth->fetchall_arrayref(); |
if (ref($dataset) eq 'ARRAY' && scalar(@$dataset)>0) { |
if (ref($dataset) eq 'ARRAY' && scalar(@$dataset)>0) { |
|
# Clear the \'s from around the submission |
|
for (my $i =0;$i<scalar(@$dataset);$i++) { |
|
$dataset->[$i]->[3] =~ s/(\'$|^\')//g; |
|
} |
return $dataset; |
return $dataset; |
} |
} |
} |
} |
Line 2215 $ENV{'course.'.$cid.'.domain'}, and $ENV
|
Line 2227 $ENV{'course.'.$cid.'.domain'}, and $ENV
|
|
|
Returns a reference to a hash which contains: |
Returns a reference to a hash which contains: |
keys '$sname:$sdom' |
keys '$sname:$sdom' |
values [$sdom,$sname,$end,$start,$id,$section,$fullname,$status] |
values [$sdom,$sname,$end,$start,$id,$section,$fullname,$status,$type] |
|
|
The constant values CL_SDOM, CL_SNAME, CL_END, etc. can be used |
The constant values CL_SDOM, CL_SNAME, CL_END, etc. can be used |
as indices into the returned list to future-proof clients against |
as indices into the returned list to future-proof clients against |
Line 2234 sub CL_ID { return 4; }
|
Line 2246 sub CL_ID { return 4; }
|
sub CL_SECTION { return 5; } |
sub CL_SECTION { return 5; } |
sub CL_FULLNAME { return 6; } |
sub CL_FULLNAME { return 6; } |
sub CL_STATUS { return 7; } |
sub CL_STATUS { return 7; } |
|
sub CL_TYPE { return 8; } |
|
|
sub get_classlist { |
sub get_classlist { |
my ($cid,$cdom,$cnum) = @_; |
my ($cid,$cdom,$cnum) = @_; |
Line 2250 sub get_classlist {
|
Line 2263 sub get_classlist {
|
} |
} |
my ($sname,$sdom) = split(/:/,$student); |
my ($sname,$sdom) = split(/:/,$student); |
my @Values = split(/:/,$info); |
my @Values = split(/:/,$info); |
my ($end,$start,$id,$section,$fullname); |
my ($end,$start,$id,$section,$fullname,$type); |
if (@Values > 2) { |
if (@Values > 2) { |
($end,$start,$id,$section,$fullname) = @Values; |
($end,$start,$id,$section,$fullname,$type) = @Values; |
} else { # We have to get the data ourselves |
} else { # We have to get the data ourselves |
($end,$start) = @Values; |
($end,$start) = @Values; |
$section = &Apache::lonnet::getsection($sdom,$sname,$cid); |
$section = &Apache::lonnet::getsection($sdom,$sname,$cid); |
Line 2289 sub get_classlist {
|
Line 2302 sub get_classlist {
|
$status='Active'; |
$status='Active'; |
} |
} |
$classlist{$student} = |
$classlist{$student} = |
[$sdom,$sname,$end,$start,$id,$section,$fullname,$status]; |
[$sdom,$sname,$end,$start,$id,$section,$fullname,$status,$type]; |
} |
} |
if (wantarray()) { |
if (wantarray()) { |
return (\%classlist,['domain','username','end','start','id', |
return (\%classlist,['domain','username','end','start','id', |
'section','fullname','status']); |
'section','fullname','status','type']); |
} else { |
} else { |
return \%classlist; |
return \%classlist; |
} |
} |