Main Content

Execution Time Limits for Learner Solutions

MATLAB® Grader™ enforces an execution time limit of 60 seconds. The clock starts when the learner clicks Run, Run Function, or Submit, and stops when the software returns the output and assessment test results. If the total execution time exceeds the limit, the learner receives this error message: "The server timed out while running and assessing your solution."

Learners might be able to run their solution without error but then receive a timeout error when they submit. This situation occurs when the reference solution and assessment tests bring the total execution time over the limit.

To estimate the execution time required for a reference solution, run it using MATLAB Online™. The computational environment of MATLAB Online is similar to MATLAB Grader. Then, estimate the execution time for submissions based on whether the assessment item is a script or a function. If you estimate that the execution time for an assessment item is likely to exceed 60 seconds, redesign or remove the assessment item.

Script Assessment Items

For a script assessment item, when the learner clicks Run, their solution runs one time. When the learner clicks Submit, MATLAB Grader runs this sequence of actions:

  1. Reference solution

  2. Learner solution

  3. All assessment tests, in sequential order

Timeout errors typically result from errors in the learner solution, inefficient code, or printing excessive output to the screen.

Function Assessment Items

For a function assessment item, when the learner clicks Run Function, the code in Code to call your function runs one time. When the learner clicks Submit, the assessment tests run in sequential order. Each assessment test runs the learner function and the reference function.

For example, submitting an assessment item with three assessment tests runs the learner solution and reference solution once for each assessment test. If the learner and reference solutions each take approximately 10 seconds to run, the estimated execution time is 60 seconds. Learners are likely to receive a timeout error.

Related Topics

Go to top of page