forked from filipg/gonito
Merge branch 'master' of ssh://gonito.net/gonito
This commit is contained in:
commit
2a1cfa5358
@ -34,6 +34,8 @@ import Data.Attoparsec.Text
|
||||
|
||||
import Data.Text (pack, unpack)
|
||||
|
||||
import Data.Conduit.SmartSource
|
||||
|
||||
getShowChallengeR :: Text -> Handler Html
|
||||
getShowChallengeR name = do
|
||||
(Entity challengeId challenge) <- runDB $ getBy404 $ UniqueName name
|
||||
@ -300,6 +302,7 @@ outForTest repoDir submissionId (Entity testId test) = do
|
||||
checksum <- liftIO $ gatherSHA1ForCollectionOfFiles [outF]
|
||||
return Out {
|
||||
outSubmission=submissionId,
|
||||
outVariant=Nothing,
|
||||
outTest=testId,
|
||||
outChecksum=SHA1 checksum }
|
||||
|
||||
@ -325,7 +328,7 @@ checkOrInsertEvaluation repoDir chan out = do
|
||||
case resultOrException of
|
||||
Right (Left _) -> do
|
||||
err chan "Cannot parse options, check the challenge repo"
|
||||
Right (Right (_, Just [result])) -> do
|
||||
Right (Right (_, Just [(_, [result])])) -> do
|
||||
msg chan $ concat [ "Evaluated! Score ", (T.pack $ show result) ]
|
||||
time <- liftIO getCurrentTime
|
||||
_ <- runDB $ insert $ Evaluation {
|
||||
@ -342,7 +345,7 @@ checkOrInsertEvaluation repoDir chan out = do
|
||||
Left exception -> do
|
||||
err chan $ "Evaluation failed: " ++ (T.pack $ show exception)
|
||||
|
||||
rawEval :: FilePath -> Metric -> FilePath -> Text -> IO (Either GEvalException (Either (ParserResult GEvalOptions) (GEvalOptions, Maybe [MetricValue])))
|
||||
rawEval :: FilePath -> Metric -> FilePath -> Text -> IO (Either GEvalException (Either (ParserResult GEvalOptions) (GEvalOptions, Maybe [(SourceSpec, [MetricValue])])))
|
||||
rawEval challengeDir metric repoDir name = Import.try (runGEvalGetOptions [
|
||||
"--alt-metric", (show metric),
|
||||
"--expected-directory", challengeDir,
|
||||
|
9
add-variants.sql
Normal file
9
add-variants.sql
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
insert into variant(submission, name) select id, 'out' from submission;
|
||||
|
||||
update out
|
||||
set variant=subquery.variant_id
|
||||
from (select O.id as out_id, V.id as variant_id
|
||||
from out as O, variant as V, submission as S
|
||||
where V.submission = S.id and O.submission = S.id) AS subquery
|
||||
where out.id = subquery.out_id;
|
@ -59,6 +59,10 @@ Submission
|
||||
isPublic Bool default=False
|
||||
isHidden Bool Maybe
|
||||
UniqueSubmissionRepoCommitChallenge repo commit challenge
|
||||
Variant
|
||||
submission SubmissionId
|
||||
name Text
|
||||
UniqueVariantSubmissionName submission name
|
||||
Fork
|
||||
source SubmissionId
|
||||
target SubmissionId
|
||||
@ -77,6 +81,7 @@ Comment
|
||||
text Textarea
|
||||
Out
|
||||
submission SubmissionId
|
||||
variant VariantId Maybe
|
||||
test TestId
|
||||
checksum SHA1
|
||||
UniqueOutSubmissionTestChecksum submission test checksum
|
||||
|
@ -122,7 +122,7 @@ library
|
||||
, filemanip
|
||||
, cryptohash
|
||||
, markdown
|
||||
, geval >= 1.0.0.0
|
||||
, geval >= 1.1.0.0 && < 1.2
|
||||
, filepath
|
||||
, yesod-table
|
||||
, regex-tdfa
|
||||
|
Loading…
Reference in New Issue
Block a user