[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm
www
lon-capa-cvs@mail.lon-capa.org
Mon, 12 May 2003 13:50:08 -0000
www Mon May 12 09:50:08 2003 EDT
Modified files:
/loncom/homework structuretags.pm
Log:
instructorcomment
Embed remarks for instructors into a resource, for example, how to use this,
how to solve this, etc. Per discussion with Ed.
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.169 loncom/homework/structuretags.pm:1.170
--- loncom/homework/structuretags.pm:1.169 Fri May 9 18:24:05 2003
+++ loncom/homework/structuretags.pm Mon May 12 09:50:08 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.169 2003/05/09 22:24:05 albertel Exp $
+# $Id: structuretags.pm,v 1.170 2003/05/12 13:50:08 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,7 +38,7 @@
use Apache::lonmenu;
BEGIN {
- &Apache::lonxml::register('Apache::structuretags',('block','languageblock','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'));
}
sub start_web {
@@ -654,6 +654,35 @@
}
sub end_languageblock {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my $result;
+ if ($target eq "edit") {
+ $result.= &Apache::edit::tag_end($target,$token,'');
+ }
+ return $result;
+}
+
+sub start_instructorcomment {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+
+ my $result;
+
+ if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
+ $target eq 'tex' || $target eq 'analyze') {
+ $result=($ENV{'request.role'}=~/^(in|cc|au|ca|li)/);
+ if ( ! $result ) {
+ my $skip=&Apache::lonxml::get_all_text("/instructorcomment",$parser);
+ &Apache::lonxml::debug("skipping ahead :$skip: $$parser[-1]");
+ }
+ $result='';
+ } elsif ($target eq 'edit') {
+ $result .=&Apache::edit::tag_start($target,$token);
+ $result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
+ }
+ return $result;
+}
+
+sub end_instructorcomment {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $result;
if ($target eq "edit") {