version 1.481, 2010/12/20 18:33:20
|
version 1.486, 2011/01/18 21:45:32
|
Line 128 sub homework_js {
|
Line 128 sub homework_js {
|
&setmode_javascript(). |
&setmode_javascript(). |
<<'JS'; |
<<'JS'; |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
// <![CDATA[ |
function setSubmittedPart (part) { |
function setSubmittedPart (part) { |
this.document.lonhomework.submitted.value="part_"+part; |
this.document.lonhomework.submitted.value="part_"+part; |
} |
} |
Line 145 function image_response_click (which, e)
|
Line 146 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; |
} |
} |
|
// ]]> |
</script> |
</script> |
JS |
JS |
} |
} |
Line 153 JS
|
Line 154 JS
|
sub setmode_javascript { |
sub setmode_javascript { |
return <<"ENDSCRIPT"; |
return <<"ENDSCRIPT"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
// <![CDATA[ |
function setmode(form,probmode) { |
function setmode(form,probmode) { |
form.problemmode.value = probmode; |
form.problemmode.value = probmode; |
form.submit(); |
form.submit(); |
} |
} |
|
// ]]> |
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
} |
} |
|
|
sub file_delchk_js { |
sub file_delchk_js { |
my $delfilewarn = &mt('You have indicated you wish to delete some files previously included for submission.').'\\n'. |
my $delfilewarn = &mt('You have indicated you wish to remove some files previously included in your submission.').'\\n'. |
&mt('Deleted files will not be graded.').' '. |
&mt('Continue submission with these files removed?'); |
&mt('Submit Answer?'); |
|
return <<"ENDSCRIPT"; |
return <<"ENDSCRIPT"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
// <![CDATA[ |
function file_deletion_check(formname) { |
function file_deletion_check(formname) { |
var str = new RegExp("^HWFILE.+_delete\$"); |
|
var delfilecount = 0; |
|
var elemnum = formname.elements.length; |
var elemnum = formname.elements.length; |
if (elemnum == 0) { |
if (elemnum == 0) { |
return true; |
return true; |
} |
} |
for (i=0; i<formname.elements.length; i++) { |
var str = new RegExp("^HWFILE.+_delete\$"); |
|
var delboxes = new Array(); |
|
for (var i=0; i<formname.elements.length; i++) { |
var id = formname.elements[i].id; |
var id = formname.elements[i].id; |
if (id != '') { |
if (id != '') { |
if (str.test(id)) { |
if (str.test(id)) { |
if (formname.elements[i].type == 'checkbox') { |
if (formname.elements[i].type == 'checkbox') { |
if (formname.elements[i].checked) { |
if (formname.elements[i].checked) { |
delfilecount ++; |
delboxes.push(id); |
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
if (delfilecount > 0) { |
if (delboxes.length > 0) { |
if (confirm("$delfilewarn")) { |
if (confirm("$delfilewarn")) { |
return true; |
return true; |
} else { |
} else { |
|
for (var j=0; j<delboxes.length; j++) { |
|
formname.elements[delboxes[j]].checked = false; |
|
} |
return false; |
return false; |
} |
} |
} else { |
} else { |
return true; |
return true; |
} |
} |
} |
} |
|
// ]]> |
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
} |
} |
Line 2262 sub start_simpleeditbutton {
|
Line 2269 sub start_simpleeditbutton {
|
# .&mt('Note: it can take up to 10 minutes for changes to take effect for all users.') |
# .&mt('Note: it can take up to 10 minutes for changes to take effect for all users.') |
# .&Apache::loncommon::help_open_topic('Caching') |
# .&Apache::loncommon::help_open_topic('Caching') |
# .'</p>'; |
# .'</p>'; |
$result.=&Apache::lonhtmlcommon::start_funclist() |
$result.=&Apache::loncommon::head_subbox( |
|
&Apache::lonhtmlcommon::start_funclist() |
.&Apache::lonhtmlcommon::add_item_funclist( |
.&Apache::lonhtmlcommon::add_item_funclist( |
'<a href="'.$url.'/smpedit?symb='.&escape($symb).'">' |
'<a href="'.$url.'/smpedit?symb='.&escape($symb).'">' |
.&mt('Edit').'</a>') |
.&mt('Edit').'</a>') |
.&Apache::lonhtmlcommon::end_funclist(); |
.&Apache::lonhtmlcommon::end_funclist()); |
|
|
} |
} |
return $result; |
return $result; |