--- loncom/homework/structuretags.pm 2003/06/25 16:47:47 1.190
+++ loncom/homework/structuretags.pm 2003/07/16 19:36:02 1.196
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.190 2003/06/25 16:47:47 albertel Exp $
+# $Id: structuretags.pm,v 1.196 2003/07/16 19:36:02 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,7 +38,8 @@ use Apache::File();
use Apache::lonmenu;
BEGIN {
- &Apache::lonxml::register('Apache::structuretags',('block','languageblock','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','startouttext','endouttext'));
+ &Apache::lonxml::register('Apache::structuretags',('block','languageblock','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','startouttext','endouttext',
+'simpleeditbutton'));
}
sub start_web {
@@ -406,7 +407,7 @@ sub start_problem {
}
} elsif ($target eq 'tex') {
my $startminipage = '';
- if ($ENV{'form.problem_split'} ne 'yes') {
+ if (not $ENV{'form.problem_split'}=~/yes/) {
$startminipage = '\begin{minipage}{\textwidth}';
}
my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval);
@@ -513,7 +514,7 @@ sub end_problem {
$result.=&Apache::lonxml::xmlend();
} elsif ($target eq 'tex') {
my $endminipage = '';
- if ($ENV{'form.problem_split'} ne 'yes') {
+ if (not $ENV{'form.problem_split'}=~/yes/) {
$endminipage = '\end{minipage}';
}
$result .= '\keephidden{ENDOFPROBLEM}\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}';
@@ -901,11 +902,17 @@ sub start_part {
if ( $target eq "web" ) {
$result="
Part is not open to be viewed. It $accessmsg
";
} elsif ( $target eq 'tex' ) {
- $result="\\end{minipage}\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\\\begin{minipage}{\\textwidth}";
+ if (not $ENV{'form.problem_split'}=~/yes/) {
+ $result="\\end{minipage}\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\\\begin{minipage}{\\textwidth}";
+ } else {
+ $result="\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\";
+ }
}
} else {
if ($target eq 'tex') {
- $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+ if (not $ENV{'form.problem_split'}=~/yes/) {
+ $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+ }
my $weight = &Apache::lonnet::EXT("resource.$id.weight");
if ($Apache::lonhomework::type eq 'exam') { $result .= '\fbox{\textit{'.$weight.' pt}}';}
}
@@ -1082,5 +1089,23 @@ sub delete_startouttext {
return 1;
}
+sub start_simpleeditbutton {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my $result='';
+ if (($target eq 'web') &&
+ (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
+ my $url=$ENV{'REQUEST_URI'};
+ $url=~s/\?.*$//;
+ $result='
'. + 'Simple Problem Editor - Note: it can take up to 10 minutes for changes to take effect for all users.'. +&Apache::loncommon::help_open_topic('Caching').' |