Problem/Motivation

Custom Paragraph content does not display on the lesson page of a course.

Steps to reproduce

  1. Create a custom paragraph to be elegible
  2. Modifiy the page paragraph type
  3. Modifiy the reference field
  4. Modifiy the reference field
  5. The paragraph then becomes elegible in your lesson
  6. It looks like it works...
  7. But it doesn't...

Maybe There's something I'm not doing. If so... I'd appreciate some enlightenment. Thanks in advance!

Issue fork anu_lms-3331125

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ledjerdemain created an issue. See original summary.

ledjerdemain’s picture

Issue summary: View changes
ledjerdemain’s picture

Issue summary: View changes
StatusFileSize
new27 KB
new11.01 KB
new22.59 KB
new16.88 KB
new49.29 KB
new20.76 KB
new35.63 KB
spleshka’s picture

Hi @ledjerdemain, great question! Basically, you've got all right. The only thing is that paragraphs are rendered via React application, and in order to display your added paragraph in the lesson, you need to create a custom React component. Would you need some help in getting this done? I can draft some guidance if you feel comfortable rendering your custom paragraph with React.

ledjerdemain’s picture

Hello @spleshka. Thank you for your answer! And because I am an absolute noob... yes I would need some help getting this done. If there is however any documentation you could point me too, I'd gladly check it out! Thanks a lot again!

spleshka’s picture

Version: 2.9.2 » 2.x-dev

Hey, I'm sorry it's taking so long to update the documentation. It's still on our TODO list.

ledjerdemain’s picture

@Spleshka I get, these things take time. But I am very much looking forward to it.

dastan56’s picture

@Spleshka hi, i am trying to override one of the anu lms react component in my custom module react, but everytime i try to import using following code:

import ParagraphsWithQuiz from '@anu/components/ParagraphsWithQuiz.js';

i get the following error, when i run npm run build:

Module not found: Error: Can't resolve '@anu/components/ParagraphsWithQuiz.js'

i see in the readme file you have written TODO. Untill you update the documentation, can you give me a quick idea here on how to get it done so that i can continue with my work, thanks

spleshka’s picture

I've created a MR with an example of how to override the existing component (addressing #8). An example of how to add a new custom paragraph is yet to be added to the same MR.

spleshka’s picture

Hi @ledjerdemain, we've finally had some time to add an example of how to add a custom paragraph type to Anu LMS: https://git.drupalcode.org/issue/anu_lms-3331125/-/tree/3331125-cant-add.... Hopefully you'll find it helpful :-)

  • Spleshka committed da349873 on 2.x
    Issue #3331125: Can't add content of custom paragraph types to lessons
    
spleshka’s picture

Status: Active » Fixed

Merged examples into the main branch. Added documentation to https://www.drupal.org/docs/contributed-modules/anu-lms/customising-anu-lms. Happy to mark the issue as fixed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.