aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2016-06-02 03:23:37 +0200
committerHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2017-06-15 19:39:15 +0200
commit254436df5a2719324196aa787e025fddd585d9c2 (patch)
treed846f3579831f9a87013636419e74bc3ae4651e2
parent428516e88d393145874343af508b831d1aa9c2f2 (diff)
downloadvipeval-254436df5a2719324196aa787e025fddd585d9c2.tar.gz
vipeval-254436df5a2719324196aa787e025fddd585d9c2.zip
Update score value parsing.
-rw-r--r--lib/result_event.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/result_event.rb b/lib/result_event.rb
index 478ccd7..31c807d 100644
--- a/lib/result_event.rb
+++ b/lib/result_event.rb
@@ -20,12 +20,12 @@ class ResultEvent
end
end
- points= -1
+ points= "-1"
result["Result"]["elements"].each do |e|
case e["MIMEtype"]
when "text/plain"
- if (val=e["value"]).strip.start_with?("*** Score:")
- points= val.strip.split(":")[1].to_i
+ if e["value"] =~ /\*\*\*\s*Score:\s*((\d+)\.?(\d*))/
+ points= $~[1]
break
end
end