ucfopen / Materia

Engage students with easily embedded apps for online courses. Supercharge your course with compelling experiences and game mechanics.
https://ucfopen.github.io/Materia-Docs/
GNU Affero General Public License v3.0
36 stars 34 forks source link

Materia is destructive when it comes to importing/processing Qset questions & answers #259

Open zachberry opened 9 years ago

zachberry commented 9 years ago

Case study:

  1. User develops a widget in DevMateria, it works. It uses a mostly but not 100% standard qset. For example, the answers provide a foo property.
  2. User installs widget into a working actual Materia install. When installing Materia calls upon Widget_Instance which uses its find_questions function. This guesses that the questions in the demo.yaml are actual "Materia Questions" (this happens regardless of the existence of the materiaType property.
  3. This function creates new Widget_Question objects which strictly only allow these properties, as defined in the code:
    protected $_question_properties = ['text', 'assets'];
    protected $_answer_properties   = ['id', 'text', 'value', 'options', 'assets'];
  1. As a result, the widget demo fails in actual Materia since the qset unexpectedly doesn't contain some properties, such as the foo property in our example.

In the end, this is working as intended, but IMO it's unclear - especially since it works in DevMateria. I argue it's impossible for the developer to know why it's not working in actual Materia without digging through the code.

Different proposed ideas to fix this:

iturgeon commented 9 years ago

We need to make sure we don't have to re-compile all the existing widgets to add this functionality.