# Bug Tracker

ID | 83 |
---|---|

Status | Closed (Fixed) |

Category | datatooltk |

Version | 1.4 |

Summary | fields repeat in the import of probsoln problems with data tool-gui interface on osx |

## Report

José Antonio Torralba Hernández

### MWE

%% % Finite probability spaces \newproblem{weightedcoin}{% A coin is weighted so that heads is four times as likely as tails. Find the probability that: \begin{textenum} \item tails appears, \item heads appears \end{textenum}}{% Let $p=P(T)$, then $P(H)=4p$. We require $P(H)+P(T)=1$, so $4p+p=1$, hence $p=\frac{1}{5}$. Therefore: \begin{textenum} \item $P(T)=\frac{1}{5}$, \item $P(H)=\frac{4}{5}$ \end{textenum}} \newproblem*{validprobspaces}{% Under which of the following functions does $S=\{a_1,a_2\}$ become a probability space? \par \begin{textenum} \begin{tabular}{ll} \incorrectitem $P(a_1)=\frac{1}{3}$, $P(a_2)=\frac{1}{2}$ & \correctitem $P(a_1)=\frac{3}{4}$, $P(a_2)=\frac{1}{4}$ \\ \correctitem $P(a_1)=1$, $P(a_2)=0$ & \incorrectitem $P(a_1)=\frac{5}{4}$, $P(a_2)=-\frac{1}{4}$ \end{tabular} \end{textenum} }

## Evaluation

At first I thought this was a bug as well, but I realise that this is due to the definition of`\newproblem`

. The datatooltk import function works by inserting all text contained inside the `onlyproblem`

environment into the `Question`

field and all text contained inside the `onlysolution`

environment into the `Answer`

field. Any text in the problem that occurs outside of either of these environments is placed in both fields (as it would appear in the document regardless of the answers/noanswers setting). The `\newproblem`

command is defined such that
\newproblem[⟨is equivalent ton⟩][⟨default args⟩]{⟨label⟩}{⟨problem⟩}{⟨solution⟩}

\begin{defproblem}[⟨(See section 6 "Defining a Problem" in the probsoln manual.) This means that ⟨n⟩][⟨default args⟩]{⟨label⟩}% ⟨problem⟩% \begin{onlysolution}% \begin{solution}% ⟨solution⟩% \end{solution}% \end{onlysolution}% \end{defproblem}

*problem*⟩ isn't inside the

`onlyproblem`

environment which is why it ends up in both fields. If you use prob-probspaces2.tex instead of `prob-probspaces.tex`which uses

`defproblem`

instead of `\newproblem`

then the import function works as expected.
Since it makes more sense for the import function to treat the ⟨*problem*⟩ argument of `\newproblem`

as though it was inside `onlyproblem`

I will modify the import function. (I can't change the definition of `\newproblem`

within probsoln.sty as that would break backward compatibility, but I could get the import function to temporarily redefine it.)

*Update 2015-04-20:* fixed in version 1.5.

## Watch This Report

If you would like to be notified whenever updates are made to this report, please fill in your email address in the box below and click on "Notify Me of Changes" button. (Please ensure the address is valid.) Your details won't be passed on to third parties in line with this site's Privacy Policy.

If you supply your name, it will be used in the email greeting, which provides a more personal message, otherwise you'll just get a generic greeting. If you have previously supplied your name when signing up for notifications, you don't need to resupply it unless you want to change it.

If you have previously subscribed to notifications for this report, you can unsubscribe by clicking on the "Stop Notification" button.

The "Confirm Bug ID" field helps to protect against spambots. Please enter the bug ID (which you can find at the top of this page).

To unsubscribe from all notifications use the notifications page.

## Comment

You can append a comment to the report using the form below. Comments are checked first before being added. Any spam or offensive content will be removed first according to this site's Terms of Website Use. Please bear in mind that I develop and maintain free software in my spare time. If you want commerical level support then you can hire a TeX consultant.

The "Confirm Bug ID" field helps to protect against spambots. Please enter the bug ID (which you can find at the top of this page).