Diff for /loncom/homework/structuretags.pm between versions 1.515 and 1.522

version 1.515, 2013/09/05 12:07:29 version 1.522, 2014/09/16 13:28:30
Line 254  function image_response_click (which, e) Line 254  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;
 }  }
   
   var submithandled = 0;
   var keypresshandled = 0;
   
   $(document).ready(function(){
   
       $(document).keypress(function(event){
           var keycode = (event.keyCode ? event.keyCode : event.which);
           if ((keycode == '13') && (keypresshandled == 0)) {
               if ( $( document.activeElement ).hasClass("LC_textline") ) {
                   keypresshandled = 1;
                   var idsArray = $( document.activeElement ).attr("id").split(/HWVAL_/);
                   if (idsArray.length) {
                       event.preventDefault();
                       var itemsArray = idsArray[1].split(/_/);
                       var buttonId = idsArray[0]+'submit_'+itemsArray[0];
                       $("#"+buttonId).trigger("click");
                   }
               }
           }
       });
   
       $(document).delegate('form :submit', 'click', function( event ) {
           if ( $( this ).hasClass( "LC_hwk_submit" ) ) {
               var buttonId = this.id;
               if (submithandled == 0) {
                   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 (buttonId != "all_submit") {
                           $( ".LC_status_"+buttonId ).hide();
                           if (( "#"+buttonId+"_pressed" ).length) {
                               $( "#"+buttonId+"_pressed" ).val( "1" );
                           }
                       }
                   } else {
                       $( ".LC_status_"+buttonId ).hide();
                   }
                   $(this.form).submit();
                   $( ".LC_hwk_submit" ).prop( "disabled", true);
                   $( ".LC_textline" ).prop( "readonly", "readonly");
                   event.preventDefault();
                   return true;
               }
           }
       });
   });
   
 // ]]>  // ]]>
 </script>  </script>
 JS  JS
Line 414  sub page_start { Line 463  sub page_start {
         $body_args{'add_entries'}    = \%add_entries;          $body_args{'add_entries'}    = \%add_entries;
         if ( $env{'request.state'} eq   'construct') {          if ( $env{'request.state'} eq   'construct') {
             $body_args{'only_body'}  = 1;              $body_args{'only_body'}  = 1;
           } elsif ($target eq 'web') {
               $body_args{'print_suppress'} = 1;
         }          }
     }      }
     $body_args{'no_auto_mt_title'} = 1;      $body_args{'no_auto_mt_title'} = 1;
Line 728  $show_all Line 779  $show_all
 <select name='problemstatus'>  <select name='problemstatus'>
   <option value=''></option>    <option value=''></option>
   ".&option('yes','problemstatus').&mt("Show Feedback")."</option>    ".&option('yes','problemstatus').&mt("Show Feedback")."</option>
   ".&option('no', 'problemstatus').&mt("Don't Show Incorect/Correct Feedback")."</option>    ".&option('no', 'problemstatus').&mt("Don't Show Incorrect/Correct Feedback")."</option>
   ".&option('no_feedback_ever', 'problemstatus').&mt("Don't Show Any Feedback")."</option>    ".&option('no_feedback_ever', 'problemstatus').&mt("Don't Show Any Feedback")."</option>
 </select>  </select>
 </span>  </span>
Line 1168  sub start_problem { Line 1219  sub start_problem {
         $target eq 'tex') {          $target eq 'tex') {
         if ($env{'form.markaccess'}) {          if ($env{'form.markaccess'}) {
             my @interval=&Apache::lonnet::EXT("resource.0.interval");              my @interval=&Apache::lonnet::EXT("resource.0.interval");
             &Apache::lonnet::set_first_access($interval[1]);              &Apache::lonnet::set_first_access($interval[1],$interval[0]);
         }          }
   
         ($status,$accessmsg,$slot_name,$slot) =          ($status,$accessmsg,$slot_name,$slot) =
Line 2057  sub end_while { Line 2108  sub end_while {
     }      }
     $return = &Apache::run::run($code,$safeeval);      $return = &Apache::run::run($code,$safeeval);
  }   }
  if ($error) {          if ($error) {
     &Apache::lonxml::error('<pre>'.&mt('Code ran too long. It ran for more than').' '.$Apache::lonnet::perlvar{'lonScriptTimeout'}.' '.&mt('seconds occurred while running &lt;while&gt; on line').' '.$line.'</pre>');              &Apache::lonxml::error(
  }                  '<pre>'
                  .&mt('Code ran too long. It ran for more than [_1] seconds.',
                           $Apache::lonnet::perlvar{'lonScriptTimeout'})
                  .&mt('This occurred while running &lt;while&gt; on line [_1].',
                           $line)
                  .'</pre>');
           }
     } elsif ($target eq "edit") {      } elsif ($target eq "edit") {
  $result.= &Apache::edit::tag_end($target,$token,'');   $result.= &Apache::edit::tag_end($target,$token,'');
     }      }

Removed from v.1.515  
changed lines
  Added in v.1.522


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>