Diff for /loncom/interface/lonparmset.pm between versions 1.118 and 1.122

version 1.118, 2003/07/24 17:53:59 version 1.122, 2003/09/04 01:09:04
Line 287  sub plink { Line 287  sub plink {
 sub startpage {  sub startpage {
     my ($r,$id,$udom,$csec,$uname,$have_assesments)=@_;      my ($r,$id,$udom,$csec,$uname,$have_assesments)=@_;
   
     my $bodytag=&Apache::loncommon::bodytag('Set Course Parameters','',      my $bodytag=&Apache::loncommon::bodytag('Set/Modify Course Parameters','',
                                             'onUnload="pclose()"');                                              'onUnload="pclose()"');
     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');
Line 343  $selscript Line 343  $selscript
 $bodytag  $bodytag
   
 <form method="post" action="/adm/parmset" name="envform">  <form method="post" action="/adm/parmset" name="envform">
 <h3>Course Environment</h3>  <h4>Course Environment Parameters</h4>
 <input type="submit" name="crsenv" value="Set Course Environment">  <input type="submit" name="crsenv" value="Set Course Environment Parameters" />
   </form>
   <hr />
   <form method="post" action="/adm/helper/parameter.helper" name="helpform">
   <h4>Course Assessment Parameter - Helper Mode</h4>
   <input type="submit" value="Set/Modify Course Assessment Parameter" />
   </form>
   <hr />
   <form method="post" action="/adm/parmset" name="overview">
   <h4>Course Assessment Parameters - Overview Mode</h4>
   <input type="submit" name="overview" value="Modify Course Assessment Parameters" />
 </form>  </form>
 <hr />  <hr />
 <form method="post" action="/adm/parmset" name="parmform">  <form method="post" action="/adm/parmset" name="parmform">
 <h3>Course Assessments</h3>  <h4>Course Assessments Parameters - Table Mode</h4>
   
 <a href="/adm/helper/parameter.helper">Use Assignment Parameter Helper</a>, a  
 simpler interface to set open, due, or answer open dates for problems or  
 sequences.<br />&nbsp;<br />  
 ENDHEAD  ENDHEAD
   
     if (!$have_assesments) {      if (!$have_assesments) {
Line 917  sub assessparms { Line 923  sub assessparms {
   
     $r->print('<h2>'.$message.'</h2><table>');      $r->print('<h2>'.$message.'</h2><table>');
                                                   
     my $submitmessage;      my $submitmessage = 'Update Section or Specific User';
     if (!$pssymb) {      if (!$pssymb) {
         $r->print('<tr><td>Select Parameter Level</td><td colspan="2">');          $r->print('<tr><td>Select Parameter Level</td><td colspan="2">');
         $r->print('<select name="parmlev">');          $r->print('<select name="parmlev">');
Line 1040  sub assessparms { Line 1046  sub assessparms {
     if (($prevvisit) || ($pschp) || ($pssymb)) {      if (($prevvisit) || ($pschp) || ($pssymb)) {
         $submitmessage = "Update Course Assessment Parameter Display";          $submitmessage = "Update Course Assessment Parameter Display";
     } else {      } else {
         $submitmessage = "Set Course Assessment Parameters";          $submitmessage = "Set/Modify Course Assessment Parameters";
     }      }
     $r->print('<input type="submit" name="dis" value="'.$submitmessage.'">');      $r->print('<input type="submit" name="dis" value="'.$submitmessage.'">');
   
Line 1658  $output Line 1664  $output
 </html>      </html>    
 ENDENV  ENDENV
 }  }
   ##################################################
   
   sub overview {
       my $r=shift;
       my $bodytag=&Apache::loncommon::bodytag(
                                'Set/Modify Course Assessment Parameters');
       my $dom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
       my $crs = $ENV{'course.'.$ENV{'request.course.id'}.'.num'};
       $r->print(<<ENDOVER);
   <html>
   <head>
   <title>LON-CAPA Course Environment</title>
   </head>
   $bodytag
   <form method="post" action="/adm/parmset" name="overview">
   <input type="hidden" name="overview" value="1" />
   ENDOVER
   # Read and display
       my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs);
       my $oldsection='';
       my $oldrealm='';
       my $oldpart='';
       foreach my $thiskey (sort keys %resourcedata) {
    my ($course,$middle,$part,$name)=
       ($thiskey=~/^(\w+)\.(.*)\.*([\w\s]+)\.(\w+)$/);
    unless ($name eq 'type') {
       my $section='All Students';
       if ($middle=~/^\[(.*)\]\./) {
    $section='Group/Section: '.$1;
    $middle=~s/^\[(.*)\]\.//;
       }
       my $realm='All Resources';
       if ($middle=~/^(.+)\_\_\_\(all\)$/) {
    $realm='Folder/Map: '.$1;
       } elsif ($middle) {
    $realm='Resource: '.$middle;
       }
       if ($section ne $oldsection) {
    $r->print("\n<hr /><h1>$section</h1>");
    $oldsection=$section;
    $oldrealm='';
       }
       if ($realm ne $oldrealm) {
    $r->print("\n<h2>$realm</h2>");
    $oldrealm=$realm;
    $oldpart='';
       }
       if ($part ne $oldpart) {
    $r->print("\n<h3>Part: $part</h3>");
    $oldpart=$part;
       }
   
       $r->print('<br />'.$name.': '.$thiskey.' = '.$resourcedata{$thiskey});
    }
       }
       $r->print('</form></body></html>');
   }
   
 ##################################################  ##################################################
 ##################################################  ##################################################
Line 1693  sub handler { Line 1756  sub handler {
     
         $coursename=$ENV{'course.'.$ENV{'request.course.id'}.'.description'};          $coursename=$ENV{'course.'.$ENV{'request.course.id'}.'.description'};
   
  unless (($ENV{'form.crsenv'}) || (!$ENV{'request.course.fn'})) {   if (($ENV{'form.crsenv'}) || (!$ENV{'request.course.fn'})) {
 # --------------------------------------------------------- Bring up assessment  
     &assessparms($r);  
 # ---------------------------------------------- This is for course environment  # ---------------------------------------------- This is for course environment
  } else {  # -------------------------- also call if toplevel map coudl not be initialized
     &crsenv($r);      &crsenv($r);
    } elsif ($ENV{'form.overview'}) {
   # --------------------------------------------------------------- Overview mode
       &overview($r);
    } else {
   # --------------------------------------------------------- Bring up assessment
       &assessparms($r);
  }   }
     } else {      } else {
 # ----------------------------- Not in a course, or not allowed to modify parms  # ----------------------------- Not in a course, or not allowed to modify parms

Removed from v.1.118  
changed lines
  Added in v.1.122


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>