--- loncom/homework/structuretags.pm 2003/11/21 20:21:20 1.226
+++ loncom/homework/structuretags.pm 2004/02/02 17:28:53 1.231
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.226 2003/11/21 20:21:20 albertel Exp $
+# $Id: structuretags.pm,v 1.231 2004/02/02 17:28:53 sakharuk 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,12 @@ sub problem_edit_header {
-
- ';
+ '.
+ &Apache::loncommon::help_open_topic('Problem_Editor_XML_Index',
+ 'Problem Editing Help').' '.
+ &Apache::loncommon::help_open_faq(5).
+ &Apache::loncommon::help_open_bug('Authoring').'
'.
+ '';
}
sub problem_edit_footer {
@@ -208,8 +213,9 @@ sub problem_web_to_edit_header {
onChange="javascript:document.lonhomework.changerandseed.click()" />
'.&mt(' Show All Foils').'
- ';
+ $result.= ' />'.&mt(' Show All Foils').
+ &Apache::loncommon::help_open_topic('Problem_Editor_Testing_Area','Testing Problems').
+ ' ';
my $numtoanalyze=$ENV{'form.numtoanalyze'};
if (!$numtoanalyze) { $numtoanalyze=20; }
$result.= ' $name
+ $result.="$head_tag_start$name
$body_tag_start \n $form_tag_start".
- ' ';
- if ($ENV{'request.state'} eq "construct") {
- $result.= &problem_web_to_edit_header($ENV{'form.rndseed'});
- }
- # if we are viewing someone else preserve that info
- if (defined $ENV{'form.grade_symb'}) {
- foreach my $field ('symb','courseid','domain','username') {
- $result .= ' '."\n";
- }
+ ' ';
+ # create a page header and exit
+ if ($ENV{'request.state'} eq "construct") {
+ $result.= &problem_web_to_edit_header($ENV{'form.rndseed'});
+ }
+ # if we are viewing someone else preserve that info
+ if (defined $ENV{'form.grade_symb'}) {
+ foreach my $field ('symb','courseid','domain','username') {
+ $result .= ' '."\n";
}
- } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER'
- || $status eq 'CLOSED' || $status eq 'UNAVALAILABLE' ||
- $status eq 'INVALID_ACCESS') {
- $result.=$head_tag_start.
- "$name \n$body_tag_start\n";
}
} elsif ($target eq 'tex') {
my $startminipage = '';
@@ -461,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;
}
}
@@ -477,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";
@@ -539,17 +538,9 @@ sub end_problem {
(($target eq 'web') && ($ENV{'request.state'} ne 'construct')) ||
($target eq 'answer') || ($target eq 'tex')
) {
- if ($status eq 'CAN_ANSWER') {
- if ($target ne 'tex' &&
- $ENV{'form.answer_output_mode'} ne 'tex') {
- $result.="