--- loncom/homework/structuretags.pm 2004/01/14 22:47:46 1.228 +++ loncom/homework/structuretags.pm 2004/02/10 22:11:37 1.233 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.228 2004/01/14 22:47:46 www Exp $ +# $Id: structuretags.pm,v 1.233 2004/02/10 22:11:37 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,6 +37,7 @@ use Apache::lonnet; use Apache::File(); use Apache::lonmenu; use Apache::lonlocal; +use Apache::lonxml; BEGIN { &Apache::lonxml::register('Apache::structuretags',('block','languageblock','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','startouttext','endouttext', @@ -186,8 +187,11 @@ sub problem_edit_header {
-
'. - &Apache::loncommon::help_open_topic('Problem_Editor_XML_Index','Problem Editing Help'). +
'. + &Apache::loncommon::help_open_topic('Problem_Editor_XML_Index', + 'Problem Editing Help').''. + &Apache::loncommon::help_open_faq(5). + &Apache::loncommon::help_open_bug('Authoring').'
'. '
'; } @@ -456,7 +460,7 @@ sub start_problem { my @packages = split /,/,$packages; my $allow_print_points = 0; foreach my $partial_key (@packages) { - if ($partial_key=~m/part_0/) { + if ($partial_key=~m/^part_0$/) { $allow_print_points=1; } } @@ -472,7 +476,7 @@ sub start_problem { my @due_file_content = <$temp_file>; my $due_file_content = $due_file_content[$#due_file_content]; chomp $due_file_content; - my $name_of_resourse= &get_resource_name($parstack,$safeeval); + my $name_of_resourse= &Apache::lonxml::latex_special_symbols(&get_resource_name($parstack,$safeeval)); if ($due_file_content ne $duedate) { $temp_file = Apache::File->new('>'.$filename); print $temp_file "$duedate\n"; @@ -519,7 +523,7 @@ sub end_problem { if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex') { if ( $target eq 'grade' && $Apache::inputtags::part eq '0' && - $status eq 'CAN_ANSWER' ) { + ($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode)) { # if part is zero, no s existed, so we need to the grading &Apache::inputtags::grade; } elsif ( ($target eq 'web' || $target eq 'tex') && @@ -971,15 +975,17 @@ sub start_part { $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent'; } my $weight = &Apache::lonnet::EXT("resource.$id.weight"); - my $allkeys=&Apache::lonnet::metadata($ENV{'request.uri'},'keys'); + my $allkeys=&Apache::lonnet::metadata($ENV{'request.uri'},'packages'); my @allkeys = split /,/,$allkeys; my $allow_print_points = 0; foreach my $partial_key (@allkeys) { - if ($partial_key=~m/\_(\d*)\_weight/) { + if ($partial_key=~m/^part_(.*)$/) { if ($1 ne '0') {$allow_print_points=1;} } } if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';} + } elsif ($target eq 'web') { + $result.=''; } } } @@ -1011,7 +1017,9 @@ sub end_part { my $result=''; if ( $target eq 'meta' ) { $result=''; - } elsif ( $target eq 'grade' && $status eq 'CAN_ANSWER' && !$hidden) { + } elsif ($target eq 'grade' && + ($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode) && + !$hidden) { $result=&Apache::inputtags::grade; } elsif (($target eq 'web' || $target eq 'tex') && !$hidden ) { my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,