'.&Apache::lonxml::message_location().'
@@ -627,26 +647,27 @@ sub firstaccess_msg {
my $foldertitle=&Apache::lonnet::gettitle($map);
&Apache::lonxml::debug("map is $map title is $foldertitle");
- $result .= (<The resources in "$foldertitle" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources "$foldertitle".
-ENDCHECKOUT
+ $result .= "
".&mt('The resources in "[_1]" are open for a limited time.'
+ .' Once you click the "Show Resource" button below you have [_2] to complete all resources "[_1]".'
+ ,$foldertitle,$time)."
";
} elsif ($interval[1] eq 'course') {
my $course = $env{'course.'.$env{'request.course.id'}.'.description'};
- $result .= (<The resources in "$course" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources in "$course".
-ENDCHECKOUT
+ $result .= "
".&mt('The resources in "[_1]" are open for a limited time.'
+ .' Once you click the "Show Resource" button below you have [_2] to complete all resources "[_1]".'
+ ,$course,$time)."
";
} else {
my $title=&Apache::lonnet::gettitle($symb);
- $result .= (<This resource "$title" is open for a limited time. Once you click the 'Show Resource' button below you have $time to complete this resource "$title".
-ENDCHECKOUT
-
+ $result .= "
".&mt('This resource "[_1]" is open for a limited time.'
+ .' Once you click the "Show Resource" button below you have [_2] to complete this resource "[_1]".'
+ ,$title,$time)."
";
}
my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'});
+ my $buttontext = &mt('Show Resource');
+ my $timertext = &mt('Start Timer?');
$result .= (<
-
+
ENDCHECKOUT
return $result;
@@ -754,7 +775,8 @@ sub start_problem {
}
if ($target ne 'analyze') {
- $Apache::lonhomework::type=&Apache::lonnet::EXT('resource.0.type');
+ my $type = &Apache::lonnet::EXT('resource.0.type');
+ $Apache::lonhomework::type=$type;
if (($env{'request.state'} eq 'construct') &&
$env{'form.problemtype'} =~ /\S/) {
$Apache::lonhomework::type=$env{'form.problemtype'};
@@ -843,6 +865,9 @@ sub start_problem {
$form_tag_start.= ' />'.&mt(' Show All Foils').
'';
}
+ if ($Apache::lonhomework::type eq 'practice') {
+ $form_tag_start.=&practice_problem_header();
+ }
$form_tag_start.='';
}
@@ -915,6 +940,11 @@ sub start_problem {
# create a page header and exit
if ($env{'request.state'} eq "construct") {
$result.= &problem_web_to_edit_header($env{'form.rndseed'});
+ if ($Apache::lonhomework::type eq 'practice') {
+ $result.= ''.
+ &practice_problem_header().'';
+ }
}
# if we are viewing someone else preserve that info
if (defined $env{'form.grade_symb'}) {
@@ -1150,6 +1180,11 @@ sub start_library {
$result.=" \n $form_tag_start".
'';
$result.=&problem_web_to_edit_header($rndseed);
+ if ($Apache::lonhomework::type eq 'practice') {
+ $result.= ''.
+ &practice_problem_header().'';
+ }
}
return $result;
}
@@ -1357,7 +1392,17 @@ sub end_languageblock {
my $result = &Apache::lonxml::endredirection();
my $which = &Apache::lonxml::get_param('which',$parstack,
$safeeval);
- $available_texts{$which} = $result;
+ if ($which=~/\w/) {
+ $available_texts{$which} = $result;
+ }
+ my $otherlangs = &Apache::lonxml::get_param('other',$parstack,
+ $safeeval);
+ foreach my $language (split(/\s*\,\s*/,$otherlangs)) {
+ if ($language=~/\w/) {
+ $available_texts{$language} = $result;
+ }
+ }
+
}
return '';
}
@@ -1454,7 +1499,7 @@ sub end_while {
$return = &Apache::run::run($code,$safeeval);
}
if ($error) {
- &Apache::lonxml::error('
'.&mt('Code ran too long. It ran for more than').' '.$Apache::lonnet::perlvar{'lonScriptTimeout'}.' '.&mt('seconds occured while running <while> on line').' '.$line.'
');
+ &Apache::lonxml::error('
'.&mt('Code ran too long. It ran for more than').' '.$Apache::lonnet::perlvar{'lonScriptTimeout'}.' '.&mt('seconds occurred while running <while> on line').' '.$line.'
');
}
} elsif ($target eq "edit") {
$result.= &Apache::edit::tag_end($target,$token,'');
@@ -1814,7 +1859,8 @@ sub start_problemtype {
$result .=&Apache::edit::checked_arg('When used as type(s):','for',
[ ['exam','Exam/Quiz Problem'],
['survey','Survey'],
- ['problem','Homework Problem'] ]
+ ['problem','Homework Problem'],
+ ['practice','Practice Problem'] ]
,$token);
$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
} elsif ($target eq 'modified') {
@@ -1847,16 +1893,22 @@ sub end_startouttext {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $result='';
my $text='';
-
if ($target eq 'edit') {
+ my $areaid = 'homework_edit_'.$Apache::lonxml::curdepth;
$text=&Apache::lonxml::get_all_text("endouttext",$parser,$style);
$result.=&Apache::edit::start_table($token)."