0

I have trying to make a quiz for distant (online) learning students using the CheckBox from hyperref so that they can answer by just clicking the right boxes. What I would really like is to make the CheckBox values mutually exclusive - if one of the four boxes in the MWE is checked and the student checks another box the previously checked box should become unchecked? A similar question has been answered and although I get the idea of using calculate but my lack of any background in JavaScript won't help me tweak it for my specific case. It would be great if you could help me make my example work. Here is my MWE:

\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[hidelinks,colorlinks=false]{hyperref}
\usepackage[table]{xcolor}
\title{Planetary Physics}
\begin{document}
\maketitle
\begin{Form}
\begin{enumerate}
\item Which one of the following is not a planet?  \quad \quad (4 points)
\begin{enumerate}
\item \CheckBox[bordercolor=0.3 0.3 0.3,backgroundcolor=0.8 0.8 0.9,name=a]{Earth}
\item \CheckBox[bordercolor=0.3 0.3 0.3,backgroundcolor=0.8 0.8 0.9,name=b]{Mars}
\item \CheckBox[bordercolor=0.3 0.3 0.3,backgroundcolor=0.8 0.8 0.9,name=c]{Moon}
\item \CheckBox[bordercolor=0.3 0.3 0.3,backgroundcolor=0.8 0.8 0.9,name=d]{Mercury}
\end{enumerate}
\end{enumerate}
\end{Form}
\end{document}

MWE

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.