Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to export the markdown to well-looked pdf or html? #35

Open
flcong opened this issue Nov 21, 2020 · 5 comments
Open

Is it possible to export the markdown to well-looked pdf or html? #35

flcong opened this issue Nov 21, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@flcong
Copy link

flcong commented Nov 21, 2020

Thank you very much for the package. It is very helpful since currently most exams are moved online. One issue is that, since the syntax here is not the same as the markdown syntax, (e.g. in multiple-answer questions, [*] will make ] italic), I wonder if there is a way to export the markdown into, e.g. pdf or HTML with the correct format (e.g. the correct choice could be in bold).

@gpoore gpoore added the enhancement New feature or request label Nov 22, 2020
@gpoore
Copy link
Owner

gpoore commented Nov 22, 2020

There is not currently a way to do this. However, this is a feature I have been thinking about and something I need myself, since I sometimes need to generate standalone answer keys and also in some cases plain PDF or HTML versions of exams (not QTI). I'm marking this as a feature to add in the future. Unless someone else implements this before I do, probably the absolute earliest this could be available would be February.

Depending on the complexity of what you need, there may be ways to get something that works right now. For example, with multiple-answer questions, you could create a copy of the quiz file, and then use a regex to replace [ ] with * to turn incorrect answers into bullet points and replace [*] with * Correct: to mark correct answers. Depending on what you want the output to look like, you might also add indentation. You might also need to do a few additional things like strip out question point values (lines starting with Points: ). At least for a simple quiz, converting it into a decent Markdown approximation in this way might not be too difficult.

@flcong
Copy link
Author

flcong commented Nov 22, 2020

Thank you. Now I plan to use LaTeX first and then use python to parse LaTeX to convert it to the markdown format. There is actually a project converting LaTeX to QTI. However, multiple-answer questions are not supported there, but I need them.

@wsphd
Copy link

wsphd commented Dec 20, 2020

I short-run workaround is to use the rpy2 module to call the "exams2html" or "exams2pdf" function from the "exams" package in R. This isn't elegant but could work.

@gpoore
Copy link
Owner

gpoore commented Apr 18, 2021

There is now basic support for exporting solutions in Pandoc Markdown, PDF, and HTML formats in the dev version on GitHub. See --solutions and --only-solutions. I may refine this a bit further before I release a new version and update PyPI, but I'm already using it myself.

@flcong
Copy link
Author

flcong commented Apr 19, 2021

There is now basic support for exporting solutions in Pandoc Markdown, PDF, and HTML formats in the dev version on GitHub. See --solutions and --only-solutions. I may refine this a bit further before I release a new version and update PyPI, but I'm already using it myself.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants