Simon-Initiative / course-digest

Tool to produce a summary or digest of OLI course package contents
MIT License
2 stars 0 forks source link

[BUGFIX] handle implicit input without id [MER-2679] #207

Closed andersweinstein closed 1 year ago

andersweinstein commented 1 year ago

Legacy apparently allows an input question, say for a numeric input, to be defined minimally with a purely implied input element with no input id mentioned anywhere: no input element, no input_refs in body, and no input id attribute in part responses. Example from STEM Readiness course:

<numeric id="alg_laws_p6_q1">
        <body> Expand 6.285 &#8226; 10<sup>3</sup>
        </body>
        <part>
            <response match="6285" score="10">
                <feedback>Correct. You moved the decimal point three places to the right.</feedback>
            </response>
            <response match="*" score="0">
                <feedback>Incorrect. Move the decimal point three places to the right.</feedback>
            </response>
        </part>
  </numeric>

Migration tool does synthesize implied input elements, but wound up crashing if id not referenced in part response elements. This change detects that case and generates an id for it.