[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm /interface/statistics lonstudentassessment.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Wed, 29 Oct 2003 16:20:14 -0000
matthew Wed Oct 29 11:20:14 2003 EDT
Modified files:
/loncom/interface loncommon.pm
/loncom/interface/statistics lonstudentassessment.pm
Log:
Added loncommon::chartlink to produce a link to the chart for a particular
student.
lonstudentassessment: Modified to support passing in of output format in the
query string. Required for chartlink to work.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.138 loncom/interface/loncommon.pm:1.139
--- loncom/interface/loncommon.pm:1.138 Wed Oct 29 10:47:52 2003
+++ loncom/interface/loncommon.pm Wed Oct 29 11:20:14 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.138 2003/10/29 15:47:52 matthew Exp $
+# $Id: loncommon.pm,v 1.139 2003/10/29 16:20:14 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -69,6 +69,7 @@
use Apache::lonmsg();
use Apache::lonmenu();
use Apache::lonlocal;
+use HTML::Entities;
my $readit;
@@ -3010,6 +3011,43 @@
#
&Apache::lonnet::appenv(%ValuesHash);
return '<img src="/cgi-bin/graph.png?'.$identifier.'" border="1" />';
+}
+
+############################################################
+############################################################
+
+=pod
+
+=head1 Statistics helper routines?
+
+Bad place for them but what the hell.
+
+=item &chartlink
+
+Returns a link to the chart for a specific student.
+
+Inputs:
+
+=over 4
+
+=item $linktext: The text of the link
+
+=item $sname: The students username
+
+=item $sdomain: The students domain
+
+=back
+
+=cut
+
+############################################################
+############################################################
+sub chartlink {
+ my ($linktext, $sname, $sdomain) = @_;
+ my $link = '<a href="/adm/statistics?reportSelected=student_assessment'.
+ '&SelectedStudent='.&Apache::lonnet::escape($sname.':'.$sdomain).
+ '&chartoutputmode='.HTML::Entities::encode('html, with all links').
+ '">'.$linktext.'</a>';
}
############################################################
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.72 loncom/interface/statistics/lonstudentassessment.pm:1.73
--- loncom/interface/statistics/lonstudentassessment.pm:1.72 Wed Oct 22 11:38:11 2003
+++ loncom/interface/statistics/lonstudentassessment.pm Wed Oct 29 11:20:14 2003
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentassessment.pm,v 1.72 2003/10/22 15:38:11 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.73 2003/10/29 16:20:14 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -419,6 +419,8 @@
sub CreateAndParseOutputSelector {
my $Str = '';
my $elementname = 'chartoutputmode';
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+ [$elementname]);
#
# Format for output options is 'mode, restrictions';
my $selected = 'html, without links';