Hello Community,
I have been constructing a set of tutorial notebooks for teaching materials science. Students are given some material and programming assignments.
I’ve trying create a method to pace the students’ progress through the notebook--I’d like them to stop and think before they can proceed.
Here is a simplified example of a modal multiple choice interface:
DialogInput[
Column[{
"What is 3 times 2?",
TabView[{3 -> Tooltip["Wrong", "Oh you are just being silly"],
Exp[3] -> "Wrong",
6 -> DefaultButton["Correct", DialogReturn[True]],
Cos[Pi/6] -> "Note quite",
"VI" ->
DefaultButton["Tu sunt rectam, sed asinus sapien.",
DialogReturn[True], ImageSize -> Full]}, None]
}
],
Modal -> True];
Note modal is not a supported option for DialogInput, but it works anyways.
In the ultimate version, the DefaultButton would programmatically open subsequent cells that will allow the students to proceed (I’ve seen a thread someplace that shows how to do this, but can’t find it now).
Here is where I am stuck: I’d like to embed this a button in the tutorial notebook. This is the functionality that I’d like to have, but it hangs and complains about a Dynamic which doesn’t evaluate (I don’t see a Dynamic, but perhaps ToolTip invokes one).
Here is an example, but warning, if you evaluate the following you will have to try to abort the process 3 times.
Button["Press Here to Continue",
DialogInput[
Column[{
"What is 3 times 2?",
TabView[{3 -> Tooltip["Wrong", "Oh you are just being silly"],
Exp[3] -> "Wrong",
6 -> DefaultButton["Correct", DialogReturn[True]],
Cos[Pi/6] -> "Note quite",
"VI" ->
DefaultButton["Tu sunt rectam, sed asinus sapien.",
DialogReturn[True], ImageSize -> Full]}, None]
}
],
Modal -> True];
]
Can anyone see a way to acheive my multiple choice blocking dialog? (And, if you could see a way for cumulative progress to be related to an instructor, that would be terrific.)
WCC




