pytexexam
A simple library for writing and printing exam in Python.
About this branch
- This branch includes the source code of the upcoming pytexexam version (3.0)
- Objective: Redesign package to generalize exam generation process and include more question types instead of MCQ only in pytexexam 2.x The project is not complete yet.
Install from github, using pip (for testing only)
pip install git+https://github.com/vungocbinh2009/pytexexam.git@pytexexam_3.x#egg=pytexexam
How to use
from pytexexam.component import Text, MultipartQuestion, OpenQuestion, ComponentGroup, MultipleChoiceQuestion, QuestionPart
from pytexexam.latex_util import two_column_header
from pytexexam import ExamGenerator, ExamFileType
# Create an exam generator object
exam = ExamGenerator()
# Then, you can create "component" to add to your exam.
# Create a text component to use as header.
header = Text(two_column_header("Left column", "Right column"))
# Create a multiple choice question and shuffle answer.
q1 = MultipleChoiceQuestion(
question="This is a multiple choice question",
answers=["Answer 1", "Answer 2", "Answer 3", "Answer 4"],
true_answer="AB",
num_column=4,
solution="Multiple choice question solution"
)
q1.shuffle_content()
# Create a question with multi part whose can shuffle it part
q2 = MultipartQuestion(
question_stem="Answer all the question below",
prompts=[
QuestionPart("Question part 1", "Answer 1", "Solution 1"),
QuestionPart("Question part 2", "Answer 2", "Solution 2"),
QuestionPart("Question part 3", "Answer 3", "Solution 3"),
QuestionPart("Question part 4", "Answer 4", "Solution 4"),
],
num_column=2
)
q2.shuffle_content()
# Create a open question
q3 = OpenQuestion(
question="This is an open question",
answer="This is open question answer",
solution="This is open question answer"
)
# Create text to split each part of the test.
text = Text(r"\section{{An exam section}}")
# You can subclass "Component" from pytexexam.component
# to create your own question type.
# Create a question group to add all component together, add to exam generator
q_group = ComponentGroup([header, q1, text, q2, q3])
exam.add_component(q_group)
# Add preamble.
exam.add_preamble_array([
r"\usepackage[utf8]{vietnam}"
])
# Generate exam
exam.generate_exam("exam1", ExamFileType.PDF)
Contribution.
Contribution are welcome. Create a pull request.
Buy me a coffee.
If you find this project useful, you can buy me coffee through Buy me a coffee
License
Apache License, Version 2.0
Metadata
Release files for pytexexam 3.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytexexam-3.0.1-py3-none-any.whl | Python 3 | none | any | Details for pytexexam-3.0.1-py3-none-any.whl |
Release files / pytexexam-3.0.1-py3-none-any.whl
| Download URL | pytexexam-3.0.1-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6fe7569ca83bf7847371d76296a6ad613b3d66d2a41752b92de7a79f588e0208
|
|
BLAKE2b-256 checksum How to use checksums |
d89199d886de6c5ea62382884f07db60317f8382705559c8a73794005d21253f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|
Security for pytexexam 3.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.