[LON-CAPA-cvs] cvs: loncom(version_2_1_X) /homework bridgetask.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 19 Jun 2006 09:43:38 -0000


albertel		Mon Jun 19 05:43:38 2006 EDT

  Modified files:              (Branch: version_2_1_X)
    /loncom/homework	bridgetask.pm 
  Log:
  - backport 1.167 
  
  
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.128.2.10 loncom/homework/bridgetask.pm:1.128.2.11
--- loncom/homework/bridgetask.pm:1.128.2.10	Mon Jun  5 13:15:37 2006
+++ loncom/homework/bridgetask.pm	Mon Jun 19 05:43:38 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.128.2.10 2006/06/05 17:15:37 albertel Exp $
+# $Id: bridgetask.pm,v 1.128.2.11 2006/06/19 09:43:38 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -456,12 +456,33 @@
 		    my (undef,undef,$domain,$user)=
 			&Apache::lonxml::whichuser();
 		    my $files = '<ul>';
+		    my $msg;
 		    foreach my $file (@files) {
 			my $url="/uploaded/$domain/$user/portfolio$file";
 			$file = '<tt>'.$file.'</tt>';
 			$files .= '<li>'.$file.'</li>';
+			$msg .= "<p>Submitted file $file</p>\n";
 		    }
 		    $files.='</ul>';
+		    my $subject = "Submission message for $title";
+		    my ($message_status,$comment_status);
+		    my $setting = $env{'course.'.$env{'request.course.id'}.'.task_messages'};
+		    $setting =~ s/^\s*(\S*)\s*$/$1/;
+		    $setting = lc($setting);
+		    if ($setting eq 'only_student'
+			|| $setting eq 'student_and_user_notes_screen') {
+			$message_status =
+			    &Apache::lonmsg::user_normal_msg($user,$domain,$subject,$msg);
+			$message_status = '<p>'.&mt('Message sent to user: [_1]',
+						    $message_status).' </p>';
+		    }
+		    if ($setting eq 'student_and_user_notes_screen') {
+			$comment_status =
+			    &Apache::lonmsg::store_instructor_comment($subject.'<br />'.
+								      $msg,$user,$domain);
+			$comment_status = '<p>'.&mt('Message sent to instructor: [_1]',
+						    $comment_status).' </p>';
+		    }
 
 		    $result.=<<DONESCREEN;
 <h2>$title</h2>
@@ -470,6 +491,8 @@
 <hr />
 <p> <a href="/adm/logout">Logout</a> </p>
 <p> <a href="/adm/roles">Change to a different course</a> </p>
+$message_status
+$comment_status
 DONESCREEN
 		} elsif ($status ne 'NOT_YET_VIEWED') {
 		    $msg.='<h1>'.&mt('Not open to be viewed').'</h1>';