Generating a Custom Set of Solutions for Each Student

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.

Generating a Custom Set of Solutions for Each Student

Postby Gregory » Sun Oct 16, 2011 9:04 pm

Hello everyone,

I used Mathematica to generate different parameters for each student in my class for an assignment.

Suppose I have just two students whose IDs are

myStudents = {2222222, 3333333};

I would like to be able to loop over the student IDs to produce either one notebook per student or to export the custom answers for each directly to PDF. Something like

(
CellPrint[Cell["Exercise 1", "Section"]]
Print[myStudent[#]]
---- How? --- Input code for custom answer for exercise 1 evaluated here and printed to a cell
CellPrint[Cell["Exercise 2", "Section"]]
---- How? --- Input code for custom answer for exercise 2 evaluated here and printed to a cell
---- and so on
) & /@ Range[Length[myStudents]]

I get stuck on how to out the results of a calculation for a cell. For example, I use CellPrint[BoxData[ etc.]] to print grids of data to cells but the formatting of the data is lost.

Any tips would be much appreciated,

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

Re: Generating a Custom Set of Solutions for Each Student

Postby Tom_DeVries » Tue Oct 18, 2011 12:00 pm

Hi, I am not sure if this is what you need, but I use this all the time to maintain formatting of plots, grids, tables, etc.

writething[nb_, thing_] :=
NotebookWrite[nb, Cell[{ToBoxes[thing]}, "Output"]];


"thing" can be anything

For example...

fred = NotebookCreate[];

plot1 = Plot[x^2, {x, -3, 3}];

plot2 = Plot[2 x - 3, {x, -3, 3}];

grid = Grid[{{"hi", "there"}, {plot1, plot2}}, Frame -> All];

writething[fred, grid]

Let me know if that helps!

BTW, are your students reading these file on computer? If so, they can use the free CDFPlayer, which saves you converting to PDF form. And you get all the functionality/interactivity that is possible with the CDF format.

Sincerely,

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

Re: Generating a Custom Set of Solutions for Each Student

Postby Gregory » Wed Oct 19, 2011 11:45 pm

Thanks Tom,

I'll give it a shot. I do recall messing around with BoxData[ToBoxes[theThing]] or something similar. It worked except that theThing, if it was a grid or table, lost its font formatting. Maybe it will work if I leave off BoxData.

Regards,

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

cron