Moodle
  1. Moodle
  2. MDL-25684

Importing questions producing invalid question names and not saving

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.9.10
    • Fix Version/s: None
    • Component/s: Questions
    • Labels:
    • Environment:
      Moodle 1.9.10+ (build 20101103)
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      When importing questions (in this case in Blackboard format), the question names are generated from the question text if not provided. The question name is truncated by character length, but if question text contains HTML, the character boundary can occur within an HTML tag and create an invalid question name. In this case, Moodle gives the error, "Cannot insert question". I realize there are many different solutions to this "problem." The attached patch is the path we have chosen, but we would much prefer to adopt a change from upstream.

        Gliffy Diagrams

        1. question_format.patch
          0.6 kB
          Vikram Dighe
        2. res00001.dat
          194 kB
          Vikram Dighe

          Issue Links

            Activity

            Hide
            Tim Hunt added a comment -

            First, the supplied patch is bad, and should not be used. For example, XML format includes the real question name in the export file, and this change would overwrite that with a fake question name constructed from the quetstion text.

            Second, question name handling in all the different import formats is a bloody mess. To appreciate the extend of the problem, search for '->name' in all the files in the question/format folder. We need to clean this up some time, but doing a proper job will take some time, so is not a priority right now.

            Show
            Tim Hunt added a comment - First, the supplied patch is bad, and should not be used. For example, XML format includes the real question name in the export file, and this change would overwrite that with a fake question name constructed from the quetstion text. Second, question name handling in all the different import formats is a bloody mess. To appreciate the extend of the problem, search for '->name' in all the files in the question/format folder. We need to clean this up some time, but doing a proper job will take some time, so is not a priority right now.
            Hide
            Tim Hunt added a comment -

            Jean-Michel has fixed Blackboard format now in MDL-25492 and related issues, so I think this can be closed now.

            Show
            Tim Hunt added a comment - Jean-Michel has fixed Blackboard format now in MDL-25492 and related issues, so I think this can be closed now.

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: