--- loncom/homework/structuretags.pm 2019/10/23 22:30:28 1.512.2.18
+++ loncom/homework/structuretags.pm 2016/09/14 02:42:43 1.550
@@ -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.18 2019/10/23 22:30:28 raeburn Exp $
+# $Id: structuretags.pm,v 1.550 2016/09/14 02:42:43 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";
@@ -494,9 +496,9 @@ sub page_start {
}
}
if ($needs_upload) {
- $extra_head .= &Apache::lonhtmlcommon::file_submissionchk_js().
- '';
+ $extra_head .= &Apache::lonhtmlcommon::file_submissionchk_js()
+ .'';
}
}
@@ -527,23 +529,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,
@@ -650,11 +654,10 @@ sub setup_rndseed {
unless (defined($questiontype)) {
$questiontype = $Apache::lonhomework::type;
}
- if (($env{'request.state'} eq "construct")
- || ($symb eq '')
- || ($Apache::lonhomework::type eq 'practice')
- || ($Apache::lonhomework::history{'resource.CODE'})
- || (($env{'form.code_for_randomlist'}) && ($target eq 'analyze'))) {
+ if ($env{'request.state'} eq "construct"
+ || $symb eq ''
+ || $Apache::lonhomework::type eq 'practice'
+ || $Apache::lonhomework::history{'resource.CODE'}) {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['rndseed']);
$rndseed=$env{'form.rndseed'};
@@ -663,9 +666,7 @@ sub setup_rndseed {
if (!$rndseed) {
$rndseed=time;
}
- unless ($env{'form.code_for_randomlist'}) {
- $env{'form.rndseed'}=$rndseed;
- }
+ $env{'form.rndseed'}=$rndseed;
}
if (($env{'request.state'} eq "construct") &&
($Apache::lonhomework::type eq 'randomizetry')) {
@@ -693,11 +694,7 @@ sub setup_rndseed {
$rndseed=join(':',&Apache::lonnet::digest($rndseed));
}
}
- if (($env{'form.code_for_randomlist'}) && ($target eq 'analyze')) {
- $env{'form.CODE'} = $env{'form.code_for_randomlist'};
- $rndseed=&Apache::lonnet::rndseed();
- undef($env{'form.CODE'});
- } elsif ($Apache::lonhomework::history{'resource.CODE'}) {
+ if ($Apache::lonhomework::history{'resource.CODE'}) {
$rndseed=&Apache::lonnet::rndseed();
}
$set_safespace = 1;
@@ -799,9 +796,9 @@ sub problem_edit_header {
' . &Apache::lonxml::message_location();
$return .= '
@@ -829,7 +826,6 @@ sub problem_edit_header {
return $return;
}
-
sub problem_edit_footer {
my $resource = $env{'request.ambiguous'};
return '
@@ -905,7 +901,7 @@ sub problem_web_to_edit_header {
".&mt("Problem Type:")."