New question type: Structure diagrams

New question type: Structure diagrams

by Miguel Martínez -
Number of replies: 15

Good morning!

I am glad to communicate you we have just finished developing a new question type based on the shortanswer one.

From our point of view, this question type attends to one of the most important and basic parts of the structural analysis. It allows the professor to ask the student to draw the graph of internal forces of a predefined structure.

At the moment we have just developed it for moodle 2.2. But we will be interested in developing it for moodle 2.4 as our university moodle version it is going to change next year.

I upload a .zip with all the information. We have tested it and we have not found any problem. But we will be very thankful if anyone checks it (as we are not moodle experts).

Kind regards




Note: We have also developed a users guide with the explanations of how to work with this question type. Available here: http://dfiles.eu/files/2swkyfnfk
The question and its components are open-souce and free.

Average of ratings: -
In reply to Miguel Martínez

Re: New question type: Structure diagrams

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

This sounds very interesting. However I cannot see an image in your post and the link you have provided is censored filtered where I work and blocks it on the grounds that it is "computers.filehosting", which seems like blocking off an awful large amount of the interwebs to me.

 

In reply to Marcus Green

Re: New question type: Structure diagrams

by Miguel Martínez -

Hi!

I attach the file on this new link: https://collab.upm.es/gm/document-1.9.150436/diagrams.zip

Inside it you can find a pdf with a user guide with pictures about it.

 
In reply to Miguel Martínez

Re: New question type: Structure diagrams

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Miguel,

Please make your new question type available on github.

Joseph

In reply to Joseph Rézeau

Re: New question type: Structure diagrams

by Miguel Martínez -

Hi Joseph!

This it´s the first time I used github, but I think it works:

https://github.com/miguel-martinez/diagrams/


In reply to Miguel Martínez

Re: New question type: Structure diagrams

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Miguel,

Thanks for uploading your contribution on github.

Upon installing, I get this error message "Notice: Use of undefined constant MATURITY_VERDE - assumed 'MATURITY_VERDE' in moodle\question\type\diagrams\version.php on line 33". This is because MATURITY_VERDE does not exist in the list of MATURITY levels, see the documentation for possible values.

Unfortunately, my level in physics is next to nil so I do not understand the explanations in the documentation and will not be able to help you test that very specialized question type. But I'm sure other moodlers will be able and willing to try.smile

Joseph

 

Average of ratings: Useful (1)
In reply to Miguel Martínez

Re: New question type: Structure diagrams

by Douglas Broad -

Miguel,

What is the extra green rectangle below the axis on the shear diagram where the left column is?  That should not be part of a shear diagram.  

Regards,

Doug

In reply to Douglas Broad

Re: New question type: Structure diagrams

by Miguel Martínez -

Hi!
I´m not quite sure if I have understood what you mean, but if you mean the vertical rectangle of the picture of the example, it corresponds to the shear diagram of the column. Notice that there is one horizontal force on the left that is assumed by the column.

Kind regards
Miguel

In reply to Miguel Martínez

Re: New question type: Structure diagrams

by Douglas Broad -

Got it.  Thanks.  Am used to working with beams separately from columns(by parts).

In reply to Miguel Martínez

Re: New question type: Structure diagrams

by Jean-Michel Védrine -

Hello Miguel,

This seems to be a very interesting question type (on a personal note it unfortunately remind me of very bad moments as I studied this, and had one of my worst marks on the final exam wink)

But I think there are some problems in your code, for instance

$result .=html_writer::tag('div', "</script><script type=\"text/javascript\" src=\"http://localhost/moodle/question/type/diagrams/diagrams.js?".base64_encode($javascript_parametro)."\"></script>", array('class' => 'qtext'));

in your renderer will not work on most Moodle install. You can't hard code the url like that.

Unfortunately i was unable to fully test it due to my poor understanding of structure diagrams (as I was not understanding them 40 years ago as a student, you can guess how it is now !)

Maybe you could upload sample questions on this forum exporting some of the ones you have using Moodle xml format ?

In reply to Jean-Michel Védrine

Re: New question type: Structure diagrams

by Jean-Michel Védrine -

Hello,

I discovered there are example questions at the end of your user manual, and I was able to replicate some of them. So this is working on my Moodle 2.6dev test installation (I only had to add some mform->setType instructions to edit_diagrams_form.php to suppress some warnings)

My only problems so far are the hardcoded url given in my previous message (I did a quick fix using $CFG->wwwroot but the javascript would surely benefit from some work for a better integration into Moodle (see docs: http://docs.moodle.org/dev/Javascript ) and the spanish help strings used in javascript too, as I don't understand them so they don't really help me smile (here also look at the docs to see how to use Moodle lang strings in javascript to permit translators to fully translate your plugin when you will submit it to the Plugins directory)

Average of ratings: Useful (1)
In reply to Jean-Michel Védrine

Re: New question type: Structure diagrams

by Miguel Martínez -

Hello Jean-Michel!

Sorry for the delay. Thank you very much for your contribution with  "$CFG->wwwroot", we have already changed it.

My apologize about the bad writing of the javascript but I have to recognised that when we first wrote the code we were not expecting to go so far even to show it to the public. And if you put it together with the fact that we have really less idea about javascript, and we have just learned a little bit of c and fortran for developing it, as it also was our first time with php, the final result it is no so bad hehehe. 

I will translate the help strings so they could be useful for others. Thank you very much for show us the page "http://docs.moodle.org/dev/Javascript", but, one little question, where do you recommend us to start there, as there´s plenty a lot of information there.

Could you please tell us what did you change for using it with moodle 2.6 (as I have said that we wish to use it next year with moodle 2.4 but we have no idea how to change it).

I haven´t uploaded it to the plugins directory, as I was waiting for your advices, I don´t know if you think we should wait to uploaded it until we have improved the javascript and made it legible.

Merci beaucoup!

Miguel

In reply to Miguel Martínez

Re: New question type: Structure diagrams

by Miguel Martínez -

Hello!


We have just translated the diagrams.js comments to English so it will become easier to understand.

If anyone notice any other possible error please let me know!

Thanks to all!
Miguel Martínez

In reply to Miguel Martínez

Re: New question type: Structure diagrams

by Jean-Michel Védrine -

Hello Miguel,

I just spotted that your version.php file is UTF-8 encoded with a Byte Order Mark, I had to remove the BOM because it was producing warnings at each plugin installation/upgrade

In reply to Jean-Michel Védrine

Re: New question type: Structure diagrams

by Miguel Martínez -

Hello!
Thank you very much Jean-Michel. Sorry for the delay, I was enjoying a short vacances.

We are planning to make a few more improvements before we uploaded it to the plugins directory, and I was wondering if you could please sent me (or uploaded it to the github version, as you prefer), the modifications you have made in the code, so that we could incorporate them and compare them to what we have.

Thank you very much

Miguel Martínez