Lesson doubled and now showing no questions

Tim Sparrow
Forums
I have 25 lessons in a course and one of them keeps showing up twice in the course view. I checked and both links point to the same node ID so it is not a duplicated lesson. I have removed all old revisions from the lessons and the questions and it still shows up. However, now I get "No questions were found. Please assign questions before trying to take this Topic." whenever I [Take] the lesson. When I go into [Manage Questions] all my questions are there as they should be. I am at the point where I am going to delete the entire lesson and start again. 1) Why would this one question keep appearing twice in the view? 2) How can I fix the "no questions" error when I [Take] the lesson? Revisions are turning out to be the bane of my life, with me forever going in and deleting old versions to make the correct lessons and questions show for new users. 3) Is there a way to switch off revisions completely? Many thanks, Tim
Profile picture for user James Aparicio
James Aparicio

Hi Tim,

Hi Tim,

Thank you for finding this bug.

What happens is that if a lesson has been part of serveral courses and has been sorted, the reference is kept in the weight sorting table and when doing the view query it shows up.

I have fixed this.

www.drupal.org/node/2334663

Look at the code change in the opigno_quiz_app.module that registers the context filter handler for the weight gid. Change this in your module and inside the view add the contextual filter "Opigno quiz app: The quiz group" : -> Provide default value : Content id from url 

http://cgit.drupalcode.org/opigno_quiz_app/commit/?id=0140f53

 

This has been pushed and will be fixed on next release

Let me know if it worked for you, Best regards

James Aparicio

Tim Sparrow

Hi James,

Hi James, Thanks for the quick fix. I am struggling finding the module and understanding what I need to change in it. Can you send me the fixed module or point me to the module location and let me know what code I need to change (I looked at the git change and didn't understand it ) I get the view contextual filter change so can do that bit :) Many thanks, Tim
Profile picture for user James Aparicio
James Aparicio

Hi Tim, if you look at the

Hi Tim, if you look at the git commit link i wrote.

http://cgit.drupalcode.org/opigno_quiz_app/commit/?id=0140f53

You have the files and changes there.

opigno_quiz_app.module

It is inside profiles/opigno_lms/modules/opigno/opigno_quiz_app/opigno_quiz_app.module. Code was changed inside the function 

opigno_quiz_app_views_data

The other file changed, views_default you do not need to change, you can go to the view itself and add the context filter as i explained.

 

Best regards

Tim Sparrow

Hi James,

Hi James, Got it this time round :) I have implemented the changes, however I may be confused as to which bug was fixed :) This fixes the bug where the lesson appears twice I assume from reading the code. Does this also fix the error I receive saying "No questions were found. Please assign questions before trying to take this Topic."? I still have this appearing on node/%/take views (not all though). It occurs when I delete previous revisions and only leave the current revision. I have it occurring in several lessons and courses now. Many thanks, Tim
Tim Sparrow

Sorry, forgot to add the

Sorry, forgot to add the picture:Link to ImageThanks
Tim Sparrow

Fixed the issue.

Fixed the issue. Ran Cron Flushed all Caches Re-ran permissions Logged out and back in again Error no longer displayed and I can see quizzes as normal.