jsxgraph / moodle-filter_jsxgraph

moodle plug-in for JSXGraph
https://jsxgraph.org
2 stars 6 forks source link

JSXGraph only create one jsxgraph in a 'quiz'. #12

Closed pbelle closed 3 years ago

pbelle commented 5 years ago

Hi, I´m trying to build a 'quiz' in moodle and only one jsxgraph apear correctly. If I try to create more then one jsxgraph, this newone apear in blank! The idea was to put one jsxgraph per alternative in a multiple choice quiz!

Is there any solution to this problem?

Thank you,

2019-05-23
andreas-web commented 5 years ago

Hello. Thank you for your interest in our Moodle filter. Could you please post the code of the two used JSX-applications including the tags here. We will try to find a solution to your problem. Greetings, Andreas

pbelle commented 5 years ago

Hello Andreas, sorry about my delay, and thank you for your support. I´m not a especialist in html programming, so may be I´m making an elementary mistake. I just copied one example from the examples pages and paste it in the choices. I only changed the object name. The codes I wrote there are the following:

Alternative a)

(function() { var brd2 = JXG.JSXGraph.initBoard('box1', {boundingbox:[-5,5,5,-5], axis:true}); var p2 = brd2.create('point', [1,2]); })();

Alternative b)

(function() { var brd = JXG.JSXGraph.initBoard('box0', {boundingbox:[-5,5,5,-5], axis:true}); var p = brd.create('point', [2,2]); })();

The idea was obviously to make 2 (or more) graphs for the student select the proper one.

Please, note that the tags are not appearing in the text. I can only see that when I edit the text.

Before the first (function() { ... I write the tag: and after the " })();" I wrote . The jsxgraph here I wrote in underlined space because in normal form the tags do not appear in text!

Using these underlined spaces, the code was:

Alternative a)

(function() { var brd2 = JXG.JSXGraph.initBoard('box1', {boundingbox:[-5,5,5,-5], axis:true}); var p2 = brd2.create('point', [1,2]); })();

Alternative b)

(function() { var brd = JXG.JSXGraph.initBoard('box0', {boundingbox:[-5,5,5,-5], axis:true}); var p = brd.create('point', [2,2]); })();

Best regards, Paulo Belletato.

andreas-web commented 4 years ago

Dear Paulo,

I am very sorry that I am only now reporting, but my exams dominate my schedule.

Thanks for your code posts. Could you please try to add the attribute box="" to the two <jsxgraph-tags. At alternative a) you would have to write box="box1", at b) box="box0". How is it then?

A second solution could also be to swap the two boxes. Maybe the board at alternative a) has to be named to "box0" and alternative b) to "box1". That means you would have to change the code to:

(function() { var brd2 = JXG.JSXGraph.initBoard('box0', {boundingbox:[-5,5,5,-5], axis:true}); var p2 = brd2.create('point', [1,2]); })();

and

(function() { var brd = JXG.JSXGraph.initBoard('box1', {boundingbox:[-5,5,5,-5], axis:true}); var p = brd.create('point', [2,2]); })();

Please test these two solutions and then get in touch again! I hope I could help you.

Andreas

pbelle commented 4 years ago

Dear Andreas, I´ve tried both of your sugestions but unfortunatly, didn´t worked! I have already tried using the second sugestion, using both single quotes, as well as, double quotes. Unfortunatly, didn´t worked also.

Can we try any other solution? Best regards, Paulo

andreas-web commented 4 years ago

Dear Paulo,

that is very strange. I tried the first suggestion from my post on 2 August in a test environment. Everything works perfect for me: moodle1

I have used the following settings: moodle2

Could it be that another plugin or filter is blocking the functionality of JSX? I use the default global JSX filter settings.

Best regards Andreas

pbelle commented 4 years ago

Dear Andreas,

I will try to verify my installation of Moodle and the plugins installed. But I´m very grateful for your assistance, and also excited to see that it worked in your system.

Thank you Andreas,

Best regards, Paulo Belletato.

Em ter, 8 de out de 2019 às 10:37, A. Walter notifications@github.com escreveu:

Dear Paulo,

that is very strange. I tried the first suggestion from my post on 2 August <#m_-3245739484289821506_issuecomment-517701664> in a test environment. Everything works perfect for me: [image: moodle1] https://user-images.githubusercontent.com/30598361/66400151-3bb2d580-e9e1-11e9-855f-23948b30739d.png

I have used the following settings: [image: moodle2] https://user-images.githubusercontent.com/30598361/66400169-42d9e380-e9e1-11e9-9393-de7422a1a6df.png

Could it be that another plugin or filter is blocking the functionality of JSX? I use the default global JSX filter settings.

Best regards Andreas

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jsxgraph/moodle-filter_jsxgraph/issues/12?email_source=notifications&email_token=AD54YCHUVLPNMTAK6MIRXE3QNSEKDA5CNFSM4HOZT33KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAUGD2Y#issuecomment-539517419, or mute the thread https://github.com/notifications/unsubscribe-auth/AD54YCFOQC5ARKEHC3KHWL3QNSEKDANCNFSM4HOZT33A .

alfredwassermann commented 4 years ago

Dear Paulo, can you please tell us, if there are any error messages in the JavaScript console? Best wishes, Alfred

andreas-web commented 4 years ago

Please note our new functionality that the boardID is saved in a variable and try to use it. Maybe that will fix your problem.

andreas-web commented 3 years ago

Because Paulo stopped answering, I mark this issue as closed. If there are still problems you can reopen it.