version 1.473, 2010/08/07 19:24:03
|
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 177 sub page_start {
|
Line 216 sub page_start {
|
$parstack,$parser,$safeeval); |
$parstack,$parser,$safeeval); |
} |
} |
|
|
$extra_head .= &homework_js(); |
$extra_head .= &homework_js(). |
|
&Apache::lonhtmlcommon::dragmath_js("EditMathPopup"); |
if ($env{'environment.wysiwygeditor'} eq 'on') { |
if (&Apache::lonhtmlcommon::htmlareabrowser()) { |
$extra_head .= &Apache::lonhtmlcommon::dragmath_js("FCKEditMathPopup"); |
my %textarea_args = ( |
} else { |
dragmath => 'math', |
$extra_head .= &Apache::lonhtmlcommon::dragmath_js("EditMathPopup"); |
); |
|
$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; |
Line 276 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 782 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 809 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 1201 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 1834 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>'; |
} |
} |
} |
} |
} |
} |
Line 2044 sub end_startouttext {
|
Line 2096 sub end_startouttext {
|
$result.=&Apache::edit::start_table($token)."<tr><td>".&mt('Text Block')."</td>" |
$result.=&Apache::edit::start_table($token)."<tr><td>".&mt('Text Block')."</td>" |
.'<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>' |
unless ($env{'environment.wysiwygeditor'} eq 'on') { |
.'<td align="left"><span id="math_'.$areaid.'" />' |
$result .= '<td align="left">' |
.&Apache::lonhtmlcommon::dragmath_button($areaid,1) |
.&Apache::lonhtmlcommon::dragmath_button($areaid,1) |
.'<span></td>' |
.'</td>' |
.'<td>' |
.'<td>' |
.&Apache::edit::insertlist($target,$token) |
.&Apache::edit::insertlist($target,$token) |
.'</td>' |
.'</td>'; |
.'<td align="right" valign="top">' . |
} |
&Apache::loncommon::helpLatexCheatsheet(). |
$result.='<td align="right" valign="top">' . |
|
&Apache::loncommon::helpLatexCheatsheet(). |
|
&Apache::edit::end_row(). |
&Apache::edit::end_row(). |
&Apache::edit::start_spanning_row()."\n". |
&Apache::edit::start_spanning_row()."\n". |
&Apache::edit::editfield($token->[1],$text,"",80,8,1); |
&Apache::edit::editfield($token->[1],$text,"",80,8,1); |