How Can I Lock Cells to Keep Them From Prying Eyes?

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.

How Can I Lock Cells to Keep Them From Prying Eyes?

Postby Gregory » Wed Sep 07, 2011 5:49 pm

Hello everyone,

Well, I guess the subject header to this post says it all. I'm trying to develop a workflow for a large number of assignments for various courses in financial economic theory. I want an exercise cell or cells followed immediately by an answer cell or cells. When the assignment is distributed, I want the answer cells closed and locked; after it has been graded, I want to redistribute the same document with the answer cells now open. The documents will be distributed as CDF and PDF, but students do have access to the full version of Mathematica, so I need to make sure that they cannot use the full version to open locked cells. Any way to do this?

The alternative would be to have duplicate documents: one with only exercises and the other with exercises and answers. It's doable but pain.

Regards,

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

Re: How Can I Lock Cells to Keep Them From Prying Eyes?

Postby Michael_Morrison » Wed Sep 07, 2011 10:47 pm

Hi, Gregory,

I don't know of a foolproof way to do this. For example, when I develop materials, I sometimes create cells with certain tags so that I can use front end commands like NotebookLocate to select the tagged cells and then hide them by setting things like CellOpen->False and Selectable->False, and then I can use the same commands to find them and change those settings so that they reappear. I do this so often, in fact, that I have a pair of buttons that I use over and over to toggle those cells between hidden and shown, depending on what I'm doing. This is easily reversible by a recipient of the file, however, if the recipient knows how to use the Cell Tags menu item in the front end, or if they just do a Select All and then then play with toggling Cell Properties > Open. If this is not a concern, then using an approach like this might be good enough.

You can take things a step further and set the entire notebook as Selectable->False (this disallows the Select All/Cell Properties->Open trick), but this is still able to be undone by someone who knows his or her way around the Option Inspector.

If you want to be absolutely sure that the content for your answer cells is not viewable until you want it to be, then I think your best option is to keep two separate sets of files: one with answer content, and one without. This doesn't need to be as tedious as you might think, however. You could set up a stylesheet so that you use a specific style for answer cells. Then, you author the master copy (with questions and answers included) of your document. Finally, when you want to create the version without answers, you can Alt+click (or Option+click on Mac OS) the cell bracket of a single answer cell, and Mathematica will select all cells of that same style in your notebook. Then you can hit the Delete key once, Save As with a new filename, and you're done.

You could do a similar approach by using cell tags (instead of a special cell style) for the answer cells, use NotebookLocate to select all of those cells, and then hit the Delete key to wipe out all the answers at once. I might lean towards this method because you could write a single command that would select the answer cells, delete them, and open the File > Save As dialog screen for you to save the "distribution" version of your document with a new filename. Yes, it's an extra step, but it helps minimize the effort required to create two different versions of each document. ;)

If you'd like to see an example of any of these ideas, I'm happy to put something together for you.

Regards,
Michael
User avatar
Michael_Morrison
 
Posts: 42
Joined: Fri Sep 11, 2009 9:50 pm
Organization: Wolfram Research, Inc.
Department: Academic Initiatives

Re: How Can I Lock Cells to Keep Them From Prying Eyes?

Postby bsyehuda » Mon Sep 12, 2011 7:56 pm

Unfortunately I have to support Michael's answer which is complete (to my best knowledge). The options are interpreted by the front end, and as such, are controlled by it.
One comment though. If the course material is not about Mathematica programming, I assume that the "secrete" (and maybe "secret") knowledge of cell options is not easily revealed (if one allows to be fully optimistic).

yehuda
User avatar
bsyehuda
 
Posts: 9
Joined: Wed Mar 17, 2010 3:02 pm
Organization: Ben-Gurion University
Department: Communication Systems Engineering

Re: How Can I Lock Cells to Keep Them From Prying Eyes?

Postby Tom_DeVries » Tue Sep 13, 2011 8:44 pm

Hi, I teach for an online school and I am doing pretty much exactly what you are doing. Students use CDFPlayer to view the files I create.

I use the method given above. I tag all "answer" cells with the cell tag answer (seemed logical!).

I create a test by pulling questions in from various question banks, save the file with a name that has "q" in it, then use NotebookLocate to locate the answer cells, delete them, and resave with a name that has "a" in it. It works quickly and easily and at present, I think is the only way to be sure students can't get at the content.

TOM
User avatar
Tom_DeVries
 
Posts: 13
Joined: Wed Mar 03, 2010 7:43 am
Organization: NorthStar Academy
Department: Mathematics

Re: How Can I Lock Cells to Keep Them From Prying Eyes?

Postby Gregory » Wed Sep 14, 2011 12:56 pm

Hi Tom,

Thanks for the tip. Seems like a good approach.

Gregory

Tom_DeVries wrote:Hi, I teach for an online school and I am doing pretty much exactly what you are doing. Students use CDFPlayer to view the files I create.

I use the method given above. I tag all "answer" cells with the cell tag answer (seemed logical!).

I create a test by pulling questions in from various question banks, save the file with a name that has "q" in it, then use NotebookLocate to locate the answer cells, delete them, and resave with a name that has "a" in it. It works quickly and easily and at present, I think is the only way to be sure students can't get at the content.

TOM
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 1 guest