version 1.504, 2012/04/11 11:40:00
|
version 1.525, 2014/11/28 18:23:04
|
Line 254 function image_response_click (which, e)
|
Line 254 function image_response_click (which, e)
|
input_element.value = click; |
input_element.value = click; |
img_element.src = '/adm/randomlabel.png?token='+token+'&clickdata='+click; |
img_element.src = '/adm/randomlabel.png?token='+token+'&clickdata='+click; |
} |
} |
|
|
|
var submithandled = 0; |
|
var keypresshandled = 0; |
|
|
|
$(document).ready(function(){ |
|
|
|
$(document).keypress(function(event){ |
|
var keycode = (event.keyCode ? event.keyCode : event.which); |
|
if ((keycode == '13') && (keypresshandled == 0)) { |
|
if ( $( document.activeElement ).hasClass("LC_textline") ) { |
|
keypresshandled = 1; |
|
var idsArray = $( document.activeElement ).attr("id").split(/HWVAL_/); |
|
if (idsArray.length) { |
|
event.preventDefault(); |
|
var itemsArray = idsArray[1].split(/_/); |
|
var buttonId = idsArray[0]+'submit_'+itemsArray[0]; |
|
$("#"+buttonId).trigger("click"); |
|
} |
|
} |
|
} |
|
}); |
|
|
|
$(document).delegate('form :submit', 'click', function( event ) { |
|
if ( $( this ).hasClass( "LC_hwk_submit" ) ) { |
|
var buttonId = this.id; |
|
if (submithandled == 0) { |
|
submithandled = 1; |
|
$( "#msg_"+buttonId ).css({"display": "inline","background-color": "#87cefa", |
|
"color": "black","padding": "2px"}) ; |
|
if (( $(this.form).id == "LC_page" ) && ($('input[name="all_submit"]').length )) { |
|
if (buttonId != "all_submit") { |
|
$( ".LC_status_"+buttonId ).hide(); |
|
if (( "#"+buttonId+"_pressed" ).length) { |
|
$( "#"+buttonId+"_pressed" ).val( "1" ); |
|
} |
|
} |
|
} else { |
|
$( ".LC_status_"+buttonId ).hide(); |
|
} |
|
$(this.form).submit(); |
|
$( ".LC_hwk_submit" ).prop( "disabled", true); |
|
$( ".LC_textline" ).prop( "readonly", "readonly"); |
|
event.preventDefault(); |
|
return true; |
|
} |
|
} |
|
}); |
|
}); |
|
|
// ]]> |
// ]]> |
</script> |
</script> |
JS |
JS |
Line 370 sub page_start {
|
Line 419 sub page_start {
|
"if (typeof swmenu != 'undefined') {swmenu.currentURL=null;}\n". |
"if (typeof swmenu != 'undefined') {swmenu.currentURL=null;}\n". |
&Apache::loncommon::browser_and_searcher_javascript(). |
&Apache::loncommon::browser_and_searcher_javascript(). |
"\n</script>\n"; |
"\n</script>\n"; |
|
if ($target eq 'edit') { |
|
$extra_head .= &Apache::edit::js_update_linknum(); |
|
} |
} |
} |
} |
} |
|
|
Line 379 sub page_start {
|
Line 431 sub page_start {
|
} elsif (!defined($found{'body'}) |
} elsif (!defined($found{'body'}) |
&& $env{'request.state'} eq 'construct') { |
&& $env{'request.state'} eq 'construct') { |
if ($target eq 'web' || $target eq 'edit') { |
if ($target eq 'web' || $target eq 'edit') { |
# Breadcrumbs for Construction Space |
# Breadcrumbs for Authoring Space |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::add_breadcrumb({ |
&Apache::lonhtmlcommon::add_breadcrumb({ |
'text' => 'Construction Space', |
'text' => 'Authoring Space', |
'href' => &Apache::loncommon::authorspace($env{'request.uri'}), |
'href' => &Apache::loncommon::authorspace($env{'request.uri'}), |
}); |
}); |
# breadcrumbs (and tools) will be created |
# breadcrumbs (and tools) will be created |
Line 414 sub page_start {
|
Line 466 sub page_start {
|
$body_args{'add_entries'} = \%add_entries; |
$body_args{'add_entries'} = \%add_entries; |
if ( $env{'request.state'} eq 'construct') { |
if ( $env{'request.state'} eq 'construct') { |
$body_args{'only_body'} = 1; |
$body_args{'only_body'} = 1; |
|
} elsif ($target eq 'web') { |
|
$body_args{'print_suppress'} = 1; |
} |
} |
} |
} |
$body_args{'no_auto_mt_title'} = 1; |
$body_args{'no_auto_mt_title'} = 1; |
Line 453 sub page_start {
|
Line 507 sub page_start {
|
} |
} |
$form_tag_start.='>'."\n"; |
$form_tag_start.='>'."\n"; |
|
|
my $symb=&Apache::lonnet::symbread(); |
|
if ($symb =~ /\S/) { |
if ($symb =~ /\S/) { |
$symb= |
$symb= |
&HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb)); |
&HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb)); |
Line 638 sub problem_edit_header {
|
Line 691 sub problem_edit_header {
|
'.&Apache::lonxml::message_location().' |
'.&Apache::lonxml::message_location().' |
</div> |
</div> |
'. |
'. |
'<table border="0" width="100%"><tr><td bgcolor="#F8F8F8">'; |
'<table id="LC_edit_problem_colorful" border="0" width="100%"><tr><td bgcolor="#F8F8F8">'; |
} |
} |
|
|
sub problem_edit_footer { |
sub problem_edit_footer { |
Line 711 sub problem_web_to_edit_header {
|
Line 764 sub problem_web_to_edit_header {
|
".&mt("Problem Type:")." |
".&mt("Problem Type:")." |
<select name='problemtype'> |
<select name='problemtype'> |
<option value=''></option> |
<option value=''></option> |
".&option('exam' ,'problemtype').&mt("Exam Problem")."</option> |
".&option('exam' ,'problemtype').&mt("Bubblesheet 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('surveycred' ,'problemtype').&mt("Survey Question (with credit)")."</option> |
Line 729 $show_all
|
Line 782 $show_all
|
<select name='problemstatus'> |
<select name='problemstatus'> |
<option value=''></option> |
<option value=''></option> |
".&option('yes','problemstatus').&mt("Show Feedback")."</option> |
".&option('yes','problemstatus').&mt("Show Feedback")."</option> |
".&option('no', 'problemstatus').&mt("Don't Show Incorect/Correct Feedback")."</option> |
".&option('no', 'problemstatus').&mt("Don't Show Incorrect/Correct Feedback")."</option> |
".&option('no_feedback_ever', 'problemstatus').&mt("Don't Show Any Feedback")."</option> |
".&option('no_feedback_ever', 'problemstatus').&mt("Don't Show Any Feedback")."</option> |
</select> |
</select> |
</span> |
</span> |
Line 847 sub initialize_storage {
|
Line 900 sub initialize_storage {
|
|
|
=item finalize_storage() |
=item finalize_storage() |
|
|
Stores away the result has to a student's environment |
Stores away the result hash to a student's environment; |
checks form.grade_ for specific values, other wises stores |
checks form.grade_ for specific values, otherwise stores |
to the running users environment |
to the running user's environment. |
Will increment totals for attempts, students, and corrects |
|
if running user has student role. |
&check_correctness_changes() is called in two circumstances |
|
in which the results hash is to be stored permanently, for |
|
grading triggered by a student's submission, where feedback on |
|
correctness is to be provided to the student. |
|
|
|
1. Immediately prior to storing the results hash |
|
|
|
To handle the case where a student's submission (and award) were |
|
stored after history was retrieved in &initialize_storage(), e.g., |
|
if a student submitted answers in quick succession (e.g., from |
|
multiple tabs). &Apache::inputtags::hidealldata() is called for |
|
any parts with out-of-order storage (i.e., correct then incorrect, |
|
where awarded >= 1 when correct). |
|
|
|
2. Immediately after storing the results hash |
|
|
|
To handle the case where lond on the student's homeserver returns |
|
delay:N -- where N is the number of transactions between the last |
|
retrieved in &initialize_storage() and the last stored immediately |
|
before permanent storage of the current transaction via |
|
lond::store_handler(). &Apache::grades::makehidden() is called |
|
for any parts with out-of-order storage (i.e., correct then incorrect, |
|
where awarded >= 1 when correct). |
|
|
|
Will call &store_aggregates() to increment totals for attempts, |
|
students, and corrects, if running user has student role. |
|
|
=cut |
=cut |
|
|
|
|
Line 873 sub finalize_storage {
|
Line 951 sub finalize_storage {
|
$namespace,'',$domain,$name); |
$namespace,'',$domain,$name); |
&Apache::lonxml::debug('Construct Store return message:'.$result); |
&Apache::lonxml::debug('Construct Store return message:'.$result); |
} else { |
} else { |
|
my ($laststore,$checkedparts,@parts,%postcorrect); |
|
if (($env{'user.name'} eq $name) && ($env{'user.domain'} eq $domain) && |
|
(!$Apache::lonhomework::scantronmode) && (!defined($env{'form.grade_symb'})) && |
|
(!defined($env{'form.grade_courseid'}))) { |
|
if ($Apache::lonhomework::history{'version'}) { |
|
$laststore = $Apache::lonhomework::history{'version'}.'='. |
|
$Apache::lonhomework::history{'timestamp'}; |
|
} else { |
|
$laststore = '0=0'; |
|
} |
|
my %record = &Apache::lonnet::restore($symb,$courseid,$domain,$name); |
|
if ($record{'version'}) { |
|
my ($newversion,$oldversion,$oldtimestamp); |
|
if ($Apache::lonhomework::history{'version'}) { |
|
$oldversion = $Apache::lonhomework::history{'version'}; |
|
$oldtimestamp = $Apache::lonhomework::history{'timestamp'}; |
|
} else { |
|
$oldversion = 0; |
|
$oldtimestamp = 0; |
|
} |
|
if ($record{'version'} > $oldversion) { |
|
if ($record{'timestamp'} >= $oldtimestamp) { |
|
$laststore = $record{'version'}.'='.$record{'timestamp'}; |
|
$newversion = $record{'version'} + 1; |
|
$checkedparts = 1; |
|
foreach my $key (keys(%Apache::lonhomework::results)) { |
|
if ($key =~ /^resource\.([^\.]+)\.solved$/) { |
|
my $part = $1; |
|
if ($Apache::lonhomework::results{$key} eq 'incorrect_attempted') { |
|
push(@parts,$part); |
|
} |
|
} |
|
} |
|
if (@parts) { |
|
my @parts_to_hide = &check_correctness_changes($symb,$courseid,$domain,$name, |
|
\%record,\@parts,$newversion, |
|
$oldversion); |
|
if (@parts_to_hide) { |
|
foreach my $part (@parts_to_hide) { |
|
$postcorrect{$part} = 1; |
|
&Apache::inputtags::hidealldata($part); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
$result=&Apache::lonnet::cstore(\%Apache::lonhomework::results, |
$result=&Apache::lonnet::cstore(\%Apache::lonhomework::results, |
$symb,$courseid,$domain,$name); |
$symb,$courseid,$domain,$name,$laststore); |
|
if ($result =~ /^delay\:(\d+)$/) { |
|
my $numtrans = $1; |
|
my ($oldversion) = split(/=/,$laststore); |
|
if ($numtrans) { |
|
my $newversion = $oldversion + 1 + $numtrans; |
|
my @possparts; |
|
if ($checkedparts) { |
|
foreach my $part (@parts) { |
|
unless ($postcorrect{$part}) { |
|
push(@possparts,$part); |
|
} |
|
} |
|
} else { |
|
foreach my $key (keys(%Apache::lonhomework::results)) { |
|
if ($key =~ /^resource\.([^\.]+)\.solved$/) { |
|
my $part = $1; |
|
unless ($postcorrect{$part}) { |
|
if ($Apache::lonhomework::results{$key} eq 'incorrect_attempted') { |
|
push(@possparts,$part); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (@possparts) { |
|
my %newrecord = &Apache::lonnet::restore($symb,$courseid,$domain,$name); |
|
my @parts_to_hide = &check_correctness_changes($symb,$courseid,$domain,$name, |
|
\%newrecord,\@possparts,$newversion, |
|
$oldversion); |
|
if (@parts_to_hide) { |
|
my $partslist = join(',',@parts_to_hide); |
|
&Apache::grades::makehidden($newversion,$partslist,\%newrecord,$symb,$domain,$name,1); |
|
} |
|
} |
|
} |
|
} |
&Apache::lonxml::debug('Store return message:'.$result); |
&Apache::lonxml::debug('Store return message:'.$result); |
&store_aggregates($symb,$courseid); |
&store_aggregates($symb,$courseid); |
} |
} |
Line 886 sub finalize_storage {
|
Line 1048 sub finalize_storage {
|
|
|
=pod |
=pod |
|
|
|
=item check_correctness_changes() |
|
|
|
For all parts for which current results contain a solved status |
|
of "incorrect_attempted", check if there was a transaction in which |
|
solved was set to "correct_by_student" in the time since the last |
|
transaction (retrieved when &initialize_storage() was called i.e., |
|
when &start_problem() was called), unless: |
|
(a) questiontype parameter is set to survey or anonymous survey (+/- credit) |
|
(b) problemstatus is set to no or no_feedback_ever |
|
If such a transaction exists, and did not occur after "reset status" |
|
by a user with grading privileges, then the current transaction is an |
|
example of an out-of-order transaction (i.e., incorrect occurring after |
|
correct). Accordingly, the current transaction should be hidden. |
|
|
|
=cut |
|
|
|
|
|
sub check_correctness_changes { |
|
my ($symb,$courseid,$domain,$name,$record,$parts,$newversion,$oldversion) = @_; |
|
my @parts_to_hide; |
|
unless ((ref($record) eq 'HASH') && (ref($parts) eq 'ARRAY')) { |
|
return @parts_to_hide; |
|
} |
|
if (@{$parts}) { |
|
my $usec; |
|
if (($env{'user.name'} eq $name) && ($env{'user.domain'} eq $domain) && |
|
($env{'request.course.id'} eq $courseid)) { |
|
$usec = $env{'request.course.sec'}; |
|
} else { |
|
$usec = &Apache::lonnet::getsection($domain,$name,$courseid); |
|
} |
|
foreach my $id (@{$parts}) { |
|
next if (($Apache::lonhomework::results{'resource.'.$id.'.type'} =~ /survey/) || |
|
(&Apache::lonnet::EXT("resource.$id.problemstatus",$symb, |
|
$domain,$name,$usec,undef,$courseid) =~ /^no/)); |
|
my $reset; |
|
for (my $i=$newversion-1; $i>=$oldversion; $i--) { |
|
if (($record->{$i.':resource.'.$id.'.regrader'}) && |
|
($record->{$i.':resource.'.$id.'.tries'} eq '') && |
|
($record->{$i.':resource.'.$id.'.award'} eq '')) { |
|
$reset = 1; |
|
} elsif (($record->{$i.":resource.$id.solved"} eq 'correct_by_student') && |
|
($record->{$i.":resource.$id.awarded"} >= 1)) { |
|
unless ($reset) { |
|
push(@parts_to_hide,$id); |
|
last; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return @parts_to_hide; |
|
} |
|
|
|
=pod |
|
|
item store_aggregates() |
item store_aggregates() |
|
|
Sends hash of values to be incremented in nohist_resourcetracker.db |
Sends hash of values to be incremented in nohist_resourcetracker.db |
Line 967 sub checkout_msg {
|
Line 1185 sub checkout_msg {
|
'resource'=>'The resource needs to be checked out', |
'resource'=>'The resource needs to be checked out', |
'id_expln'=>'As a resource gets checked out, a unique timestamped ID is given to it, and a permanent record is left in the system.', |
'id_expln'=>'As a resource gets checked out, a unique timestamped ID is given to it, and a permanent record is left in the system.', |
'warning'=>'Checking out resources is subject to course policies, and may exclude future credit even if done erroneously.', |
'warning'=>'Checking out resources is subject to course policies, and may exclude future credit even if done erroneously.', |
'checkout'=>'Check out Exam for Viewing', |
'checkout'=>'Check out Bubblesheet Exam for Viewing', |
'checkout?'=>'Check out Exam?'); |
'checkout?'=>'Check out Bubblesheet Exam?'); |
my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); |
my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); |
return (<<ENDCHECKOUT); |
return (<<ENDCHECKOUT); |
<h2>$lt{'resource'}</h2> |
<h2>$lt{'resource'}</h2> |
Line 976 sub checkout_msg {
|
Line 1194 sub checkout_msg {
|
<p class="LC_warning">$lt{'warning'}</p> |
<p class="LC_warning">$lt{'warning'}</p> |
<form name="checkout" method="post" action="$uri"> |
<form name="checkout" method="post" action="$uri"> |
<input type="hidden" name="doescheckout" value="yes" /> |
<input type="hidden" name="doescheckout" value="yes" /> |
<input type="button" name="checkoutbutton" value="$lt{'checkout'}" onClick="javascript:if (confirm('$lt{'checkout?'}')) { document.checkout.submit(); }" /> |
<input type="button" name="checkoutbutton" value="$lt{'checkout'}" onclick="javascript:if (confirm('$lt{'checkout?'}')) { document.checkout.submit(); }" /> |
</form> |
</form> |
ENDCHECKOUT |
ENDCHECKOUT |
} |
} |
Line 996 sub firstaccess_msg {
|
Line 1214 sub firstaccess_msg {
|
} elsif ($interval[1] eq 'course') { |
} elsif ($interval[1] eq 'course') { |
my $course = $env{'course.'.$env{'request.course.id'}.'.description'}; |
my $course = $env{'course.'.$env{'request.course.id'}.'.description'}; |
$result .= "<h2>".&mt('The resources in "[_1]" are open for a limited time.',$course)."</h2>" |
$result .= "<h2>".&mt('The resources in "[_1]" are open for a limited time.',$course)."</h2>" |
.'<p>'.&mt('Once you click the "Show Resource" button below you have [_2] to omplete all resources "[_1]".' |
.'<p>'.&mt('Once you click the "Show Resource" button below you have [_2] to complete all resources "[_1]".' |
,$course,$time)."</p>"; |
,$course,$time)."</p>"; |
} else { |
} else { |
my $title=&Apache::lonnet::gettitle($symb); |
my $title=&Apache::lonnet::gettitle($symb); |
Line 1010 sub firstaccess_msg {
|
Line 1228 sub firstaccess_msg {
|
$result .= (<<ENDCHECKOUT); |
$result .= (<<ENDCHECKOUT); |
<form name="markaccess" method="post" action="$uri"> |
<form name="markaccess" method="post" action="$uri"> |
<input type="hidden" name="markaccess" value="yes" /> |
<input type="hidden" name="markaccess" value="yes" /> |
<input type="button" name="accessbutton" value="$buttontext" onClick="javascript:if (confirm('$timertext')) { document.markaccess.submit(); }" /> |
<input type="button" name="accessbutton" value="$buttontext" onclick="javascript:if (confirm('$timertext')) { document.markaccess.submit(); }" /> |
</form> |
</form> |
ENDCHECKOUT |
ENDCHECKOUT |
return $result; |
return $result; |
Line 1160 sub start_problem {
|
Line 1378 sub start_problem {
|
&Apache::run::run($expression,$safeeval); |
&Apache::run::run($expression,$safeeval); |
my $status; |
my $status; |
my $accessmsg; |
my $accessmsg; |
|
my $resource_due; |
|
|
my $name= &get_resource_name($parstack,$safeeval); |
my $name= &get_resource_name($parstack,$safeeval); |
my ($result,$form_tag_start); |
my ($result,$form_tag_start,$slot_name,$slot); |
|
|
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || |
|
$target eq 'tex') { |
|
if ($env{'form.markaccess'}) { |
|
my @interval=&Apache::lonnet::EXT("resource.0.interval"); |
|
&Apache::lonnet::set_first_access($interval[1],$interval[0]); |
|
} |
|
|
|
($status,$accessmsg,$slot_name,$slot) = |
|
&Apache::lonhomework::check_slot_access('0','problem'); |
|
push (@Apache::inputtags::status,$status); |
|
} |
|
|
if ($target eq 'web' || $target eq 'webgrade' || $target eq 'tex' |
if ($target eq 'web' || $target eq 'webgrade' || $target eq 'tex' |
|| $target eq 'edit') { |
|| $target eq 'edit') { |
($result,$form_tag_start) = |
($result,$form_tag_start) = |
Line 1175 sub start_problem {
|
Line 1407 sub start_problem {
|
if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval,$target); } |
if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval,$target); } |
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || |
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || |
$target eq 'tex') { |
$target eq 'tex') { |
if ($env{'form.markaccess'}) { |
|
my @interval=&Apache::lonnet::EXT("resource.0.interval"); |
|
&Apache::lonnet::set_first_access($interval[1]); |
|
} |
|
my $resource_due = &Apache::lonhomework::due_date(0, $env{'request.symb'}); |
|
my $time_left = $resource_due - time(); |
|
if ($resource_due && ($time_left > 0) && ($target eq 'web')) { |
|
$result .= &Apache::lonhtmlcommon::set_due_date($resource_due); |
|
} |
|
|
|
|
|
($status,$accessmsg,my $slot_name,my $slot) = |
|
&Apache::lonhomework::check_slot_access('0','problem'); |
|
push (@Apache::inputtags::status,$status); |
|
|
|
#handle rand seed in construction space |
#handle rand seed in construction space |
my $rndseed=&setup_rndseed($safeeval,$target); |
my $rndseed=&setup_rndseed($safeeval,$target); |
Line 1298 sub start_problem {
|
Line 1516 sub start_problem {
|
'problem'); |
'problem'); |
} |
} |
} elsif ($target eq 'web') { |
} elsif ($target eq 'web') { |
if ($status eq 'CAN_ANSWER' |
if ($status eq 'CAN_ANSWER') { |
&& $slot_name ne '' |
$resource_due = &Apache::lonhomework::due_date(0, $env{'request.symb'}); |
&& $Apache::lonhomework::history{'resource.0.checkedin'} eq '') { |
if ($slot_name ne '') { |
# unproctored slot access, self checkin |
my $checked_in = |
&Apache::bridgetask::check_in('problem',undef,undef, |
$Apache::lonhomework::history{'resource.0.checkedin'}; |
$slot_name); |
if ($checked_in eq '') { |
} |
# unproctored slot access, self checkin |
|
&Apache::bridgetask::check_in('problem',undef,undef, |
|
$slot_name); |
|
$checked_in = |
|
$Apache::lonhomework::results{"resource.0.checkedin"}; |
|
} |
|
if ((ref($slot) eq 'HASH') && ($checked_in ne '')) { |
|
if ($slot->{'starttime'} < time()) { |
|
if (!$resource_due) { |
|
$resource_due = $slot->{'endtime'}; |
|
} elsif ($slot->{'endtime'} < $resource_due) { |
|
$resource_due = $slot->{'endtime'}; |
|
} |
|
} |
|
} |
|
} |
|
if ($resource_due) { |
|
my $time_left = $resource_due - time(); |
|
if ($resource_due && ($time_left > 0) && ($target eq 'web')) { |
|
$result .= &Apache::lonhtmlcommon::set_due_date($resource_due); |
|
} |
|
} |
|
} |
$result.="\n $form_tag_start \t". |
$result.="\n $form_tag_start \t". |
'<input type="hidden" name="submitted" value="yes" />'; |
'<input type="hidden" name="submitted" value="yes" />'; |
# create a page header and exit |
# create a page header and exit |
Line 1490 sub end_problem {
|
Line 1730 sub end_problem {
|
$result.="</form>"; |
$result.="</form>"; |
} |
} |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result.= &Apache::loncommon::end_page({'discussion' => 1}); |
# |
|
# Closing </body></html> not added by end_page(). |
|
# Added separately at end of this routine, after added |
|
# <script></script> so document will be valid xhtml. |
|
# |
|
$result.= &Apache::loncommon::end_page({'discussion' => 1, |
|
'notbody' => 1}); |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
my $endminipage = ''; |
my $endminipage = ''; |
if (not $env{'form.problem_split'}=~/yes/) { |
if (not $env{'form.problem_split'}=~/yes/) { |
Line 1548 sub end_problem {
|
Line 1794 sub end_problem {
|
# |
# |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result .= &Apache::lonhtmlcommon::set_compute_end_time(); |
$result .= &Apache::lonhtmlcommon::set_compute_end_time(); |
|
# |
|
# Closing tags delayed so any <script></script> tags |
|
# not in head can appear inside body, for valid xhtml. |
|
# |
|
$result .= "</body>\n</html>"; |
} |
} |
return $result; |
return $result; |
} |
} |
Line 2025 sub end_while {
|
Line 2276 sub end_while {
|
} |
} |
$return = &Apache::run::run($code,$safeeval); |
$return = &Apache::run::run($code,$safeeval); |
} |
} |
if ($error) { |
if ($error) { |
&Apache::lonxml::error('<pre>'.&mt('Code ran too long. It ran for more than').' '.$Apache::lonnet::perlvar{'lonScriptTimeout'}.' '.&mt('seconds occurred while running <while> on line').' '.$line.'</pre>'); |
&Apache::lonxml::error( |
} |
'<pre>' |
|
.&mt('Code ran too long. It ran for more than [_1] seconds.', |
|
$Apache::lonnet::perlvar{'lonScriptTimeout'}) |
|
.&mt('This occurred while running <while> on line [_1].', |
|
$line) |
|
.'</pre>'); |
|
} |
} elsif ($target eq "edit") { |
} elsif ($target eq "edit") { |
$result.= &Apache::edit::tag_end($target,$token,''); |
$result.= &Apache::edit::tag_end($target,$token,''); |
} |
} |
Line 2464 sub start_problemtype {
|
Line 2721 sub start_problemtype {
|
['hide','Hide']] |
['hide','Hide']] |
,$token); |
,$token); |
$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','Bubblesheet Exam/Quiz Problem'], |
['survey','Survey'], |
['survey','Survey'], |
['surveycred','Survey (with credit)'], |
['surveycred','Survey (with credit)'], |
['anonsurvey','Anonymous Survey'], |
['anonsurvey','Anonymous Survey'], |
Line 2511 sub end_startouttext {
|
Line 2768 sub end_startouttext {
|
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.&Apache::edit::deletelist($target,$token) |
.&Apache::edit::deletelist($target,$token) |
.'</span></td>' |
.'</span></td>' |
.'<td align="left"><span id="math_'.$areaid.'" />' |
.'<td><span id="math_'.$areaid.'">' |
.&Apache::lonhtmlcommon::dragmath_button($areaid,1) |
.&Apache::lonhtmlcommon::dragmath_button($areaid,1) |
.'<span></td>' |
.'</span></td>' |
.'<td>' |
.'<td>' |
.&Apache::edit::insertlist($target,$token) |
.&Apache::edit::insertlist($target,$token) |
.'</td>' |
.'</td>' |
.'<td align="right" valign="top">' . |
.'<td class="LC_edit_problem_latexhelper">' . |
&Apache::loncommon::helpLatexCheatsheet(). |
&Apache::loncommon::helpLatexCheatsheet(). |
&Apache::edit::end_row(). |
&Apache::edit::end_row(). |
&Apache::edit::start_spanning_row()."\n". |
&Apache::edit::start_spanning_row()."\n". |