--- loncom/homework/structuretags.pm 2009/06/17 15:27:20 1.452
+++ loncom/homework/structuretags.pm 2011/01/01 21:54:08 1.465.2.10
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.452 2009/06/17 15:27:20 bisitz Exp $
+# $Id: structuretags.pm,v 1.465.2.10 2011/01/01 21:54:08 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -66,7 +66,7 @@ use lib '/home/httpd/lib/perl/';
use LONCAPA;
BEGIN {
- &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'));
+ &Apache::lonxml::register('Apache::structuretags',('block','languageblock','translated','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','problemtype','startpartmarker','startouttext','endpartmarker','endouttext','simpleeditbutton','definetag'));
}
sub start_web {
@@ -128,6 +128,7 @@ sub homework_js {
&setmode_javascript().
<<'JS';
JS
}
@@ -161,6 +162,50 @@ function setmode(form,probmode) {
ENDSCRIPT
}
+sub file_delchk_js {
+ my $delfilewarn = &mt('You have indicated you wish to delete some files previously included for submission.').'\\n'.
+ &mt('Deleted files will not be graded.').' '.
+ &mt('Submit Answer?');
+ return <<"ENDSCRIPT";
+
+ENDSCRIPT
+}
+
sub page_start {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$name,
$extra_head)=@_;
@@ -177,12 +222,17 @@ sub page_start {
$parstack,$parser,$safeeval);
}
- $extra_head .= &homework_js();
-
- if ($env{'environment.wysiwygeditor'} eq 'on') {
- $extra_head .= &Apache::lonhtmlcommon::dragmath_js("FCKEditMathPopup");
- } else {
- $extra_head .= &Apache::lonhtmlcommon::dragmath_js("EditMathPopup");
+ $extra_head .= &homework_js().
+ &Apache::lonhtmlcommon::dragmath_js("EditMathPopup");
+ if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+ my %textarea_args = (
+ dragmath => 'math',
+ );
+ $extra_head .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args);
+ }
+ my $is_task = ($env{'request.uri'} =~ /\.task$/);
+ if ($is_task) {
+ $extra_head .= &file_delchk_js();
}
my %body_args;
@@ -218,13 +268,15 @@ sub page_start {
'text' => 'Construction Space',
'href' => &Apache::loncommon::authorspace(),
});
+ # breadcrumbs (and tools) will be created
+ # in start_page->bodytag->innerregister
+
# FIXME Where are we?
# &Apache::lonhtmlcommon::add_breadcrumb({
# 'text' => 'Problem Editing', # 'Problem Testing'
# 'href' => '',
# });
- $pageheader = &Apache::lonhtmlcommon::breadcrumbs()
- .&Apache::loncommon::head_subbox(
+ $pageheader =&Apache::loncommon::head_subbox(
&Apache::loncommon::CSTR_pageheader());
}
} elsif (!defined($found{'body'})) {
@@ -257,11 +309,11 @@ sub page_start {
&& ($target eq 'web' || $target eq 'webgrade')) {
my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser();
- if ($symb eq '' && !$publicuser) {
- my $help = &Apache::loncommon::help_open_topic("Ambiguous_Reference");
- $help=&mt("Browsing resource, all submissions are temporary.")." ";
- $page_start .= $help;
- }
+ if ($symb eq '' && !$publicuser) {
+ $page_start .= '
'
+ .&mt('Browsing resource, all submissions are temporary.')
+ .'
';
+ }
}
if (!defined($found{'body'}) && $env{'request.state'} ne 'construct') {
@@ -271,11 +323,16 @@ sub page_start {
my $form_tag_start;
if (!defined($found{'form'})) {
$form_tag_start='