LEARNING OUTCOME
Hiring Managers will learn about generating and using code stubs in their programming-related questions.
What are code stubs?
Code stub is a piece of code that can be given to the candidates as a Kickstarter in the Test. Code stubs are useful because they save the candidates' time and allows you to test their problem-solving skills better, rather than testing their memory.
To generate code stubs
Login to your WeCP account as a Recruiter or Hiring Manager.
Select the concerned Test from the home page and navigate to the Questions tab at the top.
Click on the down arrow in the Section, to view all the questions of that section, or click on Expand All to view the questions in all the sections.
Choose the question for which you want to generate a code stub and click on the pencil icon corresponding to it.
Further, in the Question Editor, click on the Codestub generator tab and configure the following details:
Function name: Enter the name of the readymade function that you want to provide to the candidate.
Function return type: Enter the return type of the same function.
Further, if you want to add a variable, click on the + New variable button below it.
For the variable that you want to add, you must specify the following parameters:
Type: Enter the data type of the variable.
Variable Name: Enter the name of the variable.
Size: Specify the size of the variable.
Pass to Function: Mark this checkbox if you want to pass the variable to the function.
Delete: At some point, if you want to delete that variable, click on the Delete icon corresponding to the variable.
Every time that you want to add a new variable, click on the Add variable button and specify all the required details.
After adding all the variables, click on Generate Code Stub.
Choose the programming language of your choice from the drop-down menu to check the code stub in that language. Following is an example code stub in the Python3 language:
You can also manually make changes to the code stub as per your choice.
Don't forget to click on Save Question to save all the changes.
This code stub will be visible to the candidates in the code editor below the question in the Test environment and act as a Kickstarter for them in the Test.
Read More How can I create New Questions in Tests?