version 1.300, 2008/11/25 13:16:17
|
version 1.304, 2009/03/04 16:00:14
|
Line 25
|
Line 25
|
# |
# |
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
|
|
=pod |
|
|
|
=head1 NAME |
|
|
|
Apache::lonhomework.pm |
|
|
|
=head1 SYNOPSIS |
|
|
|
handles requests for output, evaluation, and |
|
alteration of a homework resource |
|
|
|
This is part of the LearningOnline Network with CAPA project |
|
described at http://www.lon-capa.org. |
|
|
|
|
|
=head1 NOTABLE SUBROUTINES |
|
|
|
=cut |
|
|
|
|
|
package Apache::lonhomework; |
package Apache::lonhomework; |
use strict; |
use strict; |
Line 104 sub set_bubble_lines {
|
Line 85 sub set_bubble_lines {
|
} |
} |
} |
} |
|
|
=pod |
# |
|
# Decides what targets to render for. |
=item get_target() |
# Implicit inputs: |
|
# Various session environment variables: |
Decides what targets to render for. |
# request.state - published - is a /res/ resource |
Implicit inputs: |
# uploaded - is a /uploaded/ resource |
Various session environment variables: |
# contruct - is a /priv/ resource |
request.state - published - is a /res/ resource |
# form.grade_target - a form parameter requesting a specific target |
uploaded - is a /uploaded/ resource |
|
contruct - is a /priv/ resource |
|
form.grade_target - a form parameter requesting a specific target |
|
|
|
=cut |
|
|
|
sub get_target { |
sub get_target { |
&Apache::lonxml::debug("request.state = $env{'request.state'}"); |
&Apache::lonxml::debug("request.state = $env{'request.state'}"); |
if( defined($env{'form.grade_target'})) { |
if( defined($env{'form.grade_target'})) { |
Line 356 sub check_slot_access {
|
Line 331 sub check_slot_access {
|
return ($slotstatus,$datemsg,$slot_name,$returned_slot); |
return ($slotstatus,$datemsg,$slot_name,$returned_slot); |
} |
} |
|
|
|
# JB, 9/24/2002: Any changes in this function may require a change |
=pod |
# in lonnavmaps::resource::getDateStatus. |
|
|
=item check_access() |
|
|
|
JB, 9/24/2002: Any changes in this function may require a change |
|
in lonnavmaps::resource::getDateStatus. |
|
|
|
=cut |
|
|
|
sub check_access { |
sub check_access { |
my ($id) = @_; |
my ($id) = @_; |
my $date =''; |
my $date =''; |
Line 513 sub check_access {
|
Line 480 sub check_access {
|
|
|
return ($status,$datemsg); |
return ($status,$datemsg); |
} |
} |
|
# this should work exactly like the copy in lonnavmaps.pm |
|
|
=pod |
|
|
|
=item due_date() |
|
|
|
this should work exactly like the copy in lonnavmaps.pm |
|
|
|
=cut |
|
|
|
sub due_date { |
sub due_date { |
my ($part_id,$symb,$udom,$uname)=@_; |
my ($part_id,$symb,$udom,$uname)=@_; |
my $date; |
my $date; |
Line 913 sub editxmlmode {
|
Line 871 sub editxmlmode {
|
&renderpage($request,$file); |
&renderpage($request,$file); |
} else { |
} else { |
my ($rows,$cols) = &Apache::edit::textarea_sizes(\$problem); |
my ($rows,$cols) = &Apache::edit::textarea_sizes(\$problem); |
my $xml_help = '<table><tr><td>'. |
|
&Apache::loncommon::helpLatexCheatsheet("Problem_Editor_XML_Index", |
|
"Problem Editing Help"). |
|
'</td><td>'. |
|
&Apache::loncommon::help_open_menu(undef,undef,5,'Authoring'). |
|
'</td></tr></table>'; |
|
if ($cols > 80) { $cols = 80; } |
if ($cols > 80) { $cols = 80; } |
if ($cols < 70) { $cols = 70; } |
if ($cols < 70) { $cols = 70; } |
if ($rows < 20) { $rows = 20; } |
if ($rows < 20) { $rows = 20; } |
Line 947 sub editxmlmode {
|
Line 899 sub editxmlmode {
|
<table class="LC_edit_problem_header_title"><tr><td> |
<table class="LC_edit_problem_header_title"><tr><td> |
'.&mt('Problem Editing').&Apache::loncommon::help_open_topic('Problem_Editor_XML_Index').' |
'.&mt('Problem Editing').&Apache::loncommon::help_open_topic('Problem_Editor_XML_Index').' |
</td><td align="right"> |
</td><td align="right"> |
'.&Apache::loncommon::helpLatexCheatsheet().' |
'.&Apache::loncommon::helpLatexCheatsheet('Problem_LON-CAPA_Functions','Script Functions').' |
</td></tr> |
</td></tr> |
</table> |
</table> |
<div class="LC_edit_problem_discards"> |
<div class="LC_edit_problem_discards"> |
Line 980 sub editxmlmode {
|
Line 932 sub editxmlmode {
|
return ''; |
return ''; |
} |
} |
|
|
=pod |
# |
|
# Render the page in whatever target desired. |
=item renderpage() |
# |
|
|
Render the page in whatever target desired. |
|
|
|
=cut |
|
|
|
sub renderpage { |
sub renderpage { |
my ($request,$file,$targets,$return_string) = @_; |
my ($request,$file,$targets,$return_string) = @_; |
|
|
Line 1187 sub update_construct_style {
|
Line 1134 sub update_construct_style {
|
&& !defined($env{'form.newrandomization'})) { |
&& !defined($env{'form.newrandomization'})) { |
if ((!$env{'form.style_file'} && $env{'construct.style'}) |
if ((!$env{'form.style_file'} && $env{'construct.style'}) |
||$env{'form.clear_style_file'}) { |
||$env{'form.clear_style_file'}) { |
&Apache::lonnet::delenv('construct\\.style'); |
&Apache::lonnet::delenv('construct.style'); |
} elsif ($env{'form.style_file'} |
} elsif ($env{'form.style_file'} |
&& $env{'construct.style'} ne $env{'form.style_file'}) { |
&& $env{'construct.style'} ne $env{'form.style_file'}) { |
&Apache::lonnet::appenv({'construct.style' => |
&Apache::lonnet::appenv({'construct.style' => |