--- loncom/interface/lonparmset.pm 2003/01/19 11:55:14 1.82 +++ loncom/interface/lonparmset.pm 2003/06/13 20:01:02 1.99 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.82 2003/01/19 11:55:14 www Exp $ +# $Id: lonparmset.pm,v 1.99 2003/06/13 20:01:02 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -56,6 +56,7 @@ package Apache::lonparmset; use strict; use Apache::lonnet; use Apache::Constants qw(:common :http REDIRECT); +use Apache::lonhtmlcommon(); use Apache::loncommon; use GDBM_File; use Apache::lonhomework; @@ -284,16 +285,14 @@ sub plink { sub startpage { - my ($r,$id,$udom,$csec,$uname)=@_; - $r->content_type('text/html'); - $r->send_http_header; - + my ($r,$id,$udom,$csec,$uname,$have_assesments)=@_; + my $bodytag=&Apache::loncommon::bodytag('Set Course Parameters','', 'onUnload="pclose()"'); my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. &Apache::loncommon::selectstudent_link('parmform','uname','udom'); my $selscript=&Apache::loncommon::studentbrowser_javascript(); - + my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); $r->print(< @@ -306,15 +305,7 @@ sub startpage { parmwin.close(); } - function pjump(type,dis,value,marker,ret,call) { - document.parmform.pres_marker.value=''; - parmwin=window.open("/adm/rat/parameter.html?type="+escape(type) - +"&value="+escape(value)+"&marker="+escape(marker) - +"&return="+escape(ret) - +"&call="+escape(call)+"&name="+escape(dis),"LONCAPAparms", - "height=350,width=350,scrollbars=no,menubar=no"); - - } + $pjump_def function psub() { pclose(); @@ -350,12 +341,22 @@ sub startpage { $selscript $bodytag + +Use Assignment Parameter Helper, a +simpler interface to set open, due, or answer open dates for problems or sequences. +

Course Environment

Course Assessments

+ENDHEAD + + if (!$have_assesments) { + $r->print('There are no assesment parameters in this course to set.
'); + } else { + $r->print(< Section/Group: @@ -371,7 +372,7 @@ $chooseopt ENDHEAD - + } } sub print_row { @@ -692,12 +693,12 @@ sub assessparms { my $url=$ENV{'form.url'}; $url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; $pssymb=&Apache::lonnet::symbread($url); - @pscat='all'; + if (!@pscat) { @pscat=('all'); } $pschp=''; $parmlev = 'full'; } elsif ($ENV{'form.symb'}) { $pssymb=$ENV{'form.symb'}; - @pscat='all'; + if (!@pscat) { @pscat=('all'); } $pschp=''; $parmlev = 'full'; } else { @@ -766,6 +767,7 @@ sub assessparms { $mapp{'0.0'} = ''; $symbp{'0.0'} = ''; + # ---------------------------------------------------------- Anything to store? if ($ENV{'form.pres_marker'}) { my ($sresid,$spnam,$snum)=split(/\&/,$ENV{'form.pres_marker'}); @@ -882,7 +884,12 @@ sub assessparms { if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} # ------------------------------------------------------------------ Start page - &startpage($r,$id,$udom,$csec,$uname); + my $have_assesments=1; + if (scalar(keys(%allkeys)) eq 0) { $have_assesments=0; } + + &startpage($r,$id,$udom,$csec,$uname,$have_assesments); + + if (!$have_assesments) { return ''; } # if ($ENV{'form.url'}) { # $r->print(''); @@ -1048,9 +1055,7 @@ sub assessparms { my $csuname=$ENV{'user.name'}; my $csudom=$ENV{'user.domain'}; - if ($parmlev eq 'full' || $parmlev eq 'brief') { - my $coursespan=$csec?8:5; $r->print('

'); $r->print(''); @@ -1458,7 +1463,8 @@ sub crsenv { 'hideemptyrows' => 'Hide Empty Rows in Spreadsheets
'. '("yes" for default hiding)', 'pageseparators' => 'Visibly Separate Items on Pages
'. - '("yes" for visible separation)', + '("yes" for visible separation, '. + 'changes will not show until next login)', 'pch.roles.denied'=> 'Disallow Resource Discussion for '. 'Roles
"st": '. 'student, "ta": '. @@ -1485,7 +1491,14 @@ sub crsenv { ",'spreadsheet')\">Browse
", 'allow_limited_html_in_feedback' => 'Allow limited HTML in discussion posts
'. - '(Set value to yes to allow)' + '(Set value to yes to allow)', + 'rndseed' + => 'Randomization algorithm used
'. + 'Modifying this will make problems '. + 'have different numbers and answers', + 'problem_stream_switch' + => 'Allow problems to be splitted over pages
'. + ' (yes if allow anything else if not)' ); foreach (keys(%values)) { unless ($descriptions{$_}) { @@ -1562,7 +1575,7 @@ ENDENV =pod -=item handler +=item * handler Main handler. Calls &assessparms and &crsenv subroutines. @@ -1570,6 +1583,7 @@ Main handler. Calls &assessparms and &c ################################################## ################################################## + use Data::Dumper; sub handler { my $r=shift; @@ -1579,6 +1593,9 @@ sub handler { return OK; } &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); + + $r->content_type('text/html'); + $r->send_http_header; # ----------------------------------------------------- Needs to be in a course if (($ENV{'request.course.id'}) &&