Diff for /loncom/homework/structuretags.pm between versions 1.520 and 1.523

version 1.520, 2014/09/14 15:21:43 version 1.523, 2014/11/21 18:04:57
Line 256  function image_response_click (which, e) Line 256  function image_response_click (which, e)
 }  }
   
 var submithandled = 0;  var submithandled = 0;
   var keypresshandled = 0;
   
 $(document).ready(function(){  $(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 ) {      $(document).delegate('form :submit', 'click', function( event ) {
         if ( $( this ).hasClass( "LC_hwk_submit" ) ) {          if ( $( this ).hasClass( "LC_hwk_submit" ) ) {
             var buttonId = this.id;              var buttonId = this.id;
             if (submithandled == 0) {              if (submithandled == 0) {
                 submithandled = 1;                  submithandled = 1;
                 $( "#msg_"+buttonId ).css({"display": "inline","background-color": "#87cefa",                  $( "#msg_"+buttonId ).css({"display": "inline","background-color": "#87cefa",
                                           "color": "black","padding": "2px"}) ;                                             "color": "black","padding": "2px"}) ;
                 $( ".LC_status_"+buttonId ).hide();                  if (( $(this.form).id == "LC_page" ) && ($('input[name="all_submit"]').length )) {
                 if (( $(this.form).id == "LC_page" ) && ($('input[name="all_submit"]').length )) {                                   if (buttonId != "all_submit") {
                     if (( "#"+buttonId+"_pressed" ).length) {                          $( ".LC_status_"+buttonId ).hide();
                         $( "#"+buttonId+"_pressed" ).val( "1" );                          if (( "#"+buttonId+"_pressed" ).length) {
                               $( "#"+buttonId+"_pressed" ).val( "1" );
                           }
                     }                      }
                   } else {
                       $( ".LC_status_"+buttonId ).hide();
                 }                  }
                 $(this.form).submit();                  $(this.form).submit();
                 $( this ).attr( "disabled", true);                  $( ".LC_hwk_submit" ).prop( "disabled", true);
                   $( ".LC_textline" ).prop( "readonly", "readonly");
                 event.preventDefault();                  event.preventDefault();
                 return true;                  return true;
             }              }
Line 874  sub initialize_storage { Line 897  sub initialize_storage {
   
 =item finalize_storage()  =item finalize_storage()
   
  Stores away the result has to a student's environment   Stores away the result hash to a student's environment
  checks form.grade_ for specific values, other wises stores   checks form.grade_ for specific values, otherwise stores
  to the running users environment   to the running user's environment.
  Will increment totals for attempts, students, and corrects   Will increment totals for attempts, students, and corrects
  if running user has student role.   if running user has student role.
   

Removed from v.1.520  
changed lines
  Added in v.1.523


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