[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm /xml lonxml.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 11 Sep 2003 22:37:54 -0000
albertel Thu Sep 11 18:37:54 2003 EDT
Modified files:
/loncom/interface loncommon.pm
/loncom/xml lonxml.pm
Log:
- add submissions link to discussion postings
- new sumbroutine &submlink() to easily insert submissions links in other desired locales
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.115 loncom/interface/loncommon.pm:1.116
--- loncom/interface/loncommon.pm:1.115 Wed Sep 10 11:06:34 2003
+++ loncom/interface/loncommon.pm Thu Sep 11 18:37:54 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.115 2003/09/10 15:06:34 matthew Exp $
+# $Id: loncommon.pm,v 1.116 2003/09/11 22:37:54 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1832,6 +1832,30 @@
}
return $userview;
}
+
+=pod
+
+=item * &submlink()
+
+Inputs: $text $uname $udom $symb
+
+Returns: A link to grades.pm such as to see the SUBM view of a student
+
+=cut
+
+###############################################
+sub submlink {
+ my ($text,$uname,$udom,$symb)=@_;
+ if (!($uname && $udom)) {
+ (my $cursymb, my $courseid,$udom,$uname)=
+ &Apache::lonxml::whichuser($symb);
+ if (!$symb) { $symb=$cursymb; }
+ }
+ if (!$symb) { $symb=&symbread(); }
+ return '<a href="/adm/grades?symb='.$symb.'&student='.$uname.
+ '&userdom='.$udom.'&command=submission">'.$text.'</a>';
+}
+##############################################
=pod
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.274 loncom/xml/lonxml.pm:1.275
--- loncom/xml/lonxml.pm:1.274 Mon Sep 8 15:00:09 2003
+++ loncom/xml/lonxml.pm Thu Sep 11 18:37:54 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.274 2003/09/08 19:00:09 albertel Exp $
+# $Id: lonxml.pm,v 1.275 2003/09/11 22:37:54 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -184,6 +184,7 @@
}
$crs=~s/\_/\//g;
my $seeid=&Apache::lonnet::allowed('rin',$crs);
+ my $viewgrades=&Apache::lonnet::allowed('vgr',$crs);
unless ($symb) {
$symb=&Apache::lonnet::symbread();
}
@@ -250,7 +251,11 @@
$sender='<i>'.$screenname.'</i>';
}
}
- $discussion.='<p><b>'.$sender.'</b> ('.
+ my $vgrlink;
+ if ($viewgrades) {
+ $vgrlink=&Apache::loncommon::submlink('Submissions',$contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$symb);
+ }
+ $discussion.='<p><b>'.$sender.'</b> '.$vgrlink.' ('.
localtime($contrib{$idx.':timestamp'}).
'):<blockquote>'.$message.
'</blockquote></p>';