--- loncom/homework/structuretags.pm 2009/05/11 16:51:22 1.444
+++ loncom/homework/structuretags.pm 2010/12/31 00:58:10 1.482
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.444 2009/05/11 16:51:22 bisitz Exp $
+# $Id: structuretags.pm,v 1.482 2010/12/31 00:58:10 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 {
@@ -161,6 +161,48 @@ 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 +219,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;
@@ -203,14 +250,28 @@ sub page_start {
}
}
+ my $pageheader = '';
if (defined($found{'body'})) {
$body_args{'skip_phases'}{'body'}=1;
} elsif (!defined($found{'body'})
&& $env{'request.state'} eq 'construct') {
if ($target eq 'web' || $target eq 'edit') {
- if ($env{'environment.remote'} ne 'off') {
- $body_args{'only_body'} = 1;
- }
+ # Breadcrumbs for Construction Space
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ &Apache::lonhtmlcommon::add_breadcrumb({
+ '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::loncommon::head_subbox(
+ &Apache::loncommon::CSTR_pageheader());
}
} elsif (!defined($found{'body'})) {
my %add_entries;
@@ -222,31 +283,30 @@ sub page_start {
my $bgcolor=&Apache::lonxml::get_param('bgcolor',$parstack,
$safeeval);
- if ($bgcolor eq '' ) { $bgcolor = '#FFFFFF'; }
+ if ($bgcolor eq '' ) { $bgcolor = '#FFFFFF'; }
- $body_args{'bgcolor'} = $bgcolor;
- $body_args{'no_title'} = 1;
- $body_args{'force_register'} = 1;
- $body_args{'add_entries'} = \%add_entries;
- if ($env{'environment.remote'} eq 'off'
- && $env{'request.state'} eq 'construct') {
- $body_args{'only_body'} = 1;
- }
+ $body_args{'bgcolor'} = $bgcolor;
+ # $body_args{'no_title'} = 1;
+ $body_args{'force_register'} = 1;
+ $body_args{'add_entries'} = \%add_entries;
+ if ( $env{'request.state'} eq 'construct') {
+ $body_args{'only_body'} = 1;
+ }
}
$body_args{'no_auto_mt_title'} = 1;
my $page_start = &Apache::loncommon::start_page($name,$extra_head,
\%body_args);
-
+ $page_start .= $pageheader;
if (!defined($found{'body'})
&& $env{'request.state'} ne 'construct'
&& ($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') {
@@ -256,11 +316,16 @@ sub page_start {
my $form_tag_start;
if (!defined($found{'form'})) {
$form_tag_start='