version 1.461.2.1, 2010/08/09 23:39:50
|
version 1.465, 2010/02/28 23:28:54
|
Line 254 sub page_start {
|
Line 254 sub page_start {
|
my $page_start = &Apache::loncommon::start_page($name,$extra_head, |
my $page_start = &Apache::loncommon::start_page($name,$extra_head, |
\%body_args); |
\%body_args); |
$page_start .= $pageheader; |
$page_start .= $pageheader; |
|
if (!defined($found{'body'}) |
unless ($env{'request.gcicontext'} eq 'buildtest') { |
&& $env{'request.state'} ne 'construct' |
if (!defined($found{'body'}) |
&& ($target eq 'web' || $target eq 'webgrade')) { |
&& $env{'request.state'} ne 'construct' |
|
&& ($target eq 'web' || $target eq 'webgrade')) { |
my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser(); |
|
if ($symb eq '' && !$publicuser) { |
my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser(); |
$page_start .= '<p class="LC_info">' |
if ($symb eq '' && !$publicuser) { |
.&mt('Browsing resource, all submissions are temporary.') |
$page_start .= '<p class="LC_info">' |
.'</p>'; |
.&mt('Browsing resource, all submissions are temporary.') |
|
.'</p>'; |
|
} |
|
} |
} |
} |
} |
|
|
Line 276 sub page_start {
|
Line 273 sub page_start {
|
my $form_tag_start; |
my $form_tag_start; |
if (!defined($found{'form'})) { |
if (!defined($found{'form'})) { |
$form_tag_start='<form name="lonhomework" enctype="multipart/form-data" method="post" action="'; |
$form_tag_start='<form name="lonhomework" enctype="multipart/form-data" method="post" action="'; |
my $uri = Apache::loncommon::inhibit_menu_check( |
my $uri = &Apache::loncommon::inhibit_menu_check( |
&Apache::lonenc::check_encrypt($env{'request.uri'})); |
&Apache::lonenc::check_encrypt($env{'request.uri'})); |
|
$uri = &HTML::Entities::encode($uri,'<>&"'); |
$form_tag_start.=$uri.'" '; |
$form_tag_start.=$uri.'" '; |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
$form_tag_start.=&Apache::edit::form_change_detection(); |
$form_tag_start.=&Apache::edit::form_change_detection(); |
Line 474 sub problem_web_to_edit_header {
|
Line 472 sub problem_web_to_edit_header {
|
".&option('exam' ,'problemtype').&mt("Exam Problem")."</option> |
".&option('exam' ,'problemtype').&mt("Exam Problem")."</option> |
".&option('problem','problemtype').&mt("Homework Problem")."</option> |
".&option('problem','problemtype').&mt("Homework Problem")."</option> |
".&option('survey' ,'problemtype').&mt("Survey Question")."</option> |
".&option('survey' ,'problemtype').&mt("Survey Question")."</option> |
|
".&option('surveycred' ,'problemtype').&mt("Survey Question (with credit)")."</option> |
|
".&option('anonsurvey' ,'problemtype').&mt("Anonymous Survey Question")."</option> |
|
".&option('anonsurveycred' ,'problemtype').&mt("Anonymous Survey Question (with credit)")."</option> |
".&option('practice' ,'problemtype').&mt("Practice Problem")."</option> |
".&option('practice' ,'problemtype').&mt("Practice Problem")."</option> |
</select> |
</select> |
</span> |
</span> |
Line 654 item store_aggregates()
|
Line 655 item store_aggregates()
|
|
|
sub store_aggregates { |
sub store_aggregates { |
my ($symb,$courseid) = @_; |
my ($symb,$courseid) = @_; |
my (%aggregate,%subtracker); |
my %aggregate; |
my $tracksub; |
|
if ($symb =~ m{^uploaded/gcitest/$LONCAPA::match_courseid/default_1261144274.sequence___\d+___gci/gci/}) { |
|
$tracksub = 1; |
|
} |
|
my @parts; |
my @parts; |
my $cdomain = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdomain = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cname = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cname = $env{'course.'.$env{'request.course.id'}.'.num'}; |
Line 673 sub store_aggregates {
|
Line 670 sub store_aggregates {
|
$Apache::lonhomework::results{'resource.'.$part.'.award'} |
$Apache::lonhomework::results{'resource.'.$part.'.award'} |
eq 'EXACT_ANS') { |
eq 'EXACT_ANS') { |
$aggregate{$symb."\0".$part."\0correct"} = 1; |
$aggregate{$symb."\0".$part."\0correct"} = 1; |
if ($tracksub) { |
|
$subtracker{$env{'user.name'}.':'.$env{'user.domain'}."\0correct"} ++; |
|
} |
|
} |
} |
if ($Apache::lonhomework::results{'resource.'.$part.'.tries'} == 1) { |
if ($Apache::lonhomework::results{'resource.'.$part.'.tries'} == 1) { |
$aggregate{$symb."\0".$part."\0users"} = 1; |
$aggregate{$symb."\0".$part."\0users"} = 1; |
Line 688 sub store_aggregates {
|
Line 682 sub store_aggregates {
|
} |
} |
} |
} |
$aggregate{$symb."\0".$part."\0attempts"} = 1; |
$aggregate{$symb."\0".$part."\0attempts"} = 1; |
if ($tracksub) { |
|
if ($Apache::lonhomework::type eq 'survey') { |
|
$subtracker{$env{'user.name'}.':'.$env{'user.domain'}."\0surveysubs"} ++; |
|
} else { |
|
$subtracker{$env{'user.name'}.':'.$env{'user.domain'}."\0attempts"} ++; |
|
} |
|
} |
|
} |
} |
if (keys (%aggregate) > 0) { |
if (keys (%aggregate) > 0) { |
&Apache::lonnet::cinc('nohist_resourcetracker',\%aggregate, |
&Apache::lonnet::cinc('nohist_resourcetracker',\%aggregate, |
$cdomain,$cname); |
$cdomain,$cname); |
} |
} |
if (keys(%subtracker) > 0) { |
|
&Apache::lonnet::cinc('nohist_submissiontracker',\%subtracker, |
|
$cdomain,$cname); |
|
} |
|
} |
} |
|
|
sub checkout_msg { |
sub checkout_msg { |
Line 935 sub start_problem {
|
Line 918 sub start_problem {
|
if ($env{'request.state'} ne "construct" && |
if ($env{'request.state'} ne "construct" && |
($symb eq '' || $Apache::lonhomework::type eq 'practice')) { |
($symb eq '' || $Apache::lonhomework::type eq 'practice')) { |
$form_tag_start.='<input type="hidden" name="rndseed" value="'. |
$form_tag_start.='<input type="hidden" name="rndseed" value="'. |
$rndseed.'" />'; |
$rndseed.'" />'. |
unless ($env{'request.gcicontext'} eq 'buildtest') { |
'<input type="submit" name="resetdata" |
$form_tag_start .= '<input type="submit" name="resetdata"'. |
value="'.&mt('New Problem Variation').'" />'; |
' value="'.&mt('New Problem Variation').'" />'; |
|
} |
|
if (exists($env{'form.username'})) { |
if (exists($env{'form.username'})) { |
$form_tag_start.= |
$form_tag_start.= |
'<input type="hidden" name="username" |
'<input type="hidden" name="username" |
value="'.$env{'form.username'}.'" />'; |
value="'.$env{'form.username'}.'" />'; |
} |
} |
unless ($env{'request.gcicontext'} eq 'buildtest') { |
if ($env{'request.role.adv'}) { |
if ($env{'request.role.adv'}) { |
$form_tag_start.= ' <label class="LC_nobreak">' |
$form_tag_start.= ' <label class="LC_nobreak">' |
.'<input type="checkbox" name="showallfoils"'; |
.'<input type="checkbox" name="showallfoils"'; |
if (defined($env{'form.showallfoils'})) { |
if (defined($env{'form.showallfoils'})) { |
$form_tag_start.=' checked="checked"'; |
$form_tag_start.=' checked="checked"'; |
} |
} |
$form_tag_start.= ' /> ' |
$form_tag_start.= ' /> ' |
.&mt('Show All Foils') |
.&mt('Show All Foils') |
.'</label>'; |
.'</label>'; |
} |
} |
|
} |
|
if ($Apache::lonhomework::type eq 'practice') { |
if ($Apache::lonhomework::type eq 'practice') { |
$form_tag_start.=&practice_problem_header(); |
$form_tag_start.=&practice_problem_header(); |
} |
} |
unless ($env{'request.gcicontext'} eq 'buildtest') { |
$form_tag_start.='<hr />'; |
$form_tag_start.='<hr />'; |
|
} |
|
} |
} |
|
|
($status,$accessmsg,my $slot_name,my $slot) = |
($status,$accessmsg,my $slot_name,my $slot) = |
Line 1152 sub end_problem {
|
Line 1129 sub end_problem {
|
'\textit{'.$duedate_text.'} '.$toc_line; |
'\textit{'.$duedate_text.'} '.$toc_line; |
} else { |
} else { |
$frontmatter.= $begin_doc.$toc_line; |
$frontmatter.= $begin_doc.$toc_line; |
if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';} |
if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { |
|
$frontmatter .= '\fbox{\textit{'.$weight.' pt}}'; |
|
} |
} |
} |
} else { |
} else { |
$frontmatter .= '\vskip 1mm\textit{'.$duedate_text.'} \\\\\\\\'.$startminipage; |
$frontmatter .= '\vskip 1mm\textit{'.$duedate_text.'} \\\\\\\\'.$startminipage; |
Line 1160 sub end_problem {
|
Line 1139 sub end_problem {
|
} else { |
} else { |
if (not $env{'request.symb'} =~ m/\.page_/) { |
if (not $env{'request.symb'} =~ m/\.page_/) { |
$frontmatter .= $begin_doc.$toc_line; |
$frontmatter .= $begin_doc.$toc_line; |
if (($Apache::lonhomework::type eq 'exam') and ($allow_print_points==1)) { $frontmatter .= '\fbox{\textit{'.$weight.' pt}}';} |
if (($Apache::lonhomework::type eq 'exam') and ($allow_print_points==1)) { |
|
$frontmatter .= '\fbox{\textit{'.$weight.' pt}}'; |
|
} |
} else { |
} else { |
$frontmatter .= '\vskip 1mm \\\\\\\\'.$startminipage; |
$frontmatter .= '\vskip 1mm \\\\\\\\'.$startminipage; |
} |
} |
Line 1802 sub start_part {
|
Line 1783 sub start_part {
|
'.disableexampointprint'}) eq 'yes') { |
'.disableexampointprint'}) eq 'yes') { |
$allow_print_points=0; |
$allow_print_points=0; |
} |
} |
if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';} |
if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { |
|
$result .= '\vskip 10mm\fbox{\textit{'.$weight.' pt}}'; |
|
|
|
} |
} elsif ($target eq 'web') { |
} elsif ($target eq 'web') { |
$result.='<a name="'.&escape($Apache::inputtags::part).'" />'; |
$result.='<a name="'.&escape($Apache::inputtags::part).'" />'; |
} |
} |
Line 1971 sub start_problemtype {
|
Line 1955 sub start_problemtype {
|
$result .=&Apache::edit::checked_arg('When used as type(s):','for', |
$result .=&Apache::edit::checked_arg('When used as type(s):','for', |
[ ['exam','Exam/Quiz Problem'], |
[ ['exam','Exam/Quiz Problem'], |
['survey','Survey'], |
['survey','Survey'], |
|
['surveycred','Survey (with credit)'], |
|
['anonsurvey','Anonymous Survey'], |
|
['anonsurveycred','Anonymous Survey (with credit)'], |
['problem','Homework Problem'], |
['problem','Homework Problem'], |
['practice','Practice Problem'] ] |
['practice','Practice Problem'] ] |
,$token); |
,$token); |