Aalto-LeTech / jsav-exercise-recorder

Records students' solutions to JSAV-based visual algorithm simulation exercises
0 stars 1 forks source link

Prim-PQ: investigate why grading works #271

Open atilante opened 2 months ago

atilante commented 2 months ago

Description

Git branch: jaal2.0.

Prim-PQ ("scaffolded" Prim) was modified in https://github.com/Aalto-LeTech/jsav-exercise-recorder/pull/263 : the custom grader based on priority queue operations should have been removed. Based on manual testing, grading and JAAL recording seem to work correctly.

The current understanding of JSAV default grader is that one should specify which properties of the data structure states are compared during grading. Reference: JSAV API > Exercise class > constructor > options parameter > compare subparameter. Unfortunately, the documentation of JSAV API is a bit scarce there.

Puzzling facts:

F1. The compare parameter of the exercise configuration is currently compare: [{class: "spanning"}] (source)

F2. The init function returns both the graph and binary heap JSAV objects. (source)

F3. The model function returns similar objects than the initfunction. (source)

F4. Function markEdge still calls function storePqOperationStep, although it is related to the neighbour-order-agnostic grader (that #263 should have been removed). (source)

F5. Functions enqueueClicked, updateClicked, and visitNeighbouralso call storePqOperationStep.

F6. The binding to the custom grading function scaffoldedGrader() was removed in #263 (source)

F1 and F6 should cause the grading to fail, because only spanning tree edges are compared, not fringe edges. By this assumption, it would mean that the student could enqueue the neighbours of a node in an arbitrary order and still get full points. However, the grading works correctly.

It seems that due to F2 and F3, also the binary heap states are included in the grading, which uses the JSAV default grader. Even more, it seems that JSAV correctly compares the structure and contents of the binary heap. It seems that because the binary heap represents the fringe information, the grading works.

Proposed steps

Modify and investigate:

Test grading manually: