');
$r->rflush();
if ($context eq 'course') {
my $classlist = &Apache::loncoursedata::get_classlist();
@@ -1268,7 +1286,7 @@ sub print_userlist {
my %advrolehash = &Apache::lonnet::get_my_roles($cnum,$cdom,undef,
\@statuses,$showroles);
&gather_userinfo($context,$format,\%userlist,$indexhash,\%userinfo,
- \%advrolehash);
+ \%advrolehash,$permission);
} else {
my (%cstr_roles,%dom_roles);
if ($context eq 'construction_space') {
@@ -1277,14 +1295,14 @@ sub print_userlist {
%cstr_roles = &Apache::lonnet::get_my_roles(undef,undef,undef,
\@statuses,\@possroles);
&gather_userinfo($context,$format,\%userlist,$indexhash,\%userinfo,
- \%cstr_roles);
+ \%cstr_roles,$permission);
} elsif ($context eq 'domain') {
if ($env{'form.roletype'} eq 'domain') {
%dom_roles = &Apache::lonnet::get_domain_roles($env{'request.role.domain'});
foreach my $key (keys(%dom_roles)) {
if (ref($dom_roles{$key}) eq 'HASH') {
&gather_userinfo($context,$format,\%userlist,$indexhash,
- \%userinfo,$dom_roles{$key});
+ \%userinfo,$dom_roles{$key},$permission);
}
}
} elsif ($env{'form.roletype'} eq 'construction_space') {
@@ -1294,7 +1312,7 @@ sub print_userlist {
if (ref($dom_roles{$key}) eq 'HASH') {
if ($env{'form.showrole'} eq 'au') {
&gather_userinfo($context,$format,\%userlist,$indexhash,
- \%userinfo,$dom_roles{$key});
+ \%userinfo,$dom_roles{$key},$permission);
} else {
my @possroles;
if ($env{'form.showrole'} eq 'Any') {
@@ -1310,7 +1328,7 @@ sub print_userlist {
$authordom,undef,\@statuses,\@possroles);
}
&gather_userinfo($context,$format,\%userlist,
- $indexhash,\%userinfo,\%coauthors);
+ $indexhash,\%userinfo,\%coauthors,$permission);
}
}
}
@@ -1323,6 +1341,7 @@ sub print_userlist {
&Apache::lonnet::coursedescription($cid,{'one_time' => 1});
my $cdom = $coursehash{'domain'};
my $cnum = $coursehash{'num'};
+ next if ($cnum eq '' || $cdom eq '');
my $cdesc = $coursehash{'description'};
my (@roles,@sections,%access,%users,%userdata,
%statushash);
@@ -1355,8 +1374,10 @@ sub print_userlist {
}
}
&gather_userinfo($context,$format,\%userlist,$indexhash,
- \%userinfo,\%allusers);
+ \%userinfo,\%allusers,$permission);
} else {
+ $r->print('');
return;
}
}
@@ -1380,26 +1401,27 @@ sub print_userlist {
# Print out the available choices
my $usercount;
if ($env{'form.action'} eq 'modifystudent') {
- ($usercount) = &show_users_list($r,$context,'view','modify',
+ ($usercount) = &show_users_list($r,$context,'view',$permission,
$env{'form.Status'},\%userlist,$keylist);
} else {
($usercount) = &show_users_list($r,$context,$env{'form.output'},
- 'aboutme',$env{'form.Status'},\%userlist,$keylist);
+ $permission,$env{'form.Status'},\%userlist,$keylist);
}
if (!$usercount) {
$r->print(' '.&mt('There are no users matching the search criteria.'));
}
}
- $r->print('');
+ $r->print('');
}
sub list_submit_button {
my ($text) = @_;
- return '';
+ return '';
}
sub gather_userinfo {
- my ($context,$format,$userlist,$indexhash,$userinfo,$rolehash) = @_;
+ my ($context,$format,$userlist,$indexhash,$userinfo,$rolehash,$permission) = @_;
foreach my $item (keys(%{$rolehash})) {
@{$userlist->{$item}} = ();
my %userdata;
@@ -1429,6 +1451,7 @@ sub gather_userinfo {
($userdata{'username'},$userdata{'domain'},$userdata{'role'}) =
split(/:/,$item);
if (ref($rolehash->{$item}) eq 'HASH') {
+ my $numcids = keys(%{$rolehash->{$item}});
foreach my $cid (sort(keys(%{$rolehash->{$item}}))) {
if (ref($rolehash->{$item}{$cid}) eq 'HASH') {
my $spanstart = '';
@@ -1436,6 +1459,13 @@ sub gather_userinfo {
my $space = ', ';
if ($format eq 'html' || $format eq 'view') {
$spanstart = '';
+ if ($permission->{'cusr'}) {
+ if ($numcids > 1) {
+ $spanstart .= '';
+ } else {
+ $spanstart .= '';
+ }
+ }
$spanend = ' ';
$space = ', ';
}
@@ -1458,6 +1488,7 @@ sub gather_userinfo {
sub build_user_record {
my ($userdata,$userinfo,$indexhash,$record_key,$userlist) = @_;
+ next if ($userdata->{'start'} eq '-1' && $userdata->{'end'} eq '-1');
&process_date_info($userdata);
my $username = $userdata->{'username'};
my $domain = $userdata->{'domain'};
@@ -1492,7 +1523,8 @@ sub courses_selector {
my $format_reply;
my $jscript = '';
- my $totcodes =
+ my $totcodes = 0;
+ $totcodes =
&Apache::courseclassifier::retrieve_instcodes(\%coursecodes,
$cdom,$totcodes);
if ($totcodes > 0) {
@@ -1694,7 +1726,7 @@ sub process_date_info {
}
sub show_users_list {
- my ($r,$context,$mode,$linkto,$statusmode,$userlist,$keylist)=@_;
+ my ($r,$context,$mode,$permission,$statusmode,$userlist,$keylist)=@_;
#
# Variables for excel output
my ($excel_workbook, $excel_sheet, $excel_filename,$row,$format);
@@ -1712,6 +1744,7 @@ sub show_users_list {
if (!grep(/^\Q$sortby\E$/,@sortable)) {
$sortby = 'username';
}
+ my $setting = $env{'form.roleaction'};
my ($cid,$cdom,$cnum,$classgroups,$displayphotos,$displayclickers);
if ($context eq 'course') {
$cid=$env{'request.course.id'};
@@ -1746,7 +1779,69 @@ function photowindow(photolink) {
END
}
unless ($mode eq 'autoenroll') {
+ my $check_uncheck_js = &Apache::loncommon::check_uncheck_jscript();
+ my $alert = &mt("You must select at least one user by checking a user's 'Select' checkbox");
+ my $singconfirm = &mt(' for a single user');
+ my $multconfirm = &mt(' for multiple users');
+ my $date_sec_selector = &date_section_javascript($context,$setting,$statusmode);
$r->print(<
+$check_uncheck_js
+
+function verify_action (field) {
+ var numchecked = 0;
+ var singconf = '$singconfirm';
+ var multconf = '$multconfirm';
+ if (field.length > 0) {
+ for (i = 0; i < field.length; i++) {
+ if (field[i].checked == true) {
+ numchecked ++;
+ }
+ }
+ } else {
+ if (field.checked == true) {
+ numchecked ++;
+ }
+ }
+ if (numchecked == 0) {
+ alert("$alert");
+ }
+ else {
+ var message = document.studentform.bulkaction[document.studentform.bulkaction.selectedIndex].text;
+ if (numchecked == 1) {
+ message += singconf;
+ }
+ else {
+ message += multconf;
+ }
+ if (confirm(message)) {
+ document.studentform.phase.value = 'bulkchange';
+ document.studentform.submit();
+ }
+ }
+}
+
+function username_display_launch(username,domain) {
+ var target;
+ for (var i=0; i
+$date_sec_selector
END
}
@@ -1770,6 +1865,13 @@ END
'clicker' => "clicker id",
'photo' => "photo",
'extent' => "extent",
+ 'pr' => "Proceed",
+ 'ca' => "check all",
+ 'ua' => "uncheck all",
+ 'ac' => "Action to take for selected users",
+ 'link' => "Behavior of username links",
+ 'aboutme' => "Display a user's personal page",
+ 'modify' => "Modify a user's information",
);
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') {
$lt{'extent'} = &mt('Course(s): description, section(s), status');
@@ -1808,16 +1910,46 @@ END
my $results_description = &results_header_row($rolefilter,$statusmode,
$context);
$r->print(''.$results_description.' ');
- my $output;
+ my ($output,$actionselect);
if ($mode eq 'html' || $mode eq 'view') {
+ if ($permission->{'cusr'}) {
+ $actionselect = &select_actions($context,$setting,$statusmode);
+ }
$r->print(<
-
+
+
+
+
+
+END
+ if ($mode ne 'autoenroll') {
+ $output = '
';
+ my @linkdests = ('aboutme');
+ if ($permission->{'cusr'}) {
+ push (@linkdests,'modify');
+ $output .= ''.$lt{'link'}.': ';
+ my $usernamelink = $env{'form.usernamelink'};
+ if ($usernamelink eq '') {
+ $usernamelink = 'aboutme';
+ }
+ foreach my $item (@linkdests) {
+ my $checkedstr = '';
+ if ($item eq $usernamelink) {
+ $checkedstr = ' checked="checked" ';
+ }
+ $output .= ' '.$lt{$item}.' ';
+ }
+ $output .= ' ';
+ } else {
+ $output .= &mt("Click on a username to view the user's personal page.").' ';
+ }
+ if ($actionselect) {
+ $output .= <<"END";
+$lt{'ac'}: $actionselect
+
+
END
- if ($linkto eq 'aboutme') {
- $output = &mt("Select a user name to view the user's personal page.");
- } elsif ($linkto eq 'modify') {
- $output = &mt("Select a user name to modify the user's information");
+ }
}
$output .= "\n
\n".
&Apache::loncommon::start_data_table().
@@ -1827,9 +1959,10 @@ END
'."\n");
+ }
}
if ($context eq 'course') {
if ($env{'form.showrole'} eq 'st' || $env{'form.showrole'} eq 'Any') {
@@ -2094,6 +2243,21 @@ END
}
}
+sub print_username_link {
+ my ($permission,$in) = @_;
+ my $output;
+ if (!$permission->{'cusr'}) {
+ $output = &Apache::loncommon::aboutmewrapper($in->{'username'},
+ $in->{'username'},
+ $in->{'domain'});
+ } else {
+ $output = '{'username'}','$in->{'domain'}'".')" />'.
+ $in->{'username'}.'';
+ }
+ return $output;
+}
+
sub role_type_names {
my %lt = &Apache::lonlocal::texthash (
'domain' => 'Domain Roles',
@@ -2103,6 +2267,254 @@ sub role_type_names {
return %lt;
}
+sub select_actions {
+ my ($context,$setting,$statusmode) = @_;
+ my %lt = &Apache::lonlocal::texthash(
+ revoke => "Revoke user roles",
+ delete => "Delete user roles",
+ reenable => "Re-enable expired user roles",
+ activate => "Make future user roles active now",
+ chgdates => "Change starting/ending dates",
+ chgsec => "Change section associated with user roles",
+ );
+ my ($output,$options,%choices);
+ if ($statusmode eq 'Any') {
+ $options .= '
+';
+ $choices{'dates'} = 1;
+ } else {
+ if ($statusmode eq 'Active' || $statusmode eq 'Future') {
+ $options .= '
+';
+ }
+ if ($statusmode eq 'Future') {
+ $options .= '
+';
+ $choices{'dates'} = 1;
+ } elsif ($statusmode eq 'Expired') {
+ $options .= '
+';
+ $choices{'dates'} = 1;
+ }
+ }
+ if ($context eq 'domain') {
+ $options .= '
+';
+ }
+ if (($context eq 'course') || ($context eq 'domain' && $setting eq 'course')) {
+ if ($statusmode ne 'Expired') {
+ $options .= '
+';
+ $choices{'sections'} = 1;
+ }
+ }
+ if ($options) {
+ $output = ''."\n".
+ ''."\n".$options."\n".'';
+ if ($choices{'dates'}) {
+ $output .=
+ ''."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n".
+ ''."\n";
+ if ($context eq 'course') {
+ $output .= ''."\n";
+ }
+ }
+ if ($choices{'sections'}) {
+ $output .= ''."\n".
+ ''."\n";
+ }
+ }
+ return $output;
+}
+
+sub date_section_javascript {
+ my ($context,$setting) = @_;
+ my $title;
+ if (($context eq 'course') || ($context eq 'domain' && $setting eq 'course')) {
+ $title = &mt('Date and Section selector');
+ } else {
+ $title = &mt('Date selector');
+ }
+ my $output = '
+
+ENDTWO
+ return $output;
+}
+
+sub date_section_selector {
+ my ($context) = @_;
+ my $callingform = $env{'form.callingform'};
+ my $formname = 'dateselect';
+ my $groupslist = &get_groupslist();
+ my $sec_js = &setsections_javascript($formname,$groupslist);
+ my $output = <<"END";
+
+';
+ my %lt = &Apache::lonlocal::texthash (
+ chac => 'Access dates to apply for selected users',
+ chse => 'Changes in section affiliation to apply to selected users',
+ fors => 'For student roles changing the section, will result in a section switch as students may only be in one section of a course at a time.',
+ forn => 'For a role in a course that is not a student role, a user may have roles in more than one section of a course at a time.',
+ reta => "Retain each user's current section affiliations?",
+ dnap => '(Does not apply to student roles).',
+ );
+ my ($date_items,$headertext);
+ if ($env{'form.bulkaction'} eq 'chgsec') {
+ $headertext = $lt{'chse'};
+ } else {
+ $headertext = $lt{'chac'};
+ my $starttime;
+ if (($env{'form.bulkaction'} eq 'activate') ||
+ ($env{'form.bulkaction'} eq 'reenable')) {
+ $starttime = time;
+ }
+ $date_items = &date_setting_table($starttime,undef,$context,
+ $env{'form.bulkaction'});
+ }
+ $output .= '
'.$headertext.'
'.
+ '';
+ return $output;
+}
+
sub results_header_row {
my ($rolefilter,$statusmode,$context) = @_;
my ($description,$showfilter);
@@ -2113,8 +2525,7 @@ sub results_header_row {
$description = &mt('Course - ').$env{'course.'.$env{'request.course.id'}.'.description'}.': ';
if ($statusmode eq 'Expired') {
$description .= &mt('Users in course with expired [_1] roles',$showfilter);
- }
- if ($statusmode eq 'Future') {
+ } elsif ($statusmode eq 'Future') {
$description .= &mt('Users in course with future [_1] roles',$showfilter);
} elsif ($statusmode eq 'Active') {
$description .= &mt('Users in course with active [_1] roles',$showfilter);
@@ -2851,36 +3262,226 @@ sub print_expire_menu {
# ================================================================== Phase four
-sub expire_user_list {
- my ($r,$context) = @_;
+sub update_user_list {
+ my ($r,$context,$setting,$choice) = @_;
+ my $now = time;
my $count=0;
- my @droplist = &Apache::loncommon::get_env_multiple('form.droplist');
- foreach (@droplist) {
- my ($uname,$udom)=split(/\:/,$_);
- # drop student
- my $result = &modifystudent($udom,$uname,$env{'request.course.id'});
+ my @changelist;
+ if ($choice ne '') {
+ @changelist = &Apache::loncommon::get_env_multiple('form.actionlist');
+ } else {
+ @changelist = &Apache::loncommon::get_env_multiple('form.droplist');
+ }
+ my %result_text = ( ok => { 'revoke' => 'Revoked',
+ 'delete' => 'Deleted',
+ 'reenable' => 'Re-enabled',
+ 'activate' => 'Activated',
+ },
+ error => {'revoke' => 'revoking',
+ 'delete' => 'deleting',
+ 'reenable' => 're-enabling',
+ 'activate' => 'activating',
+ },
+ );
+ my ($startdate,$enddate);
+ if ($choice eq 'chgdates' || $choice eq 'reenable' || $choice eq 'activate') {
+ ($startdate,$enddate) = &get_dates_from_form();
+ }
+ foreach my $item (@changelist) {
+ my ($role,$uname,$udom,$cid,$sec,$scope,$result,$type,$locktype,@sections,
+ $scopestem);
+ if ($context eq 'course') {
+ ($uname,$udom,$role,$sec,$type,$locktype) = split(/\:/,$item,-1);
+ $cid = $env{'request.course.id'};
+ $scopestem = '/'.$cid;
+ $scopestem =~s/\_/\//g;
+ if ($sec eq '') {
+ $scope = $scopestem;
+ } else {
+ $scope = $scopestem.'/'.$sec;
+ }
+ } elsif ($context eq 'construction_space') {
+ ($uname,$udom,$role) = split(/\:/,$item,-1);
+ $scope = '/'.$env{'user.domain'}.'/'.$env{'user.name'};
+ } elsif ($context eq 'domain') {
+ if ($setting eq 'domain') {
+ ($role,$uname,$udom) = split(/\:/,$item,-1);
+ $scope = '/'.$env{'request.role.domain'}.'/';
+ } elsif ($setting eq 'construction_space') {
+ ($uname,$udom,$role,$scope) = split(/\:/,$item);
+ } elsif ($setting eq 'course') {
+ ($uname,$udom,$role,$cid,$sec,$type,$locktype) =
+ split(/\:/,$item);
+ $scope = '/'.$cid;
+ $scope =~s/\_/\//g;
+ if ($sec ne '') {
+ $scope .= '/'.$sec;
+ }
+ }
+ }
+ my $plrole = &Apache::lonnet::plaintext($role);
+ my ($uid,$first,$middle,$last,$gene,$sec);
+ my $start = $env{'form.'.$item.'_start'};
+ my $end = $env{'form.'.$item.'_end'};
+ # revoke or delete user role
+ if ($choice eq 'revoke') {
+ $end = $now;
+ if ($role eq 'st') {
+ $result =
+ &Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,$sec,$end,$start,$type,$locktype,$cid);
+ } else {
+ $result =
+ &Apache::lonnet::revokerole($udom,$uname,$scope,$role);
+ }
+ } elsif ($choice eq 'delete') {
+ $start = -1;
+ $end = -1;
+ if ($role eq 'st') {
+# FIXME - how does role deletion affect classlist?
+ &Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,$sec,$end,$start,$type,$locktype,$cid);
+ } else {
+ $result =
+ &Apache::lonnet::assignrole($udom,$uname,$scope,$role,$now,
+ 0,1);
+ }
+ } else {
+ #reenable, activate, change access dates or change section
+ if ($choice ne 'chgsec') {
+ $start = $startdate;
+ $end = $enddate;
+ }
+ if ($choice eq 'reenable') {
+ if ($role eq 'st') {
+ $result = &Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,$sec,$end,$start,$type,$locktype,$cid);
+ } else {
+ $result =
+ &Apache::lonnet::assignrole($udom,$uname,$scope,$role,$end,
+ $now);
+ }
+ } elsif ($choice eq 'activate') {
+ if ($role eq 'st') {
+ $result = &Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,$sec,$end,$start,$type,$locktype,$cid);
+ } else {
+ $result = &Apache::lonnet::assignrole($udom,$uname,$scope,$role,$end,
+ $now);
+ }
+ } elsif ($choice eq 'chgdates') {
+ if ($role eq 'st') {
+ $result = &Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,$sec,$end,$start,$type,$locktype,$cid);
+ } else {
+ $result = &Apache::lonnet::assignrole($udom,$uname,$scope,$role,$end,
+ $start);
+ }
+ } elsif ($choice eq 'chgsec') {
+ my (@newsecs,$revresult,$nochg,@retained);
+ if ($role ne 'cc') {
+ @newsecs = split(/,/,$env{'form.newsecs'});
+ }
+ # remove existing section if not to be retained.
+ if (!$env{'form.retainsec'}) {
+ if ($sec eq '') {
+ if (@newsecs == 0) {
+ $result = &mt('No change in section assignment (none)');
+ $nochg = 1;
+ }
+ } else {
+ if (!grep(/^\Q$sec\E$/,@newsecs)) {
+ $revresult =
+ &Apache::lonnet::revokerole($udom,$uname,$scope,$role);
+ } else {
+ push(@retained,$sec);
+ }
+ }
+ } else {
+ push(@retained,$sec);
+ }
+ # add new sections
+ if (@newsecs == 0) {
+ if (!$nochg) {
+ if ($sec ne '') {
+ if ($role eq 'st') {
+ $result =
+ &Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,undef,$end,$start,$type,$locktype,$cid);
+ } else {
+ my $newscope = $scopestem;
+ $result = &Apache::lonnet::assignrole($udom,$uname,$newscope,$role,$end,$start);
+ }
+ }
+ }
+ } else {
+ foreach my $newsec (@newsecs) {
+ if (!grep(/^\Q$newsec\E$/,@retained)) {
+ if ($role eq 'st') {
+ $result = &Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,$newsec,$end,$start,$type,$locktype,$cid);
+ } else {
+ my $newscope = $scopestem;
+ if ($newsec ne '') {
+ $newscope .= '/'.$newsec;
+ }
+ $result = &Apache::lonnet::assignrole($udom,$uname,
+ $newscope,$role,$end,$start);
+ }
+ }
+ }
+ }
+ }
+ }
if ($result eq 'ok' || $result eq 'ok:') {
- $r->print(&mt('Dropped [_1]',$uname.'@'.$udom).' ');
+ $r->print(&mt("$result_text{'ok'}{$choice} role of '[_1]' in [_2] for [_3]",
+ $plrole,$scope,$uname.':'.$udom).' ');
$count++;
} else {
$r->print(
- &mt('Error dropping [_1]:[_2]',$uname.'@'.$udom,$result).
- ' ');
+ &mt("Error $result_text{'error'}{$choice} [_1] in [_2] for [_3]:[_4]",
+ $plrole,$scope,$uname.':'.$udom,$result).' ');
+ }
+ }
+ $r->print('
'.&mt("$result_text{'ok'}{$choice} role(s) for [quant,_1,user,users,users].",$count).'
');
+ if ($count > 0) {
+ if ($choice eq 'revoke') {
+ $r->print('
'.&mt('Re-enabling will re-activate data for the role.
'));
+ }
+ # Flush the course logs so reverse user roles immediately updated
+ &Apache::lonnet::flushcourselogs();
+ }
+ if ($env{'form.makedatesdefault'}) {
+ if ($choice eq 'chgdates' || $choice eq 'reenable' || $choice eq 'activate') {
+ $r->print(&make_dates_default($startdate,$enddate));
}
}
- $r->print('
'.&mt('Dropped [_1] user(s).',$count).'
');
- $r->print('
'.&mt('Re-enrollment will re-activate data.')) if ($count);
}
-sub section_check_js {
- my $groupslist;
- my %curr_groups = &Apache::longroup::coursegroups();
- if (%curr_groups) {
- $groupslist = join('","',sort(keys(%curr_groups)));
+sub classlist_drop {
+ my ($scope,$uname,$udom,$now,$action) = @_;
+ my ($cdom,$cnum) = ($scope=~m{^/($match_domain)/($match_courseid)});
+ my $cid=$cdom.'_'.$cnum;
+ my $user = $uname.':'.$udom;
+ if ($action eq 'drop') {
+ if (!&active_student_roles($cnum,$cdom,$uname,$udom)) {
+ my $result =
+ &Apache::lonnet::cput('classlist',
+ { $user => $now },
+ $env{'course.'.$cid.'.domain'},
+ $env{'course.'.$cid.'.num'});
+ return &mt('Drop from classlist: [_1]',
+ ''.$result.'').' ';
+ }
}
+}
+
+sub active_student_roles {
+ my ($cnum,$cdom,$uname,$udom) = @_;
+ my %roles =
+ &Apache::lonnet::get_my_roles($uname,$udom,'userroles',
+ ['future','active'],['st']);
+ return exists($roles{"$cnum:$cdom:st"});
+}
+
+sub section_check_js {
+ my $groupslist= &get_groupslist();
return <<"END";
function validate(caller) {
- var groups = new Array("$groupslist");
+ var groups = new Array($groupslist);
var secname = caller.value;
if ((secname == 'all') || (secname == 'none')) {
alert("'"+secname+"' may not be used as the name for a section, as it is a reserved word.\\nPlease choose a different section name.");
@@ -2927,5 +3528,144 @@ sub set_login {
return $response;
}
+sub course_sections {
+ my ($sections_count,$role) = @_;
+ my $output = '';
+ my @sections = (sort {$a <=> $b} keys %{$sections_count});
+ if (scalar(@sections) == 1) {
+ $output = '