Diff for /loncom/automation/batchcreatecourse.pm between versions 1.40.2.1.2.1 and 1.43

version 1.40.2.1.2.1, 2020/05/22 22:01:59 version 1.43, 2019/07/26 02:28:28
Line 89  use strict; Line 89  use strict;
 # <disresdis>1</disresdis>  # <disresdis>1</disresdis>
 # <disablechat>1</disablechat>  # <disablechat>1</disablechat>
 # <openall></openall>  # <openall></openall>
 # <openallfrom></openallfrom>  
 # <notify_dc>1</notify_dc>  # <notify_dc>1</notify_dc>
 # <notify_owner>1</notify_owner>  # <notify_owner>1</notify_owner>
 # <owner>  # <owner>
Line 165  use strict; Line 164  use strict;
 # firstres can be nav, syl, or blank for "Navigate Contents", Syllabus, or  # firstres can be nav, syl, or blank for "Navigate Contents", Syllabus, or
 # no entry respectively.  # no entry respectively.
 #   # 
 # crstype can be Course or Community  # crstype can be Course, Community or Placement
 #  #
 # crsquota is the total disk space permitted for course group portfolio files  # crsquota is the total disk space permitted for course group portfolio files
 # in all course groups.  # in all course groups.
Line 212  sub create_courses { Line 211  sub create_courses {
             $longroles{'Community'}{$1} = $3;              $longroles{'Community'}{$1} = $3;
         }          }
     }      }
     my ($logmsg,$keysmsg,$newusermsg,$addresult,%codehash);      my ($logmsg,$keysmsg,$newusermsg,$addresult,%codehash,%instcodes);
     my %enrollcount = ();      my %enrollcount = ();
     my $newcoursedir = LONCAPA::tempdir().'/addcourse/'.$dom.'/'.$context;      my $newcoursedir = LONCAPA::tempdir().'/addcourse/'.$dom.'/'.$context;
     if ($context eq 'auto') {      if ($context eq 'auto') {
Line 240  sub create_courses { Line 239  sub create_courses {
                         if ($code) {                          if ($code) {
                             $codehash{$courseid} = $code;                              $codehash{$courseid} = $code;
                         }                          }
                           if ($details{$num}{'coursecode'} ne '') {
                               push(@{$instcodes{$details{$num}{'coursecode'}}},$courseid);
                           }
                     }                      }
                 }                  }
             }              }
         }          }
     }      }
     return ($output,$logmsg,$keysmsg,\%codehash);      return ($output,$logmsg,$keysmsg,\%codehash,\%instcodes);
 }  }
   
 #############################################################  #############################################################
Line 270  sub parse_coursereqs { Line 272  sub parse_coursereqs {
     my $role = '';      my $role = '';
     my @items = ('title','optional_id','coursecode','defaultcredits','coursehome','reshome','nonstandard','adds','drops','topmap','firstres','clonecrs','clonedom','datemode','dateshift','showphotos','setpolicy','setcontent','setcomment','setkeys','keyauth','disresdis','disablechat','openall','notify_owner','notify_dc','crstype','crsquota','uniquecode');      my @items = ('title','optional_id','coursecode','defaultcredits','coursehome','reshome','nonstandard','adds','drops','topmap','firstres','clonecrs','clonedom','datemode','dateshift','showphotos','setpolicy','setcontent','setcomment','setkeys','keyauth','disresdis','disablechat','openall','notify_owner','notify_dc','crstype','crsquota','uniquecode');
     my @possroles = qw(st ad ep ta in cc co);      my @possroles = qw(st ad ep ta in cc co);
     my @dateitems = ('enrollstart','enrollend','accessstart','accessend','openallfrom');      my @dateitems = ('enrollstart','enrollend','accessstart','accessend');
     my @useritems = ('autharg','authtype','firstname','generation','lastname','middlename','studentID');      my @useritems = ('autharg','authtype','firstname','generation','lastname','middlename','studentID');
     my $p = HTML::Parser->new      my $p = HTML::Parser->new
     (      (
Line 430  sub build_course { Line 432  sub build_course {
             $rolenames = $longroles->{'Community'};              $rolenames = $longroles->{'Community'};
         }          }
     } else {      } else {
         $crstype = 'Course';          if ($details->{'crstype'} eq 'Placement') {
               $crstype = $details->{'crstype'};
           } else {
               $crstype = 'Course';
           }
         $ccrole = 'cc';          $ccrole = 'cc';
         if (ref($longroles) eq 'HASH') {          if (ref($longroles) eq 'HASH') {
             $rolenames = $longroles->{'Course'};              $rolenames = $longroles->{'Course'};
Line 453  sub build_course { Line 459  sub build_course {
     if ($firstres eq '') {      if ($firstres eq '') {
         if ($crstype eq 'Community') {          if ($crstype eq 'Community') {
             $firstres = 'nav';              $firstres = 'nav';
           } elsif ($crstype eq 'Placement') {
               $firstres = 'blank'; 
         } else {          } else {
             $firstres = 'syl';              $firstres = 'syl';
         }          }
Line 543  sub build_course { Line 551  sub build_course {
                disresdis => $details->{'disresdis'},                 disresdis => $details->{'disresdis'},
                disablechat => $details->{'disablechat'},                 disablechat => $details->{'disablechat'},
                openall => $details->{'openall'},                 openall => $details->{'openall'},
                openallfrom => $details->{'openallfrom'},  
                firstres => $firstres                 firstres => $firstres
                };                 };
         if ($details->{'textbook'}) {          if ($details->{'textbook'}) {
Line 564  sub build_course { Line 571  sub build_course {
     } else {      } else {
         return;          return;
     }      }
       
 #  #
 # Make owner a coordinator  # Make owner a coordinator
 #  #

Removed from v.1.40.2.1.2.1  
changed lines
  Added in v.1.43


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