The context:
Together with a couple of other people, I'm running a programming course that uses C++. We write and release assignments at a rapid pace. An assignment release consists of a code distribution (several folders and files) that is missing some sections for the students to fill in, and an example binary that shows them what their programs are supposed to do at the end. The work in each assignment is divided into a bunch of requirements, normally up to 5. There are also multiple items of optional extra work. Sometimes I want to include implementations of those extra items in the example binary, sometimes not.
I want to conveniently:
- Test the code at different stages of requirement completion.
- Produce the code distribution for the students.
- Produce the example binary with all requirement code and some of the extra code.
Flipping SOLN on/off in my IDE gives me either the behavior of the code distribution or an example binary with all the code. Also, I wrote a small executable that strips the SOLN stuff out and automatically produces the code distribution from a folder. It works great and doesn't require installing. What's missing is that I don't have the means to jump to a partial solution or an ability to easily exclude some code from my example binary.
I'm thinking about splitting my macro into something like "SOLN_REQ_1..10" and "SOLN_EXTRA_1..10". Then I could use derivatives like "SOLN_REQ_UPTO_4" to instantly enable a specific subset in the IDE. The distrib tool would only need to strip the new stuff out, no complicated changes.
Comments? Is there a tool I should be using instead of putting more time in my own?
Note that the goal is to speed up already-rapid development, making comparisons to submitted student code, etc. - maintenance doesn't need improvement. Any solution has to be lightweight, stuff like per-requirement branching in a VCS is right out.
Together with a couple of other people, I'm running a programming course that uses C++. We write and release assignments at a rapid pace. An assignment release consists of a code distribution (several folders and files) that is missing some sections for the students to fill in, and an example binary that shows them what their programs are supposed to do at the end. The work in each assignment is divided into a bunch of requirements, normally up to 5. There are also multiple items of optional extra work. Sometimes I want to include implementations of those extra items in the example binary, sometimes not.
I want to conveniently:
- Test the code at different stages of requirement completion.
- Produce the code distribution for the students.
- Produce the example binary with all requirement code and some of the extra code.
Code:
#ifdef SOLN
... this goes in example binary but not code distribution ...
#else
... vice versa ...
#endif
I'm thinking about splitting my macro into something like "SOLN_REQ_1..10" and "SOLN_EXTRA_1..10". Then I could use derivatives like "SOLN_REQ_UPTO_4" to instantly enable a specific subset in the IDE. The distrib tool would only need to strip the new stuff out, no complicated changes.
Comments? Is there a tool I should be using instead of putting more time in my own?
Note that the goal is to speed up already-rapid development, making comparisons to submitted student code, etc. - maintenance doesn't need improvement. Any solution has to be lightweight, stuff like per-requirement branching in a VCS is right out.