--- loncom/homework/structuretags.pm 2017/03/14 12:20:57 1.512.2.13 +++ loncom/homework/structuretags.pm 2020/06/03 18:40:33 1.512.2.13.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.512.2.13 2017/03/14 12:20:57 raeburn Exp $ +# $Id: structuretags.pm,v 1.512.2.13.2.2 2020/06/03 18:40:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -342,12 +342,12 @@ var postsubmit = '$postsubmit'; 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 (( \$(this.form).attr("id") == "LC_page" ) && (\$('input[name="all_submit"]').length )) { if (buttonId != "all_submit") { \$( ".LC_status_"+buttonId ).hide(); - if (( "#"+buttonId+"_pressed" ).length) { - \$( "#"+buttonId+"_pressed" ).val( "1" ); - } + } + if (( "#"+buttonId+"_pressed" ).length) { + \$( "#"+buttonId+"_pressed" ).val( "1" ); } } else { \$( ".LC_status_"+buttonId ).hide(); @@ -360,11 +360,9 @@ var postsubmit = '$postsubmit'; if (timeout > 0) { setTimeout(function(){ \$( "#msg_"+buttonId ).css({"display": "none"}); - if (( \$(this.form).id == "LC_page" ) && (\$('input[name="all_submit"]').length )) { - if (buttonId != "all_submit") { - if (( "#"+buttonId+"_pressed" ).length) { - \$( "#"+buttonId+"_pressed" ).val( "" ); - } + if (( \$(this.form).attr("id") == "LC_page" ) && (\$('input[name="all_submit"]').length )) { + if (( "#"+buttonId+"_pressed" ).length) { + \$( "#"+buttonId+"_pressed" ).val( "" ); } } \$( ".LC_hwk_submit" ).prop( "disabled", false); @@ -1525,7 +1523,8 @@ sub start_problem { $target eq 'tex') { if ($env{'form.markaccess'}) { my @interval=&Apache::lonnet::EXT("resource.0.interval"); - &Apache::lonnet::set_first_access($interval[1],$interval[0]); + my ($timelimit) = ($interval[0] =~ /^(\d+)/); + &Apache::lonnet::set_first_access($interval[1],$timelimit); } ($status,$accessmsg,$slot_name,$slot) =