@@ -34,6 +34,7 @@ module AOC.Run.Load (
3434 dayInt ,
3535 TestMeta (.. ),
3636 aocUserAgent ,
37+ defaultAoCOpts' ,
3738
3839 -- * Parsers
3940 parseMeta ,
@@ -125,6 +126,9 @@ makeChallengeDirs CP{..} =
125126 (createDirectoryIfMissing True . takeDirectory)
126127 [_cpPrompt, _cpCodeBlocks, _cpInput, _cpAnswer, _cpTests, _cpLog]
127128
129+ defaultAoCOpts' :: Integer -> String -> AoCOpts
130+ defaultAoCOpts' y s = (defaultAoCOpts aocUserAgent y s) { _aInferRankOnSubmission = True }
131+
128132-- | Load data associated with a challenge from a given specification.
129133-- Will fetch answers online and cache if required (and if giten a session
130134-- token).
@@ -183,7 +187,7 @@ challengeData sess yr spec@CS{..} = do
183187 maybeToEither
184188 [" Session key needed to fetch input" ]
185189 sess
186- let opts = defaultAoCOpts aocUserAgent yr s
190+ let opts = defaultAoCOpts' yr s
187191 inp <-
188192 liftEither . bimap showAoCError T. unpack
189193 =<< liftIO (runAoC opts a)
@@ -204,7 +208,7 @@ challengeData sess yr spec@CS{..} = do
204208 liftIO $ T. writeFile _cpPrompt prompt
205209 pure prompt
206210 where
207- opts = defaultAoCOpts aocUserAgent yr $ fold sess
211+ opts = defaultAoCOpts' yr $ fold sess
208212 a = AoCPrompt _csDay
209213 e = case sess of
210214 Just _ -> " Part not yet released"
@@ -222,7 +226,7 @@ challengeData sess yr spec@CS{..} = do
222226 liftIO $ T. writeFile _cpCodeBlocks $ T. intercalate codeBlockSep blocks
223227 pure blocks
224228 where
225- opts = defaultAoCOpts aocUserAgent yr $ fold sess
229+ opts = defaultAoCOpts' yr $ fold sess
226230 a = AoCPrompt _csDay
227231 e = case sess of
228232 Just _ -> " Part not yet released"
0 commit comments