Chris Chudzicki, 8-17-2016
more authentic
higher cognitive skill
<script type="loncapa/python">
<![CDATA[
def check_function(expect, answer):
#Grading code here
]]>
</script>
<customresponse cfn="check_function">
<textline />
<textbox />
<formulaequationinput />
</customresponse><customresponse cfn="check_function">
<jsinput gradefn="getInput"
get_statefn="getState"
set_statefn="setState"
initial_state='{}'
width="660"
height="550"
html_file="/static/problem.html"
/>
</customresponse><problem display_name="Acceleration in Circular Motion">
<script type="loncapa/python">
import python_lib.vectordraw as vectordraw
custom_checks = {'sum_vec': vectordraw.custom.check_sum_vec,}
grader = vectordraw.Grader("Success Message", custom_checks)
cfn = grader.cfn
</script>
<!--Problem Description Here -->
<customresponse cfn="cfn">
<jsinput gradefn="getInput"
get_statefn="getState"
set_statefn="setState"
initial_state='{}'
width="800"
height="500"
html_file="/static/PROBLEM_FILE.html"
/>
</customresponse>
</problem>Problem XML File
// Setup your vectors
vectors: [
{name: 'a_t', description: 'Tangential Acceleration'},
{name: 'a_r', description: 'Radial Acceleration'},
{name: 'a', description: 'Acceleration'},
],
//Convenient, built-in check functions
expected_result: {
'a_t': {tail: [-0.25,4.5], angle:180, angle_errmsg: "Is the particle up or slowing down?"},
'a_r': {tail: [-0.25,4.5], angle:270},
'a' : {tail: [-0.25,4.5], tail_tolerance:3 }
},
//Advanced: all the power of customresponse check functions
custom_checks: [
{
check: 'sum_vec',
vectors: ['a_r', 'a_t', 'a'],
coeffs: [1, 1, -1],
expected: {x:0, y:0},
errmsg: "The acceleration vector drawn is not consistent with its components."
}
]Problem HTML File
Not that great for free body diagrams?
Better default feedback messages, too!
import python_lib.cfn_tools as cfn_tools
# define or import old_check_function
pretty_check_function = pretty( old_check_function )# plus optional settingsPhysics courses (8.01, 8.05) have lots of <formularesponse/> problems
<problem>
<formularesponse type='cs' answer='r*sin(theta)' samples='theta,r@ 0,4:1,9 #3'>
<!-- cs means case-sensitive -->
<!-- sample theta in range [0,1]-->
<!-- sample r in range [4,9]-->
<responseparam default='1%' type='tolerance'/>
<formulaequationinput inline='1'/>
</formularesponse>
</problem>Obstacle 2: When should we give feedback?
ODL (Ike's) Dashboard
Obstacle 1: How to code formularesponse feedback?
Two options:
a) python hint function
b) XML <formulahint/> tag
<formularesponse answer="m*c^2" samples="...">
<formulaequationinput inline="1"/>
<hintgroup>
<formulahint answer="m*c^3" samples="..." name="cubed"/>
<hintpart on="cubed"><text>Some Hint</text></hintpart>
</hintgroup>
</formularesponse>Existing analytics tools don't group formularesponse submissions appropriately.
Give feedback for common wrong answers! But ...
Obstacle 3: For which problems is it worth writing feedback?
<problem>
<formularesponse type="cs" answer="m*c^2" samples="m,c@ 1,1:3,3 #5">
<responseparam default="0.01%" type="tolerance"/>
<formulaequationinput inline="1"/>
<hintgroup>
<formulahint answer="m*c^3" samples="m,c@ 1,1:3,3 #5" name="cubed"/>
<hintpart on="cubed"><text>Some Hint</text></hintpart>
</hintgroup>
</formularesponse>
</problem>1. Start with big CSV of student submissions, attempt number, correctness
2. Numerically evaluate submissions (using edX grading libraries)
3. Group submissions by approximate equivalence
Screenshot is:
file:///Users/cchudzicki/Documents/_dev-personal/FormulaResponseAnalysis/801r-2015/gui/problem/pset_pset7_2_2_1.html
<formularesponse answer="m*c^2" samples="...">
<formulaequationinput inline="1"/>
<hintgroup>
<formulahint answer="m*c^3" samples="..." name="cubed"/>
<hintpart on="cubed"><text>Some Hint</text></hintpart>
</hintgroup>
</formularesponse>Can we provide useful feedback automatically?
import python_lib.formularesponse_tools.check_dimensions as cd
import python_lib.hfn_tools as hfn_tools
expected = "sqrt(2*h/g)*v_0"
samples = "v_0,g,h@ 1,1,1:2,2,2 #3"
L = cd.Dimension({"Length":1})
T = cd.Dimension({"Time":1})
dims_dict = {'v_0': L/T, 'g': L/T**2,'h': L}
checker = cd.DimensionsChecker(expected, samples, dims_dict)
hint_fn = checker.hint_fn #get hint_fn from checker
hint_fn = hfn_tools.pretty(hint_fn) #make hint_fn prettycomplements specific wrong answer approach
import python_lib.formularesponse_tools.check_dimensions as cd
import python_lib.hfn_tools as hfn_tools
expected = "sqrt(2*h/g)*v_0"
samples = "v_0,g,h@ 1,1,1:2,2,2 #3"
L = cd.Dimension({"Length":1})
T = cd.Dimension({"Time":1})
dims_dict = {'v_0': L/T, 'g': L/T**2,'h': L}
checker = cd.DimensionsChecker(expected, samples, dims_dict)
hint_fn = checker.hint_fn #get hint_fn from checker
hint_fn = hfn_tools.pretty(hint_fn) #make hint_fn pretty<formularesponse expected="$expected" samples="$samples">
<!--etc -->
<hintgroup hintfn="hint_fn"/>
</formularesponse>https://github.com/ChristopherChudzicki/
*or use OpenCraft version