# \answerline to the right of a question with dot line between answer line and question

I see a nice feature \answerline to the right of a question. The answer is put to the right of a question. What I want is:

1. the number before the answer line should be removed, because I think the number before answer line is redundant.
2. dotted line between the question end and the answer.

Is that possible?

Using the code from Werner's solution to the other question, you can put a \leaders command in the replacement text that was removing the vertical skip.

\leaders takes some box and copies it enough times to fill up some specified horizontal space. So here is one version: we make a box containing a dot with some space around it, we ask the sequence of boxes to fill up an aggressively stretchable horizontal space of 0pt plus 1filll. This will squeeze out the other stretchable space on the line before the answer material, pushing it to the right and filling the intervening space with a line of dots.

For removing the number, we just note that Werner's code already provided a command \answerline* command, so we may use that when we wish to suppress numbers.

\documentclass[a4paper]{exam}

\usepackage{letltxmacro,xpatch}
{\leaders\hbox{\hskip0.2em .\hskip0.2em}\hskip 0pt plus 1filll}% <replace>
{}{}% <success><failure>
\makeatletter
\begingroup
\IfBooleanTF{#1}
\IfNoValueTF{#2}