version 1.347, 2004/11/29 22:45:51
|
version 1.350, 2004/12/09 23:45:59
|
Line 1338 ENDNOTFOUND
|
Line 1338 ENDNOTFOUND
|
if ($ENV{'form.editmode'} && (!($ENV{'form.viewmode'}))) { |
if ($ENV{'form.editmode'} && (!($ENV{'form.viewmode'}))) { |
my $displayfile=$request->uri; |
my $displayfile=$request->uri; |
$displayfile=~s/^\/[^\/]*//; |
$displayfile=~s/^\/[^\/]*//; |
$result='<html><body bgcolor="#FFFFFF">'. |
my $bodytag='<body bgcolor="#FFFFFF">'; |
|
if ($ENV{'environment.remote'} eq 'off') { |
|
$bodytag=&Apache::loncommon::bodytag(); |
|
} |
|
$result='<html>'.$bodytag. |
&Apache::lonxml::message_location().'<h3>'. |
&Apache::lonxml::message_location().'<h3>'. |
$displayfile. |
$displayfile. |
'</h3></body></html>'; |
'</h3></body></html>'; |
Line 1377 sub debug {
|
Line 1381 sub debug {
|
} |
} |
} |
} |
|
|
|
sub show_error_warn_msg { |
|
return (($Apache::lonxml::debug eq 1) || |
|
($ENV{'request.state'} eq 'construct') || |
|
($Apache::lonhomework::browse eq 'F' |
|
&& |
|
$ENV{'form.show_errors'} eq 'on')); |
|
} |
|
|
sub error { |
sub error { |
$errorcount++; |
$errorcount++; |
if (($Apache::lonxml::debug eq 1) || ($ENV{'request.state'} eq 'construct') ) { |
if ( &show_error_warn_msg() ) { |
# If printing in construction space, put the error inside <pre></pre> |
# If printing in construction space, put the error inside <pre></pre> |
push(@Apache::lonxml::error_messages, |
push(@Apache::lonxml::error_messages, |
$Apache::lonxml::warnings_error_header. |
$Apache::lonxml::warnings_error_header. |
Line 1419 sub warning {
|
Line 1431 sub warning {
|
$warningcount++; |
$warningcount++; |
|
|
if ($ENV{'form.grade_target'} ne 'tex') { |
if ($ENV{'form.grade_target'} ne 'tex') { |
if ($ENV{'request.state'} eq 'construct' || $Apache::lonxml::debug) { |
if ( &show_error_warn_msg() ) { |
my $request=$Apache::lonxml::request; |
my $request=$Apache::lonxml::request; |
if (!$request) { $request=Apache->request; } |
if (!$request) { $request=Apache->request; } |
push(@Apache::lonxml::warning_messages, |
push(@Apache::lonxml::warning_messages, |
Line 1584 sub whichuser {
|
Line 1596 sub whichuser {
|
my ($passedsymb)=@_; |
my ($passedsymb)=@_; |
my ($symb,$courseid,$domain,$name,$publicuser); |
my ($symb,$courseid,$domain,$name,$publicuser); |
if (defined($ENV{'form.grade_symb'})) { |
if (defined($ENV{'form.grade_symb'})) { |
my $tmp_courseid=$ENV{'form.grade_courseid'}; |
my ($tmp_courseid)= |
my $allowed=&Apache::lonnet::allowed('vgr',$tmp_courseid); |
&Apache::loncommon::get_env_multiple('form.grade_courseid'); |
if (!$allowed && |
my $allowed=&Apache::lonnet::allowed('vgr',$tmp_courseid); |
exists($ENV{'request.course.sec'}) && |
if (!$allowed && |
$ENV{'request.course.sec'} !~ /^\s*$/) { |
exists($ENV{'request.course.sec'}) && |
$allowed=&Apache::lonnet::allowed('vgr',$ENV{'form.grade_courseid'}. |
$ENV{'request.course.sec'} !~ /^\s*$/) { |
'/'.$ENV{'request.course.sec'}); |
$allowed=&Apache::lonnet::allowed('vgr',$tmp_courseid. |
} |
'/'.$ENV{'request.course.sec'}); |
if ($allowed) { |
} |
$symb=$ENV{'form.grade_symb'}; |
if ($allowed) { |
$courseid=$ENV{'form.grade_courseid'}; |
($symb)=&Apache::loncommon::get_env_multiple('form.grade_symb'); |
$domain=$ENV{'form.grade_domain'}; |
$courseid=$tmp_courseid; |
$name=$ENV{'form.grade_username'}; |
($domain)=&Apache::loncommon::get_env_multiple('form.grade_domain'); |
} |
($name)=&Apache::loncommon::get_env_multiple('form.grade_username'); |
} else { |
return ($symb,$courseid,$domain,$name,$publicuser); |
if (!$passedsymb) { |
|
$symb=&Apache::lonnet::symbread(); |
|
} else { |
|
$symb=$passedsymb; |
|
} |
} |
$courseid=$ENV{'request.course.id'}; |
} |
$domain=$ENV{'user.domain'}; |
if (!$passedsymb) { |
$name=$ENV{'user.name'}; |
$symb=&Apache::lonnet::symbread(); |
if ($name eq 'public' && $domain eq 'public') { |
} else { |
if (!defined($ENV{'form.username'})) { |
$symb=$passedsymb; |
$ENV{'form.username'}.=time.rand(10000000); |
} |
} |
$courseid=$ENV{'request.course.id'}; |
$name.=$ENV{'form.username'}; |
$domain=$ENV{'user.domain'}; |
|
$name=$ENV{'user.name'}; |
|
if ($name eq 'public' && $domain eq 'public') { |
|
if (!defined($ENV{'form.username'})) { |
|
$ENV{'form.username'}.=time.rand(10000000); |
} |
} |
|
$name.=$ENV{'form.username'}; |
} |
} |
return ($symb,$courseid,$domain,$name,$publicuser); |
return ($symb,$courseid,$domain,$name,$publicuser); |
} |
} |