--- loncom/homework/structuretags.pm 2007/09/10 17:02:32 1.395
+++ loncom/homework/structuretags.pm 2007/10/30 00:09:30 1.406
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.395 2007/09/10 17:02:32 albertel Exp $
+# $Id: structuretags.pm,v 1.406 2007/10/30 00:09:30 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,7 +42,7 @@ 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'));
+ &Apache::lonxml::register('Apache::structuretags',('block','languageblock','translated','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','problemtype','startouttext','endouttext','simpleeditbutton','definetag'));
}
sub start_web {
@@ -92,6 +92,31 @@ sub end_tex {
return '';
}
+sub homework_js {
+ return &Apache::loncommon::resize_textarea_js().
+ <<'JS';
+
+JS
+}
+
sub page_start {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$name,
$extra_head)=@_;
@@ -108,13 +133,7 @@ sub page_start {
$parstack,$parser,$safeeval);
}
- $extra_head.= '
-
-';
+ $extra_head .= &homework_js();
my %body_args;
if (defined($found{'html'})) {
@@ -139,7 +158,9 @@ function setSubmittedPart (part) {
} elsif (!defined($found{'body'})
&& $env{'request.state'} eq 'construct') {
if ($target eq 'web' || $target eq 'edit') {
- # no extra args to bodytag
+ if ($env{'environment.remote'} ne 'off') {
+ $body_args{'only_body'} = 1;
+ }
}
} elsif (!defined($found{'body'})) {
my %add_entries;
@@ -311,35 +332,44 @@ sub option {
sub problem_web_to_edit_header {
my ($rndseed)=@_;
- my $result.='';
+ my $result .= '