Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-48984

Lesson content page jump descriptions, numerical and shortanswer questions answers allow rich html but should be plain text

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.2
    • Fix Version/s: 2.9
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide

      Test of the upgrade step

      • Prior to applying the patch and upgrading, in a course create a lesson with a content page, a short answer question page and a numerical question page
      • Edit the content page and change Content 1 Description editor from "Moodle auto format" to "HTML Format" and Save page
      • Edit again the content page and put some HTML formatting for Content 1 Description
      • Edit the short answer question page and change Answer 1 Answer editor from from "Moodle auto format" to "HTML Format" and Save page
      • Edit again the short answer question page and put some HTML formatting for Answer 1 Answer
      • At that step if you want you can verify that the short answer is now broken because when attempted as a student you are unable to enter the HTML tags (Edit: in fact it depends, in some case it may be broken and in other it will continue to work, due to the fact that clean_param PARAM_TEXT is applied to the answer before comparison with the student's answer, anyway this is not important, answers should certainly be plain text : )
      • Edit the numerical question page and change Answer 1 Answer editor from from "Moodle auto format" to "HTML Format" and Save page
      • Edit again the numerical question page and put some HTML formatting for Answer 1 Answer
      • Make a backup of that course
      • upgrade the website
      • verify that all 3 modified questions are now back to normal: format is now plain text and tags have been stripped from answers or descriptions. It may be easier to verify that to look at the content of the lesson_answers table in the database
      • attempt the lesson as a student and verify that the short answer question is now fixed and you are able to get a good mark

      Test of restore

      Restore the backup made in prior test, and verify that all 3 modified questions are now back to normal: format is now plain text and tags have been stripped from answers or descriptions. It may be easier to verify that to look at the content of the lesson_answers table in the database.

      Test of the new UI

      • In a course, as a teacher create a lesson
      • add a content page to the lesson
      • verify that for each Content the description field is not a text area with a format menu but just a simple text input. Veify that each description is correctly saved and can be edited
      • add a short answer question page to the lesson
      • verify that a simple text input is displayed to enter each answer not a text area with a format menu (an editor should be available for the response)
      • verify that each answer is correctly saved
      • verify that you can edit the question page that existing answers are displayed and can be changed and correctly saved
      • Do the same tests for a numerical question page.
      • Verify that for a numerical question page you can enter a range using the syntax min:max for an answer and that it works (attempt the question as a student and verify that only numbers inside the range are considered correct.
      Show
      Test of the upgrade step Prior to applying the patch and upgrading, in a course create a lesson with a content page, a short answer question page and a numerical question page Edit the content page and change Content 1 Description editor from "Moodle auto format" to "HTML Format" and Save page Edit again the content page and put some HTML formatting for Content 1 Description Edit the short answer question page and change Answer 1 Answer editor from from "Moodle auto format" to "HTML Format" and Save page Edit again the short answer question page and put some HTML formatting for Answer 1 Answer At that step if you want you can verify that the short answer is now broken because when attempted as a student you are unable to enter the HTML tags (Edit: in fact it depends, in some case it may be broken and in other it will continue to work, due to the fact that clean_param PARAM_TEXT is applied to the answer before comparison with the student's answer, anyway this is not important, answers should certainly be plain text : ) Edit the numerical question page and change Answer 1 Answer editor from from "Moodle auto format" to "HTML Format" and Save page Edit again the numerical question page and put some HTML formatting for Answer 1 Answer Make a backup of that course upgrade the website verify that all 3 modified questions are now back to normal: format is now plain text and tags have been stripped from answers or descriptions. It may be easier to verify that to look at the content of the lesson_answers table in the database attempt the lesson as a student and verify that the short answer question is now fixed and you are able to get a good mark Test of restore Restore the backup made in prior test, and verify that all 3 modified questions are now back to normal: format is now plain text and tags have been stripped from answers or descriptions. It may be easier to verify that to look at the content of the lesson_answers table in the database. Test of the new UI In a course, as a teacher create a lesson add a content page to the lesson verify that for each Content the description field is not a text area with a format menu but just a simple text input. Veify that each description is correctly saved and can be edited add a short answer question page to the lesson verify that a simple text input is displayed to enter each answer not a text area with a format menu (an editor should be available for the response) verify that each answer is correctly saved verify that you can edit the question page that existing answers are displayed and can be changed and correctly saved Do the same tests for a numerical question page. Verify that for a numerical question page you can enter a range using the syntax min:max for an answer and that it works (attempt the question as a student and verify that only numbers inside the range are considered correct.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull Master Branch:

      Description

      It is possible to set rich HTML such as images as the correct answer for both the numeric and short answer questions even though it is not possible for the student to enter that value as an answer.

      To reproduce:
      1. In a lesson add a new numeric question page.
      2. Name the page Numeric Question 1
      3. Set the page contents to "This is a numeric question"
      4. Set answer 1 to "ABCD1234"
      5. Set the answer format to "HTML Format"
      6. Save the page
      7. click on the edit button and edit "Numeric Question 1"
      8. You will see an HTML editor now for the Answer 1 "Answer" field.
      9. Try to add an image, you will be prompted to select a URL. The filemanager will not be available.
      10. Add an image from a URL
      11. Save the page

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/May/15