--- loncom/homework/lonhomework.pm 2009/03/20 20:36:41 1.298.2.1 +++ loncom/homework/lonhomework.pm 2008/11/19 18:34:56 1.299 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.298.2.1 2009/03/20 20:36:41 raeburn Exp $ +# $Id: lonhomework.pm,v 1.299 2008/11/19 18:34:56 jms Exp $ # # Copyright Michigan State University Board of Trustees # @@ -85,14 +85,20 @@ sub set_bubble_lines { } } -# -# Decides what targets to render for. -# Implicit inputs: -# Various session environment variables: -# request.state - published - is a /res/ resource -# uploaded - is a /uploaded/ resource -# contruct - is a /priv/ resource -# form.grade_target - a form parameter requesting a specific target +=pod + +=item get_target() + +Decides what targets to render for. +Implicit inputs: + Various session environment variables: + request.state - published - is a /res/ resource + uploaded - is a /uploaded/ resource + contruct - is a /priv/ resource + form.grade_target - a form parameter requesting a specific target + +=cut + sub get_target { &Apache::lonxml::debug("request.state = $env{'request.state'}"); if( defined($env{'form.grade_target'})) { @@ -173,7 +179,7 @@ sub setup_vars { sub createmenu { my ($which,$request)=@_; if ($which eq 'grade') { - $request->print(''); @@ -331,8 +337,16 @@ sub check_slot_access { return ($slotstatus,$datemsg,$slot_name,$returned_slot); } -# JB, 9/24/2002: Any changes in this function may require a change -# in lonnavmaps::resource::getDateStatus. + +=pod + +=item check_access() + +JB, 9/24/2002: Any changes in this function may require a change +in lonnavmaps::resource::getDateStatus. + +=cut + sub check_access { my ($id) = @_; my $date =''; @@ -480,7 +494,16 @@ sub check_access { return ($status,$datemsg); } -# this should work exactly like the copy in lonnavmaps.pm + + +=pod + +=item due_date() + + this should work exactly like the copy in lonnavmaps.pm + +=cut + sub due_date { my ($part_id,$symb,$udom,$uname)=@_; my $date; @@ -855,11 +878,8 @@ sub editxmlmode { my $result; my $problem=&Apache::lonnet::getfile($file); if ($problem eq -1) { - &Apache::lonxml::error( - ' ' - .&mt('Unable to find [_1]', - ''.$file.'') - .''); + &Apache::lonxml::error(" ".&mt('Unable to find'). + " $file"); $problem=''; } if (defined($env{'form.editxmltext'}) || defined($env{'form.Undo'})) { @@ -874,6 +894,12 @@ sub editxmlmode { &renderpage($request,$file); } else { my ($rows,$cols) = &Apache::edit::textarea_sizes(\$problem); + my $xml_help = '
'. + &Apache::loncommon::helpLatexCheatsheet("Problem_Editor_XML_Index", + "Problem Editing Help"). + ''. + &Apache::loncommon::help_open_menu(undef,undef,5,'Authoring'). + '
'; if ($cols > 80) { $cols = 80; } if ($cols < 70) { $cols = 70; } if ($rows < 20) { $rows = 20; } @@ -902,7 +928,7 @@ sub editxmlmode {
'.&mt('Problem Editing').&Apache::loncommon::help_open_topic('Problem_Editor_XML_Index').' - '.&Apache::loncommon::helpLatexCheatsheet('Problem_LON-CAPA_Functions','Script Functions').' + '.&Apache::loncommon::helpLatexCheatsheet().'
@@ -935,9 +961,14 @@ sub editxmlmode { return ''; } -# -# Render the page in whatever target desired. -# +=pod + +=item renderpage() + + Render the page in whatever target desired. + +=cut + sub renderpage { my ($request,$file,$targets,$return_string) = @_; @@ -966,7 +997,7 @@ sub renderpage { my $filename=(split('/',$file))[-1]; my $error = " ".&mt('Unable to find [_1]', - ''.$filename.'') + ' '.$filename.'') .""; $result.= &Apache::loncommon::simple_error_page($request,'Not available', @@ -1137,7 +1168,7 @@ sub update_construct_style { && !defined($env{'form.newrandomization'})) { if ((!$env{'form.style_file'} && $env{'construct.style'}) ||$env{'form.clear_style_file'}) { - &Apache::lonnet::delenv('construct.style'); + &Apache::lonnet::delenv('construct\\.style'); } elsif ($env{'form.style_file'} && $env{'construct.style'} ne $env{'form.style_file'}) { &Apache::lonnet::appenv({'construct.style' =>