version 1.142, 2003/12/05 16:18:45
|
version 1.147, 2004/01/14 22:08:23
|
Line 306 sub startpage {
|
Line 306 sub startpage {
|
'oi' => "or ID", |
'oi' => "or ID", |
'ad' => "at Domain" |
'ad' => "at Domain" |
); |
); |
|
my $overallhelp=&Apache::loncommon::help_open_topic("Course_Setting_Parameters","Parameters"); |
|
my $assessparmhelp=&Apache::loncommon::help_open_topic("Cascading_Parameters","Assessment Parameters"); |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<html> |
<html> |
<head> |
<head> |
Line 354 sub startpage {
|
Line 356 sub startpage {
|
$selscript |
$selscript |
</head> |
</head> |
$bodytag |
$bodytag |
|
$overallhelp |
ENDHEAD |
ENDHEAD |
|
|
unless ($trimheader) {$r->print(<<ENDHEAD2); |
unless ($trimheader) {$r->print(<<ENDHEAD2); |
Line 362 ENDHEAD
|
Line 365 ENDHEAD
|
<input type="submit" name="crsenv" value="$lt{'scep'}" /> |
<input type="submit" name="crsenv" value="$lt{'scep'}" /> |
</form> |
</form> |
<hr /> |
<hr /> |
|
$assessparmhelp |
<form method="post" action="/adm/helper/parameter.helper" name="helpform"> |
<form method="post" action="/adm/helper/parameter.helper" name="helpform"> |
<h4>$lt{'caphm'}</h4> |
<h4>$lt{'caphm'}</h4> |
<input type="submit" value="$lt{'smcap'}" /> |
<input type="submit" value="$lt{'smcap'}" /> |
Line 1099 sub assessparms {
|
Line 1103 sub assessparms {
|
'rl' => "Resource Level", |
'rl' => "Resource Level", |
'ic' => 'in Course', |
'ic' => 'in Course', |
'aut' => "Assessment URL and Title", |
'aut' => "Assessment URL and Title", |
'type' => &mt('Type'), |
'type' => 'Type', |
'emof' => "Enclosing Map or Folder", |
'emof' => "Enclosing Map or Folder", |
'part' => &mt('Part'), |
'part' => 'Part', |
'pn' => 'Parameter Name', |
'pn' => 'Parameter Name', |
'def' => 'default', |
'def' => 'default', |
'femof' => 'from Enclosing Map or Folder', |
'femof' => 'from Enclosing Map or Folder', |
Line 1764 ENDOVER
|
Line 1768 ENDOVER
|
} |
} |
} |
} |
# Store |
# Store |
&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs); |
my $delentries=$#deldata+1; |
&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs); |
my @newdatakeys=keys %newdata; |
|
my $putentries=$#newdatakeys+1; |
|
if ($delentries) { |
|
if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') { |
|
$r->print('<h2>'.&mt('Deleted [_1] parameter(s)</h2>',$delentries)); |
|
} else { |
|
$r->print('<h2><font color="red">'. |
|
&mt('Error deleting parameters').'</font></h2>'); |
|
} |
|
} |
|
if ($putentries) { |
|
if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') { |
|
$r->print('<h2>'.&mt('Stored [_1] parameter(s)</h2>',$putentries)); |
|
} else { |
|
$r->print('<h2><font color="red">'. |
|
&mt('Error storing parameters').'</font></h2>'); |
|
} |
|
} |
# Read and display |
# Read and display |
my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs); |
my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs); |
my $oldsection=''; |
my $oldsection=''; |
Line 1773 ENDOVER
|
Line 1794 ENDOVER
|
my $oldpart=''; |
my $oldpart=''; |
my $pointer=0; |
my $pointer=0; |
$tableopen=0; |
$tableopen=0; |
|
my $foundkeys=0; |
foreach my $thiskey (sort keys %resourcedata) { |
foreach my $thiskey (sort keys %resourcedata) { |
if ($resourcedata{$thiskey.'.type'}) { |
if ($resourcedata{$thiskey.'.type'}) { |
my ($course,$middle,$part,$name)= |
my ($course,$middle,$part,$name)= |
Line 1810 ENDOVER
|
Line 1832 ENDOVER
|
$r->print(&tablestart().'<tr><td><b>'.$name. |
$r->print(&tablestart().'<tr><td><b>'.$name. |
':</b></td><td><input type="checkbox" name="del_'. |
':</b></td><td><input type="checkbox" name="del_'. |
$thiskey.'" /></td><td>'); |
$thiskey.'" /></td><td>'); |
|
$foundkeys++; |
if ($resourcedata{$thiskey.'.type'}=~/^date/) { |
if ($resourcedata{$thiskey.'.type'}=~/^date/) { |
my $jskey='key_'.$pointer; |
my $jskey='key_'.$pointer; |
$pointer++; |
$pointer++; |
Line 1828 ENDOVER
|
Line 1851 ENDOVER
|
} |
} |
} |
} |
|
|
$r->print(&tableend(). |
$r->print(&tableend().'<p>'. |
'<p><input type="submit" value="'.&mt('Modify Parameters').'" /></p></form></body></html>'); |
($foundkeys?'<input type="submit" value="'.&mt('Modify Parameters').'" />':&mt('There are no course or section parameters.')).'</p></form></body></html>'); |
} |
} |
|
|
################################################## |
################################################## |