Diff for /loncom/homework/templates/sampleexternal.pl between versions 1.2 and 1.3

version 1.2, 2011/04/29 00:32:11 version 1.3, 2012/02/04 15:12:40
Line 46  my $message=''; Line 46  my $message='';
 foreach my $testcase (split(/\,/,$FORM{'LONCAPA_correct_answer'})) {  foreach my $testcase (split(/\,/,$FORM{'LONCAPA_correct_answer'})) {
    my ($value,$result)=split(/\=/,$testcase);     my ($value,$result)=split(/\=/,$testcase);
 # Execute the student code and call the expected function  # Execute the student code and call the expected function
    my $studentanswer=$compartment->reval($FORM{'LONCAPA_student_response'}.'&factorial('.$value.')');     my $studentanswer=$compartment->reval(
   $FORM{'somecode'}."\n".
   $FORM{'LONCAPA_student_response'}."\n".
   '&factorial('.$value.')'
   );
 # A syntax error occurred  # A syntax error occurred
    if ($@) {     if ($@) {
       $award='WRONG_FORMAT';        $award='WRONG_FORMAT';
Line 86  foreach my $testcase (split(/\,/,$FORM{' Line 90  foreach my $testcase (split(/\,/,$FORM{'
 #  #
 # For partial correctness, awarddetail needs to be ASSIGNED_SCORE  # For partial correctness, awarddetail needs to be ASSIGNED_SCORE
 # The partial score would be in <awarded>  # The partial score would be in <awarded>
   # The message is passed as unparsed character data, so embedded HTML
   # or entities do not get parsed by LON-CAPA's internal parser. Remove
   # the CDATA wrapper if you want the parser to process the message.
 #  #
   
 print (<<ENDOUT);  print (<<ENDOUT);
 <loncapagrade>  <loncapagrade>
     <awarddetail>$award</awarddetail>      <awarddetail>$award</awarddetail>
     <message>$message</message>      <message><![CDATA[$message]]></message>
     <awarded></awarded>      <awarded></awarded>
 </loncapagrade>  </loncapagrade>
 ENDOUT  ENDOUT

Removed from v.1.2  
changed lines
  Added in v.1.3


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