--- loncom/homework/structuretags.pm 2003/11/05 21:43:11 1.224 +++ loncom/homework/structuretags.pm 2004/01/15 03:44:01 1.229 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.224 2003/11/05 21:43:11 www Exp $ +# $Id: structuretags.pm,v 1.229 2004/01/15 03:44:01 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -186,8 +186,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 +212,9 @@ sub problem_web_to_edit_header { onChange="javascript:document.lonhomework.changerandseed.click()" /> '; + $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 $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 = ''; @@ -503,6 +501,8 @@ sub start_problem { } elsif ($target eq 'edit') { $result.=$head_tag_start."".$body_tag_start.$form_tag_start. &problem_edit_header(); + $Apache::lonxml::warnings_error_header= + &mt("Editor Errors - these errors might not effect the running of the problem, but they will likely cause problems with further use of the Edit mode. Please use the EditXML mode to fix these errors.")."
"; my $temp=&Apache::edit::insertlist($target,$token); $result.=$temp; } elsif ($target eq 'modified') { @@ -537,17 +537,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.="\n"; - } - } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' || - $status eq 'UNCHECKEDOUT' || $status eq 'INVALID_ACCESS') { - if ($target ne 'tex' && - $ENV{'form.answer_output_mode'} ne 'tex') { - $result.="\n"; - } + if ($target ne 'tex' && + $ENV{'form.answer_output_mode'} ne 'tex') { + $result.="\n"; } if ($target eq 'web') { $result.=&Apache::lonxml::xmlend(); @@ -1003,10 +995,9 @@ sub start_part { &Apache::edit::end_row().&Apache::edit::start_spanning_row(); } elsif ($target eq 'modified') { my $constructtag=&Apache::edit::get_new_args($token,$parstack, - $safeeval,'id'). - &Apache::edit::get_new_args($token,$parstack, - $safeeval,'display'); + $safeeval,'id','display'); if ($constructtag) { + #limiting ids to only letters numbers, and space $token->[2]->{'id'}=~s/[^A-Za-z0-9 ]//gs; $result = &Apache::edit::rebuild_tag($token); $result.=&Apache::edit::handle_insert();