Moodle

TEXT: lesson_answers->response

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.7
  • Fix Version/s: 1.7.2, 1.8
  • Component/s: Lesson
  • Labels:
    None
  • Affected Branches:
    MOODLE_17_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE

Description

The response field in the lesson_answers table is not always set. Branch tables do not use this field and it is optional for questions. Eloy suggested in this discussion (http://moodle.org/mod/forum/discuss.php?d=63588) to allow the response field to be NULL.

This problem was found in MDL-8196

Activity

Hide
Mark Nielsen added a comment -

I put 1.8 as the fix version, but this should really be 1.7 STABLE because the Lesson module does not work at all on a fresh install using the install.xml file.

Show
Mark Nielsen added a comment - I put 1.8 as the fix version, but this should really be 1.7 STABLE because the Lesson module does not work at all on a fresh install using the install.xml file.
Hide
Mark Nielsen added a comment -

Assigning to Eloy. Eloy, let me know if you want me to fix this.

Cheers,
Mark

Show
Mark Nielsen added a comment - Assigning to Eloy. Eloy, let me know if you want me to fix this. Cheers, Mark
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Mark, as you want. I agree that it should be fixed both for 1.7 and 1.8. Steps should be:

  • Change the definition under 17_STABLE and HEAD. This will fix installations.
  • Upgrade 17_STABLE to convert the field to NULL and to drop the DEFAULT (two steps).
  • Upgrade HEAD to convert the field to NULL and to drop the DEFAULT (two steps).

As lasson->version are the same both to 17_STABLE and HEAD, incrementing both to 2006091802 should be Ok and there isn't need to perform any conditional execution under HEAD.

(Note that the "drop default" can fail under some servers so I wouldn't add its return value to the $result variable).

You decide!

Show
Eloy Lafuente (stronk7) added a comment - Hi Mark, as you want. I agree that it should be fixed both for 1.7 and 1.8. Steps should be:
  • Change the definition under 17_STABLE and HEAD. This will fix installations.
  • Upgrade 17_STABLE to convert the field to NULL and to drop the DEFAULT (two steps).
  • Upgrade HEAD to convert the field to NULL and to drop the DEFAULT (two steps).
As lasson->version are the same both to 17_STABLE and HEAD, incrementing both to 2006091802 should be Ok and there isn't need to perform any conditional execution under HEAD. (Note that the "drop default" can fail under some servers so I wouldn't add its return value to the $result variable). You decide!
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Mark,

I get this now!

Show
Eloy Lafuente (stronk7) added a comment - Hi Mark, I get this now!
Hide
Eloy Lafuente (stronk7) added a comment -

This is now done. lesson_answers->response is now nullable

Show
Eloy Lafuente (stronk7) added a comment - This is now done. lesson_answers->response is now nullable
Hide
Mark Nielsen added a comment -

Thanks Eloy! Sorry I didn't respond earlier; my work sometimes carries me away

I reviewed your code so now I know how to do it in the future. Thanks again for helping out on this one.

Cheers,
Mark

Show
Mark Nielsen added a comment - Thanks Eloy! Sorry I didn't respond earlier; my work sometimes carries me away I reviewed your code so now I know how to do it in the future. Thanks again for helping out on this one. Cheers, Mark
Hide
Eloy Lafuente (stronk7) added a comment -

NP! Thanks!

(note that I'm not dropping the DEFAULT clause explicity). This only affects PostgreSQL but it isn't critical. I've added MDL-8372 in order to drop them all in the 1.8 -> 1.9 transition.

Show
Eloy Lafuente (stronk7) added a comment - NP! Thanks! (note that I'm not dropping the DEFAULT clause explicity). This only affects PostgreSQL but it isn't critical. I've added MDL-8372 in order to drop them all in the 1.8 -> 1.9 transition.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: