Suggestion: Add pretestcase

Suggestion: Add pretestcase

by Hongchuan Liu -
Number of replies: 2

 Sometimes, student code is not a complete program, such as a function, and parameters can be passed in testcase to control intput. If the student code is an expression, there is no way to control input.  I teach primary and secondary schools and often have students write code snippets. For example: 

Given the variable 'year', write an expression to determine if it is a leap year.  

You can assign values to 'year' in pretestcase to control the input.

In reply to Hongchuan Liu

Re: Suggestion: Add pretestcase

by Robert Mařík -
This is possible. Just customize Python3 template or use some advanced template.

See the attached file.
In reply to Robert Mařík

Re: Suggestion: Add pretestcase

by Hongchuan Liu -
Thank you!

In fact, I am currently using this method as well.

But sometimes' extra 'has other uses. If a pretestcase could be added, the universality of the default template would be even better.