--- loncom/interface/lonparmset.pm 2005/08/26 19:55:19 1.241
+++ loncom/interface/lonparmset.pm 2005/08/27 00:03:32 1.242
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.241 2005/08/26 19:55:19 banghart Exp $
+# $Id: lonparmset.pm,v 1.242 2005/08/27 00:03:32 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2727,7 +2727,12 @@ ENDMAINFORMHEAD
### Set instructor defined metadata
sub setinstmeta {
my ($r)=@_;
- my $setoutput='';
+ my $next_meta;
+ if ($env{'form.nextmeta'}) {
+ $next_meta = $env{'form.nextmeta'};
+ } else {
+ $next_meta = 1;
+ }
$r->print(&Apache::lonxml::xmlbegin());
$r->print('
LON-CAPA Set Instructor Metadata
@@ -2737,7 +2742,37 @@ sub setinstmeta {
'Set Instructor Metadata'));
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
- $r->print('Set instructor metadata here');
+ if ($env{'form.state'}eq 'add') {
+ $r->print('Compose a new metadata item:
');
+ $r->print('');
+ } elsif ($env{'form.state'}eq 'save') {
+ $r->print('Here we save the metadata');
+ } else {
+ foreach my $key (sort keys %env) {
+ my $found_one = 0;
+ if ($key=~m/^course\.$env{'request.course.id'}\.metadata\.title/) {
+ unless ($found_one) {
+ $found_one = 1;
+ $r->print('Existing Metadata
');
+ }
+ $r->print($env{$key}.'
');
+ $key=~~m/^course\.$env{'request.course.id'}\.metadata\.title\.(d*)\./;
+ if ($1 ge $next_meta) {
+ $next_meta = $1 ++;
+ }
+ }
+ }
+ $r->print('Add Metadata Item
');
+ }
$r->print('