--- loncom/interface/lonhelper.pm 2004/04/20 15:08:26 1.69 +++ loncom/interface/lonhelper.pm 2004/08/12 05:44:36 1.85 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.69 2004/04/20 15:08:26 sakharuk Exp $ +# $Id: lonhelper.pm,v 1.85 2004/08/12 05:44:36 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -263,8 +263,13 @@ sub real_handler { # Send header, don't cache this page - - if (&Apache::lonhomework::setupheader($r)) { return OK; } + if ($ENV{'browser.mathml'}) { + &Apache::loncommon::content_type($r,'text/xml'); + } else { + &Apache::loncommon::content_type($r,'text/html'); + } + $r->send_http_header; + return OK if $r->header_only; $r->rflush(); # Discard result, we just want the objects that get created by the @@ -580,30 +585,6 @@ sub display { $result .= < - $loncapaHelper: $helperTitle @@ -1290,7 +1271,6 @@ BUTTONS $choiceLabel = eval($choiceLabel); $choiceLabel = &$choiceLabel($helper, $self); } - &Apache::lonnet::logthis("TITLE TRANSLATION >$choiceLabel<"); $result .= "/> " . &mtn($choiceLabel) . "\n"; } $result .= "\n\n\n"; @@ -2109,7 +2089,9 @@ sub render { for (i=0; i @@ -2125,16 +2114,18 @@ SCRIPT my %lt=&Apache::lonlocal::texthash( 'ocs' => "Select Only Current Students", + 'ues' => "Unselect Expired Students", 'sas' => "Select All Students", 'uas' => "Unselect All Students", - 'sfsg' => "Select for Section/Group", + 'sfsg' => "Select Current Students for Section/Group", 'ufsg' => "Unselect for Section/Group"); $buttons = < +
- +
  @@ -2197,7 +2188,6 @@ BUTTONS } my $name = $self->{'coursepersonnel'} ? &mt('Name') : &mt('Student Name'); - &Apache::lonnet::logthis("THE NAME IS >$name<"); my $type = 'radio'; if ($self->{'multichoice'}) { $type = 'checkbox'; } $result .= "\n"; @@ -2471,7 +2461,7 @@ BUTTONS } # Sort the fileList into order - @fileList = sort @fileList; + @fileList = sort {lc($a) cmp lc($b)} @fileList; $result .= $buttons; @@ -2690,6 +2680,7 @@ string honors the validation function, i no strict; @ISA = ("Apache::lonhelper::element"); use strict; +use Apache::lonlocal; BEGIN { &Apache::lonhelper::register('Apache::lonhelper::string', @@ -2808,6 +2799,8 @@ be able to call methods on it. =cut +use Apache::lonlocal; + BEGIN { &Apache::lonhelper::register('Apache::lonhelper::general', 'exec', 'condition', 'clause', @@ -3121,7 +3114,7 @@ sub render { # Print the granularity, depending on the action if ($vars->{GRANULARITY} eq 'whole_course') { - $resourceString .= '
  • for all resources in the course
  • '; + $resourceString .= '
  • '.&mt('for all resources in the course').'
  • '; $level = 9; # general course, see lonparmset.pm perldoc $affectedResourceId = "0.0"; $symb = 'a'; @@ -3132,7 +3125,7 @@ sub render { my $title = $res->compTitle(); $symb = $res->symb(); $navmap->untieHashes(); - $resourceString .= "
  • for the map named $title
  • "; + $resourceString .= '
  • '.&mt('for the map named [_1]',"$title").'
  • '; $level = 8; $affectedResourceId = $vars->{RESOURCE_ID}; $paramlevel = 'map'; @@ -3142,7 +3135,7 @@ sub render { $symb = $res->symb(); my $title = $res->compTitle(); $navmap->untieHashes(); - $resourceString .= "
  • for the resource named $title
  • "; + $resourceString .= '
  • '.&mt('for the resource named [_1]',"$title").'
  • '; $level = 7; $affectedResourceId = $vars->{RESOURCE_ID}; $paramlevel = 'full'; @@ -3152,12 +3145,19 @@ sub render { $result .= '

    '.&mt('Confirm that this information is correct, then click "Finish Helper" to complete setting the parameter.').'

      '; # Print the type of manipulation: - $result .= '
    • Setting the ' . $dateTypeHash{$vars->{ACTION_TYPE}} . ''; + my $extra; if ($vars->{ACTION_TYPE} eq 'tries') { - $result .= ' to ' . $vars->{TRIES} . ''; + $extra = $vars->{TRIES}; } if ($vars->{ACTION_TYPE} eq 'weight') { - $result .= ' to ' . $vars->{WEIGHT} . ''; + $extra = $vars->{WEIGHT}; + } + $result .= "
    • "; + my $what = &mt($dateTypeHash{$vars->{ACTION_TYPE}}); + if ($extra) { + $result .= &mt('Setting the [_1] to [_2]',"$what",$extra); + } else { + $result .= &mt('Setting the [_1]',"$what"); } $result .= "
    • \n"; if ($vars->{ACTION_TYPE} eq 'due_date' || @@ -3188,10 +3188,10 @@ sub render { # Print targets if ($vars->{TARGETS} eq 'course') { - $result .= '
    • for all students in course
    • '; + $result .= '
    • '.&mt('for all students in course').'
    • '; } elsif ($vars->{TARGETS} eq 'section') { my $section = $vars->{SECTION_NAME}; - $result .= "
    • for section $section
    • "; + $result .= '
    • '.&mt('for section [_1]',"$section").'
    • '; $level -= 3; $result .= "&"') . "' />\n"; @@ -3202,7 +3202,7 @@ sub render { # Chop off everything after the last colon (section) $username = substr($username, 0, rindex($username, ':')); my $name = $classlist->{$username}->[6]; - $result .= "
    • for $name
    • "; + $result .= '
    • '.&mt('for [_1]',"$name").'
    • '; $level -= 6; my ($uname, $udom) = split /:/, $vars->{USER_NAME}; $result .= "{ACTION_TYPE} ne 'weight') { - $result .= "
    • to " . ctime($vars->{PARM_DATE}) . " (" . - Apache::lonnavmaps::timeToHumanString($vars->{PARM_DATE}) - . ")
    • \n"; + $result .= '
    • '.&mt('to [_1] ([_2])',"".ctime($vars->{PARM_DATE})."",Apache::lonnavmaps::timeToHumanString($vars->{PARM_DATE}))."
    • \n"; } # print pres_marker @@ -3228,7 +3226,7 @@ sub render { $result .= "\n"; $result .= "\n"; - $result .= "

      \n"; + $result .= "

      \n"; return $result; }