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

version 1.508, 2012/09/12 05:14:09 version 1.520, 2014/09/14 15:21:43
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;
   
   $(document).ready(function(){
       $(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"}) ;
                   $( ".LC_status_"+buttonId ).hide();
                   if (( $(this.form).id == "LC_page" ) && ($('input[name="all_submit"]').length )) {             
                       if (( "#"+buttonId+"_pressed" ).length) {
                           $( "#"+buttonId+"_pressed" ).val( "1" );
                       }
                   }
                   $(this.form).submit();
                   $( this ).attr( "disabled", true);
                   event.preventDefault();
                   return true;
               }
           }
       });
   });
   
 // ]]>  // ]]>
 </script>  </script>
 JS  JS
Line 379  sub page_start { Line 405  sub page_start {
     } elsif (!defined($found{'body'})       } elsif (!defined($found{'body'}) 
      && $env{'request.state'} eq 'construct') {       && $env{'request.state'} eq 'construct') {
  if ($target eq 'web' || $target eq 'edit') {   if ($target eq 'web' || $target eq 'edit') {
         # Breadcrumbs for Construction Space          # Breadcrumbs for Authoring Space
         &Apache::lonhtmlcommon::clear_breadcrumbs();          &Apache::lonhtmlcommon::clear_breadcrumbs();
         &Apache::lonhtmlcommon::add_breadcrumb({          &Apache::lonhtmlcommon::add_breadcrumb({
             'text'  => 'Construction Space',              'text'  => 'Authoring Space',
             'href'  => &Apache::loncommon::authorspace($env{'request.uri'}),              'href'  => &Apache::loncommon::authorspace($env{'request.uri'}),
         });          });
         # breadcrumbs (and tools) will be created           # breadcrumbs (and tools) will be created 
Line 414  sub page_start { Line 440  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 453  sub page_start { Line 481  sub page_start {
         }          }
  $form_tag_start.='>'."\n";   $form_tag_start.='>'."\n";
   
  my $symb=&Apache::lonnet::symbread();  
  if ($symb =~ /\S/) {   if ($symb =~ /\S/) {
     $symb=      $symb=
  &HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb));   &HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb));
Line 638  sub problem_edit_header { Line 665  sub problem_edit_header {
 '.&Apache::lonxml::message_location().'  '.&Apache::lonxml::message_location().'
 </div>  </div>
 '.  '.
        '<table border="0" width="100%"><tr><td bgcolor="#F8F8F8">';         '<table id="LC_edit_problem_colorful" border="0" width="100%"><tr><td bgcolor="#F8F8F8">';
 }  }
   
 sub problem_edit_footer {  sub problem_edit_footer {
Line 711  sub problem_web_to_edit_header { Line 738  sub problem_web_to_edit_header {
 ".&mt("Problem Type:")."  ".&mt("Problem Type:")."
 <select name='problemtype'>  <select name='problemtype'>
   <option value=''></option>    <option value=''></option>
   ".&option('exam'   ,'problemtype').&mt("Exam Problem")."</option>    ".&option('exam'   ,'problemtype').&mt("Bubblesheet Exam Problem")."</option>
   ".&option('problem','problemtype').&mt("Homework Problem")."</option>    ".&option('problem','problemtype').&mt("Homework Problem")."</option>
   ".&option('survey' ,'problemtype').&mt("Survey Question")."</option>    ".&option('survey' ,'problemtype').&mt("Survey Question")."</option>
   ".&option('surveycred' ,'problemtype').&mt("Survey Question (with credit)")."</option>    ".&option('surveycred' ,'problemtype').&mt("Survey Question (with credit)")."</option>
Line 729  $show_all Line 756  $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 967  sub checkout_msg { Line 994  sub checkout_msg {
  'resource'=>'The resource needs to be checked out',   'resource'=>'The resource needs to be checked out',
  'id_expln'=>'As a resource gets checked out, a unique timestamped ID is given to it, and a permanent record is left in the system.',   'id_expln'=>'As a resource gets checked out, a unique timestamped ID is given to it, and a permanent record is left in the system.',
                 'warning'=>'Checking out resources is subject to course policies, and may exclude future credit even if done erroneously.',                  'warning'=>'Checking out resources is subject to course policies, and may exclude future credit even if done erroneously.',
                 'checkout'=>'Check out Exam for Viewing',                  'checkout'=>'Check out Bubblesheet Exam for Viewing',
  'checkout?'=>'Check out Exam?');   'checkout?'=>'Check out Bubblesheet Exam?');
     my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'});      my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'});
     return (<<ENDCHECKOUT);      return (<<ENDCHECKOUT);
 <h2>$lt{'resource'}</h2>  <h2>$lt{'resource'}</h2>
Line 976  sub checkout_msg { Line 1003  sub checkout_msg {
 <p class="LC_warning">$lt{'warning'}</p>  <p class="LC_warning">$lt{'warning'}</p>
 <form name="checkout" method="post" action="$uri">  <form name="checkout" method="post" action="$uri">
 <input type="hidden" name="doescheckout" value="yes" />  <input type="hidden" name="doescheckout" value="yes" />
 <input type="button" name="checkoutbutton" value="$lt{'checkout'}" onClick="javascript:if (confirm('$lt{'checkout?'}')) { document.checkout.submit(); }" />  <input type="button" name="checkoutbutton" value="$lt{'checkout'}" onclick="javascript:if (confirm('$lt{'checkout?'}')) { document.checkout.submit(); }" />
 </form>  </form>
 ENDCHECKOUT  ENDCHECKOUT
 }  }
Line 1010  sub firstaccess_msg { Line 1037  sub firstaccess_msg {
     $result .= (<<ENDCHECKOUT);      $result .= (<<ENDCHECKOUT);
 <form name="markaccess" method="post" action="$uri">  <form name="markaccess" method="post" action="$uri">
 <input type="hidden" name="markaccess" value="yes" />  <input type="hidden" name="markaccess" value="yes" />
 <input type="button" name="accessbutton" value="$buttontext" onClick="javascript:if (confirm('$timertext')) { document.markaccess.submit(); }" />  <input type="button" name="accessbutton" value="$buttontext" onclick="javascript:if (confirm('$timertext')) { document.markaccess.submit(); }" />
 </form>  </form>
 ENDCHECKOUT  ENDCHECKOUT
     return $result;      return $result;
Line 1169  sub start_problem { Line 1196  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 2058  sub end_while { Line 2085  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,'');
     }      }
Line 2497  sub start_problemtype { Line 2530  sub start_problemtype {
     ['hide','Hide']]      ['hide','Hide']]
    ,$token);     ,$token);
  $result .=&Apache::edit::checked_arg('When used as type(s):','for',   $result .=&Apache::edit::checked_arg('When used as type(s):','for',
      [ ['exam','Exam/Quiz Problem'],       [ ['exam','Bubblesheet Exam/Quiz Problem'],
        ['survey','Survey'],         ['survey','Survey'],
                                                ['surveycred','Survey (with credit)'],                                                 ['surveycred','Survey (with credit)'],
                                                ['anonsurvey','Anonymous Survey'],                                                 ['anonsurvey','Anonymous Survey'],
Line 2544  sub end_startouttext { Line 2577  sub end_startouttext {
                  .'<td><span class="LC_nobreak">'.&mt('Delete?').' '                   .'<td><span class="LC_nobreak">'.&mt('Delete?').' '
                  .&Apache::edit::deletelist($target,$token)                   .&Apache::edit::deletelist($target,$token)
                  .'</span></td>'                   .'</span></td>'
          .'<td align="left"><span id="math_'.$areaid.'" />'           .'<td><span id="math_'.$areaid.'">'
  .&Apache::lonhtmlcommon::dragmath_button($areaid,1)   .&Apache::lonhtmlcommon::dragmath_button($areaid,1)
  .'<span></td>'   .'</span></td>'
  .'<td>'   .'<td>'
  .&Apache::edit::insertlist($target,$token)   .&Apache::edit::insertlist($target,$token)
  .'</td>'   .'</td>'
          .'<td align="right" valign="top">' .           .'<td class="LC_edit_problem_latexhelper">' .
          &Apache::loncommon::helpLatexCheatsheet().           &Apache::loncommon::helpLatexCheatsheet().
  &Apache::edit::end_row().   &Apache::edit::end_row().
                  &Apache::edit::start_spanning_row()."\n".                   &Apache::edit::start_spanning_row()."\n".

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


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