Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-17284 Add Olli's new quiz editing UI to Moodle 2.0
  3. MDL-17361

$mform->hardFreeze('parent'); breaks the form /question/category_form_randomquestion.php

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0
    • Quiz
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Moderate

    Description

      //TODO: Tim? why does the above evaluate true, breaking the form?
      // and more importantly, if this is a valid situation, how should we react,
      // that is, what does this mean?
      //$mform->hardFreeze('parent');

      "By the way, the purpose of the code

      if (1 == $DB->count_records_sql("SELECT count
      FROM

      {question_categories} c1,
      {question_categories}

      c2
      WHERE c2.id = ?
      AND c1.contextid = c2.contextid", array($currentcat)))

      { $mform->hardFreeze('parent'); }

      Well, the SQL is counting the number of other categories belonging to the same context as this one. If there is only one, then it is trying to stop you changing the parent (so you can't remove the default category from any context.) However, that should not apply when you are creating a new context. (That applies to the standard create category form too.) Can you either fix this, or create a new issues assigned to me."

      If the check does not apply, perhaps remove it, or debug the reason behind it?

      Attachments

        Activity

          People

            timhunt Tim Hunt
            pilpi Olli Savolainen
            Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10