--- loncom/homework/structuretags.pm 2023/02/03 16:52:57 1.573 +++ loncom/homework/structuretags.pm 2023/04/02 03:16:28 1.574 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.573 2023/02/03 16:52:57 raeburn Exp $ +# $Id: structuretags.pm,v 1.574 2023/04/02 03:16:28 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -625,7 +625,9 @@ sub page_start { my ($symb,$courseid,$udom,$uname)=&Apache::lonnet::whichuser(); my ($path,$multiresp) = &Apache::loncommon::get_turnedin_filepath($symb,$uname,$udom); - if (($is_task) || ($needs_upload)) { + if ($env{'request.user_in_effect'}) { + $form_tag_start .= ' onsubmit="preventDefault();"'; + } elsif (($is_task) || ($needs_upload)) { $form_tag_start .= ' onsubmit="return file_submission_check(this,'."'$path','$multiresp'".');"'; } $form_tag_start.='>'."\n"; @@ -1845,6 +1847,11 @@ sub start_problem { } } + if (($target eq 'web') && ($env{'request.user_in_effect'})) { + &Apache::lonxml::get_all_text("/problem",$parser,$style); + return $result; + } + if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') { @@ -2129,6 +2136,12 @@ sub end_problem { } } $result =~ s/INSERTTEXFRONTMATTERHERE/$frontmatter/; + } elsif ($target eq 'web') { + if ($env{'request.user_in_effect'}) { + &reset_problem_globals('problem'); + $result .= &Apache::lonhtmlcommon::set_compute_end_time(); + return $result; + } } my $status=$Apache::inputtags::status['-1'];