How to expand branching scenario features

Forums: 

Hello my friends!

First I would like to know if it is possible to expand the functionality of the branching scenario, as my goal is to add conditionals on the branches.

If it is possible to edit this way how can I do it? I have a lot of experience with HTML, CSS and Javascript. However, so far I am not able to run and edit the H5P libraries. I haven't really found a tutorial that clearly explains this.

The question is, how can I edit, run and test an H5P library?

Do you have any step by step?

Thanks

Content types: 

Anyone can help me please?

otacke's picture

Hi Edsamo!

Not sure if I understand the question:

  • You can find all the source code on github at https://github.com/h5p/?q=branching&type=&language=
  • You can find documentation at https://h5p.org/developers
  • There are a handful of videos on coding for H5P at https://youtube.com/playlist?list=PL4lOawnmqTnHuQIBYz7K7LkdTybL3Ui7T

Best,

Oliver 

Hello Otacke! Thanks for reply!

Yes, i saw the source codes on the github. But, I prefer to edit the code outside of wordpress, drupal or moodle. Is that possible?

I'm trying to edit code using the H5P Dev Tool 0.9.0, but it doesn't seem to work properly. 

I am sending attached images to help better understand my problem.

I thank you for your help.

 

otacke's picture

Hi!

I am sorry, but I have no clue what the H5P Dev Tool is. The screenshots seem to suggest some setup/path issue potentially.

Best,

Oliver 

H5P with drupal envrionment works great. Thanks!

otacke's picture

Hi!

Glad you gave it a try. It's not ideal, but the plan is to replace it by a platform indepent solution as Drupal 7 is being phased out.

Best,
Oliver

papi Jo's picture

Hi Oliver!

That's good news! 

Hi Otacke!

I'm trying to run Branching Scenario Editor on Drupal 7, but the editor isn't work.  

I dowloaded the code here: https://github.com/h5p/h5p-editor-branching-scenario and put it in the folder development.

After this i executed the following commands npm install and npm run watch.

I attached a screen shot of the problem. Do you know what is happening there?

See ya

Attachments: 
otacke's picture

Hi!

No, but the H5P core has been working on the four libraries that build Branching Scenario. Maybe you fetched a work-in-progress state?

Best,

Oliver 

The stable version works great! Thanks!

Hello Otacke!

I'm improving branching scenario features, and i wanna know how to get access to a subcontent methods.

In this case i want to jump to a specific slide of course presentation, inside of branching scenario content type.

Is that possible?

 

Anyone can help me please?

otacke's picture

You can access instances of content types via the libraryScreens where the instances are created, cmp. https://github.com/h5p/h5p-branching-scenario/blob/master/scripts/libraryScreen.js#L605 And yes, Course Presentation exposes a jumpToSlide function.

This works, thanks!

And now i'm trying to jump to given time in InteractiveVideo, but it's not working. I'm using this function on this case: https://github.com/h5p/h5p-interactive-video/blob/stable/src/scripts/int...

Do you know what is missing, to work properly?

 

otacke's picture

Hi edsamo!

It'd help if you shared what exactly you were doing. The function itself is fine. Are you calling it on the right instance? Are you passing a valid argument? ...

Cheers,
Oliver

Yes, i'm calling the function in an InteractiveVideo instance and passed a valid time argument (Number).  The attached secreenshot shows it.

I'm trying to do the following behavior: When navigate from any content type for an interactive video, i want to start the video at a certain time instead of starting 0:00.

i hope do you understanded 

Attachments: 
otacke's picture

I understand, but when I wrote "share what exactly you were doing" I expected you'd share your code :-) The screenshot is not showing what you were doing, only the results ... Anyway, that red error message returned by YouTube didn't make you suspicious? It suggests that it's an X-Frame-Header problem/issue with TLS, but I assume that your call comes before YouTube's iframe has finished loading, so you might want to delay your call until that's done. To autostart at position 3:00, something like

instance.video.on('loaded', () => {
  instance.seek(180);
  instance.play(); // Not sure if YT videos play automatically after seek
});

where instance is your instance of Interactive Video might do the trick in that case.

This way that you explained works great!

Thanks Otacke!

How can i use my modified h5p plugin at drupal in another plataform like moodle?