Printing answer on dotted line exam class
I am making a worksheet for a task for my teachertraining. My worksheet should leave the students enough place to answer, but also show what answer I expect.
The exam-class is perfect for making worksheets, however, I have one problem: I am using dotted lines for answers. If I print the answer, the dotted lines disappear and instead, my answer is printed in a box (which wraps perfectly around the answer, thus not showing how much place I would leave for the students to answer).
Is there some way, to make the answer appear on the dotted lines? This way, I can show my expected answer and how much place I think students would need. I am aware of the answerline-command, but I prefer dotted lines.
EDIT:
As per comment, some code to show my problem:
1) version with answering lines, without answer:
documentclass[11pt]{exam}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{solutionordottedlines}[0.5in]
This sum equals $4$.
end{solutionordottedlines}
end{document}
2) version with answer, but the dotted lines disappeared
documentclass[11pt, answers]{exam}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{solutionordottedlines}[0.5in]
This sum equals $4$.
end{solutionordottedlines}
end{document}
Question: how to combine both documents, such that, when the answer is displayed, it appears on top of the dotted lines, while keeping the original amount of dotted lines?
exam
add a comment |
I am making a worksheet for a task for my teachertraining. My worksheet should leave the students enough place to answer, but also show what answer I expect.
The exam-class is perfect for making worksheets, however, I have one problem: I am using dotted lines for answers. If I print the answer, the dotted lines disappear and instead, my answer is printed in a box (which wraps perfectly around the answer, thus not showing how much place I would leave for the students to answer).
Is there some way, to make the answer appear on the dotted lines? This way, I can show my expected answer and how much place I think students would need. I am aware of the answerline-command, but I prefer dotted lines.
EDIT:
As per comment, some code to show my problem:
1) version with answering lines, without answer:
documentclass[11pt]{exam}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{solutionordottedlines}[0.5in]
This sum equals $4$.
end{solutionordottedlines}
end{document}
2) version with answer, but the dotted lines disappeared
documentclass[11pt, answers]{exam}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{solutionordottedlines}[0.5in]
This sum equals $4$.
end{solutionordottedlines}
end{document}
Question: how to combine both documents, such that, when the answer is displayed, it appears on top of the dotted lines, while keeping the original amount of dotted lines?
exam
1
You should show us -- as usual here -- a short compilable tex code resulting in your issue. Then we have not to guess what you are doing ...
– Kurt
Mar 28 at 21:35
@Kurt: I did not know what to include, since I have no code which comes close. The pieces of tex code give no error, however, I would like to combine both effects. I hope this is ok (although it probably does not satisfy the 'usual code found in a question').
– Student
Mar 28 at 23:00
It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...
– Kurt
Mar 28 at 23:17
add a comment |
I am making a worksheet for a task for my teachertraining. My worksheet should leave the students enough place to answer, but also show what answer I expect.
The exam-class is perfect for making worksheets, however, I have one problem: I am using dotted lines for answers. If I print the answer, the dotted lines disappear and instead, my answer is printed in a box (which wraps perfectly around the answer, thus not showing how much place I would leave for the students to answer).
Is there some way, to make the answer appear on the dotted lines? This way, I can show my expected answer and how much place I think students would need. I am aware of the answerline-command, but I prefer dotted lines.
EDIT:
As per comment, some code to show my problem:
1) version with answering lines, without answer:
documentclass[11pt]{exam}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{solutionordottedlines}[0.5in]
This sum equals $4$.
end{solutionordottedlines}
end{document}
2) version with answer, but the dotted lines disappeared
documentclass[11pt, answers]{exam}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{solutionordottedlines}[0.5in]
This sum equals $4$.
end{solutionordottedlines}
end{document}
Question: how to combine both documents, such that, when the answer is displayed, it appears on top of the dotted lines, while keeping the original amount of dotted lines?
exam
I am making a worksheet for a task for my teachertraining. My worksheet should leave the students enough place to answer, but also show what answer I expect.
The exam-class is perfect for making worksheets, however, I have one problem: I am using dotted lines for answers. If I print the answer, the dotted lines disappear and instead, my answer is printed in a box (which wraps perfectly around the answer, thus not showing how much place I would leave for the students to answer).
Is there some way, to make the answer appear on the dotted lines? This way, I can show my expected answer and how much place I think students would need. I am aware of the answerline-command, but I prefer dotted lines.
EDIT:
As per comment, some code to show my problem:
1) version with answering lines, without answer:
documentclass[11pt]{exam}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{solutionordottedlines}[0.5in]
This sum equals $4$.
end{solutionordottedlines}
end{document}
2) version with answer, but the dotted lines disappeared
documentclass[11pt, answers]{exam}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{solutionordottedlines}[0.5in]
This sum equals $4$.
end{solutionordottedlines}
end{document}
Question: how to combine both documents, such that, when the answer is displayed, it appears on top of the dotted lines, while keeping the original amount of dotted lines?
exam
exam
edited Mar 28 at 22:01
Student
asked Mar 28 at 21:18
StudentStudent
1405
1405
1
You should show us -- as usual here -- a short compilable tex code resulting in your issue. Then we have not to guess what you are doing ...
– Kurt
Mar 28 at 21:35
@Kurt: I did not know what to include, since I have no code which comes close. The pieces of tex code give no error, however, I would like to combine both effects. I hope this is ok (although it probably does not satisfy the 'usual code found in a question').
– Student
Mar 28 at 23:00
It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...
– Kurt
Mar 28 at 23:17
add a comment |
1
You should show us -- as usual here -- a short compilable tex code resulting in your issue. Then we have not to guess what you are doing ...
– Kurt
Mar 28 at 21:35
@Kurt: I did not know what to include, since I have no code which comes close. The pieces of tex code give no error, however, I would like to combine both effects. I hope this is ok (although it probably does not satisfy the 'usual code found in a question').
– Student
Mar 28 at 23:00
It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...
– Kurt
Mar 28 at 23:17
1
1
You should show us -- as usual here -- a short compilable tex code resulting in your issue. Then we have not to guess what you are doing ...
– Kurt
Mar 28 at 21:35
You should show us -- as usual here -- a short compilable tex code resulting in your issue. Then we have not to guess what you are doing ...
– Kurt
Mar 28 at 21:35
@Kurt: I did not know what to include, since I have no code which comes close. The pieces of tex code give no error, however, I would like to combine both effects. I hope this is ok (although it probably does not satisfy the 'usual code found in a question').
– Student
Mar 28 at 23:00
@Kurt: I did not know what to include, since I have no code which comes close. The pieces of tex code give no error, however, I would like to combine both effects. I hope this is ok (although it probably does not satisfy the 'usual code found in a question').
– Student
Mar 28 at 23:00
It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...
– Kurt
Mar 28 at 23:17
It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...
– Kurt
Mar 28 at 23:17
add a comment |
1 Answer
1
active
oldest
votes
Based on this answer, with some changes (using ulem package), following solution maybe used.
documentclass[11pt, answers]{exam}
usepackage[normalem]{ulem}
newboxallanswers
setboxallanswers=vbox{}
newenvironment{answer}
{%
globalsetboxallanswers=vboxbgroup
unvboxallanswers
}%
{%
bigbreak
egroup
}
newcommand{showanswers}{unvboxallanswers}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{answer}
dotuline{ This sum equals $4$. Hence the answer is "four". Also the answer is $2^2$}
end{answer}
vspace{0.5cm}
showanswers
end{questions}
end{document}

EDIT: The answer is displayed, it appears on top of the dotted lines, while keeping the original amount of dotted lines.
documentclass[11pt]{exam}
newboxallanswers
setboxallanswers=vbox{}
newenvironment{answer}
{%
globalsetboxallanswers=vboxbgroup
unvboxallanswers
}%
{%
bigbreak
egroup
}
newcommand{showanswers}{unvboxallanswers}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{answer}
This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$.This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$.
begin{solutionordottedlines}[0.5in]
end{solutionordottedlines}
end{answer}
vspace{0.5cm}
showanswers
end{questions}
end{document}

Thank you for your answer. If I remove the showanswers option, the dotted line disappears. Also, it does not allow to manually controle the length of the dotted line (for example: if I type a sentence which spannes two lines, a written answer would be four lines. Hence, I would like the answer to appear on the first two lines, while the other two lines are still there...). I'll try to use your answer to experiment a bit and see what I can make from it, so thank you for your suggestion!
– Student
Mar 28 at 23:41
@Student, Ok. I edited my answer.
– ferahfeza
Mar 29 at 0:35
I was hoping there would be a more 'automatic' solution. Since there is not so much response, I suppose this will not be possible. Thank you for your time.
– Student
Mar 30 at 7:59
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f481990%2fprinting-answer-on-dotted-line-exam-class%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Based on this answer, with some changes (using ulem package), following solution maybe used.
documentclass[11pt, answers]{exam}
usepackage[normalem]{ulem}
newboxallanswers
setboxallanswers=vbox{}
newenvironment{answer}
{%
globalsetboxallanswers=vboxbgroup
unvboxallanswers
}%
{%
bigbreak
egroup
}
newcommand{showanswers}{unvboxallanswers}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{answer}
dotuline{ This sum equals $4$. Hence the answer is "four". Also the answer is $2^2$}
end{answer}
vspace{0.5cm}
showanswers
end{questions}
end{document}

EDIT: The answer is displayed, it appears on top of the dotted lines, while keeping the original amount of dotted lines.
documentclass[11pt]{exam}
newboxallanswers
setboxallanswers=vbox{}
newenvironment{answer}
{%
globalsetboxallanswers=vboxbgroup
unvboxallanswers
}%
{%
bigbreak
egroup
}
newcommand{showanswers}{unvboxallanswers}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{answer}
This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$.This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$.
begin{solutionordottedlines}[0.5in]
end{solutionordottedlines}
end{answer}
vspace{0.5cm}
showanswers
end{questions}
end{document}

Thank you for your answer. If I remove the showanswers option, the dotted line disappears. Also, it does not allow to manually controle the length of the dotted line (for example: if I type a sentence which spannes two lines, a written answer would be four lines. Hence, I would like the answer to appear on the first two lines, while the other two lines are still there...). I'll try to use your answer to experiment a bit and see what I can make from it, so thank you for your suggestion!
– Student
Mar 28 at 23:41
@Student, Ok. I edited my answer.
– ferahfeza
Mar 29 at 0:35
I was hoping there would be a more 'automatic' solution. Since there is not so much response, I suppose this will not be possible. Thank you for your time.
– Student
Mar 30 at 7:59
add a comment |
Based on this answer, with some changes (using ulem package), following solution maybe used.
documentclass[11pt, answers]{exam}
usepackage[normalem]{ulem}
newboxallanswers
setboxallanswers=vbox{}
newenvironment{answer}
{%
globalsetboxallanswers=vboxbgroup
unvboxallanswers
}%
{%
bigbreak
egroup
}
newcommand{showanswers}{unvboxallanswers}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{answer}
dotuline{ This sum equals $4$. Hence the answer is "four". Also the answer is $2^2$}
end{answer}
vspace{0.5cm}
showanswers
end{questions}
end{document}

EDIT: The answer is displayed, it appears on top of the dotted lines, while keeping the original amount of dotted lines.
documentclass[11pt]{exam}
newboxallanswers
setboxallanswers=vbox{}
newenvironment{answer}
{%
globalsetboxallanswers=vboxbgroup
unvboxallanswers
}%
{%
bigbreak
egroup
}
newcommand{showanswers}{unvboxallanswers}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{answer}
This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$.This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$.
begin{solutionordottedlines}[0.5in]
end{solutionordottedlines}
end{answer}
vspace{0.5cm}
showanswers
end{questions}
end{document}

Thank you for your answer. If I remove the showanswers option, the dotted line disappears. Also, it does not allow to manually controle the length of the dotted line (for example: if I type a sentence which spannes two lines, a written answer would be four lines. Hence, I would like the answer to appear on the first two lines, while the other two lines are still there...). I'll try to use your answer to experiment a bit and see what I can make from it, so thank you for your suggestion!
– Student
Mar 28 at 23:41
@Student, Ok. I edited my answer.
– ferahfeza
Mar 29 at 0:35
I was hoping there would be a more 'automatic' solution. Since there is not so much response, I suppose this will not be possible. Thank you for your time.
– Student
Mar 30 at 7:59
add a comment |
Based on this answer, with some changes (using ulem package), following solution maybe used.
documentclass[11pt, answers]{exam}
usepackage[normalem]{ulem}
newboxallanswers
setboxallanswers=vbox{}
newenvironment{answer}
{%
globalsetboxallanswers=vboxbgroup
unvboxallanswers
}%
{%
bigbreak
egroup
}
newcommand{showanswers}{unvboxallanswers}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{answer}
dotuline{ This sum equals $4$. Hence the answer is "four". Also the answer is $2^2$}
end{answer}
vspace{0.5cm}
showanswers
end{questions}
end{document}

EDIT: The answer is displayed, it appears on top of the dotted lines, while keeping the original amount of dotted lines.
documentclass[11pt]{exam}
newboxallanswers
setboxallanswers=vbox{}
newenvironment{answer}
{%
globalsetboxallanswers=vboxbgroup
unvboxallanswers
}%
{%
bigbreak
egroup
}
newcommand{showanswers}{unvboxallanswers}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{answer}
This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$.This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$.
begin{solutionordottedlines}[0.5in]
end{solutionordottedlines}
end{answer}
vspace{0.5cm}
showanswers
end{questions}
end{document}

Based on this answer, with some changes (using ulem package), following solution maybe used.
documentclass[11pt, answers]{exam}
usepackage[normalem]{ulem}
newboxallanswers
setboxallanswers=vbox{}
newenvironment{answer}
{%
globalsetboxallanswers=vboxbgroup
unvboxallanswers
}%
{%
bigbreak
egroup
}
newcommand{showanswers}{unvboxallanswers}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{answer}
dotuline{ This sum equals $4$. Hence the answer is "four". Also the answer is $2^2$}
end{answer}
vspace{0.5cm}
showanswers
end{questions}
end{document}

EDIT: The answer is displayed, it appears on top of the dotted lines, while keeping the original amount of dotted lines.
documentclass[11pt]{exam}
newboxallanswers
setboxallanswers=vbox{}
newenvironment{answer}
{%
globalsetboxallanswers=vboxbgroup
unvboxallanswers
}%
{%
bigbreak
egroup
}
newcommand{showanswers}{unvboxallanswers}
setlengthdottedlinefillheight{.25in}
begin{document}
begin{questions}
question What is $2 + 2$?
begin{answer}
This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$.This sum equals $4$. This sum equals $4$. This sum equals $4$. This sum equals $4$.
begin{solutionordottedlines}[0.5in]
end{solutionordottedlines}
end{answer}
vspace{0.5cm}
showanswers
end{questions}
end{document}

edited Mar 29 at 0:34
answered Mar 28 at 23:14
ferahfezaferahfeza
7,41411933
7,41411933
Thank you for your answer. If I remove the showanswers option, the dotted line disappears. Also, it does not allow to manually controle the length of the dotted line (for example: if I type a sentence which spannes two lines, a written answer would be four lines. Hence, I would like the answer to appear on the first two lines, while the other two lines are still there...). I'll try to use your answer to experiment a bit and see what I can make from it, so thank you for your suggestion!
– Student
Mar 28 at 23:41
@Student, Ok. I edited my answer.
– ferahfeza
Mar 29 at 0:35
I was hoping there would be a more 'automatic' solution. Since there is not so much response, I suppose this will not be possible. Thank you for your time.
– Student
Mar 30 at 7:59
add a comment |
Thank you for your answer. If I remove the showanswers option, the dotted line disappears. Also, it does not allow to manually controle the length of the dotted line (for example: if I type a sentence which spannes two lines, a written answer would be four lines. Hence, I would like the answer to appear on the first two lines, while the other two lines are still there...). I'll try to use your answer to experiment a bit and see what I can make from it, so thank you for your suggestion!
– Student
Mar 28 at 23:41
@Student, Ok. I edited my answer.
– ferahfeza
Mar 29 at 0:35
I was hoping there would be a more 'automatic' solution. Since there is not so much response, I suppose this will not be possible. Thank you for your time.
– Student
Mar 30 at 7:59
Thank you for your answer. If I remove the showanswers option, the dotted line disappears. Also, it does not allow to manually controle the length of the dotted line (for example: if I type a sentence which spannes two lines, a written answer would be four lines. Hence, I would like the answer to appear on the first two lines, while the other two lines are still there...). I'll try to use your answer to experiment a bit and see what I can make from it, so thank you for your suggestion!
– Student
Mar 28 at 23:41
Thank you for your answer. If I remove the showanswers option, the dotted line disappears. Also, it does not allow to manually controle the length of the dotted line (for example: if I type a sentence which spannes two lines, a written answer would be four lines. Hence, I would like the answer to appear on the first two lines, while the other two lines are still there...). I'll try to use your answer to experiment a bit and see what I can make from it, so thank you for your suggestion!
– Student
Mar 28 at 23:41
@Student, Ok. I edited my answer.
– ferahfeza
Mar 29 at 0:35
@Student, Ok. I edited my answer.
– ferahfeza
Mar 29 at 0:35
I was hoping there would be a more 'automatic' solution. Since there is not so much response, I suppose this will not be possible. Thank you for your time.
– Student
Mar 30 at 7:59
I was hoping there would be a more 'automatic' solution. Since there is not so much response, I suppose this will not be possible. Thank you for your time.
– Student
Mar 30 at 7:59
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f481990%2fprinting-answer-on-dotted-line-exam-class%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You should show us -- as usual here -- a short compilable tex code resulting in your issue. Then we have not to guess what you are doing ...
– Kurt
Mar 28 at 21:35
@Kurt: I did not know what to include, since I have no code which comes close. The pieces of tex code give no error, however, I would like to combine both effects. I hope this is ok (although it probably does not satisfy the 'usual code found in a question').
– Student
Mar 28 at 23:00
It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...
– Kurt
Mar 28 at 23:17