version 1.512.2.24.2.3, 2023/07/05 20:57:30
|
version 1.512.2.24.2.9, 2024/01/13 17:48:57
|
Line 273 sub homework_js {
|
Line 273 sub homework_js {
|
} |
} |
return &Apache::loncommon::resize_textarea_js(). |
return &Apache::loncommon::resize_textarea_js(). |
&Apache::loncommon::colorfuleditor_js(). |
&Apache::loncommon::colorfuleditor_js(). |
&setmode_javascript(). |
&Apache::lonxml::setmode_javascript(). |
<<"JS"; |
<<"JS"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
Line 385 var postsubmit = '$postsubmit';
|
Line 385 var postsubmit = '$postsubmit';
|
JS |
JS |
} |
} |
|
|
sub setmode_javascript { |
|
return <<"ENDSCRIPT"; |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
function setmode(form,probmode) { |
|
var initial = form.problemmode.value; |
|
form.problemmode.value = probmode; |
|
form.submit(); |
|
form.problemmode.value = initial; |
|
} |
|
// ]]> |
|
</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 600 sub page_start {
|
Line 585 sub page_start {
|
my ($symb,$courseid,$udom,$uname)=&Apache::lonnet::whichuser(); |
my ($symb,$courseid,$udom,$uname)=&Apache::lonnet::whichuser(); |
my ($path,$multiresp) = |
my ($path,$multiresp) = |
&Apache::loncommon::get_turnedin_filepath($symb,$uname,$udom); |
&Apache::loncommon::get_turnedin_filepath($symb,$uname,$udom); |
if (($is_task) || ($needs_upload)) { |
if ($env{'request.user_in_effect'}) { |
|
$form_tag_start .= ' onsubmit="preventDefault();"'; |
|
} elsif (($is_task) || ($needs_upload)) { |
$form_tag_start .= ' onsubmit="return file_submission_check(this,'."'$path','$multiresp'".');"'; |
$form_tag_start .= ' onsubmit="return file_submission_check(this,'."'$path','$multiresp'".');"'; |
} |
} |
$form_tag_start.='>'."\n"; |
$form_tag_start.='>'."\n"; |
Line 1381 sub needs_linkprot_passback {
|
Line 1368 sub needs_linkprot_passback {
|
$lti_in_use = $domlti{$itemnum}; |
$lti_in_use = $domlti{$itemnum}; |
} |
} |
my ($state,$others,$listed,$scope,$protect,$display,$target,$exit) = split(/,/,$deeplink); |
my ($state,$others,$listed,$scope,$protect,$display,$target,$exit) = split(/,/,$deeplink); |
my $passback; |
my ($passback,$pbscope); |
if ($scope eq 'resource') { |
if ($scope eq 'res') { |
if ($deeplink_symb eq $symb) { |
if ($deeplink_symb eq $symb) { |
$passback = 1; |
$passback = 1; |
|
$pbscope = 'resource'; |
} |
} |
} elsif ($scope eq 'map') { |
} elsif ($scope eq 'map') { |
if (&Apache::lonnet::clutter($deeplink_map) eq $map) { |
if (&Apache::lonnet::clutter($deeplink_map) eq $map) { |
$passback = 1; |
$passback = 1; |
|
$pbscope = 'nonrec'; |
|
} |
|
} elsif ($scope eq 'rec') { |
|
if (&Apache::lonnet::clutter($deeplink_map) eq $map) { |
|
$passback = 1; |
|
$pbscope = 'map'; |
|
} else { |
|
my @recurseup = &Apache::lonnet::get_map_hierarchy($map,$env{'request.course.id'}); |
|
if (grep(/^\Q$deeplink_map\E$/,@recurseup)) { |
|
$passback = 1; |
|
$pbscope = 'map'; |
|
} |
} |
} |
} elsif ($scope eq 'recurse') { |
|
#FIXME check if $deeplink_map contains $map |
|
$passback = 1; |
|
} |
} |
return ($passback,$scope,$deeplink_map,$deeplink_symb,$crsdef,$itemnum,$lti_in_use); |
return ($passback,$pbscope,$deeplink_map,$deeplink_symb,$crsdef,$itemnum,$lti_in_use); |
} |
} |
} |
} |
} |
} |
Line 1757 sub start_problem {
|
Line 1754 sub start_problem {
|
$firstaccres = $is_set; |
$firstaccres = $is_set; |
} |
} |
} |
} |
|
|
($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' |
Line 1768 sub start_problem {
|
Line 1761 sub start_problem {
|
($result,$form_tag_start,$probpartlist) = |
($result,$form_tag_start,$probpartlist) = |
&page_start($target,$token,$tagstack,$parstack,$parser,$safeeval, |
&page_start($target,$token,$tagstack,$parstack,$parser,$safeeval, |
$name); |
$name); |
} elsif (($target eq 'grade') && ($Apache::lonhomework::type eq 'randomizetry')) { |
} elsif ((($target eq 'grade') && ($Apache::lonhomework::type eq 'randomizetry')) || |
|
($target eq 'answer')) { |
my ($symb)= &Apache::lonnet::whichuser(); |
my ($symb)= &Apache::lonnet::whichuser(); |
if ($symb ne '') { |
if ($symb ne '') { |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
Line 1781 sub start_problem {
|
Line 1775 sub start_problem {
|
} |
} |
} |
} |
|
|
|
if (($target eq 'web') && ($env{'request.user_in_effect'})) { |
|
&Apache::lonxml::get_all_text("/problem",$parser,$style); |
|
return $result; |
|
} |
|
|
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || |
|
$target eq 'tex') { |
|
|
|
my ($symb)= &Apache::lonnet::whichuser(); |
|
($status,$accessmsg,$slot_name,$slot) = |
|
&Apache::lonhomework::check_slot_access('0','problem',$symb,$probpartlist); |
|
push (@Apache::inputtags::status,$status); |
|
} |
|
|
if ($target eq 'tex' and $env{'request.symb'} =~ m/\.page_/) {$result='';} |
if ($target eq 'tex' and $env{'request.symb'} =~ m/\.page_/) {$result='';} |
|
|
if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval,$target); } |
if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval,$target); } |
Line 2113 sub end_problem {
|
Line 2121 sub end_problem {
|
} |
} |
} |
} |
$result =~ s/INSERTTEXFRONTMATTERHERE/$frontmatter/; |
$result =~ s/INSERTTEXFRONTMATTERHERE/$frontmatter/; |
|
} elsif ($target eq 'web') { |
|
if ($env{'request.user_in_effect'}) { |
|
&reset_problem_globals('problem'); |
|
$result .= &Apache::lonhtmlcommon::set_compute_end_time(); |
|
return $result; |
|
} |
} |
} |
|
|
my $status=$Apache::inputtags::status['-1']; |
my $status=$Apache::inputtags::status['-1']; |
Line 2227 ENDJS
|
Line 2241 ENDJS
|
# computation: |
# computation: |
# |
# |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result .= &Apache::lonhtmlcommon::set_compute_end_time(); |
$result .= &Apache::lonhtmlcommon::dash_to_minus_js(). |
|
&Apache::lonhtmlcommon::set_compute_end_time(); |
# |
# |
# Closing tags delayed so any <script></script> tags |
# Closing tags delayed so any <script></script> tags |
# not in head can appear inside body, for valid xhtml. |
# not in head can appear inside body, for valid xhtml. |