--- loncom/homework/templates/sampleexternal.pl 2010/12/20 18:14:18 1.1 +++ loncom/homework/templates/sampleexternal.pl 2013/09/11 10:29:58 1.4 @@ -46,7 +46,11 @@ my $message=''; foreach my $testcase (split(/\,/,$FORM{'LONCAPA_correct_answer'})) { my ($value,$result)=split(/\=/,$testcase); # 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 if ($@) { $award='WRONG_FORMAT'; @@ -61,6 +65,7 @@ foreach my $testcase (split(/\,/,$FORM{' } } +my $handbackurl = "Here will be the URL of the handbackfile"; # # ==== The remainder is sending results $award and $message back to LON-CAPA # @@ -83,12 +88,20 @@ foreach my $testcase (split(/\,/,$FORM{' # 'EXACT_ANS','COMMA_FAIL' # # plus a free-form $message. - +# +# For partial correctness, awarddetail needs to be ASSIGNED_SCORE +# The partial score would be in +# 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 (< $award - $message + + $handbackurl + ENDOUT exit;