version 1.94, 2003/12/12 18:04:38
|
version 1.96, 2003/12/27 23:38:13
|
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 232 sub print_upload_manager_header {
|
Line 227 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 237 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 263 END
|
Line 266 END
|
my $auth_checks = (<<END); |
my $auth_checks = (<<END); |
var foundatype=0; |
var foundatype=0; |
END |
END |
unless ($mode eq 'createcourse') { |
if ($mode eq 'createcourse') { |
|
$auth_checks .= (<<END); |
|
if (document.ccrs.autoadds[0].checked == true) { |
|
if (current.radiovalue == null || current.radiovalue == 'nochange') { |
|
alert('$alert{'authen'}'); |
|
return; |
|
} |
|
} |
|
END |
|
} else { |
$auth_checks .= (<<END); |
$auth_checks .= (<<END); |
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') || ($mode eq 'modifycourse') ) { |
|
$auth_checks .= " |
|
foundatype=1"; |
|
if ($mode eq 'createcourse') { |
|
$auth_checks .= " |
|
if ( (document.ccrs.autoadds[0].checked == true) && |
|
(document.ccrs.elements[current.argfield].value == null || document.ccrs.elements[current.argfield].value == '') ) {"; |
|
} elsif ($mode eq 'modifycourse') { |
|
$auth_checks .= " |
|
if (document.ccrs.elements[current.argfield].value == null || document.cmod.elements[current.argfield].value == '') }"; |
|
} |
|
$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 341 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 386 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 584 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); |