Skip to content

Commit

Permalink
Fixed bug in text generation
Browse files Browse the repository at this point in the history
  • Loading branch information
kagalenko-m-b committed May 3, 2024
1 parent e727e89 commit 9b314d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/MakeProblemSet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ function problemset_latex(
for p in problems_active
Random.seed!(rng_seed + n + p)
pr = problems[p]
condition = build_text(:text, pr)
solution = build_text(:solution_text, pr)
data = pr()
condition = build_text(:text, pr, data)
solution = build_text(:solution_text, pr, data)
txt *= "\\underline{Задача $(p):}\n\n$(condition)\n\n"
txt_sol *= "\\underline{Задача $(p):}\n\n$(solution)\n\n"
end
Expand All @@ -101,8 +102,7 @@ function problemset_latex(
return txt,txt_sol
end

function build_text(kind::Symbol, pr::Function)
data = pr()
function build_text(kind::Symbol, pr::Function, data::AbstractVector)
vars = pr(Val(:vars))
str = pr(Val(kind))
ms = eachmatch(r"%(\w+)%", str)
Expand Down

0 comments on commit 9b314d3

Please sign in to comment.