Can't see students Essay's

Re: Can't see students Essay's

by Ben Stilwell -
Number of replies: 0

So I'm still working on this to make it work for me. I turned debugging on to see the following errors:

Notice: Trying to get property of non-object in /services/webpages/d/o/webserver.com/public/moodle/mod/lesson/view.php on line 966

Notice: Trying to get property of non-object in /services/webpages/d/o/webserver.com/public/moodle/mod/lesson/view.php on line 970

referring to:

$pageid = $firstattempt->pageid;

$USER->modattempts[$lesson->id] = $lastattempt->pageid;

My thought was that this has to do with the pageid which shows as being set to -9.

I was also getting an error on:

Notice: Trying to get property of non-object in /services/webpages/d/o/webserver.com/public/moodle/mod/lesson/action/continue.php on line 668

which refers to:

if($response)

immediately preceding this is:

        if (empty($response)) {
            if (!$lesson->feedback and !$noanswer and !($lesson->review and !$correctanswer and !$isessayquestion)) {
                // These conditions have been met:
                //  1. The lesson manager has not supplied feedback to the student
                //  2. Not displaying default feedback
                //  3. The user did provide an answer
                //  4. We are not reviewing with an incorrect answer (and not reviewing an essay question)
               
                $nodefaultresponse = true;  // This will cause a redirect below
            } else if ($isessayquestion) {
                $response = get_string('defaultessayresponse', 'lesson');
            } else if ($correctanswer) {
                $response = get_string('thatsthecorrectanswer', 'lesson');
            } else {
                $response = get_string('thatsthewronganswer', 'lesson');
            }
        }

I've bolded the if statement and the php statement because it was indeed firing, but it seems to me it shouldn't. Instead the first else..if statement should have gone. So on that assumption I changed it to:

if (!$lesson->feedback and !$noanswer and (!$lesson->review and !$correctanswer and !$isessayquestion))

which seemed to match what the comments said it was supposed to do.

Anyway, this changed things a bit, now after clicking "Please enter your answer in the box" it takes me to a page that appears to be a review with a "continue" button. Clicking the continue takes me to the "Congratulations - end of lesson reached" page with above 2 errors and no entry into the "Grade Essays" section for the admin.

So I'm still stuck. Please, please help.