Moodle
  1. Moodle
  2. MDL-24594

provide HTML editor in multichoice (and calculatedmulti) question's answers

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      Create a new MC question. Verify the HTML editor appears for the choices. Add an image to at least one of the choices.

      Save the question, and then re-edit it. Verify everything has been saved and re-loaded accurately.

      Preview the question, and verify that it looks right.

      Add the question to a quiz. Attempt the quiz as a student one or more times. As teacher go to the quiz responses report and verify the recorded response looks OK.

      Still as teacher, go to the statistics report and drill down to the details for this question. Verify that the analysis of responses is right.

      Export the question as Moodle XML. Import to another course. Verify that it has transferred accurately.

      Export the question as GIFT fomat. Verify that the image is handled in a sensible way.

      Backup the course with the MC question. Restore to another course. Verify that it has transferred accurately.

      Edit a MC question that you created before this patch was applied. Make sure it is OK to edit it.

      Show
      Create a new MC question. Verify the HTML editor appears for the choices. Add an image to at least one of the choices. Save the question, and then re-edit it. Verify everything has been saved and re-loaded accurately. Preview the question, and verify that it looks right. Add the question to a quiz. Attempt the quiz as a student one or more times. As teacher go to the quiz responses report and verify the recorded response looks OK. Still as teacher, go to the statistics report and drill down to the details for this question. Verify that the analysis of responses is right. Export the question as Moodle XML. Import to another course. Verify that it has transferred accurately. Export the question as GIFT fomat. Verify that the image is handled in a sensible way. Backup the course with the MC question. Restore to another course. Verify that it has transferred accurately. Edit a MC question that you created before this patch was applied. Make sure it is OK to edit it.
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-24594_wip
    • Rank:
      471

      Description

      Original description :
      please provide HTML editor in quiz question's answers
      see http://moodle.org/mod/forum/discuss.php?d=159574

      will be applied to multichoice (and calculatedmulti) (see comments)

        Issue Links

          Activity

          Hide
          Al Ali added a comment -

          Hi Tim and Joseph,

          Was this overlooked in 2.0.1 ?

          When you expect it will be resolved?

          Regards
          Al

          Show
          Al Ali added a comment - Hi Tim and Joseph, Was this overlooked in 2.0.1 ? When you expect it will be resolved? Regards Al
          Hide
          Pierre Pichet added a comment -

          Tim,
          Given your workload, what could be the delay to revise and process classic CVS diff files if I can submit a workking solution for multiple choice in the next days ?

          Show
          Pierre Pichet added a comment - Tim, Given your workload, what could be the delay to revise and process classic CVS diff files if I can submit a workking solution for multiple choice in the next days ?
          Hide
          Pierre Pichet added a comment -

          Tim,
          To control the form length could we set the answer HTML display control to something as
          not display if there is no HTML code in the answer and add a button so that the user can set it on if he want HTML in the answer fields and or store this as preference?

          Show
          Pierre Pichet added a comment - Tim, To control the form length could we set the answer HTML display control to something as not display if there is no HTML code in the answer and add a button so that the user can set it on if he want HTML in the answer fields and or store this as preference?
          Hide
          Tim Hunt added a comment -

          I don't think trying to do that specifically in the question type forms is a good idea.

          I think we just have to switch to using the HTML editor, and hope that in the future, someone makes the HTML editor form control more compact.

          Show
          Tim Hunt added a comment - I don't think trying to do that specifically in the question type forms is a good idea. I think we just have to switch to using the HTML editor, and hope that in the future, someone makes the HTML editor form control more compact.
          Hide
          Pierre Pichet added a comment -

          Tim,
          You wrote :

          "I think we just have to switch to using the HTML editor, and hope that in the future, someone makes the HTML editor form control more compact"

          I have an almost finished solution for multiple choice which imply also changes in import-export ( done for Moodle XML) and back-up and restore ( todo).
          Should I create a new sub-task for multiplechoice or should we change this bug name to multiplechoice only?

          I don't think that we should use the HTML editor as a general default for all question types.

          Show
          Pierre Pichet added a comment - Tim, You wrote : "I think we just have to switch to using the HTML editor, and hope that in the future, someone makes the HTML editor form control more compact" I have an almost finished solution for multiple choice which imply also changes in import-export ( done for Moodle XML) and back-up and restore ( todo). Should I create a new sub-task for multiplechoice or should we change this bug name to multiplechoice only? I don't think that we should use the HTML editor as a general default for all question types.
          Hide
          Tim Hunt added a comment -

          HTML editor should only be used for multichoice (and calculatedmulti). So, no need for separate sub-tasks.

          Show
          Tim Hunt added a comment - HTML editor should only be used for multichoice (and calculatedmulti). So, no need for separate sub-tasks.
          Hide
          Pierre Pichet added a comment - - edited

          As it is my first complex changes using GIT, should I do multiple commits in my local branch MDL-24594 to clearly identify the different steps in the various files so that you (and the following reviewers) can more easily follow the code changes and when everything is ready push the branch on GITHub ?

          If so, there is no need to a specific page în Development docs i.e
          http://docs.moodle.org/en/Development:Adding_images_in_multiple_choice_answers ?

          Show
          Pierre Pichet added a comment - - edited As it is my first complex changes using GIT, should I do multiple commits in my local branch MDL-24594 to clearly identify the different steps in the various files so that you (and the following reviewers) can more easily follow the code changes and when everything is ready push the branch on GITHub ? If so, there is no need to a specific page în Development docs i.e http://docs.moodle.org/en/Development:Adding_images_in_multiple_choice_answers ?
          Hide
          Tim Hunt added a comment -

          Generally, breaking the work into small logical commits is a good idea. (With git, one can merge small commits to make a new bigger commit later, if desired, so it is not a big problem to do too many small commits.)

          There is no need for a docs page about this, because it is clear what needs to be done.

          Show
          Tim Hunt added a comment - Generally, breaking the work into small logical commits is a good idea. (With git, one can merge small commits to make a new bigger commit later, if desired, so it is not a big problem to do too many small commits.) There is no need for a docs page about this, because it is clear what needs to be done.
          Hide
          Pierre Pichet added a comment -

          I just realize that it should work also for multiplechoice in Cloze questions.
          The HTML editor is already there, I just need to get the correct structure to answers before they are sent to multiplechoice for saving.
          In 1.9 users can put image in Cloze multiplechoice answers.

          Show
          Pierre Pichet added a comment - I just realize that it should work also for multiplechoice in Cloze questions. The HTML editor is already there, I just need to get the correct structure to answers before they are sent to multiplechoice for saving. In 1.9 users can put image in Cloze multiplechoice answers.
          Hide
          Tim Hunt added a comment -

          No, we should not provide the HTML editor there, at least not in the case where the answers will be displayed in <select> menus, because you can't have anything other than plain text there.

          I suggest we fix multichoice and calculatedmulti first, since we are nearly there with those, and leave multianswer for a bit later.

          Show
          Tim Hunt added a comment - No, we should not provide the HTML editor there, at least not in the case where the answers will be displayed in <select> menus, because you can't have anything other than plain text there. I suggest we fix multichoice and calculatedmulti first, since we are nearly there with those, and leave multianswer for a bit later.
          Hide
          Pierre Pichet added a comment - - edited

          I can set easily the answer structure just for Multichoice vertical and multichoice horizontal but not for normal multichoice (or numerical or shortanswer).
          This is just transfering to 2,0 something that can be done in 1.9.

          Incidently, when there is a HTML editor , the answer text contains <p>text</p> so it does not appear inline with the numbering.
          How do you suggest to change the diplay.html code ?

          If everything works as I expect this could be ready next week.(need testing backup )

          Show
          Pierre Pichet added a comment - - edited I can set easily the answer structure just for Multichoice vertical and multichoice horizontal but not for normal multichoice (or numerical or shortanswer). This is just transfering to 2,0 something that can be done in 1.9. Incidently, when there is a HTML editor , the answer text contains <p>text</p> so it does not appear inline with the numbering. How do you suggest to change the diplay.html code ? If everything works as I expect this could be ready next week.(need testing backup )
          Hide
          Tim Hunt added a comment -

          OK, however you want to do the work.

          I was just thinking that the changes in multichoice and and cloze are probably quite different, so might be sensible to keep the fixes separate.

          Show
          Tim Hunt added a comment - OK, however you want to do the work. I was just thinking that the changes in multichoice and and cloze are probably quite different, so might be sensible to keep the fixes separate.
          Hide
          Pierre Pichet added a comment -

          The three following commits solving editing, display and XML format are available
          for multichoice.
          https://github.com/ppichet/moodle/commit/d4b7b19d99446d5998537492a5b09823862810f2
          https://github.com/ppichet/moodle/commit/9d512577c19e22f36bcb3999754eb2faf7669602
          https://github.com/ppichet/moodle/commit/975ade9575143892a62cdeb6cc5cb9a5a304a41a

          However, I have not solve the backup/restore and category moving which are next todo.

          All comments are appreciate as usual

          Show
          Pierre Pichet added a comment - The three following commits solving editing, display and XML format are available for multichoice. https://github.com/ppichet/moodle/commit/d4b7b19d99446d5998537492a5b09823862810f2 https://github.com/ppichet/moodle/commit/9d512577c19e22f36bcb3999754eb2faf7669602 https://github.com/ppichet/moodle/commit/975ade9575143892a62cdeb6cc5cb9a5a304a41a However, I have not solve the backup/restore and category moving which are next todo. All comments are appreciate as usual
          Hide
          Pierre Pichet added a comment -

          Tim,
          I have solved the backup/restore so should be able to clean the code and trimmings.
          Did "patch triaged" means that these three first commits will be applied to moodle_head ?
          and included if 2.0.2 monday or apply after 2.02 release ?
          For coherence with 'answerfeedback' , I have renamed in files database table area 'answer' to 'answertext'.

          Show
          Pierre Pichet added a comment - Tim, I have solved the backup/restore so should be able to clean the code and trimmings. Did "patch triaged" means that these three first commits will be applied to moodle_head ? and included if 2.0.2 monday or apply after 2.02 release ? For coherence with 'answerfeedback' , I have renamed in files database table area 'answer' to 'answertext'.
          Hide
          Tim Hunt added a comment -

          The labels are explained here: http://docs.moodle.org/en/Development:Bug_triage

          basically, triaged means that someone has reviewed all the information given in the bug, and it is complete, and assigned to the right person and fix version.

          patch means that there is some code there waiting for review. However, since the backup and restore is not quite finished, I should not really have added that yet.

          Nothing else will be added to Moodle 2.0.2. The plan is to see what happens with all the changes that were applied to this week's weekly build. If no critical problems are found by Monday, then what is currently being downloaded as 2.0.1+ on http://download.moodle.org/ will be renamed to 2.0.2.

          Show
          Tim Hunt added a comment - The labels are explained here: http://docs.moodle.org/en/Development:Bug_triage basically, triaged means that someone has reviewed all the information given in the bug, and it is complete, and assigned to the right person and fix version. patch means that there is some code there waiting for review. However, since the backup and restore is not quite finished, I should not really have added that yet. Nothing else will be added to Moodle 2.0.2. The plan is to see what happens with all the changes that were applied to this week's weekly build. If no critical problems are found by Monday, then what is currently being downloaded as 2.0.1+ on http://download.moodle.org/ will be renamed to 2.0.2.
          Hide
          Pierre Pichet added a comment -

          Here the backup/restore and fixing filearea as answertext following the convention for feedback ie. answerfeedback

          https://github.com/ppichet/moodle/commit/b5e99b10da4bc7253a83314a7261e543653e9b7b

          Show
          Pierre Pichet added a comment - Here the backup/restore and fixing filearea as answertext following the convention for feedback ie. answerfeedback https://github.com/ppichet/moodle/commit/b5e99b10da4bc7253a83314a7261e543653e9b7b
          Hide
          Pierre Pichet added a comment -

          One side effect is the history display.
          The alt text should be significant or we could implement HTML viewing or we could wait for the new engine or ...

          Show
          Pierre Pichet added a comment - One side effect is the history display. The alt text should be significant or we could implement HTML viewing or we could wait for the new engine or ...
          Hide
          Pierre Pichet added a comment -

          I create two new bugs
          MDL-26510 for calculatedmulti and MDL-26511 for Cloze.

          Show
          Pierre Pichet added a comment - I create two new bugs MDL-26510 for calculatedmulti and MDL-26511 for Cloze.
          Hide
          Pierre Pichet added a comment - - edited

          Tim,
          Are we doing the rigth thing the rigth way ?
          Do a search in all moodle code for answer['text'] which is the necessary structure to include files (i.e. image) in answer
          AND compare to a a search in all moodle code for answer which is often the actual representation for answertext data.

          In multiplechoice question type the state->answer that is used to compare with the student response is the [$key] in answers array so there was no real problem (only in answer display) but this is not the case for other questiontypes as short, numerical or calculated.

          This appears to me when trying to add HTML to calculatedmulti which use a lot of calculated code.

          I think we could be in trouble...

          Show
          Pierre Pichet added a comment - - edited Tim, Are we doing the rigth thing the rigth way ? Do a search in all moodle code for answer ['text'] which is the necessary structure to include files (i.e. image) in answer AND compare to a a search in all moodle code for answer which is often the actual representation for answertext data. In multiplechoice question type the state->answer that is used to compare with the student response is the [$key] in answers array so there was no real problem (only in answer display) but this is not the case for other questiontypes as short, numerical or calculated. This appears to me when trying to add HTML to calculatedmulti which use a lot of calculated code. I think we could be in trouble...
          Hide
          Tim Hunt added a comment -

          The ->answer['text'] bit is only relevant in save_question(_options) etc. where the data it taken from the form (or the import file) and saved into the database.

          All the other parts of the code use data loaded from the database, where there are two separate fields ->answer and ->answerformat, and very little has to change, other than the call to format_text, and adding the call to rewrite_pluginfile_urls.

          Show
          Tim Hunt added a comment - The ->answer ['text'] bit is only relevant in save_question(_options) etc. where the data it taken from the form (or the import file) and saved into the database. All the other parts of the code use data loaded from the database, where there are two separate fields ->answer and ->answerformat, and very little has to change, other than the call to format_text, and adding the call to rewrite_pluginfile_urls.
          Hide
          Pierre Pichet added a comment -

          Tim,
          reviewing patch
          https://github.com/ppichet/moodle/commit/9d512577c19e22f36bcb3999754eb2faf7669602
          I just notice that when testing I add line 322 .$state->attempt.
          $a->text = $this->number_in_style($key, $question->options->answernumbering) .$state->attempt.
          and that I DID NOT NOTICED when reviewing the code.

          Could you fix it as I don't know exactly where to put this info.

          Show
          Pierre Pichet added a comment - Tim, reviewing patch https://github.com/ppichet/moodle/commit/9d512577c19e22f36bcb3999754eb2faf7669602 I just notice that when testing I add line 322 .$state->attempt. $a->text = $this->number_in_style($key, $question->options->answernumbering) .$state->attempt. and that I DID NOT NOTICED when reviewing the code. Could you fix it as I don't know exactly where to put this info.
          Hide
          Pierre Pichet added a comment -

          The commit
          https://github.com/ppichet/moodle/commit/b5acdeaa78cb2204ba2b6de92a5eed8adf85b407
          contains the patch for correcting line 322.

          So all the neccessary patches are on github for multichoice.(and for cloz MDL-26511)
          Calculatedmulti will be done later.

          The MDL-26511 tracker contains an XML export file example with a multichoice and two cloze question with images.

          Show
          Pierre Pichet added a comment - The commit https://github.com/ppichet/moodle/commit/b5acdeaa78cb2204ba2b6de92a5eed8adf85b407 contains the patch for correcting line 322. So all the neccessary patches are on github for multichoice.(and for cloz MDL-26511 ) Calculatedmulti will be done later. The MDL-26511 tracker contains an XML export file example with a multichoice and two cloze question with images.
          Hide
          Adam Olley added a comment -

          Hi all,

          Assuming Pierre's work on this goes well, when would we be likely to see this committed into moodle?

          Show
          Adam Olley added a comment - Hi all, Assuming Pierre's work on this goes well, when would we be likely to see this committed into moodle?
          Hide
          Oleg Sychev added a comment -

          As a systematic enemy of repeated HTML editors I am, of course, not impressed by that. Especially with multichoice questions.

          More seriuosly, if the HTML editors will be mandatory I insist on testing it with multichoice questions with at least 30 choices (some our questions have more) with all supported browsers. Note that when doing batch jobs on a category of 10-15 randomly selected similar questions, a load time of 30 or 60 sec is quite angering. Pierre, could you publish results of such test (i.e. page load times, has the browser/javascript module crashed etc)?

          There is a way to avoid that: add an admin setting where to use HTML editor for answer (and similar setting for feedback in all questions please). This is actually easy thing to do and it is eliminate at least part of controversy about HTML editors.

          Show
          Oleg Sychev added a comment - As a systematic enemy of repeated HTML editors I am, of course, not impressed by that. Especially with multichoice questions. More seriuosly, if the HTML editors will be mandatory I insist on testing it with multichoice questions with at least 30 choices (some our questions have more) with all supported browsers. Note that when doing batch jobs on a category of 10-15 randomly selected similar questions, a load time of 30 or 60 sec is quite angering. Pierre, could you publish results of such test (i.e. page load times, has the browser/javascript module crashed etc)? There is a way to avoid that: add an admin setting where to use HTML editor for answer (and similar setting for feedback in all questions please). This is actually easy thing to do and it is eliminate at least part of controversy about HTML editors.
          Hide
          Pierre Pichet added a comment -

          As the actual 2,0 multichoice set the answer feedback with the HTML editor on , I just test on http://demo.moodle.net/ by adding supplementary answers up to 54 answers which imply 54 HTML feedback ( same as 27 answers with the HTML set on for handling images and other files types) and the others HTML to 59 without any crash on Mac Safari.

          The new HTML editor seems to work without much of the old problems.
          There are much less comments on this in the forums.

          However, if you can find how we can use the preferences settings for the edit_question..forms at the user level to control the HTML, this could be useful for your specific needs.

          Show
          Pierre Pichet added a comment - As the actual 2,0 multichoice set the answer feedback with the HTML editor on , I just test on http://demo.moodle.net/ by adding supplementary answers up to 54 answers which imply 54 HTML feedback ( same as 27 answers with the HTML set on for handling images and other files types) and the others HTML to 59 without any crash on Mac Safari. The new HTML editor seems to work without much of the old problems. There are much less comments on this in the forums. However, if you can find how we can use the preferences settings for the edit_question..forms at the user level to control the HTML, this could be useful for your specific needs.
          Hide
          Oleg Sychev added a comment -

          Pierre - it's actually very easy to work with user preferences in Moodle: just look for functions get_user_preferences() and set_user_preference() (I hope you could find them youself).

          You just need to add checkboxes or something (probably hidden as advanced controls) for user to use htmleditors on repeated answers (multichoice only) and feedback (question base class), and set them according to user preferences. That's pretty much solves the issue.

          P.S. No crashes is good, but how about initialisation time (i.e. how fast you could start work with a page)?

          Show
          Oleg Sychev added a comment - Pierre - it's actually very easy to work with user preferences in Moodle: just look for functions get_user_preferences() and set_user_preference() (I hope you could find them youself). You just need to add checkboxes or something (probably hidden as advanced controls) for user to use htmleditors on repeated answers (multichoice only) and feedback (question base class), and set them according to user preferences. That's pretty much solves the issue. P.S. No crashes is good, but how about initialisation time (i.e. how fast you could start work with a page)?
          Hide
          Tim Hunt added a comment -

          OK, in my testing, opening the editing form for a multiple-choice question with 62 choices (this is in 2.1 beta, before applying this patch, so 69 editors) takes

          • 14 seconds on Firefox 4
          • 22 seconds in IE 8
          • 11 seconds in Chrome

          For comparison, opening the reply to forum post page (one HTML editor) takes

          • 3 seconds on Firefox 4
          • 3 seconds in IE 8
          • 2 seconds in Chrome

          So, Tiny MCE, on its now is unpleasantly slow, but the scalability could be worse.

          Show
          Tim Hunt added a comment - OK, in my testing, opening the editing form for a multiple-choice question with 62 choices (this is in 2.1 beta, before applying this patch, so 69 editors) takes 14 seconds on Firefox 4 22 seconds in IE 8 11 seconds in Chrome For comparison, opening the reply to forum post page (one HTML editor) takes 3 seconds on Firefox 4 3 seconds in IE 8 2 seconds in Chrome So, Tiny MCE, on its now is unpleasantly slow, but the scalability could be worse.
          Hide
          Oleg Sychev added a comment -

          Is adding a 1-2 user preferences to show/not repeated HTML such a big work that avoiding it needs reasoning? I guess it easier to add check boxes (normally hidden as additional fields) like "Use HTMLEditor for answers text" and "Use HTMLEditor for answer's feedback", store it in user_preferences and all would be quite happy with it. I'm not writing the code for this myself mainly because I lost faith in it ever be reviewed, but it equally trivial for you/Pierre.

          The problem with question editing is that you often need to use random, so have a category of 10-20 similar question and many edits are bulk ones. When you need to edit one question, 22 sec. is OK. When you need to edit 15 similar questions, it much worse

          P.S.Did you test it over Internet, or just on local computer? Bandwith is another thing that could affect loading time if each editor instance adds many code...

          Show
          Oleg Sychev added a comment - Is adding a 1-2 user preferences to show/not repeated HTML such a big work that avoiding it needs reasoning? I guess it easier to add check boxes (normally hidden as additional fields) like "Use HTMLEditor for answers text" and "Use HTMLEditor for answer's feedback", store it in user_preferences and all would be quite happy with it. I'm not writing the code for this myself mainly because I lost faith in it ever be reviewed, but it equally trivial for you/Pierre. The problem with question editing is that you often need to use random, so have a category of 10-20 similar question and many edits are bulk ones. When you need to edit one question, 22 sec. is OK. When you need to edit 15 similar questions, it much worse P.S.Did you test it over Internet, or just on local computer? Bandwith is another thing that could affect loading time if each editor instance adds many code...
          Hide
          Tim Hunt added a comment -

          The test was over the OU network. Good point.

          I am sure you know you can turn the HTML editor on or off completely in your profile. You can do that temporarily, for example while editing big questions. Also, thinking about this bug got me to do MDL-27890 today. (That does not help with the load time, but it does reduce scrolling.)

          My colleague Colin is thinking about greater improvements to the question editing UI. http://moodle.org/mod/forum/discuss.php?d=175290, but those will probably not get in until Moodle 2.2.

          I think it is important to make sure people can add images to multiple-choice choices (look at the votes on this issue). I think that outweighs the slowness of editing big questions, but I agree it is a trade-off - and one that will hurt your situation in particular.

          Adding a check-box has some problems. Suppose

          1. Someone else makes a multiple choice question, with images in the choices.
          2. You have HTML editor turned off for the choices.
          3. You edit this question.
            What happens to the images?

          My current plan is to integrate Pierre's work into Moodle 2.1, and hope that Colin's work can make things better in the future. I fear that is the best I can do.

          Show
          Tim Hunt added a comment - The test was over the OU network. Good point. I am sure you know you can turn the HTML editor on or off completely in your profile. You can do that temporarily, for example while editing big questions. Also, thinking about this bug got me to do MDL-27890 today. (That does not help with the load time, but it does reduce scrolling.) My colleague Colin is thinking about greater improvements to the question editing UI. http://moodle.org/mod/forum/discuss.php?d=175290 , but those will probably not get in until Moodle 2.2. I think it is important to make sure people can add images to multiple-choice choices (look at the votes on this issue). I think that outweighs the slowness of editing big questions, but I agree it is a trade-off - and one that will hurt your situation in particular. Adding a check-box has some problems. Suppose Someone else makes a multiple choice question, with images in the choices. You have HTML editor turned off for the choices. You edit this question. What happens to the images? My current plan is to integrate Pierre's work into Moodle 2.1, and hope that Colin's work can make things better in the future. I fear that is the best I can do.
          Hide
          Tim Hunt added a comment -

          I think https://github.com/timhunt/moodle/commit/111fe3b377962f489ddb4e783a2bb6ba8e048c42 is the correct change for Moodle 2.1, but I have not tested it at all yet. That will have to wait until tomorrow.

          Show
          Tim Hunt added a comment - I think https://github.com/timhunt/moodle/commit/111fe3b377962f489ddb4e783a2bb6ba8e048c42 is the correct change for Moodle 2.1, but I have not tested it at all yet. That will have to wait until tomorrow.
          Hide
          Oleg Sychev added a comment -

          Turning off HTML editor in the profile could be undesirable if you need to edit question text/feedback with complex formating, while having many choices in these questions. That's a practical problem, otherwise I would have adopted using profile for such edits long ago.

          I am not expert in Moodle 2.0 file handling for now, which (judging by reactions of many people, both in our university and moodle.org) primary purpose was to scare off 3d party developers from writing anything for Moodle, so I couldn't answer you question. But I wonder what will happen with images in you scenario, where you disable HTML Editor in profile instead of check boxes? Either this problem already solved, and solution could be easily reused, or this bug exists in Moodle regardless of check boxes.

          Show
          Oleg Sychev added a comment - Turning off HTML editor in the profile could be undesirable if you need to edit question text/feedback with complex formating, while having many choices in these questions. That's a practical problem, otherwise I would have adopted using profile for such edits long ago. I am not expert in Moodle 2.0 file handling for now, which (judging by reactions of many people, both in our university and moodle.org) primary purpose was to scare off 3d party developers from writing anything for Moodle, so I couldn't answer you question. But I wonder what will happen with images in you scenario, where you disable HTML Editor in profile instead of check boxes? Either this problem already solved, and solution could be easily reused, or this bug exists in Moodle regardless of check boxes.
          Hide
          Tim Hunt added a comment -

          I was thinking about this as I cycled home, and it is probably safe when editing without the HTML editor. I expect the files will be saved, but there will be no way to edit them. However, I would like to test. Also, I do not think I have time to put this change in before the 2.1 release. Hopefully soon afterwards.

          Actually, the file API is very nice for developers (once you understand it).

          The people who complain are mostly end users, and mostly end users who are very familiar with Moodle 1.9, and do not want to change. There are just a few valid concerns, most of which are fixable when someone gets the time.

          Show
          Tim Hunt added a comment - I was thinking about this as I cycled home, and it is probably safe when editing without the HTML editor. I expect the files will be saved, but there will be no way to edit them. However, I would like to test. Also, I do not think I have time to put this change in before the 2.1 release. Hopefully soon afterwards. Actually, the file API is very nice for developers (once you understand it). The people who complain are mostly end users, and mostly end users who are very familiar with Moodle 1.9, and do not want to change. There are just a few valid concerns, most of which are fixable when someone gets the time.
          Hide
          Pierre Pichet added a comment -

          Hi Tim,
          I just take a look and locate this in question.php line 94 ...

          public function check_file_access($qa, $options, $component, $filearea, $args, $forcedownload) {
                  if ($component == 'question' && in_array($filearea,
                          array('correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback'))) {
                      return $this->check_combined_feedback_file_access($qa, $options, $filearea);
          
                  } else if ($component == 'question' && $filearea == 'answerfeedback') {
                      $answerid = reset($args); // itemid is answer id.
                      return  in_array($answerid, $this->order);
          
                  } else if ($component == 'question' && $filearea == 'answerfeedback') {
                      $answerid = reset($args); // itemid is answer id.
                      $response = $this->get_response($qa);
                      $isselected = false;
                      foreach ($this->order as $value => $ansid) {
                          if ($ansid == $answerid) {
                              $isselected = $this->is_choice_selected($response, $value);
                              break;
                          }
                      }
          
          Show
          Pierre Pichet added a comment - Hi Tim, I just take a look and locate this in question.php line 94 ... public function check_file_access($qa, $options, $component, $filearea, $args, $forcedownload) { if ($component == 'question' && in_array($filearea, array('correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback'))) { return $this->check_combined_feedback_file_access($qa, $options, $filearea); } else if ($component == 'question' && $filearea == 'answerfeedback') { $answerid = reset($args); // itemid is answer id. return in_array($answerid, $this->order); } else if ($component == 'question' && $filearea == 'answerfeedback') { $answerid = reset($args); // itemid is answer id. $response = $this->get_response($qa); $isselected = false; foreach ($this->order as $value => $ansid) { if ($ansid == $answerid) { $isselected = $this->is_choice_selected($response, $value); break; } }
          Hide
          Tim Hunt added a comment -

          Thank you!

          Show
          Tim Hunt added a comment - Thank you!
          Hide
          Tim Hunt added a comment -

          At the moment, GIFT exports like

          // question: 4  name: MC Single
          ::MC Single::[html]<p>Which is the amphibian</p>{
          	~<p><img src\="@@PLUGINFILE@@/quiz_usage.png" alt\="Graph" width\="645" height\="407" /></p>#<p><img src\="@@PLUGINFILE@@/roles.png" alt\="Flowchart" width\="359" height\="313" /></p>
          	=<p>Frog</p>\n<p>Toad</p>
          	~<p>Dog</p>\n<p>XXX<img src\="@@PLUGINFILE@@/quiz_usage.png" alt\="Graph" width\="645" height\="407" /></p>
          }
          

          When that is re-imported you get broken images in the question, but otherwise it works. One can use the HTML editor to re-upload the images.

          Can anyone thing of a better way than this of handling GIFT? I think we can live with this until someone has a better idea.

          Show
          Tim Hunt added a comment - At the moment, GIFT exports like // question: 4 name: MC Single ::MC Single::[html]<p>Which is the amphibian</p>{ ~<p><img src\="@@PLUGINFILE@@/quiz_usage.png" alt\="Graph" width\="645" height\="407" /></p>#<p><img src\="@@PLUGINFILE@@/roles.png" alt\="Flowchart" width\="359" height\="313" /></p> =<p>Frog</p>\n<p>Toad</p> ~<p>Dog</p>\n<p>XXX<img src\="@@PLUGINFILE@@/quiz_usage.png" alt\="Graph" width\="645" height\="407" /></p> } When that is re-imported you get broken images in the question, but otherwise it works. One can use the HTML editor to re-upload the images. Can anyone thing of a better way than this of handling GIFT? I think we can live with this until someone has a better idea.
          Hide
          Tim Hunt added a comment -

          Backup and restore, and XML import/export both seem to be fine too. So that completes my testing. About to submit for integration into 2.1.

          Show
          Tim Hunt added a comment - Backup and restore, and XML import/export both seem to be fine too. So that completes my testing. About to submit for integration into 2.1.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Don't like accumulated executions like:

          $question->make_html_inline($question->format_text(...
          

          But looks goo, so far... so integrating...

          Show
          Eloy Lafuente (stronk7) added a comment - Don't like accumulated executions like: $question->make_html_inline($question->format_text(... But looks goo, so far... so integrating...
          Show
          Eloy Lafuente (stronk7) added a comment - Tim, for cross-reference, testing this I got: http://tracker.moodle.org/browse/MDL-27916?focusedCommentId=113749&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-113749 I continue testing here...
          Hide
          Eloy Lafuente (stronk7) added a comment -

          All tested seems to be working ok, so I'm going to pass this, but:

          1) Or I don't understand the penalties or they are not working as expected. I did a partially correct answer in first attempt and one correct answer in second attempt. But it seems that the second attempt didn't get any penaly and acoounted for full 3 points (100%).

          2) If, when exporting as GIFT (and importing later) "Verify that the image is handled in a sensible way" means I get PLUGINFILE and broken images (as you commented above), then yes, it's sensible, lol

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - All tested seems to be working ok, so I'm going to pass this, but: 1) Or I don't understand the penalties or they are not working as expected. I did a partially correct answer in first attempt and one correct answer in second attempt. But it seems that the second attempt didn't get any penaly and acoounted for full 3 points (100%). 2) If, when exporting as GIFT (and importing later) "Verify that the image is handled in a sensible way" means I get PLUGINFILE and broken images (as you commented above), then yes, it's sensible, lol Ciao
          Hide
          Eloy Lafuente (stronk7) added a comment -

          U.P.S.T.R.E.A.M

          Show
          Eloy Lafuente (stronk7) added a comment - U.P.S.T.R.E.A.M
          Hide
          Tim Hunt added a comment -

          Coming up with a better way to handle references to images when doing GIFT export (which if fundamentally a plain-text format) is a separate problem. I don't have a good solution to suggest at the moment.

          Show
          Tim Hunt added a comment - Coming up with a better way to handle references to images when doing GIFT export (which if fundamentally a plain-text format) is a separate problem. I don't have a good solution to suggest at the moment.
          Hide
          Pierre Pichet added a comment -

          Tim,
          I just noticed that this has been fixed for 2.1 but not 2.0.

          We have a meeting at UQAM tomorrow about migrating from 1,9 to 2,0 .
          The migration should be done in january.
          I am not sure that they will migrate to 2,1 soon.
          This could an example of the time lag between Moodle and the real world of some universities ...

          More news tomorrow

          Show
          Pierre Pichet added a comment - Tim, I just noticed that this has been fixed for 2.1 but not 2.0. We have a meeting at UQAM tomorrow about migrating from 1,9 to 2,0 . The migration should be done in january. I am not sure that they will migrate to 2,1 soon. This could an example of the time lag between Moodle and the real world of some universities ... More news tomorrow
          Hide
          Jean-Michel Vedrine added a comment -

          Hello Pierre,
          Are they crazzy ? Do they really realise this :
          Bug fixes for general core bugs in 2.0.x will end December 2011. NEARLY 2 months from now !!!!!
          Bug fixes for serious security issues in 2.0.x will end June 2012. Only 8 months from now !!!
          Source : http://docs.moodle.org/dev/Updates

          Show
          Jean-Michel Vedrine added a comment - Hello Pierre, Are they crazzy ? Do they really realise this : Bug fixes for general core bugs in 2.0.x will end December 2011. NEARLY 2 months from now !!!!! Bug fixes for serious security issues in 2.0.x will end June 2012. Only 8 months from now !!! Source : http://docs.moodle.org/dev/Updates
          Hide
          Pierre Pichet added a comment -

          They seem to think that adding a version decimal is a sign of a great progress.
          If we look back the most important versions were 1.5 , 1.6 , 1.9 then 2.
          However look how many are on 1,9 which is a mature version.
          This is definitively not the case of 2,0 if you look at the new question engine.

          OU will step directly to 2,2 even if this is not as stable as it should.

          The curves showing the bug created and solved does not tell all the truth as the real testing
          has a time lag with the version release date.
          How many tested 2,1 this last summer ?

          This should be put in forum but perhaps we are too far from the headquarters viewpoint ?

          Show
          Pierre Pichet added a comment - They seem to think that adding a version decimal is a sign of a great progress. If we look back the most important versions were 1.5 , 1.6 , 1.9 then 2. However look how many are on 1,9 which is a mature version. This is definitively not the case of 2,0 if you look at the new question engine. OU will step directly to 2,2 even if this is not as stable as it should. The curves showing the bug created and solved does not tell all the truth as the real testing has a time lag with the version release date. How many tested 2,1 this last summer ? This should be put in forum but perhaps we are too far from the headquarters viewpoint ?
          Hide
          Oleg Sychev added a comment -

          I quite agree with you, Pierre & Jean-Michele, on account of versions. This rush with new version every 6 months is quite a bother for many reasons: bother for 3d party developers, who should upgrade their modules too fast, bother for teachers who should get used to new interface too often - and often without nearly enough help/docs (yes, in this rush developers hardly have time to write serious docs), bother for admins since they discontinue bug fixes before most bugs are finded and fixed in these versions, bother for translators who don't have time to translate all new strings before new version arrives.... I liked old, 1.x system, with 1 release in a 1-1,5 year MUCH more.

          Just look at 2.1, where help on new "behavours" for the teachers was written, as Tim said, "with OU audience in mind". Just as any other teacher, been forced to use behavours in 2.1, could easily guess what behavours are and how to use them...

          P.S. If any of you would post angry message on the forums (General Developer Forum), please post a link there so I and others could join in the discussion.
          P.P.S. We are still on 1.9 and maybe go to 2.0 this winter.

          Show
          Oleg Sychev added a comment - I quite agree with you, Pierre & Jean-Michele, on account of versions. This rush with new version every 6 months is quite a bother for many reasons: bother for 3d party developers, who should upgrade their modules too fast, bother for teachers who should get used to new interface too often - and often without nearly enough help/docs (yes, in this rush developers hardly have time to write serious docs), bother for admins since they discontinue bug fixes before most bugs are finded and fixed in these versions, bother for translators who don't have time to translate all new strings before new version arrives.... I liked old, 1.x system, with 1 release in a 1-1,5 year MUCH more. Just look at 2.1, where help on new "behavours" for the teachers was written, as Tim said, "with OU audience in mind". Just as any other teacher, been forced to use behavours in 2.1, could easily guess what behavours are and how to use them... P.S. If any of you would post angry message on the forums (General Developer Forum), please post a link there so I and others could join in the discussion. P.P.S. We are still on 1.9 and maybe go to 2.0 this winter.
          Hide
          Martin Dougiamas added a comment -

          Oleg, Pierre and Jean-Michel:

          Please note that along with the faster release cycle we have smaller incremental releases. The step from 2.1 to 2.2 is very small, just a few new features, and thus there is a lot less instability to deal with.

          The giant upgrade from 1.9 to 2.0 was extremely disruptive and painful for a lot of people simply because we spent too long adding too much new stuff. That will not happen again.

          Once you get onto 2.x the upgrades are very easy. No-one is saying you have to upgrade every 6 months, you could upgrade once a year and view the "missed" release as the one where the other hemisphere fixes more bugs for you.

          Show
          Martin Dougiamas added a comment - Oleg, Pierre and Jean-Michel: Please note that along with the faster release cycle we have smaller incremental releases. The step from 2.1 to 2.2 is very small, just a few new features, and thus there is a lot less instability to deal with. The giant upgrade from 1.9 to 2.0 was extremely disruptive and painful for a lot of people simply because we spent too long adding too much new stuff. That will not happen again. Once you get onto 2.x the upgrades are very easy. No-one is saying you have to upgrade every 6 months, you could upgrade once a year and view the "missed" release as the one where the other hemisphere fixes more bugs for you.
          Hide
          Pierre Pichet added a comment -

          In all cases large universities have a slower pace.

          We discussed yesterday of our ( Université du Québec à Montréal) moodle comity of moving from 1,9 to at least 2,2 and we concluded that we will do it when everything will have been really tested given the complexity of the new question engine and the file api .

          "really tested" has a more precise meaning "OU tested"

          Given all the local modifications our calendar could be January 2013 for some courses and a general deployment in autumn 2013.

          What will be the version we will finally used will be set during the process.

          Moodle HQ should perhaps modify the closing of merging updates on a specific version following the needs of the large institutions.
          First let's see how the community move to the marvelous 2,0 universe

          Show
          Pierre Pichet added a comment - In all cases large universities have a slower pace. We discussed yesterday of our ( Université du Québec à Montréal) moodle comity of moving from 1,9 to at least 2,2 and we concluded that we will do it when everything will have been really tested given the complexity of the new question engine and the file api . "really tested" has a more precise meaning "OU tested" Given all the local modifications our calendar could be January 2013 for some courses and a general deployment in autumn 2013. What will be the version we will finally used will be set during the process. Moodle HQ should perhaps modify the closing of merging updates on a specific version following the needs of the large institutions. First let's see how the community move to the marvelous 2,0 universe
          Hide
          Oleg Sychev added a comment -

          Pierre, you could easily see that while Martin replied there (following my copying this discussion on http://docs.moodle.org/dev/Updates talk page, from which it was deleted quite fast , he don't add himself as a watcher to this bug, so it's pointless to reply to him there.

          It seems if we want this discussion to continue, it should be moved to General Developers Forum, preferable by copying comments above in the first message.

          Show
          Oleg Sychev added a comment - Pierre, you could easily see that while Martin replied there (following my copying this discussion on http://docs.moodle.org/dev/Updates talk page, from which it was deleted quite fast , he don't add himself as a watcher to this bug, so it's pointless to reply to him there. It seems if we want this discussion to continue, it should be moved to General Developers Forum, preferable by copying comments above in the first message.
          Hide
          Martin Dougiamas added a comment - - edited

          As I said, please don't compare the move from 1.x -> 2.x with 2.x -> 2.x.

          The first is difficult for sure, and that's why we're supporting 1.9 for 4.5 years since it was released.

          Moodle 2.x releases are different, and I want to encourage Universities to

          1. upgrade at least once a year to take advantage of all the new features and fixes
          2. find "clean" ways to implement your modifications, using the many new types of plugins and hooks that 2.x has. Use git too!
          3. throw away the local modifications that are now core features

          This is the way we can get to quality. Not by fragmentation and old code.

          If there really is a huge movement to stay on any version for many years at a time, then I think we have found our volunteers to maintain that particular version for that period.

          Show
          Martin Dougiamas added a comment - - edited As I said, please don't compare the move from 1.x -> 2.x with 2.x -> 2.x. The first is difficult for sure, and that's why we're supporting 1.9 for 4.5 years since it was released. Moodle 2.x releases are different, and I want to encourage Universities to upgrade at least once a year to take advantage of all the new features and fixes find "clean" ways to implement your modifications, using the many new types of plugins and hooks that 2.x has. Use git too! throw away the local modifications that are now core features This is the way we can get to quality. Not by fragmentation and old code. If there really is a huge movement to stay on any version for many years at a time, then I think we have found our volunteers to maintain that particular version for that period.
          Hide
          Oleg Sychev added a comment -

          Hi, Martin. I know the arguments for 6 months well, but they are only half-truth.

          Look at upgrade from 2.0 to 2.1. It is small if you distribute new features to all Moodle, but HUGE for anything question-related (and no backward compatibility). As a 3d party question author I'm bothered by it MUCH MORE >8-( , than 1.9->2.0 upgrade - and there will be always some reworks that just couldn't be done in small steps. And if you are maintaining something, it isn't matter which hemisphere use it if you get at least one user in both. There always would be universities that decided to upgrade right away and their unfortuante teachers wanting you to upgrade you plugin right now, since they use it in their courses. Similar problems for translators. Similar problems for posted patches/git commits, with usual review time from Moodle developers from 0,5 to 3 years from posting it will be pretty much several versions away by the time you could get attention. Rebase inside version branch is easy, but between them may be problematic...

          And as admin you don't want just miss half of releases. You'd want to upgrade for release with major changes (like new question engine in 2.0->2.1) some time later, so it could get rough edge smoothed - it gives time and many angry users for Moodle developers to reconsider their solutions (which is somewhat natural). There is motto from 1.x time "use moodle functions one release later than they are created first if you can help it". And sometimes - as with Files 2.0 or Question Engine 2.1 you just can't help it, so should avoid early upgrade on both, and who will tell that there will be no such big feature in both 2.2 and 2.3? But just as they got smoothed there will be new release with new rough edges, while old is unsupported (e.g. not smoothed) any more. And when you report minor bugs, they will get not much attention since there is new version, so who would bother about non-critical bug in the old (even supported) one? Or you would get asked to install new version on the separate site to try to reproduce bug on it.

          That's the problems with short upgrade you coudn't easily amend by less changes. The 1.9->2.0 time was too large, I said so long ago. But now you at different extreme. That's no good either. All it given I use git, try to push upstream every modification when possible (but even this don't save them from been broken in each new release, and I have to bother with patches to core to repair them), write plugins when possible etc.

          P.S. Martin, you will shortly have 2.1 and 2.2 - two releases on 6 month period. After that, of after 2.3, would you venture to place a survey in the "Using Moodle" course to ask people - how much time between releases they want?

          Show
          Oleg Sychev added a comment - Hi, Martin. I know the arguments for 6 months well, but they are only half-truth. Look at upgrade from 2.0 to 2.1. It is small if you distribute new features to all Moodle, but HUGE for anything question-related (and no backward compatibility). As a 3d party question author I'm bothered by it MUCH MORE >8-( , than 1.9->2.0 upgrade - and there will be always some reworks that just couldn't be done in small steps. And if you are maintaining something, it isn't matter which hemisphere use it if you get at least one user in both. There always would be universities that decided to upgrade right away and their unfortuante teachers wanting you to upgrade you plugin right now, since they use it in their courses. Similar problems for translators. Similar problems for posted patches/git commits, with usual review time from Moodle developers from 0,5 to 3 years from posting it will be pretty much several versions away by the time you could get attention. Rebase inside version branch is easy, but between them may be problematic... And as admin you don't want just miss half of releases. You'd want to upgrade for release with major changes (like new question engine in 2.0->2.1) some time later, so it could get rough edge smoothed - it gives time and many angry users for Moodle developers to reconsider their solutions (which is somewhat natural). There is motto from 1.x time "use moodle functions one release later than they are created first if you can help it". And sometimes - as with Files 2.0 or Question Engine 2.1 you just can't help it, so should avoid early upgrade on both, and who will tell that there will be no such big feature in both 2.2 and 2.3? But just as they got smoothed there will be new release with new rough edges, while old is unsupported (e.g. not smoothed) any more. And when you report minor bugs, they will get not much attention since there is new version, so who would bother about non-critical bug in the old (even supported) one? Or you would get asked to install new version on the separate site to try to reproduce bug on it. That's the problems with short upgrade you coudn't easily amend by less changes. The 1.9->2.0 time was too large, I said so long ago. But now you at different extreme. That's no good either. All it given I use git, try to push upstream every modification when possible (but even this don't save them from been broken in each new release, and I have to bother with patches to core to repair them), write plugins when possible etc. P.S. Martin, you will shortly have 2.1 and 2.2 - two releases on 6 month period. After that, of after 2.3, would you venture to place a survey in the "Using Moodle" course to ask people - how much time between releases they want?

            People

            • Votes:
              25 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: