locked output files students can turn in
Show older comments
Hello,
I'm wondering if I can get some input on a problem. I'm trying to save data generated in an app (made with AppDesigner) into a spreadsheet or other output file. Students will be using this program, and I'd like for there to be a way to password protect the file or something so the students can't modify their answers or adjust them prior to turning them in. I see two options, but I'm curious what other solutions may exist:
- use ActiveX to open excel, password protect, and save the file - but this requires whoever downloads the app to have microsoft excel. I'd like this to be more versatile as many students don't. An example I found combing MATLAB answers looks something like this:
%set password
openPassword = "password";
protectPassword = "password";
%open and set up
excel = actxGetRunningServer('Excel.Application'); % attach to open Excel instance
excel.Visible = true; % ensure Excel is visible
wb = excel.Workbooks.Add();% add a new workbook to the workbooks collection
wb.Password = openPassword;% set the password property
ws = wb.ActiveSheet(); % set ws variable to the active worksheet in wb
% write data
ws.Range("A1:A2").Value2 = {'hello','world'}
% protect the sheet, save, and close
wb.Protect(protectPassword, true, true);
wb.SaveAs(filepath);
wb.Close();
2. use the sendmail function to send the data to the instructor via e-mail when the student clicks a "submit" callback function. Can you configure sendmail for an app that is distributed so that all submissions are sent to the same e-mail? How does sendmail work when packaged into an app?
Any other ideas?
Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Update figure-Based Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!