version 1.94, 2003/12/12 18:04:38
|
version 1.98, 2004/01/15 03:18:19
|
Line 25
|
Line 25
|
# |
# |
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
# (Handler to set parameters for assessments |
|
# |
|
# (Handler to resolve ambiguous file locations |
|
# |
|
# (TeX Content Handler |
|
# |
# |
############################################################### |
############################################################### |
############################################################## |
############################################################## |
Line 47 use Apache::lonlocal;
|
Line 42 use Apache::lonlocal;
|
############################################################### |
############################################################### |
############################################################### |
############################################################### |
sub header { |
sub header { |
my $bodytag=&Apache::loncommon::bodytag('Enrollment Manager'); |
my $bodytag=&Apache::loncommon::bodytag('Enrollment Manager'). |
|
&Apache::loncommon::help_open_faq(9). |
|
&Apache::loncommon::help_open_bug('Instructor Interface'); |
my $title = &mt('LON-CAPA Enrollment Manager'); |
my $title = &mt('LON-CAPA Enrollment Manager'); |
return(<<ENDHEAD); |
return(<<ENDHEAD); |
<html> |
<html> |
Line 148 sub print_main_menu {
|
Line 145 sub print_main_menu {
|
'view' => 'View Class List', |
'view' => 'View Class List', |
'drop' => 'Drop Students', |
'drop' => 'Drop Students', |
'populate' => 'Automated Enrollment Manager'); |
'populate' => 'Automated Enrollment Manager'); |
|
my %help=(); |
|
foreach ('Course_Drop_Student','Course_Add_Student', |
|
'Course_Modify_Student_Data','Course_View_Class_List', |
|
'Course_Create_Class_List') { |
|
$help{$_}=&Apache::loncommon::help_open_topic($_); |
|
} |
|
|
$r->print(<<END); |
$r->print(<<END); |
<p> |
<p> |
<font size="+1"> |
<font size="+1"> |
<a href="/adm/dropadd?action=upload">$Text{'upload'}</a> |
<a href="/adm/dropadd?action=upload">$Text{'upload'}</a> |
</font> |
</font>$help{'Course_Create_Class_List'} |
</p><p> |
</p><p> |
<font size="+1"> |
<font size="+1"> |
<a href="/adm/dropadd?action=enrollstudent">$Text{'enrollone'}</a> |
<a href="/adm/dropadd?action=enrollstudent">$Text{'enrollone'}</a> |
</font> |
</font>$help{'Course_Add_Student'} |
</p><p> |
</p><p> |
<font size="+1"> |
<font size="+1"> |
<a href="/adm/dropadd?action=modifystudent">$Text{'modify'}</a> |
<a href="/adm/dropadd?action=modifystudent">$Text{'modify'}</a> |
</font> |
</font>$help{'Course_Modify_Student_Data'} |
</p><p> |
</p><p> |
<font size="+1"> |
<font size="+1"> |
<a href="/adm/dropadd?action=classlist">$Text{'view'}</a> |
<a href="/adm/dropadd?action=classlist">$Text{'view'}</a> |
</font> |
</font>$help{'Course_View_Class_List'} |
</p><p> |
</p><p> |
<font size="+1"> |
<font size="+1"> |
<a href="/adm/dropadd?action=drop">$Text{'drop'}</a> |
<a href="/adm/dropadd?action=drop">$Text{'drop'}</a> |
</font> |
</font>$help{'Course_Drop_Student'} |
</p><p> |
</p><p> |
<font size="+1"> |
<font size="+1"> |
<a href="/adm/populate">$Text{'populate'}</a> |
<a href="/adm/populate">$Text{'populate'}</a> |
Line 232 sub print_upload_manager_header {
|
Line 235 sub print_upload_manager_header {
|
############################################################### |
############################################################### |
############################################################### |
############################################################### |
sub javascript_validations { |
sub javascript_validations { |
my ($mode,$krbdefdom)=@_; |
my ($mode,$krbdefdom,$curr_authtype,$curr_authfield)=@_; |
my $authheader; |
my $authheader; |
if ($mode eq 'auth') { |
if ($mode eq 'auth') { |
my %param = ( formname => 'studentform', |
my %param = ( formname => 'studentform', |
Line 242 sub javascript_validations {
|
Line 245 sub javascript_validations {
|
my %param = ( formname => 'ccrs', |
my %param = ( formname => 'ccrs', |
kerb_def_dom => $krbdefdom ); |
kerb_def_dom => $krbdefdom ); |
$authheader = &Apache::loncommon::authform_header(%param); |
$authheader = &Apache::loncommon::authform_header(%param); |
|
} elsif ($mode eq 'modifycourse') { |
|
my %param = ( formname => 'cmod', |
|
kerb_def_dom => $krbdefdom, |
|
mode => 'modifycourse', |
|
curr_authtype => $curr_authtype, |
|
curr_autharg => $curr_authfield ); |
|
$authheader = &Apache::loncommon::authform_header(%param); |
} |
} |
|
|
|
|
my %alert = &Apache::lonlocal::texthash |
my %alert = &Apache::lonlocal::texthash |
(username => 'You need to specify the username field.', |
(username => 'You need to specify the username field.', |
Line 260 sub javascript_validations {
|
Line 271 sub javascript_validations {
|
my $function_name =(<<END); |
my $function_name =(<<END); |
function verify_message (vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail) { |
function verify_message (vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail) { |
END |
END |
my $auth_checks = (<<END); |
my $auth_checks; |
var foundatype=0; |
if ($mode eq 'createcourse') { |
|
$auth_checks .= (<<END); |
|
if (vf.autoadds[0].checked == true) { |
|
if (current.radiovalue == null || current.radiovalue == 'nochange') { |
|
alert('$alert{'authen'}'); |
|
return; |
|
} |
|
} |
END |
END |
unless ($mode eq 'createcourse') { |
} else { |
$auth_checks .= (<<END); |
$auth_checks .= (<<END); |
|
var foundatype=0; |
if (founduname==0) { |
if (founduname==0) { |
alert('$alert{'username'}'); |
alert('$alert{'username'}'); |
return; |
return; |
} |
} |
END |
|
} |
|
$auth_checks .= (<<END); |
|
// alert('current.radiovalue = '+current.radiovalue); |
// alert('current.radiovalue = '+current.radiovalue); |
if (current.radiovalue == null || current.radiovalue == 'nochange') { |
if (current.radiovalue == null || current.radiovalue == 'nochange') { |
// They did not check any of the login radiobuttons. |
// They did not check any of the login radiobuttons. |
alert('$alert{'authen'}'); |
alert('$alert{'authen'}'); |
return; |
return; |
} |
} |
|
END |
|
} |
|
if ($mode eq 'createcourse') { |
|
$auth_checks .= " |
|
if ( (vf.autoadds[0].checked == true) && |
|
(vf.elements[current.argfield].value == null || vf.elements[current.argfield].value == '') ) { |
|
"; |
|
} elsif ($mode eq 'modifycourse') { |
|
$auth_checks .= " |
|
if (vf.elements[current.argfield].value == null || vf.elements[current.argfield].value == '') { |
|
"; |
|
} |
|
if ( ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) { |
|
$auth_checks .= (<<END); |
|
var alertmsg = ''; |
|
switch (current.radiovalue) { |
|
case 'krb': |
|
alertmsg = '$alert{'krb'}'; |
|
break; |
|
default: |
|
alertmsg = ''; |
|
} |
|
if (alertmsg != '') { |
|
alert(alertmsg); |
|
return; |
|
} |
|
} |
|
END |
|
} else { |
|
$auth_checks .= (<<END); |
foundatype=1; |
foundatype=1; |
if (current.argfield == null || current.argfield == '') { |
if (current.argfield == null || current.argfield == '') { |
var alertmsg = ''; |
var alertmsg = ''; |
Line 301 END
|
Line 347 END
|
} |
} |
} |
} |
END |
END |
|
} |
my $optional_checks = ''; |
my $optional_checks = ''; |
if ($mode eq 'createcourse') { |
if ( ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) { |
$optional_checks = (<<END); |
$optional_checks = (<<END); |
vf.submit(); |
vf.submit(); |
} |
} |
Line 345 END
|
Line 392 END
|
END |
END |
} |
} |
my $result = $function_name; |
my $result = $function_name; |
if ( ($mode eq 'auth') || ($mode eq 'createcourse') ) { |
if ( ($mode eq 'auth') || ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) { |
$result .= $auth_checks; |
$result .= $auth_checks; |
} |
} |
$result .= $optional_checks; |
$result .= $optional_checks; |
if ( ($mode eq 'auth') || ($mode eq 'createcourse') ) { |
if ( ($mode eq 'auth') || ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) { |
$result .= $authheader; |
$result .= $authheader; |
} |
} |
return $result; |
return $result; |
Line 543 sub print_upload_manager_footer {
|
Line 590 sub print_upload_manager_footer {
|
'of Conflicting IDs (only do if you know what you are doing)'). |
'of Conflicting IDs (only do if you know what you are doing)'). |
"\n</p><p>\n"; |
"\n</p><p>\n"; |
$Str .= '<input type="button" onClick="javascript:verify(this.form)" '. |
$Str .= '<input type="button" onClick="javascript:verify(this.form)" '. |
'value="Update Courselist" />'."<br />\n"; |
'value="Update Class List" />'."<br />\n"; |
$Str .= &mt('Note: for large courses, this operation may be time '. |
$Str .= &mt('Note: for large courses, this operation may be time '. |
'consuming'); |
'consuming'); |
$r->print($Str); |
$r->print($Str); |