[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm

www www at source.lon-capa.org
Wed Jan 4 15:12:40 EST 2012


www		Wed Jan  4 20:12:40 2012 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  This had been double-counting for a while ...
  ... no big deal, since we never looked at the data, and it is limited by course
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.319 loncom/interface/lonfeedback.pm:1.320
--- loncom/interface/lonfeedback.pm:1.319	Wed Jan  4 19:27:04 2012
+++ loncom/interface/lonfeedback.pm	Wed Jan  4 20:12:40 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.319 2012/01/04 19:27:04 www Exp $
+# $Id: lonfeedback.pm,v 1.320 2012/01/04 20:12:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2787,27 +2787,28 @@
 	}
     }
 
-# Records of number of postings, etc, are kept under the "symb" called "_feedback"
+# Records of number of feedback messages are kept under the "symb" called "_feedback"
 # There are two entries within the framework of a course:
 # - the URLs for which feedback was provided
 # - the total number of contributions
-    my %record=&getdiscrecords();
-    my ($temp)=keys(%record);
-    unless ($temp=~/^error\:/) {
-	my %newrecord=();
-	$newrecord{'resource'}=$feedurl;
-	$newrecord{'subnumber'}=$record{'subnumber'}+1;
-	unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') {
-	    $status.='<br />'.&mt('Not registered').'<br />';
-	}
+    if ($sendsomething) {
+        my %record=&getfeedbackrecords();
+        my ($temp)=keys(%record);
+        unless ($temp=~/^error\:/) {
+	    my %newrecord=();
+	    $newrecord{'resource'}=$feedurl;
+	    $newrecord{'subnumber'}=$record{'subnumber'}+1;
+	    unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') {
+	        $status.='<br />'.&mt('Not registered').'<br />';
+	    }
+        }
     }
-    
     return ($status,$sendsomething);
 }
 
-# Routine to get the complete discussion records
+# Routine to get the complete feedback records
 
-sub getdiscrecords {
+sub getfeedbackrecords {
     my ($uname,$udom,$course)=@_;
     unless ($uname) { $uname=$env{'user.name'}; }
     unless ($udom)  { $udom=$env{'user.domain'}; }
@@ -2816,10 +2817,10 @@
     return %record;
 }
 
-# Routine to get discussion statistics
+# Routine to get feedback statistics
 
-sub getdiscstats {
-    my %record=&getdiscrecords(@_);
+sub getfeedbackstats {
+    my %record=&getfeedbackrecords(@_);
     my $subnumber=$record{'subnumber'};
     my $points=0;
     my $likes=0;
@@ -2834,9 +2835,9 @@
     return ($subnumber,$points,$likes);
 }
 
-# Store discussion credit
+# Store feedback credit
 
-sub storediscpoints {
+sub storefeedbackpoints {
     my ($points,$uname,$udom,$course)=@_;
     unless ($points) { $points=0; }
     unless ($uname) { $uname=$env{'user.name'}; }
@@ -2848,9 +2849,9 @@
     return &Apache::lonnet::cstore(\%record,'_feedback');
 }
 
-# Store discussion "likes"
+# Store feedback "likes"
 
-sub storedisclikes {
+sub storefeedbacklikes {
     my ($likes,$uname,$udom,$course)=@_;
     unless ($likes) { $likes=0; }
     if ($likes>0) { $likes=1; }




More information about the LON-CAPA-cvs mailing list