version 1.354, 2006/04/28 18:34:22
|
version 1.357, 2006/06/20 03:33:55
|
Line 38 use Apache::lonlocal;
|
Line 38 use Apache::lonlocal;
|
use Apache::lonxml; |
use Apache::lonxml; |
use Apache::lonenc(); |
use Apache::lonenc(); |
use Time::HiRes qw( gettimeofday tv_interval ); |
use Time::HiRes qw( gettimeofday tv_interval ); |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::structuretags',('block','languageblock','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','problemtype','startouttext','endouttext','simpleeditbutton','definetag')); |
&Apache::lonxml::register('Apache::structuretags',('block','languageblock','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','problemtype','startouttext','endouttext','simpleeditbutton','definetag')); |
} |
} |
Line 160 sub page_start {
|
Line 163 sub page_start {
|
$form_tag_start.=&Apache::edit::form_change_detection(); |
$form_tag_start.=&Apache::edit::form_change_detection(); |
} |
} |
$form_tag_start.='>'; |
$form_tag_start.='>'; |
|
|
|
my $symb=&Apache::lonnet::symbread(); |
|
if ($symb =~ /\S/) { |
|
$symb= |
|
&HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb)); |
|
$form_tag_start.= |
|
'<input type="hidden" name="symb" value="'.$symb.'" />'; |
|
} |
} |
} |
return ($page_start,$form_tag_start); |
return ($page_start,$form_tag_start); |
} |
} |
Line 331 Feedback Mode:
|
Line 342 Feedback Mode:
|
} |
} |
|
|
sub initialize_storage { |
sub initialize_storage { |
|
my ($given_symb) = @_; |
undef(%Apache::lonhomework::results); |
undef(%Apache::lonhomework::results); |
undef(%Apache::lonhomework::history); |
undef(%Apache::lonhomework::history); |
my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); |
my ($symb,$courseid,$domain,$name) = |
|
&Apache::lonxml::whichuser($given_symb); |
|
|
# anonymous users (CODEd exams) have no data |
# anonymous users (CODEd exams) have no data |
if ($name eq 'anonymous' |
if ($name eq 'anonymous' |
Line 373 sub initialize_storage {
|
Line 386 sub initialize_storage {
|
# Will increment totals for attempts, students, and corrects |
# Will increment totals for attempts, students, and corrects |
# if running user has student role. |
# if running user has student role. |
sub finalize_storage { |
sub finalize_storage { |
|
my ($given_symb) = @_; |
my $result; |
my $result; |
if (%Apache::lonhomework::results) { |
if (%Apache::lonhomework::results) { |
my @remove = grep(/^INTERNAL_/,keys(%Apache::lonhomework::results)); |
my @remove = grep(/^INTERNAL_/,keys(%Apache::lonhomework::results)); |
delete(@Apache::lonhomework::results{@remove}); |
delete(@Apache::lonhomework::results{@remove}); |
my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); |
my ($symb,$courseid,$domain,$name) = |
|
&Apache::lonxml::whichuser($given_symb); |
if ($env{'request.state'} eq 'construct' |
if ($env{'request.state'} eq 'construct' |
|| $symb eq '' |
|| $symb eq '' |
|| $Apache::lonhomework::type eq 'practice') { |
|| $Apache::lonhomework::type eq 'practice') { |
Line 1372 sub start_part {
|
Line 1387 sub start_part {
|
} |
} |
if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';} |
if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';} |
} elsif ($target eq 'web') { |
} elsif ($target eq 'web') { |
$result.='<a name="'.&Apache::lonnet::escape($Apache::inputtags::part).'" />'; |
$result.='<a name="'.&escape($Apache::inputtags::part).'" />'; |
} |
} |
} |
} |
} |
} |
Line 1625 sub start_simpleeditbutton {
|
Line 1640 sub start_simpleeditbutton {
|
$url=~s/\?.*$//; |
$url=~s/\?.*$//; |
my ($symb) = &Apache::lonxml::whichuser(); |
my ($symb) = &Apache::lonxml::whichuser(); |
$result='<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'. |
$result='<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'. |
'<a href="'.$url.'/smpedit?symb='.&Apache::lonnet::escape($symb).'">'.&mt('Edit').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). |
'<a href="'.$url.'/smpedit?symb='.&escape($symb).'">'.&mt('Edit').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). |
&Apache::loncommon::help_open_topic('Caching').'</td></tr></table><br />'; |
&Apache::loncommon::help_open_topic('Caching').'</td></tr></table><br />'; |
} |
} |
return $result; |
return $result; |