How can I make links to Graphics be "portable" or how can links be changed "en masse"?

How can I make links to Graphics be "portable" or how can links be changed "en masse"?

ໂດຍ Peter Halverson -
ຈຳນວນການຕອບກັບ: 2

Hello everyone,     (I am using moodle 2.4)

I am really close to having a nice "low-resources" solution to the problems of making graphs in Calculated and Formulas type quiz questions.  See discussion in https://moodle.org/mod/forum/discuss.php?d=231118

A loose end, though, is the problem of "portability."  What happens if the teacher changes moodle server?  Or what if the machine that serves up the graphics changes address?  It could be really bad.  Imagine you made 100 questions with graphics.  Fixing 100 links would be awful!

Right now the graphics links look like this:

http://halverchemphysics.net/moodle/jsxgraph1/GraphForMoodle1.html?graph=x*x

This would draw a parabola.  The problem is that if the server address changes from "halverchemphysics" to "joesphysics", then this and all the other questions' links will have to be modified.

I tried to make the link be just

jsxgraph1/GraphForMoodle1.html?graph=x*x

And inside the moodle/question directory putting a symbolic link for jsxgraph1 pointing to the correct directory.  This works in some situations, but it often fails because moodle will automatically add the "http://myphysics.net/moodle/" to the start of the link.  (Is there a way to prevent that?)

A different approach would be to find a way to change all links from "myphysics" to "yourphysics" throughout an entire course.  Is there any way to do that?

Any ideas???

Thanks,

Peter Halverson

ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ Peter Halverson

Re: How can I make links to Graphics be "portable" or how can links be changed "en masse"?

ໂດຍ Bernat Martinez -

Hi Peter, 

Regarding portability could you try this inside the  iframe tag

/moodle/jsxgraph1/GraphForMoodle1.html?graph=x*x

I have installed jsxgraph1  in my Moodle and tried, it works

Everything works fine, but unfortunately it seems not passing random variable value

Regards

Bernat

ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ Bernat Martinez

Re: How can I make links to Graphics be "portable" or how can links be changed "en masse"?

ໂດຍ Peter Halverson -

Thank you for the suggestion, but unfortunately, moodle seems to be changing the link.  In other words, I put in /moodle/jsxgraph1/GraphForMoodle1.html?graph=x*x, but then it right away changes it to http://halverchemphysics.net/moodle/jsxgraph1/GraphForMoodle1.html?graph=x*x

I do want the change to occur but not right away.  I want it to happen when the student takes the quiz.  By immdiately change the address moodle is making "un-portable" an address that was "portable" to begin with.

(Wow.. how confusing is that!)

As far as getting the random variables to work,

I suggest going in small steps.  First get the quiz to plot 5*x*x

Then when that is working, define a random called for example "k".  Now make the quiz plot {k}*x*x

It should work.

Peter

ການຈັດອັນດັບສະເລ່ຍ: -