ZGNkYTI2MmEwMmM2NTU4MGJjMmM4OTIyNTIyNGI0MWI1MjNkODY0MWIzYWRmMTQ3MTk1YTQzOGMyZWEzYzQzYg.msfha8xz.eyJ1cmwiOiIvcGwvY291cnNlX2luc3RhbmNlLzIvaW5zdGFuY2VfcXVlc3Rpb24vMjA1LyIsImF1dGhuX3VzZXJfaWQiOiIxIn0
Skip to main content Accessibility guide
PrairieLearn Go home
  • XC 101, SectionA
  • Assessments
  • Gradebook
  • C4
Load from disk
  • Dev User student
    View type
    ✓ Staff view staff ✓ Student view student ✓ Student view without access restrictions student
    Effective user
    Customize…
    Course Requests Settings Log out

Regenerate assessment instance

Warning: Regenerating the assessment instance will select a new set of questions from this assessment. Any progress on the current assessment instance will be lost.

Are you sure you want to regenerate the assessment instance?

Course staff: Regenerate your assessment instance to pick up changes to the assessment or to get a fresh set of questions.

C4.26. Element pl-sketch: Advanced grading examples

The examples below illustrate some concrete, more advanced use cases for pl-sketch and how they can be implemented. For convenience, all examples allow blank submissions.

To grade curves drawn with pl-sketch tools like free-draw, spline or polyline, it is often easiest to compare them to a reference function via the match-function grading criterion. This criterion can also be used for partial or piecewise functions when the comparison is delimited by an x-range parameter.

For full marks, draw the function $$ f(x) = \begin{cases} x & \text{if } x < 0 \\ x^2 & \text{if } x \geq 0 \end{cases}. $$

eyJ3aWR0aCI6IDgwMCwgImhlaWdodCI6IDQ1MCwgInhyYW5nZSI6IFstMy4wNzY5MjMwNzY5MjMwNzcsIDMuMDc2OTIzMDc2OTIzMDc3XSwgInhzY2FsZSI6ICJsaW5lYXIiLCAieXJhbmdlIjogWy01LjIzMjU1ODEzOTUzNDg4NCwgNS4yMzI1NTgxMzk1MzQ4ODRdLCAieXNjYWxlIjogImxpbmVhciIsICJwbHVnaW5zIjogW3sibmFtZSI6ICJheGVzIiwgImNvbG9ycyI6IHsieGF4aXNMYWJlbCI6ICJibHVlIiwgInlheGlzTGFiZWwiOiAiYmx1ZSJ9LCAiZm9udFNpemUiOiB7InhheGlzTGFiZWwiOiAxNCwgInlheGlzTGFiZWwiOiAxNH0sICJ4YXhpc0xhYmVsIjogeyJkeCI6IDEwLCAiZHkiOiAxMCwgInZhbHVlIjogIngifSwgInlheGlzTGFiZWwiOiB7ImR4IjogMTAsICJkeSI6IDIwLCAidmFsdWUiOiAieSJ9fSwgeyJpZCI6ICJmZCIsICJuYW1lIjogImZyZWVmb3JtIiwgInNpemUiOiBudWxsLCAiY29sb3IiOiAiYmx1ZSIsICJncm91cCI6IG51bGwsICJsYWJlbCI6ICJGdW5jdGlvbiBmKHgpIiwgImxpbWl0IjogbnVsbCwgImNsb3NlZCI6IG51bGwsICJoZWxwZXIiOiBmYWxzZSwgImhvbGxvdyI6IG51bGwsICJvcGFjaXR5IjogbnVsbCwgInJlYWRvbmx5IjogZmFsc2UsICJhcnJvd0hlYWQiOiBudWxsLCAiZGFzaFN0eWxlIjogbnVsbCwgImZpbGxDb2xvciI6IG51bGwsICJsZW5ndGhDb25zdHJhaW50IjogbnVsbCwgImRpcmVjdGlvbkNvbnN0cmFpbnQiOiBudWxsfV0sICJjb29yZGluYXRlcyI6ICJjYXJ0ZXNpYW4iLCAiaW5pdGlhbHN0YXRlIjoge30sICJzYWZldHlCdWZmZXIiOiAxMCwgImVuZm9yY2VCb3VuZHMiOiBmYWxzZX0=
Loading SketchInput canvas...

When splitting up grading criteria as in the example above, giving partial points per criterion is often desirable. To prevent giving any partial marks unless the full function is correct, it is possible to use stage parameters and a dummy criterion that assigns points when all other grading criteria are satisfied.

For full marks, draw the function $$ f(x) = \begin{cases} x & \text{if } x < 0 \\ x^2 & \text{if } x \geq 0 \end{cases}. $$

eyJ3aWR0aCI6IDgwMCwgImhlaWdodCI6IDQ1MCwgInhyYW5nZSI6IFstMy4wNzY5MjMwNzY5MjMwNzcsIDMuMDc2OTIzMDc2OTIzMDc3XSwgInhzY2FsZSI6ICJsaW5lYXIiLCAieXJhbmdlIjogWy01LjIzMjU1ODEzOTUzNDg4NCwgNS4yMzI1NTgxMzk1MzQ4ODRdLCAieXNjYWxlIjogImxpbmVhciIsICJwbHVnaW5zIjogW3sibmFtZSI6ICJheGVzIiwgImNvbG9ycyI6IHsieGF4aXNMYWJlbCI6ICJibHVlIiwgInlheGlzTGFiZWwiOiAiYmx1ZSJ9LCAiZm9udFNpemUiOiB7InhheGlzTGFiZWwiOiAxNCwgInlheGlzTGFiZWwiOiAxNH0sICJ4YXhpc0xhYmVsIjogeyJkeCI6IDEwLCAiZHkiOiAxMCwgInZhbHVlIjogIngifSwgInlheGlzTGFiZWwiOiB7ImR4IjogMTAsICJkeSI6IDIwLCAidmFsdWUiOiAieSJ9fSwgeyJpZCI6ICJmZCIsICJuYW1lIjogImZyZWVmb3JtIiwgInNpemUiOiBudWxsLCAiY29sb3IiOiAiYmx1ZSIsICJncm91cCI6IG51bGwsICJsYWJlbCI6ICJGdW5jdGlvbiBmKHgpIiwgImxpbWl0IjogbnVsbCwgImNsb3NlZCI6IG51bGwsICJoZWxwZXIiOiBmYWxzZSwgImhvbGxvdyI6IG51bGwsICJvcGFjaXR5IjogbnVsbCwgInJlYWRvbmx5IjogZmFsc2UsICJhcnJvd0hlYWQiOiBudWxsLCAiZGFzaFN0eWxlIjogbnVsbCwgImZpbGxDb2xvciI6IG51bGwsICJsZW5ndGhDb25zdHJhaW50IjogbnVsbCwgImRpcmVjdGlvbkNvbnN0cmFpbnQiOiBudWxsfV0sICJjb29yZGluYXRlcyI6ICJjYXJ0ZXNpYW4iLCAiaW5pdGlhbHN0YXRlIjoge30sICJzYWZldHlCdWZmZXIiOiAxMCwgImVuZm9yY2VCb3VuZHMiOiBmYWxzZX0=
Loading SketchInput canvas...

The xy-flip parameter allows the grading of curves that represent functions of $y$. Because this parameter also changes the interpretation of some grading criteria, we recommend testing question with this parameter carefully to make sure they match the expected grading logic.

For full marks, draw the curve $x = y^2$.

eyJ3aWR0aCI6IDgwMCwgImhlaWdodCI6IDQ1MCwgInhyYW5nZSI6IFstNS4xMjgyMDUxMjgyMDUxMjgsIDUuMTI4MjA1MTI4MjA1MTI4XSwgInhzY2FsZSI6ICJsaW5lYXIiLCAieXJhbmdlIjogWy0zLjEzOTUzNDg4MzcyMDkzLCAzLjEzOTUzNDg4MzcyMDkzXSwgInlzY2FsZSI6ICJsaW5lYXIiLCAicGx1Z2lucyI6IFt7Im5hbWUiOiAiYXhlcyIsICJjb2xvcnMiOiB7InhheGlzTGFiZWwiOiAiYmx1ZSIsICJ5YXhpc0xhYmVsIjogImJsdWUifSwgImZvbnRTaXplIjogeyJ4YXhpc0xhYmVsIjogMTQsICJ5YXhpc0xhYmVsIjogMTR9LCAieGF4aXNMYWJlbCI6IHsiZHgiOiAxMCwgImR5IjogMTAsICJ2YWx1ZSI6ICJ4In0sICJ5YXhpc0xhYmVsIjogeyJkeCI6IDEwLCAiZHkiOiAyMCwgInZhbHVlIjogInkifX0sIHsiaWQiOiAiZmQiLCAibmFtZSI6ICJmcmVlZm9ybSIsICJzaXplIjogbnVsbCwgImNvbG9yIjogImJsdWUiLCAiZ3JvdXAiOiBudWxsLCAibGFiZWwiOiAiRnVuY3Rpb24gZih4KSIsICJsaW1pdCI6IG51bGwsICJjbG9zZWQiOiBudWxsLCAiaGVscGVyIjogZmFsc2UsICJob2xsb3ciOiBudWxsLCAib3BhY2l0eSI6IG51bGwsICJyZWFkb25seSI6IGZhbHNlLCAiYXJyb3dIZWFkIjogbnVsbCwgImRhc2hTdHlsZSI6IG51bGwsICJmaWxsQ29sb3IiOiBudWxsLCAibGVuZ3RoQ29uc3RyYWludCI6IG51bGwsICJkaXJlY3Rpb25Db25zdHJhaW50IjogbnVsbH1dLCAiY29vcmRpbmF0ZXMiOiAiY2FydGVzaWFuIiwgImluaXRpYWxzdGF0ZSI6IHt9LCAic2FmZXR5QnVmZmVyIjogMTAsICJlbmZvcmNlQm91bmRzIjogZmFsc2V9
Loading SketchInput canvas...
Additional attempts available with new variants

Correct answer

Collection 4

Assessment overview
Total points: 0/360
Score:
0%

Question C4.26

Value: 2
All variants: Open (current)
Total points: — /10
Auto-graded question

This form is only for reporting errors in the question itself. Do not use this form if you just don't know how to answer the question.

Previous question Next question

 Personal Notes

No attached notes

Attached files will be saved here for your reference. These files act as personal notes and can be used for your own review purposes. They are not used for grading.

Max file size: 10 MB

Attached personal notes will be saved here for your reference. These notes can be used for your own review purposes. They are not used for grading.

Staff information

Student details

Dev User
dev@example.com

Question

QID:
element/sketchAdvanced
Title:
Element pl-sketch: Advanced grading examples

Variant

Started at:
2026-08-04 16:38:15 (CDT)
Duration:
0s
Show/Hide answer
{}

Assessment instance

Assessment:
gallery/elements
Started at:
2026-08-04 16:37:17 (CDT)
Duration:
0s
View log
This box is not visible to students.