CuDeeB Question Types
Interactive Questions with Intelligent Feedback

CuDeeB has a few different question types. Basic flash-card style questions for fast revision, coding questions with automatic compilation, and interactive questions that provide feedback if your answer is incorrect. This article takes an in-depth look at feedback questions, using a C++ question on lambdas as an example.

Image showing the initial question display of an interactive feedback question.

So the question says ...

Given the basic syntax of a lambda is : 

[capture](parameters) -> return_type{ function }
Suppose you wanted to capture a local variable "x" by copy, and all other local variables by reference.

What will the capture look like ?

Now the correct answer to this question is


Now let's make some common mistakes ...

Getting things the wrong way around ...

Sometimes programmers accidentally put specific variables before the lambda default. In other words, they get the items the wrong way around. So we enter our answer like this :

Image showing an incorrect answer being entered by the user.

The interactive/feedback element of this question type comes into play here. The answer provided is analysed by CuDeeB's custom algorithms for some suitable feedback. In this case, the following is displayed.

Image showing CuDeeB's response to an incorrect answer.  It specifically tells the user to use an ampersand as the first capture item.

The feedback provided points you the specific issue with your answer. In this case by stating You need a capture-default to capture by reference. Use "&" as the FIRST capture parameter.

Another Example

Another common mistake is to use "=x" to refer to "capture x by copy". Suppose we make this error and provide "[&,=x]" as our answer.

Image showing CuDeeB's response to an incorrect answer. It is specifically highlighted that = is only to be used for capture defaults.

In this case the feedback is even more specific.

How about we use the wrong kind of brackets ?

Image showing CuDeeB's response to an incorrect answer. It highlights the need for square brackets.