How can I copy text, equations, figures and code from Live Editor to MATLAB Grader

7 views (last 30 days)
I'm putting together some coding exercises using MATLAB Grader. I'd like to be able to write the problem statement using Live Editor as well as have my reference function and the Code to Run the file in the same document (along with each assessment, but maybe that's too much).
This way I have a single file that I can run and test the reference code easily. I can also have a local source of the grader problem.
However, I haven't figured out a way to take the text from the Problem Statement in Live Editor and copy it into the Problem Statement of Grader without losing all of the formatting (monospace, underline, italic), images and Latex equations. When I bring it into Grader I have to recreate those which is inefficient and defeats the purpose of having a development file.
Is there a way to do this efficiently?

Accepted Answer

Cris LaPierre
Cris LaPierre on 9 Jan 2022
Edited: Cris LaPierre on 9 Jan 2022
Good question.
Please open your live script in MATLAB Online. In a new tab of the same browser, open your MATLAB Grader problem. Then copy from the live script in MATLAB Online. You should be able to paste to MATLAB Grader without losing any formatting (including equations and images).
If you are developing the files on your desktop, then I recommend installing MATLAB Drive Connector to add a synced MATLAB Drive folder on your desktop. Any content added to that folder will sync with MATLAB Drive in the cloud (and vice versa).
MATLAB Drive is the file system of MATLAB Online, so any content in this folder will be available in MATLAB Online automatically.
  2 Comments
Mark Thompson
Mark Thompson on 10 Jan 2022
Cris,
That did the trick! I had the drive connector already installed so that was easy to set up and get working.
I copied in some text, figures and equations into a test problem and that worked well.
Will Grader functions like assessVariableEqual work in Live Editor (on-line) so that I can write and test assessments in the Live Editor file?
Is there a way to have separate reference and learner functions to exercise assessments in Live Editor? I suppose I could name them differently and edit the assessment later in Grader. Maybe those are best developed and tested within Grader?
Thanks for your really quick reply (on a weekend no less)!
Mark
Cris LaPierre
Cris LaPierre on 10 Jan 2022
The assessment functions currently only exist within MATLAB Grader.
It is certainly possible to build and test reference solutions in MATLAB, but it can be challenging to recreate and test the assessment portion outside of the Grader environment, especially if you are using the provided assessment functions. There are features that were designed into Grader to make this easier
Script type problems
  • sharing the same random number generator seed in the reference and learner workspaces (rand will generate the same random numbers in both scripts)
  • using the same variable name in both the reference and learner solutions without one overwriting the other.
Function type problems
  • using the same function name for the reference and learner solutions
You may already have a good grasp of how things work, but if you are looking for more, I would suggest Ch 6 of our self-paced course Teaching with MATLAB. You may also try reaching out to your school's customer success engineer. If you are not sure who that is, you can contact support and they can help put you in touch.

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with MATLAB 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!