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

Database error when creating simple calculated question

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_400_STABLE
    • MDL-75065-master
    • Hide
      1. Create a course
      2. Add quiz activity to a course
      3. Add Simple calculated question to the quiz
      4. Put some text as question name and question text
      5. Put

        {b}*{h}
        

        into 'Answer 1 formula ='

      6. Select 100% from Grade dropdown
      7. Click "Find the wild cards..." button
      8. Click "Generate"
      9. Click "Save changes"
      10. Ensure question is added and no error is thrown
      Show
      Create a course Add quiz activity to a course Add Simple calculated question to the quiz Put some text as question name and question text Put {b}*{h} into 'Answer 1 formula =' Select 100% from Grade dropdown Click "Find the wild cards..." button Click "Generate" Click "Save changes" Ensure question is added and no error is thrown

      I just installed moodle 4.0.1 through cpanel. I tried creating a Simple Calculated Question and I got the error below. That's on the server where my moodle is hosted.
       
      To make sure it's not some server issue, I just freshly installed moodle 4.0.1 on my personal laptop as well (I'm using Archlinux). I then created a new course, and then tried creating a simple calculated question. I got the same exact error. Again, this is a completely fresh install.

      As a test, I then tried creating a Numerical question and I was able to create it without issues.

      Any help would be greatly appreciated! Thank you in advance!
       
       
      Can't find data record in database.

      More information about this error
       
      Debug info: SELECT q.id, qc.id as category, q.parent, q.name, q.questiontext, q.questiontextformat,
      q.generalfeedback, q.generalfeedbackformat, q.defaultmark, q.penalty, q.qtype,
      q.length, q.stamp, q.timecreated, q.timemodified,
      q.createdby, q.modifiedby, qbe.idnumber,
      qc.contextid,
      qv.status,
      qv.id as versionid,
      qv.version,
      qv.questionbankentryid
      FROM {question} q
      JOIN {question_versions} qv ON qv.questionid = q.id
      JOIN {question_bank_entries} qbe ON qbe.id = qv.questionbankentryid
      JOIN {question_categories} qc ON qc.id = qbe.questioncategoryid
      WHERE q.id = :id
      [array (
      'id' => 0,
      )]
      Error code: invalidrecordunknown
       
       
      Stack trace:

      • line 1674 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      • line 624 of /question/engine/bank.php: call to moodle_database->get_record_sql()
      • line 587 of /cache/classes/loaders.php: call to question_finder->load_for_cache()
      • line 1792 of /cache/classes/loaders.php: call to cache->get_implementation()
      • line 405 of /cache/classes/loaders.php: call to cache_application->get_implementation()
      • line 480 of /question/engine/bank.php: call to cache->get()
      • line 255 of /question/engine/bank.php: call to question_finder->load_question_data()
      • line 273 of /question/engine/bank.php: call to question_bank::load_question_data()
      • line 217 of /question/bank/editquestion/question.php: call to question_bank::load_question()

      When I click continue, I get another set of errors:
       
      Need to provide courseid or cmid to print_question.

      More information about this error
       
      Debug info:
      Error code: missingcourseorcmid
       Stack trace: * line 109 of /question/bank/editquestion/question.php: moodle_exception thrown

            antonp Anton P
            t287ma S T
            Safat Shahin Safat Shahin
            Tim Hunt Tim Hunt
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            7 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 26 minutes
                26m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.