Skip to content
  • Tim Hunt's avatar
    a3e6ad77
    MDL-34066 adaptive behaviour: refactor logic out of renderer. · a3e6ad77
    Tim Hunt authored
    These changes move the logic to the behaviour class, which is how things
    should be.
    
    It also makes it easier to re-use the code that displays the messages
    like "Marks for this submission: 1.00/1.00. Accounting for previous
    tries, this gives 0.33/1.00." in other places.
    
    To try to make it clearer what is going on, I introduced a new class
    qbehaviour_adaptive_mark_details to hold and document the data that the
    behaviour needs to return, and the renderer can base its display on.
    
    As far as my testing can tell (and there are new unit tests), this
    commit does not change the existing behaviour.
    
    This commit also replaces all the string concatenation that is going on,
    which should help translators. At the moment, a few of the old strings
    are still in the language file, and are used in the unit tests to verify
    that the behaviour has not changed.
    
    Thanks to Oleg Sychev for making a helpful suggestion about the API.
    a3e6ad77
    MDL-34066 adaptive behaviour: refactor logic out of renderer.
    Tim Hunt authored
    These changes move the logic to the behaviour class, which is how things
    should be.
    
    It also makes it easier to re-use the code that displays the messages
    like "Marks for this submission: 1.00/1.00. Accounting for previous
    tries, this gives 0.33/1.00." in other places.
    
    To try to make it clearer what is going on, I introduced a new class
    qbehaviour_adaptive_mark_details to hold and document the data that the
    behaviour needs to return, and the renderer can base its display on.
    
    As far as my testing can tell (and there are new unit tests), this
    commit does not change the existing behaviour.
    
    This commit also replaces all the string concatenation that is going on,
    which should help translators. At the moment, a few of the old strings
    are still in the language file, and are used in the unit tests to verify
    that the behaviour has not changed.
    
    Thanks to Oleg Sychev for making a helpful suggestion about the API.
Loading