MATLAB Grader: Instructor Guide to MATLAB Grader
Instructor Guide to MATLAB Grader
MATLAB Grader is a tool that allows instructors to create interactive MATLAB questions in Canvas that automatically grade and provide feedback on student work.
MATLAB Integration with Canvas
- In your Canvas course, select Assignments from the course navigation menu.
- There are two ways to create new assignments. You can either click the +Assignment button or you can add an assignment directly under an existing assignment group using the +. We recommend the +Assignment button.
- Add the assignment details, such as the assignment title, description and points.
- In the Submission Type drop-down, select External Tool. Click Find.
- On the pop-up that appears, scroll down and select MATLAB Coding Problem. Click on the Select button.
- In the Submission Type section you will now see that the URL box includes a link to MATLAB Grader. Set the assignment due and available dates and times. Click Save or Save & Publish. The Save button will create a draft of your assignment that you can publish later. The Save & Publish button will immediately publish the assignment to your course.
- You will be redirected to the MATLAB Grader platform, so that you can add content to the assignment. Questions in MATLAB are referred to as PROBLEMS.
Add a Blank MATLAB Problem
This integration with Canvas allows you to assign one problem per assignment.- On the Add Problem screen, click Blank Problem.
- Add a Title and Problem Description and Instructions.
- Scroll down and select the Problem Type: Script or Function [1].
Scripts are m-files that operate on the variables within the code and are better for a single task. A Function has certain input and output parameters and can easily be applied in multiple tasks.
The Reference Solution [2] is the instructor’s solution, which students cannot see, and is used to evaluate the student’s solution.
The Learner Template [3] provides students with starter code to write their solution.
Enter the Reference Solution and Learner Template in the text box [4].
- Select an Assessment Method. This is how your students’ code will be graded. There are two options for Assessment Method: Correct/Incorrect and Weighted.
Correct/Incorrect will return a 1 if the student passes all tests and a 0 if any of the tests fail.
For the Weighted option, instructors assign a relative point to each test and the assessment returns a decimal value between 0.00 and 1.00.
If the “Only show feedback for initial error” option is selected, feedback to students is provided on an initial error in their code. Feedback on subsequent errors will be hidden by default, but students can click to see subsequent error feedback.
- Click the + Add Assessment to create an assessment test. You can create multiple assessment tests. The following screenshot is for a Script problem type
Add a Test description [1].
Select a Test Type [2].
This option sets how the test will be marked.
Variable Equals Reference Solution: Tests if a variable from the student’s solution is equal, with tolerance, to the reference solution. Also tests variable presence, size, and data type.
Function or Keyword Is Present: Checks if a certain function(s) or keyword(s) are present in the student’s solution.
Function or Keyword Is Absent: Checks if a certain function(s) or keyword(s) are not present in the student’s solution.
MATLAB code: Compares students’ solution to the reference solution.
Enter the Variable Name You Want to Compare [3] - the variable that you are testing against the Reference Solution.
Feedback on Incorrect [4] allows the instructor to add feedback on errors in addition to the default feedback.
Note: With a Function problem type, MATLAB Code tests the students’ function; you do not select a Test Type or enter a Variable Name.
- After all assessments have been added, there are four options at the bottom of the screen:
Learner Preview displays a student view of the assignment, similar to Canvas’s Student View.
Validate Reference Solution runs the Reference Solution code and checks the assessment tests.
Save as Draft allows you to save and continue editing until you are satisfied with the problem. The problem is not visible to students when saved as a draft.
Save as Final publishes the problem for students to see. You cannot edit in this view. However, you can always go back to Draft if you notice anything wrong with your final version.
Note that your Canvas assignment must also be published for students to view the problem.
Add a Sample Problem
- On the Add Problem screen, select any of the options under Sample Problems from MathWorks.
- All available problems for the selected option are displayed. Find a problem that suits your needs, then click Copy.
- The final version of the problem is then displayed. To edit the problem, scroll down and click Set to Draft. Once you do this, the problem will not be visible to students. You can edit as required, then click Save as Final to publish the problem for students to see. Note that your Canvas assignment must also be published for students to view the problem.
To learn more about MATLAB Grader contact ctl.helpdesk@ubc.ca.
UBC Okanagan Centre for Teaching and Learning MATLAB Grader Directory
Updated September 2020