[LON-CAPA-cvs] cvs: loncom /homework essayresponse.pm grades.pm

www www@source.lon-capa.org
Thu, 22 Apr 2010 13:00:24 -0000


www		Thu Apr 22 13:00:24 2010 EDT

  Modified files:              
    /loncom/homework	essayresponse.pm grades.pm 
  Log:
  Once you had entered anything in the collaborator field, you could never get rid of it.
  
  
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.105 loncom/homework/essayresponse.pm:1.106
--- loncom/homework/essayresponse.pm:1.105	Tue Apr 20 23:59:53 2010
+++ loncom/homework/essayresponse.pm	Thu Apr 22 13:00:24 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.105 2010/04/20 23:59:53 www Exp $
+# $Id: essayresponse.pm,v 1.106 2010/04/22 13:00:24 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -105,7 +105,7 @@
 	my @msgs;
 	if ($Apache::lonhomework::history{"resource.$part.$id.collaborators"} =~ /\S/) {
 	    my $coll= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"},'<>&"');
-	    $result .= '<td>'.&mt('Collaborated with [_1]',$coll).'</td>';
+	    $result .= '<td><i>'.&mt('Collaborated with [_1]',$coll).'</i></td>';
 	}
 
 	my $file_submission = 
@@ -136,12 +136,14 @@
     my $increment     = &Apache::response::repetition();
     my $result;
     if ( $target eq 'grade' ) {
-	my $collaborators = $env{'form.HWCOL'.$part.'_'.$id};	
-	if ($collaborators =~ /[^\s]/) {
-	    my $previous_list= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"},'<>&"');
-	    $Apache::lonhomework::results{"resource.$part.$id.collaborators"}=$collaborators
-		if ($collaborators ne $previous_list);
-	}
+# Deal with collaborators
+	my $collaborators = $env{'form.HWCOL'.$part.'_'.$id};
+	my $previous_list= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"},'<>&"');
+	if ($collaborators ne $previous_list) { 
+#           &Apache::lonnet::logthis("New collaborators [$collaborators] [$previous_list]");
+           $Apache::lonhomework::results{"resource.$part.$id.collaborators"}=$collaborators; 
+        }
+# Scantron
 	if (  &Apache::response::submitted('scantron') ) {
 	    $increment=&Apache::response::scored_response($part,$id);
 	} elsif ( &Apache::response::submitted() ) {
@@ -419,7 +421,7 @@
 					$env{'course.'.$env{'request.course.id'}.'.num'});
     my (@badcollaborators,$result);
   
-    my (@collaborators) = split(/,?\s+/,$coll);
+    my (@collaborators) = split(/[,;\s]+/,$coll);
     foreach my $entry (@collaborators) {
         my $collaborator;
 	if ($entry =~ /:/) {
@@ -467,7 +469,7 @@
 
 =head1 NAME
 
-Apache::easyresponse
+Apache::essayresponse
 
 =head1 SYNOPSIS
 
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.629 loncom/homework/grades.pm:1.630
--- loncom/homework/grades.pm:1.629	Wed Apr 21 20:22:19 2010
+++ loncom/homework/grades.pm	Thu Apr 22 13:00:24 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.629 2010/04/21 20:22:19 www Exp $
+# $Id: grades.pm,v 1.630 2010/04/22 13:00:24 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2341,7 +2341,7 @@
 	next if ($record->{'resource.'.$part.'.collaborators'} eq '');
 	my (@good_collaborators, @bad_collaborators);
 	foreach my $possible_collaborator
-	    (split(/,?\s+/,$record->{'resource.'.$part.'.collaborators'})) { 
+	    (split(/[,;\s]+/,$record->{'resource.'.$part.'.collaborators'})) { 
 	    $possible_collaborator =~ s/[\$\^\(\)]//g;
 	    next if ($possible_collaborator eq '');
 	    my ($co_name,$co_dom) = split(/\@|:/,$possible_collaborator);
@@ -2357,13 +2357,13 @@
 	    }
 	}
 	if (scalar(@good_collaborators) != 0) {
-	    $result.='<br />'.&mt('Collaborators: ');
+	    $result.='<br />'.&mt('Collaborators:').'<ol>';
 	    foreach my $name (@good_collaborators) {
 		my ($lastname,$givenn) = split(/,/,$$fullname{$name});
 		push(@col_fullnames, $givenn.' '.$lastname);
-		$result.=$fullname->{$name}.'&nbsp; &nbsp; &nbsp;';
+		$result.='<li>'.$fullname->{$name}.'</li>';
 	    }
-	    $result.='<br />'."\n";
+	    $result.='</ol><br />'."\n";
 	    my ($part)=split(/\./,$part);
 	    $result.='<input type="hidden" name="collaborator'.$counter.
 		'" value="'.$part.':'.(join ':',@good_collaborators).'" />'.