version 1.190, 2005/04/07 06:56:23
|
version 1.195, 2005/05/30 17:58:51
|
Line 279 sub storeparm {
|
Line 279 sub storeparm {
|
$reply=&Apache::lonnet::cput |
$reply=&Apache::lonnet::cput |
('resourcedata',\%storecontent,$udom,$uname); |
('resourcedata',\%storecontent,$udom,$uname); |
} |
} |
|
&Apache::lonnet::devalidateuserresdata($uname,$udom); |
} |
} |
|
|
if ($reply=~/^error\:(.*)/) { |
if ($reply=~/^error\:(.*)/) { |
Line 384 sub startpage {
|
Line 385 sub startpage {
|
|
|
my $bodytag=&Apache::loncommon::bodytag('Set/Modify Course Parameters','', |
my $bodytag=&Apache::loncommon::bodytag('Set/Modify Course Parameters','', |
'onUnload="pclose()"'); |
'onUnload="pclose()"'); |
|
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef,'Table'); |
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. |
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. |
&Apache::loncommon::selectstudent_link('parmform','uname','udom'); |
&Apache::loncommon::selectstudent_link('parmform','uname','udom'); |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
Line 453 $html
|
Line 455 $html
|
$selscript |
$selscript |
</head> |
</head> |
$bodytag |
$bodytag |
|
$breadcrumbs |
$overallhelp |
$overallhelp |
ENDHEAD |
ENDHEAD |
|
|
Line 489 ENDHEAD2
|
Line 492 ENDHEAD2
|
$sections.='</select>'; |
$sections.='</select>'; |
} |
} |
$r->print(<<ENDHEAD3); |
$r->print(<<ENDHEAD3); |
<form method="post" action="/adm/parmset" name="parmform"> |
<form method="post" action="/adm/parmset?action=settable" name="parmform"> |
<h4>$lt{'captm'}</h4> |
<h4>$lt{'captm'}</h4> |
ENDHEAD3 |
ENDHEAD3 |
|
|
Line 712 sub extractResourceInformation {
|
Line 715 sub extractResourceInformation {
|
my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); |
my $parmdis = $display; |
my $parmdis = $display; |
$parmdis =~ s|(\[Part.*$)||g; |
$parmdis =~ s|(\[Part.*)$||g; |
my $partkey = $part; |
my $partkey = $part; |
$partkey =~ tr|_|.|; |
$partkey =~ tr|_|.|; |
$$allparms{$name} = $parmdis; |
$$allparms{$name} = $parmdis; |
Line 933 sub assessparms {
|
Line 936 sub assessparms {
|
&Apache::lonnet::devalidatecourseresdata( |
&Apache::lonnet::devalidatecourseresdata( |
$env{'course.'.$env{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}); |
$env{'course.'.$env{'request.course.id'}.'.domain'}); |
&Apache::lonnet::clear_EXT_cache_status(); |
#&Apache::lonnet::clear_EXT_cache_status(); |
# -------------------------------------------------------------- Get coursedata |
# -------------------------------------------------------------- Get coursedata |
%courseopt = &Apache::lonnet::dump |
%courseopt = &Apache::lonnet::dump |
('resourcedata', |
('resourcedata', |
Line 965 sub assessparms {
|
Line 968 sub assessparms {
|
my $have_assesments=1; |
my $have_assesments=1; |
if (scalar(keys(%allkeys)) eq 0) { $have_assesments=0; } |
if (scalar(keys(%allkeys)) eq 0) { $have_assesments=0; } |
|
|
|
$trimheader = 'yes'; |
&startpage($r,$id,$udom,$csec,$uname,$have_assesments,$trimheader); |
&startpage($r,$id,$udom,$csec,$uname,$have_assesments,$trimheader); |
|
|
if (!$have_assesments) { |
if (!$have_assesments) { |
Line 1190 ENDTABLETWO
|
Line 1194 ENDTABLETWO
|
$r->print(<<ENDTABLEHEADFOUR); |
$r->print(<<ENDTABLEHEADFOUR); |
</tr><tr><th>$lt{'aut'}</th><th>$lt{'type'}</th> |
</tr><tr><th>$lt{'aut'}</th><th>$lt{'type'}</th> |
<th>$lt{'emof'}</th><th>$lt{'part'}</th><th>$lt{'pn'}</th> |
<th>$lt{'emof'}</th><th>$lt{'part'}</th><th>$lt{'pn'}</th> |
<th>$lt{'gen'}</th><th>$lt{'femof'}</th> |
<th>$lt{'gen'}</th><th>$lt{'foremf'}</th> |
<th>$lt{'def'}</th><th>$lt{'foremf'}</th><th>$lt{'fr'}</th> |
<th>$lt{'def'}</th><th>$lt{'femof'}</th><th>$lt{'fr'}</th> |
ENDTABLEHEADFOUR |
ENDTABLEHEADFOUR |
|
|
if ($csec) { |
if ($csec) { |
Line 1509 sub crsenv {
|
Line 1513 sub crsenv {
|
my $setoutput=''; |
my $setoutput=''; |
my $bodytag=&Apache::loncommon::bodytag( |
my $bodytag=&Apache::loncommon::bodytag( |
'Set Course Environment Parameters'); |
'Set Course Environment Parameters'); |
|
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef, |
|
'Edit Course Environment'); |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
|
Line 1800 $browse_js
|
Line 1806 $browse_js
|
<title>LON-CAPA Course Environment</title> |
<title>LON-CAPA Course Environment</title> |
</head> |
</head> |
$bodytag |
$bodytag |
<form method="post" action="/adm/parmset" name="envform"> |
$breadcrumbs |
|
<form method="post" action="/adm/parmset?action=crsenv" name="envform"> |
$setoutput |
$setoutput |
<p> |
<p> |
<table border=2> |
<table border=2> |
Line 1842 sub overview {
|
Line 1849 sub overview {
|
'Set/Modify Course Assessment Parameters'); |
'Set/Modify Course Assessment Parameters'); |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef,'Overview'); |
my $html=&Apache::lonxml::xmlbegin(); |
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
$html |
$html |
Line 1849 $html
|
Line 1857 $html
|
<title>LON-CAPA Course Environment</title> |
<title>LON-CAPA Course Environment</title> |
</head> |
</head> |
$bodytag |
$bodytag |
<form method="post" action="/adm/parmset" name="overviewform"> |
$breadcrumbs |
|
<form method="post" action="/adm/parmset?action=setoverview" name="overviewform"> |
<input type="hidden" name="overview" value="1" /> |
<input type="hidden" name="overview" value="1" /> |
ENDOVER |
ENDOVER |
# Setting |
# Setting |
Line 2046 sub change_clone {
|
Line 2055 sub change_clone {
|
} |
} |
} |
} |
|
|
|
|
|
################################################## |
|
################################################## |
|
|
|
=pod |
|
|
|
=item * header |
|
|
|
Output html header for page |
|
|
|
=cut |
|
|
|
################################################## |
|
################################################## |
|
sub header { |
|
my $html=&Apache::lonxml::xmlbegin(); |
|
my $bodytag=&Apache::loncommon::bodytag('Parameter Manager'); |
|
my $title = &mt('LON-CAPA Parameter Manager'); |
|
return(<<ENDHEAD); |
|
$html |
|
<head> |
|
<title>$title</title> |
|
</head> |
|
$bodytag |
|
ENDHEAD |
|
} |
|
################################################## |
|
################################################## |
|
sub print_main_menu { |
|
my ($r,$parm_permission)=@_; |
|
# |
|
$r->print(<<ENDMAINFORMHEAD); |
|
<form method="post" enctype="multipart/form-data" |
|
action="/adm/parmset" name="studentform"> |
|
ENDMAINFORMHEAD |
|
# |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my @menu = |
|
( |
|
{ text => 'Set Course Environment Parameters', |
|
help => 'Course_Setting_Parameters', |
|
action => 'crsenv', |
|
permission => $parm_permission, |
|
}, |
|
{ text => 'Set/Modify Course Assessment Parameters - Helper Mode', |
|
url => '/adm/helper/parameter.helper', |
|
permission => $parm_permission, |
|
}, |
|
{ text => 'Modify Course Assessment Parameters - Overview Mode', |
|
action => 'setoverview', |
|
permission => $parm_permission, |
|
}, |
|
{ text => 'Set/Modify Course Assessment Parameters - Table Mode', |
|
action => 'settable', |
|
permission => $parm_permission, |
|
}, |
|
# { text => 'Set Parameter Default Preferences', |
|
# help => 'Course_View_Class_List', |
|
# action => 'setdefaults', |
|
# permission => $parm_permission, |
|
# }, |
|
); |
|
my $menu_html = ''; |
|
foreach my $menu_item (@menu) { |
|
next if (! $menu_item->{'permission'}); |
|
$menu_html.='<p>'; |
|
$menu_html.='<font size="+1">'; |
|
if (exists($menu_item->{'url'})) { |
|
$menu_html.=qq{<a href="$menu_item->{'url'}">}; |
|
} else { |
|
$menu_html.= |
|
qq{<a href="/adm/parmset?action=$menu_item->{'action'}">}; |
|
} |
|
$menu_html.= &mt($menu_item->{'text'}).'</a></font>'; |
|
if (exists($menu_item->{'help'})) { |
|
$menu_html.= |
|
&Apache::loncommon::help_open_topic($menu_item->{'help'}); |
|
} |
|
$menu_html.='</p>'.$/; |
|
} |
|
$r->print($menu_html); |
|
return; |
|
} |
|
|
|
|
|
|
|
|
################################################## |
################################################## |
################################################## |
################################################## |
|
|
Line 2056 sub change_clone {
|
Line 2153 sub change_clone {
|
Main handler. Calls &assessparms and &crsenv subroutines. |
Main handler. Calls &assessparms and &crsenv subroutines. |
|
|
=cut |
=cut |
|
|
################################################## |
################################################## |
################################################## |
################################################## |
use Data::Dumper; |
use Data::Dumper; |
Line 2068 sub handler {
|
Line 2164 sub handler {
|
$r->send_http_header; |
$r->send_http_header; |
return OK; |
return OK; |
} |
} |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
|
['action','state']); |
|
|
# ----------------------------------------------------------- Clear out garbage |
# ----------------------------------------------------------- Clear out garbage |
|
|
Line 2084 sub handler {
|
Line 2181 sub handler {
|
|
|
%maptitles=(); |
%maptitles=(); |
|
|
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/parmset", |
|
text=>"Parameter Manager", |
|
faq=>9, |
|
bug=>'Instructor Interface'}); |
# ----------------------------------------------------- Needs to be in a course |
# ----------------------------------------------------- Needs to be in a course |
|
my $parm_permission = |
if (($env{'request.course.id'}) && |
(&Apache::lonnet::allowed('opa',$env{'request.course.id'}) || |
(&Apache::lonnet::allowed('opa',$env{'request.course.id'}) || |
|
&Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'. |
&Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'. |
$env{'request.course.sec'}) |
$env{'request.course.sec'})); |
)) { |
if ($env{'request.course.id'} && $parm_permission) { |
|
|
|
# Start Page |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
if (($env{'form.crsenv'}) || (!$env{'request.course.fn'})) { |
# |
# ---------------------------------------------- This is for course environment |
# Main switch on form.action and form.state, as appropriate |
# -------------------------- also call if toplevel map coudl not be initialized |
# |
&crsenv($r); |
# Check first if coming from someone else headed directly for |
} elsif ($env{'form.overview'}) { |
# the table mode |
# --------------------------------------------------------------- Overview mode |
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
|
&& (!$env{'form.dis'})) || ($env{'form.symb'})) { |
|
&assessparms($r); |
|
|
|
} elsif (! exists($env{'form.action'})) { |
|
$r->print(&header()); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs(undef, |
|
'Parameter Manager')); |
|
&print_main_menu($r,$parm_permission); |
|
} elsif ($env{'form.action'} eq 'crsenv' && $parm_permission) { |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=crsenv', |
|
text=>"Course Environment"}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs(undef, |
|
'Edit Course Environment')); |
|
&crsenv($r); |
|
} elsif ($env{'form.action'} eq 'setoverview' && $parm_permission) { |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
|
text=>"Overview Mode"}); |
&overview($r); |
&overview($r); |
} else { |
} elsif ($env{'form.action'} eq 'settable' && $parm_permission) { |
# --------------------------------------------------------- Bring up assessment |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
|
text=>"Table Mode"}); |
&assessparms($r); |
&assessparms($r); |
} |
} |
|
|
} else { |
} else { |
# ----------------------------- Not in a course, or not allowed to modify parms |
# ----------------------------- Not in a course, or not allowed to modify parms |
$env{'user.error.msg'}= |
$env{'user.error.msg'}= |