version 1.474, 2010/08/08 02:00:50
|
version 1.478, 2010/11/03 17:06:28
|
Line 161 function setmode(form,probmode) {
|
Line 161 function setmode(form,probmode) {
|
ENDSCRIPT |
ENDSCRIPT |
} |
} |
|
|
|
sub file_delchk_js { |
|
my $delfilewarn = &mt('You have indicated you wish to delete some files previously included for submission.').'\\n'. |
|
&mt('Deleted files will not be graded.').' '. |
|
&mt('Submit Answer?'); |
|
return <<"ENDSCRIPT"; |
|
<script type="text/javascript"> |
|
function file_deletion_check(formname) { |
|
var str = new RegExp("^HWFILE.+_delete\$"); |
|
var delfilecount = 0; |
|
var elemnum = formname.elements.length; |
|
if (elemnum == 0) { |
|
return true; |
|
} |
|
for (i=0; i<formname.elements.length; i++) { |
|
var id = formname.elements[i].id; |
|
if (id != '') { |
|
if (str.test(id)) { |
|
if (formname.elements[i].type == 'checkbox') { |
|
if (formname.elements[i].checked) { |
|
delfilecount ++; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (delfilecount > 0) { |
|
if (confirm("$delfilewarn")) { |
|
return true; |
|
} else { |
|
return false; |
|
} |
|
} else { |
|
return true; |
|
} |
|
} |
|
</script> |
|
ENDSCRIPT |
|
} |
|
|
sub page_start { |
sub page_start { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$name, |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$name, |
$extra_head)=@_; |
$extra_head)=@_; |
Line 185 sub page_start {
|
Line 224 sub page_start {
|
); |
); |
$extra_head .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args); |
$extra_head .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args); |
} |
} |
|
my $is_task = ($env{'request.uri'} =~ /\.task$/); |
|
if ($is_task) { |
|
$extra_head .= &file_delchk_js(); |
|
} |
|
|
my %body_args; |
my %body_args; |
if (defined($found{'html'})) { |
if (defined($found{'html'})) { |
Line 277 sub page_start {
|
Line 320 sub page_start {
|
if ($target eq 'edit') { |
if ($target eq 'edit') { |
$form_tag_start.=&Apache::edit::form_change_detection(); |
$form_tag_start.=&Apache::edit::form_change_detection(); |
} |
} |
|
if ($is_task) { |
|
$form_tag_start .= ' onsubmit="return file_deletion_check(this);"'; |
|
} |
$form_tag_start.='>'."\n"; |
$form_tag_start.='>'."\n"; |
|
|
my $symb=&Apache::lonnet::symbread(); |
my $symb=&Apache::lonnet::symbread(); |
Line 783 sub init_problem_globals {
|
Line 829 sub init_problem_globals {
|
&Apache::lonhomework::reset_show_problem_status(); |
&Apache::lonhomework::reset_show_problem_status(); |
$Apache::lonhomework::ignore_response_errors=1; |
$Apache::lonhomework::ignore_response_errors=1; |
} |
} |
|
@Apache::functionplotresponse::callscripts=(); |
@Apache::inputtags::responselist = (); |
@Apache::inputtags::responselist = (); |
@Apache::inputtags::importlist = (); |
@Apache::inputtags::importlist = (); |
@Apache::inputtags::previous=(); |
@Apache::inputtags::previous=(); |
Line 810 sub reset_problem_globals {
|
Line 857 sub reset_problem_globals {
|
undef($Apache::lonhomework::type); |
undef($Apache::lonhomework::type); |
undef($Apache::lonhomework::scantronmode); |
undef($Apache::lonhomework::scantronmode); |
undef($Apache::lonhomework::ignore_response_errors); |
undef($Apache::lonhomework::ignore_response_errors); |
|
undef(@Apache::functionplotresponse::callscripts); |
&Apache::lonhomework::reset_show_problem_status(); |
&Apache::lonhomework::reset_show_problem_status(); |
} |
} |
|
|
Line 1202 sub end_problem {
|
Line 1250 sub end_problem {
|
} |
} |
} |
} |
} |
} |
|
if ($target eq 'web') { |
|
$result.=&Apache::functionplotresponse::init_script(); |
|
} |
if ($target eq 'grade') { |
if ($target eq 'grade') { |
&Apache::lonhomework::showhash(%Apache::lonhomework::results); |
&Apache::lonhomework::showhash(%Apache::lonhomework::results); |
&finalize_storage(); |
&finalize_storage(); |
Line 1835 sub start_part {
|
Line 1886 sub start_part {
|
|
|
} |
} |
} elsif ($target eq 'web') { |
} elsif ($target eq 'web') { |
$result.='<a name="'.&escape($Apache::inputtags::part).'" />'; |
$result.='<a name="'.&escape($Apache::inputtags::part).'" ></a>'; |
} |
} |
} |
} |
} |
} |