[LON-CAPA-cvs] cvs: loncom /interface lonmeta.pm
banghart
lon-capa-cvs@mail.lon-capa.org
Thu, 04 Aug 2005 23:47:39 -0000
banghart Thu Aug 4 19:47:39 2005 EDT
Modified files:
/loncom/interface lonmeta.pm
Log:
Saving work in progress.
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.102 loncom/interface/lonmeta.pm:1.103
--- loncom/interface/lonmeta.pm:1.102 Tue Aug 2 17:35:10 2005
+++ loncom/interface/lonmeta.pm Thu Aug 4 19:47:37 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.102 2005/08/02 21:35:10 banghart Exp $
+# $Id: lonmeta.pm,v 1.103 2005/08/04 23:47:37 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -292,11 +292,18 @@
my ($r)=@_;
$r->print('<h3>Instructor Selected Meta-Data</h3><br />');
$r->print('<form action="" method="post">');
- $r->print('Select your course<br>');
+ $r->print('Select your course<br />');
$r->print('<select name="metacourse" >');
- foreach my $key (keys %env) {
-
+ my $meta_not_found = 1;
+ foreach my $key (keys %env) {
if ($key =~ /\.metadata\./) {
+ if ($meta_not_found) {
+ undef($meta_not_found);
+ $r->print('<h3>Instructor Selected Meta-Data</h3><br />');
+ $r->print('<form action="" method="post">');
+ $r->print('Select your course<br />');
+ $r->print('<select name="metacourse" >');
+ }
my $course_key = $key;
$course_key =~ s/\.metadata\..*//;
$r->print('<option value="'.$course_key.'">');
@@ -304,9 +311,11 @@
$r->print('</option>');
}
}
- $r->print('</select><br />');
- $r->print('<input type="submit" >');
- $r->print('</form>');
+ unless ($meta_not_found) {
+ $r->print('</select><br />');
+ $r->print('<input type="submit" value="Assign Instructor Metadata" />');
+ $r->print('</form>');
+ }
return 'ok';
}
# Pretty printing of metadata field
@@ -911,7 +920,10 @@
sub present_instructor_metadata {
my ($r,$uri, $file_type) = @_;
- print $r->print('This is the instructor metadata area');
+ $r->print('This is the instructor metadata area<br />');
+ my $keywords = $env{$env{'form.metacourse'}.'.metadata.keywords'};
+ $r->print($env{'form.metacourse'}.'<br />');
+ $r->print('the keywords are: '.$keywords);
return 'ok';
}