--- loncom/homework/structuretags.pm 2006/04/28 18:34:22 1.354 +++ loncom/homework/structuretags.pm 2006/06/26 22:33:22 1.359 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.354 2006/04/28 18:34:22 albertel Exp $ +# $Id: structuretags.pm,v 1.359 2006/06/26 22:33:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,6 +38,9 @@ use Apache::lonlocal; use Apache::lonxml; use Apache::lonenc(); use Time::HiRes qw( gettimeofday tv_interval ); +use lib '/home/httpd/lib/perl/'; +use LONCAPA; + BEGIN { &Apache::lonxml::register('Apache::structuretags',('block','languageblock','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','problemtype','startouttext','endouttext','simpleeditbutton','definetag')); } @@ -160,6 +163,14 @@ sub page_start { $form_tag_start.=&Apache::edit::form_change_detection(); } $form_tag_start.='>'; + + my $symb=&Apache::lonnet::symbread(); + if ($symb =~ /\S/) { + $symb= + &HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb)); + $form_tag_start.= + ''; + } } return ($page_start,$form_tag_start); } @@ -240,7 +251,7 @@ sub problem_edit_header {
'. - &Apache::loncommon::help_open_menu('','Problem Editing Help','Problem_Editor_XML_Index','',5,'Authoring',undef,undef,undef,'Problem Editing Help') + &Apache::loncommon::help_open_menu('Problem Editing Help','Problem_Editor_XML_Index',5,'Authoring',undef,undef,undef,'Problem Editing Help') .'
'. '
'; } @@ -331,9 +342,11 @@ Feedback Mode: } sub initialize_storage { + my ($given_symb) = @_; undef(%Apache::lonhomework::results); undef(%Apache::lonhomework::history); - my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); + my ($symb,$courseid,$domain,$name) = + &Apache::lonxml::whichuser($given_symb); # anonymous users (CODEd exams) have no data if ($name eq 'anonymous' @@ -373,11 +386,13 @@ sub initialize_storage { # Will increment totals for attempts, students, and corrects # if running user has student role. sub finalize_storage { + my ($given_symb) = @_; my $result; if (%Apache::lonhomework::results) { my @remove = grep(/^INTERNAL_/,keys(%Apache::lonhomework::results)); delete(@Apache::lonhomework::results{@remove}); - my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); + my ($symb,$courseid,$domain,$name) = + &Apache::lonxml::whichuser($given_symb); if ($env{'request.state'} eq 'construct' || $symb eq '' || $Apache::lonhomework::type eq 'practice') { @@ -511,7 +526,9 @@ sub init_problem_globals { @Apache::structuretags::whileline=(); $Apache::lonhomework::scantronmode=0; undef($Apache::lonhomework::name); - + undef($Apache::lonhomework::default_type); + undef($Apache::lonhomework::type); + undef($Apache::lonhomework::problemstatus); } sub reset_problem_globals { @@ -523,6 +540,11 @@ sub reset_problem_globals { #detect if we try to do 2 problems in one file # undef($Apache::lonhomework::parsing_a_problem); undef($Apache::lonhomework::name); + undef($Apache::lonhomework::default_type); + undef($Apache::lonhomework::type); + undef($Apache::lonhomework::scantronmode); + undef($Apache::lonhomework::problemstatus); + undef($Apache::lonhomework::ignore_response_errors); } sub set_problem_state { @@ -1372,7 +1394,7 @@ sub start_part { } if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';} } elsif ($target eq 'web') { - $result.=''; + $result.=''; } } } @@ -1625,7 +1647,7 @@ sub start_simpleeditbutton { $url=~s/\?.*$//; my ($symb) = &Apache::lonxml::whichuser(); $result='
'. - ''.&mt('Edit').' - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). + ''.&mt('Edit').' - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). &Apache::loncommon::help_open_topic('Caching').'

'; } return $result;