version 1.376, 2006/09/22 21:11:55
|
version 1.377, 2006/09/27 22:09:16
|
Line 112 sub nameUserString {
|
Line 112 sub nameUserString {
|
#--- Indicate if a response type is coded handgraded or not. --- |
#--- Indicate if a response type is coded handgraded or not. --- |
sub response_type { |
sub response_type { |
my ($symb) = shift; |
my ($symb) = shift; |
my (undef,undef,$url) = &Apache::lonnet::decode_symb($symb); |
|
my $allkeys = &Apache::lonnet::metadata($url,'keys'); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my %vPart; |
my $res = $navmap->getBySymb($symb); |
foreach my $partid (&Apache::loncommon::get_env_multiple('form.vPart')) { |
my $partlist = $res->parts(); |
$vPart{$partid}=1; |
my (%response_types,%handgrade); |
} |
foreach my $part (@{ $partlist }) { |
my %seen = (); |
my @types = $res->responseType($part); |
my (@partlist,%handgrade,%responseType); |
my @ids = $res->responseIds($part); |
foreach (split(/,/,&Apache::lonnet::metadata($url,'packages'))) { |
for (my $i=0; $i < scalar(@ids); $i++) { |
if (/^\w+response_.*/ || /^Task_/) { |
$response_types{$part}{$ids[$i]} = $types[$i]; |
my ($responsetype,$part) = split(/_/,$_,2); |
$handgrade{$part.'_'.$ids[$i]} = |
my ($partid,$respid) = split(/_/,$part,2); |
&Apache::lonnet::EXT('resource.'.$part.'_'.$ids[$i]. |
if ($responsetype eq 'Task') { $respid='0'; } |
'.handgrade',$symb); |
if (&Apache::loncommon::check_if_partid_hidden($partid,$symb)) { |
|
next; |
|
} |
|
if (%vPart && !exists($vPart{$partid})) { |
|
next; |
|
} |
|
$responsetype =~ s/response$//; # make it compatible w/ navmaps - should move to that!! |
|
my ($value) = &Apache::lonnet::EXT('resource.'.$part.'.handgrade',$symb); |
|
$handgrade{$part} = ($value eq 'yes' ? 'yes' : 'no'); |
|
if (!exists($responseType{$partid})) { $responseType{$partid}={}; } |
|
$responseType{$partid}->{$respid}=$responsetype; |
|
next if ($seen{$partid} > 0); |
|
$seen{$partid}++; |
|
push @partlist,$partid; |
|
} |
} |
} |
} |
return (\@partlist,\%handgrade,\%responseType); |
return ($partlist,\%handgrade,\%response_types); |
} |
} |
|
|
sub flatten_responseType { |
sub flatten_responseType { |
Line 1918 KEYWORDS
|
Line 1904 KEYWORDS
|
my $order=&get_order($partid,$respid,$symb,$uname,$udom); |
my $order=&get_order($partid,$respid,$symb,$uname,$udom); |
if ($env{'form.lastSub'} eq 'lastonly' || |
if ($env{'form.lastSub'} eq 'lastonly' || |
($env{'form.lastSub'} eq 'hdgrade' && |
($env{'form.lastSub'} eq 'hdgrade' && |
$$handgrade{$part} eq 'yes')) { |
$$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) { |
my $display_part=&get_display_part($partid,$symb); |
my $display_part=&get_display_part($partid,$symb); |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part:</b> '. |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part:</b> '. |
$display_part.' <font color="#999999">( ID '.$respid. |
$display_part.' <font color="#999999">( ID '.$respid. |