It is possible to incorporate Matlab code in an assessment test which gives specific results to the students?
To clarify – suppose the students have to write a function in Grader which adds two numbers, something simple like:
function r = addthem(a,b)r = a+b;end
Suppose then my assessment test wants to feed a bunch of sample input in a simple way such as:
% Innocent until proven guilty.
pass = 1% Run learner solution in multiple sets of inputs.
for count = [1:100] a = randi([-100,100]) b = randi([-100,100]) % Compare.
if addthem(a,b) != reference.addthem(a,b) % Guilty.
pass = 0; endendassessVariableEqual('pass',1);
Is it possible for this function to be modified so that it shows the student, when the student submits the code, exactly what input and output are being printed? Putting a disp (or some such) inside the assessment doesn't work – can the assessment be modified to generate feedback in any way?
Best Answer