open-resources / scripts

Repo of converter scripts to and from MD files to various platform file formats.
3 stars 0 forks source link

Webwork Script - Investigate extra YAML characters based on Indentations #31

Closed Parsa-Rajabi closed 3 years ago

Parsa-Rajabi commented 3 years ago

Currently in the output file:

server: |2-
      imports: |
          import random
          import problem_bank_helpers as pbh
      generate: |
          data2 = pbh.create_data2()

          # define or load names/items/objects from server files
          TBD
          # store phrases etc
          TBD
          # Randomize Variables
          TBD
          # store the variables in the dictionary "params"
          TBD
          # define possible answers
          TBD
          # Update the data object with a new dict
          data.update(data2)
      prepare: |
          pass
      parse: |
          pass
      grade: |
          pass
part1: |-
  type: TBD
  pl-customizations:
      weight: 1

The server section has an extra | 2 - in the beginning and the part section has an extra | - added to it due to YAML dump. Ideally these should not exist.

firasm commented 3 years ago

This is not a bug, and is a matter of how many indents there are. When we last talked, we decided you had "one tab too many" wherever there was |2- , | is fine though.

Parsa-Rajabi commented 3 years ago

fixed -> https://github.com/open-resources/scripts/commit/85461ee0c6d11ecc2628f51edb21361d7863fe17