I'm working on how to represent Parsons problems that spawn executable activecodes upon completion and would like some input on schema design for it.
Just adding an @executable to an exercise isn't enough as there are quite possibly a host of other options that the activecode needs. It can get the language from the exercise, but it might need things like @compiler-args, @include, @codelens, etc... Adding all of those to the exercise doesn't feel right.
So I am leaning to executable-area (I don't love that name) as an optional element in an exercise with blocks. Its presence implies that the Parsons should span the activecode. The executable-area can have all the attributes that activecodes can get - they are applied to the activecode that gets created later. Finally, the executable-area can have child elements "prepended" and "appended" that contain text that is added to whatever the student produced in the Parsons problem.
A mockup is below. Any thoughts and advice is welcome.
<exercise label="parsons-with-executable" language="cpp" adaptive="yes" indentation="show">
<title>Parsons Problem with executable</title>
<statement>
<p>Write a simple C++ function <c>int foo(int x)</c> that simply applies the function <c>int bar(int x) (from <c>mystery.h</c>) to x and returns the result.</p>
</statement>
<blocks>
<block order="4">
<cline>int foo(int x) {</cline>
</block>
<block order="2">
<cline> int barResult = bar(x);</cline>
</block>
<block order="3">
<cline> return bar;</cline>
</block>
<block order="1">
<cline>}</cline>
</block>
</blocks>
<executable-area compiler-args="-std=c++17" linker-args="-s" include="mystery.h" datafile="ccdata2.txt" codelens="no">
<prepended>
//extra code before Parsons output
#include <iostream>
using namespace std;
</prepended>
<appended>
//extra code after Parsons output
int main() {
cout << foo(5) << endl;
}
</appended>
</executable-area>
</exercise>
Andrew Scholer (he/him/his)
Computer Science Instructor/Program Chair
Chemeketa Community College