Printing answer on dotted line exam class












1















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?










share|improve this question




















  • 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
    3 hours ago













  • @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
    2 hours ago











  • It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...

    – Kurt
    2 hours ago
















1















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?










share|improve this question




















  • 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
    3 hours ago













  • @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
    2 hours ago











  • It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...

    – Kurt
    2 hours ago














1












1








1








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?










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 3 hours ago







Student

















asked 4 hours ago









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
    3 hours ago













  • @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
    2 hours ago











  • It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...

    – Kurt
    2 hours ago














  • 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
    3 hours ago













  • @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
    2 hours ago











  • It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...

    – Kurt
    2 hours ago








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
3 hours ago







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
3 hours ago















@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
2 hours ago





@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
2 hours ago













It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...

– Kurt
2 hours ago





It is okay, better such kind of code that no code. It helps to understand what you have and what you are trying ...

– Kurt
2 hours ago










1 Answer
1






active

oldest

votes


















1














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}


enter image description here



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}


enter image description here






share|improve this answer


























  • 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
    1 hour ago











  • @Student, Ok. I edited my answer.

    – ferahfeza
    54 mins ago












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
});


}
});














draft saved

draft discarded


















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









1














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}


enter image description here



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}


enter image description here






share|improve this answer


























  • 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
    1 hour ago











  • @Student, Ok. I edited my answer.

    – ferahfeza
    54 mins ago
















1














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}


enter image description here



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}


enter image description here






share|improve this answer


























  • 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
    1 hour ago











  • @Student, Ok. I edited my answer.

    – ferahfeza
    54 mins ago














1












1








1







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}


enter image description here



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}


enter image description here






share|improve this answer















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}


enter image description here



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}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 54 mins ago

























answered 2 hours ago









ferahfezaferahfeza

7,08911933




7,08911933













  • 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
    1 hour ago











  • @Student, Ok. I edited my answer.

    – ferahfeza
    54 mins ago



















  • 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
    1 hour ago











  • @Student, Ok. I edited my answer.

    – ferahfeza
    54 mins ago

















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
1 hour ago





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
1 hour ago













@Student, Ok. I edited my answer.

– ferahfeza
54 mins ago





@Student, Ok. I edited my answer.

– ferahfeza
54 mins ago


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Lallio

Unable to find Lightning Node

Futebolista