--- loncom/interface/lonhelper.pm 2004/09/24 19:49:12 1.87 +++ loncom/interface/lonhelper.pm 2005/02/17 23:19:44 1.97 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.87 2004/09/24 19:49:12 matthew Exp $ +# $Id: lonhelper.pm,v 1.97 2005/02/17 23:19:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -575,6 +575,7 @@ sub display { } # Phase 4: Display. + my $html=&Apache::lonxml::xmlbegin(); my $stateTitle=&mt($state->title()); my $helperTitle = &mt($self->{TITLE}); my $bodytag = &Apache::loncommon::bodytag($helperTitle,'',''); @@ -584,9 +585,8 @@ sub display { my $loncapaHelper = &mt("LON-CAPA Helper:"); $result .= < +$html - $loncapaHelper: $helperTitle $bodytag @@ -1165,7 +1165,7 @@ sub start_choice { $parser)); my $nextstate = $token->[2]{'nextstate'}; my $evalFlag = $token->[2]{'eval'}; - push @{$paramHash->{CHOICES}}, [$human, $computer, $nextstate, + push @{$paramHash->{CHOICES}}, [&mtn($human), $computer, $nextstate, $evalFlag]; return ''; } @@ -1267,7 +1267,7 @@ BUTTONS $result .= "\n \n"; $result .= "&"') + HTML::Entities::encode($choice->[1],"<>&\"'") . "'"; if ($checkedChoices{$choice->[1]}) { $result .= " checked "; @@ -1281,7 +1281,7 @@ BUTTONS $choiceLabel = &$choiceLabel($helper, $self); } $result .= "/> ".qq{\n"; + $choiceLabel. "\n"; } $result .= "\n\n\n"; $result .= $buttons; @@ -1424,7 +1424,7 @@ sub render { $result .= "&\"'"); + if($option_vars) { + foreach my $option_var (@$option_vars) { + $col .= + " "; + } + } + + $col .= "&"') - . "' />"; - return $col; + $col .= "value='" . $resource_name . "' />"; + + return $result.$col; } }; + my $renderPartsFunc = sub { + my ($resource, $part, $params) = @_; + my $col= ""; + my $id=$resource->{ID}; + my $resource_name = + &HTML::Entities::encode(&$valueFunc($resource),"<>&\"'"); + if ($addparts && (scalar(@{$resource->parts}) > 1)) { + $col .= ""; + } + $col .= ""; + }; + $result.=(< + function updateRadio(form,name,value) { + var radiobutton=form[name]; + for (var i=0; i