kfl / staffeli_nt

Staffeli NT Technology
MIT License
8 stars 7 forks source link

"better" options for code-snippets in feedback files #17

Open madsobitsoe opened 3 years ago

madsobitsoe commented 3 years ago

Using YAML makes it hard to write feedback containing code (and 00's style smileys). : and - are parsed as either text or control character, depending on the context.

There seems to be no way to escape these characters in YAML. They will be ignored in some cases, e.g. when they are not immediately followed by whitespace or enclosed in single/double-quotes. YAML is indent-sensitive as well, making it hard to include properly indented code-snippets. (e.g. when correcting minor mistakes in a student's code or showing them a cleaner, shorter version of what they wrote)

I think YAML is a nice and easy format, but I also spend a lot of time fighting with it. I don't have any ideas for a good and easy fix for this. "Replace YAML" might be too much to ask for, and I think "Custom YAML Parser" is too much as well.

I would be willing to make an effort, both trying to find a "better format" or implementing a proposed "solution", if anyone agrees with me that this is in fact an issue. (I would also like to be taught "how to do it", if it's possible to escape these characters)

kfl commented 3 years ago

On AP we effectively ended up dropping YAML, and wrote the feedback.txt by hand instead. So I think there is some strong indications that YAML may not be the best format for the feedback. So I'm up for changing it.

One idea that I've been toying with is to use YAML for meta data, and then use specialised markdown for the feedback.

madsobitsoe commented 3 years ago

So something along the lines of translating this template:

name: someAssignment
passing-points: 42

tasks:
  - someAssGeneral:
      title: Generelle kommentarer 
      points: 0
      rubric: |
        Some general comments

  - someAssCode:
      title: Code-part
      points: 21
      rubric: |
        Feedback for code

  - someAssReport:
      title: Report-part
      points: 21
      rubric: |
        Feedback for report

into

name: someAssignment
students:
  -  12345:
         name: students name
         login: ku-email@alumni.ku.dk

!YAML ENDS HERE SO SPLIT ME IN PYTHON! 
#someAssGeneral
##title: Generelle Kommentarer
##pointsObtainable: 0
##pointsObtained: XX
##Comment
Some general comments

#someAssCode
##title: Code-part
##pointsObtainable: 21
##pointsObtained: XX
##Comment
Feedback for code

#someAssReport
##title: Report-part
##pointsObtainable: 21
##pointsObtained: XX
##Comment
Feedback for report

It's probably not the best solution as I spent 2 minutes thinking about it, but I could see this work.