CDF, Buttons, and Dynamic Homework Assignments

General discussion about Mathematica features and functionality...
Forum Rules
By using the Wolfram Faculty Program Forum, you agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, or sexually oriented material. Wolfram Faculty Program Forum administrators have the right to remove, edit, move or close any topic at any time should we see fit.

Personal Information: Posts in this forum may be viewed by non-members; however, the forum prohibits non-members from viewing your profile. Although your email address is hidden from both non-members and members, your account is initially configured to allow members to contact you via email through the forum. If you wish to hide your profile, or prohibit others from contacting you directly, you may change these settings by updating your profile through the User Control Panel.

Attachments: Attachments are not currently enabled on this forum. To share a file with others on this site, simply upload your file to the online storage service of your choice and include a link to the file within your post. If your school does not offer an online file storage and sharing service, the following sites provide free basic online file storage and sharing: Mozy, FilesAnywhere, Adrive, and KeepandShare.

CDF, Buttons, and Dynamic Homework Assignments

Postby Gregory » Fri Sep 14, 2012 12:25 pm

Hello everyone,

I'm using CDF as the format for a series of undergraduate multiple-choice quizzes and graduate assignments that I am developing. Both generate unique homework exercises for each student by drawing random samples from real-world data sets. I have already used them successfully in an intermediate undergraduate theory course in financial economics. But something came up yesterday when I was putting the finishing touches on a prototype for multiple-choice quizzes, and I suppose it should have occurred to me before I even started. I included radio buttons for the answer choices to each question, knowing that free CDFs cannot export, but thinking that the answers chosen could be dynamically updated in a table, and students could then use the table to enter their answers into a web form for submission. No problem with this as long as the quiz is completed all at once. But students are not be able to come back to complete a quiz that they had started earlier because free CDFs cannot save the interface state and do not allow importing (which, presumably, could be used to create a file to do the same thing). All this being said, I was wondering if someone on the list might confirm, and perhaps suggest a workaround if one exists. A volume license for Player Pro is not an option at my institution.

I think CDFs are neat, but the inability to save states, severely limits their usefulness for homework, and I am now wondering whether I might just as well use Mathematica to create a workflow to generate a unique PDF for each student instead of a CDF. Even if a student does not print a PDF, they can always annotate them, and in that way, save their work. I guess this is a shout-out to Wolfram to consider expanding the capabilities of free CDFs for these purposes.

Regards,

Gregory
User avatar
Gregory
 
Posts: 32
Joined: Wed Jul 27, 2011 3:13 pm
Location: Montreal
Organization: Concordia University
Department: Finance

Re: CDF, Buttons, and Dynamic Homework Assignments

Postby Michael_Rogers » Sun Sep 16, 2012 1:43 pm

One standard way is to use the same random samples each time, which can be done with SeedRandom. Seems like an oxymoron, and it might not be an appropriate solution in every case. But maybe it will work for you. Here the dummy database consists of the integers from 1 to 100.

Variation 1: User chooses from preselected seeds:

Manipulate[
SeedRandom[seed];
Sort[RandomSample[database, 10]],
{{seed, 1, "dataset"}, Range[10], SetterBar},
{{database, Range[100]}, None}
]

Variation 2: User enters arbitrary seed:

Manipulate[
SeedRandom[seed];
Sort[RandomSample[database, 10]],
{{seed, 1, "dataset"}, InputField[Dynamic[seed], Number] &} ,
{{database, Range[100]}, None}
]

In a homework assignment, the user would set the seed for the whole document, and the same exercises would appear for the same seed each time.

Hope that helps,

Michael
User avatar
Michael_Rogers
 
Posts: 10
Joined: Mon May 24, 2010 3:28 pm
Organization: Emory University
Department: Oxford College

Re: CDF, Buttons, and Dynamic Homework Assignments

Postby Gregory » Sun Sep 16, 2012 5:10 pm

Hi Michel,

Thanks for responding. I have been using a seed random, so that each student is shown the same set of questions, associated with their student ID, each time they open the document. What I have not been been able to do is to have the CDF save the states (highlights) of radio buttons that students click to make their answer choices. Does your use of Dynamic[] and the input field and a chosen seed make that possible, or is it intended as a way for the student to lock into an assignment whose questions will remain the same?

Regards,

Gregory
User avatar
Gregory
 
Posts: 32
Joined: Wed Jul 27, 2011 3:13 pm
Location: Montreal
Organization: Concordia University
Department: Finance

Re: CDF, Buttons, and Dynamic Homework Assignments

Postby Michael_Rogers » Sun Sep 16, 2012 7:06 pm

Hi Gregory,

I got confused and thought there were two issues, the one I addressed and saving button states. For the button states, I don't have an easy way to save them. (A slightly difficult way would be to encode the states in a string or number that the student could cut and save in a text editor or paste into an input field, something like a digit for each button, 0 = no selection, 1 = a, 2 = b, etc. It would mean tying all the buttons to the state variable. There's a lot to manage every time you write or rewrite such a quiz.)

The InputField[Dynamic[seed],Number]& is there because I knew it would work in CDFs. CDFs have limitation on InputFields and I didn't bother to look up whether they are imposed automatically or I had to do it. A valid Manipulate variable declaration is
{var, myFunction[Dynamic[var],..]&}

Sorry I've not been more help. I agree with you that it would be nice if CDFs could save states. Mathematica saves the state of DynamicModules. That doesn't seem like such a security risk.

Good luck,

Michael
User avatar
Michael_Rogers
 
Posts: 10
Joined: Mon May 24, 2010 3:28 pm
Organization: Emory University
Department: Oxford College

Re: CDF, Buttons, and Dynamic Homework Assignments

Postby Gregory » Sun Sep 16, 2012 9:45 pm

It's all good Michel. This is a big help. I had never thought of nesting Dynamic[] in a Manipulate control. It may open up new possibilities.

Thanks again,

Gregory
User avatar
Gregory
 
Posts: 32
Joined: Wed Jul 27, 2011 3:13 pm
Location: Montreal
Organization: Concordia University
Department: Finance


Return to General Mathematica Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron