--- loncom/homework/structuretags.pm 2017/03/14 12:20:57 1.512.2.13
+++ loncom/homework/structuretags.pm 2016/04/04 17:24:18 1.548
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.512.2.13 2017/03/14 12:20:57 raeburn Exp $
+# $Id: structuretags.pm,v 1.548 2016/04/04 17:24:18 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -226,9 +226,11 @@ sub end_tex {
sub homework_js {
my ($postsubmit,$timeout);
if (($env{'request.course.id'}) && ($env{'request.state'} ne 'construct')) {
- my $crstype;
- if (&Apache::loncommon::course_type() eq 'Community') {
+ my $crstype = &Apache::loncommon::course_type();
+ if ($crstype eq 'Community') {
$crstype = 'community';
+ } elsif ($crstype eq 'Placement') {
+ $crstype = 'placement';
} else {
if ($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}) {
$crstype = 'official';
@@ -270,7 +272,7 @@ sub homework_js {
$jstimeout = 1000 * $timeout;
}
return &Apache::loncommon::resize_textarea_js().
- &Apache::loncommon::colorfuleditor_js().
+ &Apache::loncommon::colorfuleditor_js().
&setmode_javascript().
<<"JS";
@@ -419,13 +419,9 @@ sub page_start {
$extra_head .= &homework_js().
&Apache::lonhtmlcommon::dragmath_js("EditMathPopup");
if (&Apache::lonhtmlcommon::htmlareabrowser()) {
- my %textarea_args;
- if (($env{'request.state'} ne 'construct') ||
- ($env{'environment.nocodemirror'})) {
- %textarea_args = (
+ my %textarea_args = (
dragmath => 'math',
);
- }
$extra_head .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args);
}
my $is_task = ($env{'request.uri'} =~ /\.task$/);
@@ -496,7 +492,9 @@ sub page_start {
}
}
if ($needs_upload) {
- $extra_head .= &Apache::lonhtmlcommon::file_submissionchk_js();
+ $extra_head .= &Apache::lonhtmlcommon::file_submissionchk_js()
+ .'';
}
}
@@ -527,23 +525,25 @@ sub page_start {
} elsif (!defined($found{'body'})
&& $env{'request.state'} eq 'construct') {
if ($target eq 'web' || $target eq 'edit') {
- # Breadcrumbs for Authoring Space
- &Apache::lonhtmlcommon::clear_breadcrumbs();
- &Apache::lonhtmlcommon::add_breadcrumb({
- 'text' => 'Authoring Space',
- 'href' => &Apache::loncommon::authorspace($env{'request.uri'}),
- });
- # breadcrumbs (and tools) will be created
- # in start_page->bodytag->innerregister
+ unless ($env{'form.inhibitmenu'} eq 'yes') {
+ # Breadcrumbs for Authoring Space
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ &Apache::lonhtmlcommon::add_breadcrumb({
+ 'text' => 'Authoring Space',
+ 'href' => &Apache::loncommon::authorspace($env{'request.uri'}),
+ });
+ # 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());
- }
+# &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;
my $background=&Apache::lonxml::get_param('background',$parstack,
@@ -774,9 +774,7 @@ sub problem_edit_buttons {
if ($mode eq 'editxml') {
$result.=&problem_edit_action_button('subedit','edit','e','Edit',1);
$result.=&problem_edit_action_button('subundo','undoxml','u','Undo',1);
- if ($env{'environment.nocodemirror'}) {
- $result.=&Apache::lonhtmlcommon::dragmath_button("LC_editxmltext",1);
- }
+ $result.=&Apache::lonhtmlcommon::dragmath_button("LC_editxmltext",1);
} else {
$result.=&problem_edit_action_button('subeditxml','editxml','x','EditXML',1);
$result.=&problem_edit_action_button('subundo','undo','u','Undo',1);
@@ -792,9 +790,9 @@ sub problem_edit_header {
' . &Apache::lonxml::message_location();
$return .= '
@@ -822,7 +820,6 @@ sub problem_edit_header {
return $return;
}
-
sub problem_edit_footer {
my $resource = $env{'request.ambiguous'};
return '
@@ -898,7 +895,7 @@ sub problem_web_to_edit_header {
".&mt("Problem Type:")."