[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonmsg.pm lonparmset.pm
www
lon-capa-cvs@mail.lon-capa.org
Mon, 06 Jun 2005 19:51:08 -0000
www Mon Jun 6 15:51:08 2005 EDT
Modified files:
/loncom/interface loncommon.pm lonmsg.pm lonparmset.pm
Log:
Direct links to track student, parameters, and grades from message, if
context is clear.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.265 loncom/interface/loncommon.pm:1.266
--- loncom/interface/loncommon.pm:1.265 Sat Jun 4 15:09:17 2005
+++ loncom/interface/loncommon.pm Mon Jun 6 15:51:05 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.265 2005/06/04 19:09:17 albertel Exp $
+# $Id: loncommon.pm,v 1.266 2005/06/06 19:51:05 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2000,7 +2000,51 @@
return qq{<a href="$link" title="$title" $target>$linktext</a>};
}
+# --------------------------------------------------------- Links into grading, etc
+sub parm_direct_link {
+ my ($linktext,$sname,$sdom,$symb,$target)=@_;
+ unless ($sname) { return ''; }
+ unless ($sdom) { return ''; }
+ unless ($symb) { return ''; }
+
+ my $link ="/adm/parmset";
+ my $title = 'Change parameters';
+ if (defined($sname) && $sname !~ /^\s*$/ &&
+ defined($sdom) && $sdom !~ /^\s*$/) {
+ $link .= "?uname=$sname&udom=$sdom&action=settable&symb=".
+ &Apache::lonnet::escape($symb);
+ }
+ if (defined($target) && $target !~ /^\s*$/) {
+ $target = qq{target="$target"};
+ } else {
+ $target = '';
+ }
+ return qq{<a href="$link" title="$title" $target>$linktext</a>};
+}
+
+sub grds_direct_link {
+ my ($linktext,$sname,$sdom,$symb,$target)=@_;
+ unless ($sname) { return ''; }
+ unless ($sdom) { return ''; }
+ unless ($symb) { return ''; }
+ my $url=(&Apache::lonnet::decode_symb($symb))[2];
+ my $link ="/adm/grades";
+ my $title = 'Change grades';
+ if (defined($sname) && $sname !~ /^\s*$/ &&
+ defined($sdom) && $sdom !~ /^\s*$/) {
+ $link .= "?stuinfo=$sname:$sdom&symb=".
+ &Apache::lonnet::escape($symb)."&url=".
+ &Apache::lonnet::escape($url).
+ "&showgrading=yes&lastsub=all&vProp=yes&vAns=yes&command=processGroup";
+ }
+ if (defined($target) && $target !~ /^\s*$/) {
+ $target = qq{target="$target"};
+ } else {
+ $target = '';
+ }
+ return qq{<a href="$link" title="$title" $target>$linktext</a>};
+}
=pod
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.145 loncom/interface/lonmsg.pm:1.146
--- loncom/interface/lonmsg.pm:1.145 Sun Jun 5 22:29:46 2005
+++ loncom/interface/lonmsg.pm Mon Jun 6 15:51:05 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.145 2005/06/06 02:29:46 albertel Exp $
+# $Id: lonmsg.pm,v 1.146 2005/06/06 19:51:05 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1790,6 +1790,22 @@
'"><b>'.&mt('Next').'</b></a></td>');
}
$r->print('</tr></table>');
+ if ($env{'user.adv'}) {
+ $r->print('<table border="2" width="100%"><tr bgcolor="#FFAAAA"><td>'.&mt('Currently available actions (will open extra window)').':</td>');
+
+ if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
+ $r->print('<td><b>'.&Apache::loncommon::track_student_link(&mt('View recent activity'),$content{'sendername'},$content{'senderdomain'},'check').'</b></td>');
+ }
+ if (&Apache::lonnet::allowed('opa',$env{'request.course.id'})) {
+ my $symb=&Apache::lonnet::symbread($content{'baseurl'});
+ $r->print('<td><b>'.&Apache::loncommon::parm_direct_link(&mt('Set/Change parameters'),$content{'sendername'},$content{'senderdomain'},$symb,'check').'</b></td>');
+ }
+ if (&Apache::lonnet::allowed('mgr',$env{'request.course.id'})) {
+ my $symb=&Apache::lonnet::symbread($content{'baseurl'});
+ $r->print('<td><b>'.&Apache::loncommon::grds_direct_link(&mt('Set/Change grades'),$content{'sendername'},$content{'senderdomain'},$symb,'check').'</b></td>');
+ }
+ $r->print('</tr></table>');
+ }
$r->print('<br /><b>'.&mt('Subject').':</b> '.$content{'subject'}.
($folder ne 'sent'?'<br /><b>'.&mt('From').':</b> '.
&Apache::loncommon::aboutmewrapper(
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.214 loncom/interface/lonparmset.pm:1.215
--- loncom/interface/lonparmset.pm:1.214 Mon Jun 6 13:38:07 2005
+++ loncom/interface/lonparmset.pm Mon Jun 6 15:51:05 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.214 2005/06/06 17:38:07 www Exp $
+# $Id: lonparmset.pm,v 1.215 2005/06/06 19:51:05 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1062,7 +1062,7 @@
my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'};
$alllevs{'Resource Level'}='full';
- $alllevs{'Map Level'}='map';
+ $alllevs{'Map/Folder Level'}='map';
$alllevs{'Course Level'}='general';
my %allparms;
@@ -2182,7 +2182,7 @@
my %alllevs=();
$alllevs{'Resource Level'}='full';
- $alllevs{'Map Level'}='map';
+ $alllevs{'Map/Folder Level'}='map';
$alllevs{'Course Level'}='general';
my $csec=$env{'form.csec'};
@@ -2536,7 +2536,7 @@
'pres_marker',
'pres_value',
'pres_type',
- 'udom','uname']);
+ 'udom','uname','symb']);
&Apache::lonhtmlcommon::clear_breadcrumbs();