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

Essays don't show on "Grade Essays" tab w SQL Server database

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.1, 2.1.2, 2.6.5, 2.7.2
    • Fix Version/s: 2.6.6, 2.7.3
    • Component/s: Lesson
    • Labels:
    • Environment:
    • Database:
      Microsoft SQL
    • Testing Instructions:
      Hide

      This should be tested with MS SQL Server to verify the fix is working (This is very important as I am unable to do it !) and with other databases to track any regression.

      1. As a teacher, create a lesson in a course using all defaults.
      2. Create an essay question in the lesson.
        #. As a student, open the lesson, answer the question and save your answer.
      3. As an admin or teacher, go to the lesson and verify that the student attempt is displayed in the Report Overview and Report Detailed statistics pages.
      4. Following "Grade essays", verify that the student attempt is displayed and that clicking on it you are able to see the student answer, and enter a comment and a score.
      Show
      This should be tested with MS SQL Server to verify the fix is working (This is very important as I am unable to do it !) and with other databases to track any regression. As a teacher, create a lesson in a course using all defaults. Create an essay question in the lesson. #. As a student, open the lesson, answer the question and save your answer. As an admin or teacher, go to the lesson and verify that the student attempt is displayed in the Report Overview and Report Detailed statistics pages. Following "Grade essays", verify that the student attempt is displayed and that clicking on it you are able to see the student answer, and enter a comment and a score.
    • Workaround:
      Hide

      In mod\lesson\essay.php, I change the referenced to the question type constant LESSON_PAGE_ESSAY to a literal and things seem to work.

      case 'display': // Default view - get the necessary data
      default:
      // Get lesson pages that are essay
      $pages = $lesson->load_all_pages();
      foreach ($pages as $key=>$page) {
      if ($page->qtype !== 10)

      { // LSN changed this, was: LESSON_PAGE_ESSAY) unset($pages[$key]); }

      }

      The qtype column in mdl_lesson_pages is defined in SQL Server as a smallint, and the qtype I saw for my page was 10.

      Also please note that I am a database person, not a php person, so it may be okay that LESSON_PAGE_ESSAY is defined only in mod\lesson\pagetypes\essay.php and only as a string:

      define("LESSON_PAGE_ESSAY", "10");

      ... but really this change to a literal 10 did the trick.

      Show
      In mod\lesson\essay.php, I change the referenced to the question type constant LESSON_PAGE_ESSAY to a literal and things seem to work. case 'display': // Default view - get the necessary data default: // Get lesson pages that are essay $pages = $lesson->load_all_pages(); foreach ($pages as $key=>$page) { if ($page->qtype !== 10) { // LSN changed this, was: LESSON_PAGE_ESSAY) unset($pages[$key]); } } The qtype column in mdl_lesson_pages is defined in SQL Server as a smallint, and the qtype I saw for my page was 10. Also please note that I am a database person, not a php person, so it may be okay that LESSON_PAGE_ESSAY is defined only in mod\lesson\pagetypes\essay.php and only as a string: define("LESSON_PAGE_ESSAY", "10"); ... but really this change to a literal 10 did the trick.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:

      Description

      Under Microsoft SQL Server 2008 SP2, essay question attempts do not show up on the Grade Essays tag. The attempts (essay answers) do show up in the Reports Detail view, although the Class Statistics column next to the answer says "no one answered this question". The problem might be a datatype conversion error (see workaround).

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14