Skip to content

Extremely unpolished questions/exams generator. Including LaTeX generator.

License

Notifications You must be signed in to change notification settings

nahkd123/questions-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Questions generator

Generate questions (and exams) from given set of "templates"

Command-line interface might be provided after I've finished all exams ;)

Usage

Write your own "templates"

Your question 1
Correct: Your correct answer 1
Corrent: Your correct answer 2
Your incorrect answer 1
Your incorrect answer 2
Your incorrect answer 3
Your incorrect answer 4

Your question 2 with constant {k}
Const: k from 1 to 100 step 0.1
Correct: Your correct answer 1 with constant {k}
Corrent: Your correct answer 2
Your incorrect answer 1 with constant {k}
Your incorrect answer 2 with constant {k}
Your incorrect answer 3
Your incorrect answer 4

Use your templates

import * as qg from "@nahkd123/questions-generator";
import * as fs from "node:fs";

let templates = qg.Question.parseSet(fs.readFileSync("template.txt", "utf-8"));
let generated = qg.Question.generateQuestions(templates);

Create LaTeX (and maybe PDF) from generated questions

let latex = new qg.LaTeXGenerator();
generated.forEach(v => latex.add(v));

console.log(latex.getLaTeX()); // node myscript.js | pdflatex

// Or you can get generated LaTeX for each question
// latex.questions.forEach(...);

Made with Termux (because I can't use PC right now lol).

About

Extremely unpolished questions/exams generator. Including LaTeX generator.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published