[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm
banghart
lon-capa-cvs@mail.lon-capa.org
Mon, 29 Aug 2005 22:57:10 -0000
banghart Mon Aug 29 18:57:10 2005 EDT
Modified files:
/loncom/interface lonparmset.pm
Log:
Changing instructor metadata interface to look like other
parm setting. Work in progress, not done.
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.243 loncom/interface/lonparmset.pm:1.244
--- loncom/interface/lonparmset.pm:1.243 Sat Aug 27 15:07:58 2005
+++ loncom/interface/lonparmset.pm Mon Aug 29 18:57:09 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.243 2005/08/27 19:07:58 banghart Exp $
+# $Id: lonparmset.pm,v 1.244 2005/08/29 22:57:09 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1950,7 +1950,7 @@
'disablesigfigs'
);
foreach my $parameter (sort(keys(%values))) {
- unless ($parameter =~ m/^internal\./) {
+ unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) {
if (! $descriptions{$parameter}) {
$descriptions{$parameter}=$parameter;
push(@Display_Order,$parameter);
@@ -2728,6 +2728,7 @@
sub setinstmeta {
my ($r)=@_;
my $next_meta;
+ my $output;
if ($env{'form.serial'}) {
$next_meta = $env{'form.serial'};
} else {
@@ -2777,21 +2778,36 @@
{$name=>$value},$dom,$crs);
&Apache::lonnet::coursedescription($env{'request.course.id'});
} else {
- my $found_one = 0;
+
foreach my $key (sort keys %env) {
if ($key=~m/^course\.$env{'request.course.id'}\.metadata\.\d+\.title$/) {
- unless ($found_one eq 1) {
- $found_one = 1;
- $r->print('<strong>Existing Metadata</strong><br >');
- }
- $r->print($env{$key}.'<br />');
$key=~m/^course\.$env{'request.course.id'}\.metadata\.(\d+)\.title/;
+
if ($1 ge $next_meta) {
$next_meta = $1 + 1;
}
+ $output.='<tr><td>'.$env{$key}.'</td>';
+ $output.='<td>Select one: <input type="radio" name="type" value="one" /><br />';
+ $output.='Select many: <input type="radio" name="type" value="many" /></td>';
+ $output.='<td><input type="text" value="'.$env{$key.'.values'}.'" /></td></tr>';
}
}
- $r->print('<a href="/adm/parmset?action=setinstmeta&state=add&serial='.$next_meta.'">Add Metadata Item</a><br />');
+ $output.='<tr><td><i>Create new instructor metadata item</i><br />';
+ $output.='<input type="text" name="instmeta" /></td><td>Options here</td>';
+ $output.='<td><input type="hidden" name="serial" value="'.$next_meta.'" /></td></tr>';
+ $r->print(<<ENDenv);
+ <form method="post" action="/adm/parmset?action=setinstmeta" name="form">
+
+ <p>
+ <table border=2>
+ <tr><th>Title</th><th>Options</th><th>Choices</th></tr>
+ $output
+ </table>
+ <input type="submit" name="instmeta" value="Update Instructor Metadata">
+ </form>
+
+ENDenv
+
}
$r->print('</body>
</html>');