second and subsequent questions not appearing in lesson

second and subsequent questions not appearing in lesson

by helen walmsley -
Number of replies: 13

I created a question page and filled in several questions with feedback. However, when I saved the page, only the first question was displayed. I returned to the home page and selected lesson 'edit' and was then presented with a slightly different question page editor - there was a 'save' button at the bottom - and this time all of the questions were saved.

Anyone any ideas how I can get the lesson to work first time round?

Average of ratings: -
In reply to helen walmsley

Re: second and subsequent questions not appearing in lesson

by Mark Nielsen -
What version of lesson are you using and what type of question did you try to make?

Cheers,
Mark
In reply to Mark Nielsen

Re: second and subsequent questions not appearing in lesson

by helen walmsley -

Hi Mark,

Not sure how to find out which version of lesson I am using - but I am using v 1.6.8.3 2005/02/06 of Moodle.

I created a question page with multiple choice questions - but as I said, the second and subsequent questions did not show on the lesson until I went into the 'edit lesson' and added them though there. I've recently had a message from our administrator (we are new to Moodle here!) who says that he has noticed some PHP errors on our site - could this be related?

In reply to helen walmsley

Re: second and subsequent questions not appearing in lesson

by Mark Nielsen -
Could you try creating a new lesson and then repeat the same steps as before to try to recreate the problem.  Perhaps the php errors threw off some of the database operations?  Not really sure big grin
In reply to Mark Nielsen

Re: second and subsequent questions not appearing in lesson

by helen walmsley -

Tried it again, and the same thing happens.

I must be missing something! I notice that when I created the first page of the lesson and add the multiple choice answer options underneath, there doesn't seem to be any way to indicate which is the correct response - does Moodle assume that it is the first one entered?

I created 2 multiple choice answer options to my question with feedback, but when I saved the page I got a message saying 'Insert Page: answer record 1 not inserted'

Only the first answer option was then displayed in the lesson.

When I returned to the lesson to edit, I re-entered the 2nd multiple choice answer option and saved the page. I then got an 'OK' and the lesson works!

Any thoughts?

In reply to helen walmsley

Re: second and subsequent questions not appearing in lesson

by Mark Nielsen -
there doesn't seem to be any way to indicate which is the correct response - does Moodle assume that it is the first one entered?

If you have custom scoring on, then correct answers are answers with scores greater than 0.

If you have custom scoring turned off, then a correct answer is a jump to a page further down in the lesson or closer to the end of lesson.  Example, an answer with the jump Next Page is always a correct answer.


As for your problem with adding a new page... I have no clue what would cause that to fail.  I don't think I have ever seen a failed insert record before mixed

Do you have anything besides plain text in the answer or response fields?  Perhaps a special character is throwing it off...?

In reply to helen walmsley

Re: second and subsequent questions not appearing in lesson

by Mick Presnell -

I had essentially the same thing happen. I'm using 1.5+ downloaded and installed about a week ago.

After creating and saving a lesson, I attempted to add a question to it. Whether I tried a multiple choice question or true false, when I attempted to save the question I received an error message indicating that the question had not been saved. The message is “Update page: answer record not inserted” This continued through several attempts, even when I used Notepad to compose the questions to make sure that MS Word code wasn’t interfering with Moodle.

Mick

In reply to Mick Presnell

Re: second and subsequent questions not appearing in lesson

by Mark Nielsen -
I'm really at a loss here.  Perhaps a screen shot of your question editing screen might help ??  Anyone else have an idea of why an insert_record might fail?
In reply to Mick Presnell

Re: second and subsequent questions not appearing in lesson

by Mark Schultz -
I too have been having this problem. The message is “Update page: answer record not inserted”. I have noticed that the error only occured when I tried to insert more than one field at a time. For instance, if I just added text into answer 1, it worked. But if I added text into answer 1 and response 1, I get the error. I'm running 1.5.2. The problem is intermittent too. Although it seems that with a particular question page, once the problem occurs, it stays.

I did try to repair the answers table in  the DB. Got an OK response, but don't know if it found a problem.
In reply to Mick Presnell

Re: second and subsequent questions not appearing in lesson

by Mark Schultz -
BY the way, I experienced this problem only after I upgraded to 1.5.2 from 1.4X. And, all the instances of this or similar problem reported in the forum refer to version 1.5. I wonder if we have a bug?
In reply to Mark Schultz

Re: second and subsequent questions not appearing in lesson

by Mark Nielsen -
I'll look into this and see if I can find anything.

Cheers,
Mark
In reply to Mark Nielsen

Re: second and subsequent questions not appearing in lesson

by Roger Gardner -
I have also had this problem when trying to add short answer question type in a lesson. The first response is fine, but I get the error when adding a second. Also using 1.5.2.
In reply to Roger Gardner

Re: second and subsequent questions not appearing in lesson

by Si :) -
Hi there Roger et al.

I have found a slip-up in the lesson code that may well be responsible for the errors you are experiencing.

Goto moodle .../mod/lesson/action/updatepage.php.

Around about line 124 (latest CVS version, 112 ish for earlier versions) you will see this..

if (isset($form->response[$i])) {
$newanswer->response = clean_param(trim($form->response[$i]), PARAM_CLEANHTML);
$newanswer->answer = addslashes($newanswer->answer);
}

...it should be this...

if (isset($form->response[$i])) {
$newanswer->response = clean_param(trim($form->response[$i]), PARAM_CLEANHTML);
$newanswer->response = addslashes($newanswer->response);
}


...that ort to do it!

Si smile

P.S. I have reopened Bug #1187
In reply to Si :)

Re: second and subsequent questions not appearing in lesson

by Mark Nielsen -
Ok, this is now fixed in 1.5.3  Thanks for you help!

Cheers,
Mark