Aquesta pàgina forma part de la documentació de Moodle en català, tot i que no ha estat traduïda encara. Podeu contribuir obertament a les tasques de traducció. Podeu consultar la Guia d'edició de la documentació i també participar ens els debats del fòrum de traductors de la documentació a moodle.org

Jmol filter: diferència entre les revisions

De MoodleDocs
Salta a:navegació, cerca
Cap resum de modificació
 
(14 revisions intermèdies per 3 usuaris que no es mostren)
Línia 5: Línia 5:
The Moodle Jmol filter makes it incredibly simple for teachers to embed these viewers into teaching material (quizzes, discussion messages, etc).
The Moodle Jmol filter makes it incredibly simple for teachers to embed these viewers into teaching material (quizzes, discussion messages, etc).


* '''[http://download.moodle.org/download.php/modules/filter_jmol.zip Download the Jmol filter]''''
* '''[https://github.com/geoffrowland/moodle-filter_jmol/tree/MOODLE_19_STABLE Download the Jmol filter for Moodle 1.8 and 1.9]'''
 
* '''[https://github.com/geoffrowland/moodle-filter_jmol Download the Jmol filter for Moodle 2.0]'''


The Jmol filter is very useful for including a molecule viewer in a variety of situations - e.g. in a [[Label]], a [[Forums | Forum]] discussion, or a [[Quizzes| Quiz]] question. If you wish to load a molecule data file as a "resource", you should also consider installing the [[Jmol resource module]].
The Jmol filter is very useful for including a molecule viewer in a variety of situations - e.g. in a [[Label]], a [[Forums | Forum]] discussion, or a [[Quizzes| Quiz]] question. If you wish to load a molecule data file as a "resource", you should also consider installing the [[Jmol resource module]].
Línia 19: Línia 21:
# Upload a molecule data file to the Moodle server. (This is important - Jmol refuses to display data files held on other servers, so you can't just link to a file that exists somewhere else on the web.)
# Upload a molecule data file to the Moodle server. (This is important - Jmol refuses to display data files held on other servers, so you can't just link to a file that exists somewhere else on the web.)
# Simply create a link to the molecule file, wherever you want the molecule viewer to appear.  
# Simply create a link to the molecule file, wherever you want the molecule viewer to appear.  
*In more detail:  
====In more detail:====
** use the Moodle text editor to add the text for a link, eg 'water'
* use the Moodle text editor (inside a course topic, label, HTML block, forum posting, quiz question etc) to add the text for a link, eg 'water'
** click-and drag to select the text link
* click-and drag to select the text link
** use the Add Web link button and entere the URL of the resource (already uploaded into the course's Files folder). The editor may 'scramble' things, particularly if you use additional parametes (below) and you may find it best to use HTML Source ([<>] button) view. So default usage of the Jmol filter, for a structure water.pdb, in course 7  of your.moodle.ac.uk might use the code:
* use the Insert Web Link button and enter the URL of the resource (already uploaded into the course's Files folder). The editor may 'scramble' things, particularly if you use additional parametes (below) and you may find it best to use HTML Source ([<>] button) view. So default usage of the Jmol filter, for a structure water.pdb, in course 7  of your.moodle.ac.uk might use the code:


  <a title="Jmol" href="http://your.moodle.ac.uk/moodle/file.php/7/water.pdb">water</a>
  <a title="Jmol" href="http://your.moodle.ac.uk/moodle/file.php/7/water.pdb">water</a>
   
   
## Parameters can be added to the end of the URL to specify certain display options. Add '''?c=0''' to hide the controls, or '''?s=150''' to set the viewer's size at 150 pixels. Or '''?c=0&s=150''' to do both.
* Parameters can be added to the end of the URL to specify certain display options. Add '''?c=0''' to hide the controls, or '''?s=150''' to set the viewer's size at 150 pixels. Or '''?c=0&s=150''' to do both.




Línia 32: Línia 34:
   
   


## The filter will output its own form tags. If you're displaying the molecule inside an existing form, please make sure you use the '''?f=0''' parameter to make sure the filter doesn't output its own form tags. This will ensure things work correctly in most web browsers.
* The filter will output its own form tags. If you're displaying the molecule inside an existing form, please make sure you use the '''?f=0''' parameter to make sure the filter doesn't output its own form tags. This will ensure things work correctly in most web browsers.
# If you wish to run extra [http://jmol.sourceforge.net/scripting/ Jmol script] upon intialisation, write '''JMOLSCRIPT{}''' straight after the link, and put your code inside the braces. For example:
 
* If you wish to run extra [http://jmol.sourceforge.net/scripting/ Jmol script] upon intialisation, write '''JMOLSCRIPT{}''' straight after the link, and put your code inside the braces. For example:


  <a title="Jmol" href="http://your.moodle.ac.uk/moodle/file.php/7/water.pdb">water</a>JMOLSCRIPT{rotate x 15; zoom 50; set axes on;}
  <a title="Jmol" href="http://your.moodle.ac.uk/moodle/file.php/7/water.pdb">water</a>JMOLSCRIPT{rotate x 15; zoom 50; set axes on;}
Línia 40: Línia 43:


The filter can be used to display molecular viewers in quiz questions. But '''please make sure you use the ?f=0 parameter at the end of each URL''', to prevent the filter outputting its own "form" tags.
The filter can be used to display molecular viewers in quiz questions. But '''please make sure you use the ?f=0 parameter at the end of each URL''', to prevent the filter outputting its own "form" tags.
The title tag is also essential for the filter to operate.




[[Category:Administrator]]
[[Category:Contributed code]]
[[Category:Filter]]
[[Category:Filter]]

Revisió de 18:54, 7 feb 2011

An example of the Jmol filter in action

Jmol is open-source Java software for interactive 3D viewing of molecular structures. It can easily be embedded into a webpage... including a Moodle page.

The Moodle Jmol filter makes it incredibly simple for teachers to embed these viewers into teaching material (quizzes, discussion messages, etc).

The Jmol filter is very useful for including a molecule viewer in a variety of situations - e.g. in a Label, a Forum discussion, or a Quiz question. If you wish to load a molecule data file as a "resource", you should also consider installing the Jmol resource module.


It requires no additional capability on your web server, but requires both Java and a JavaScript-enabled browser for the user.


How to use

  1. Upload a molecule data file to the Moodle server. (This is important - Jmol refuses to display data files held on other servers, so you can't just link to a file that exists somewhere else on the web.)
  2. Simply create a link to the molecule file, wherever you want the molecule viewer to appear.

In more detail:

  • use the Moodle text editor (inside a course topic, label, HTML block, forum posting, quiz question etc) to add the text for a link, eg 'water'
  • click-and drag to select the text link
  • use the Insert Web Link button and enter the URL of the resource (already uploaded into the course's Files folder). The editor may 'scramble' things, particularly if you use additional parametes (below) and you may find it best to use HTML Source ([<>] button) view. So default usage of the Jmol filter, for a structure water.pdb, in course 7 of your.moodle.ac.uk might use the code:
<a title="Jmol" href="http://your.moodle.ac.uk/moodle/file.php/7/water.pdb">water</a>

  • Parameters can be added to the end of the URL to specify certain display options. Add ?c=0 to hide the controls, or ?s=150 to set the viewer's size at 150 pixels. Or ?c=0&s=150 to do both.


<a title="Jmol" href="http://your.moodle.ac.uk/moodle/file.php/7/water.pdb?c=0&s=150">water</a>

  • The filter will output its own form tags. If you're displaying the molecule inside an existing form, please make sure you use the ?f=0 parameter to make sure the filter doesn't output its own form tags. This will ensure things work correctly in most web browsers.
  • If you wish to run extra Jmol script upon intialisation, write JMOLSCRIPT{} straight after the link, and put your code inside the braces. For example:
<a title="Jmol" href="http://your.moodle.ac.uk/moodle/file.php/7/water.pdb">water</a>JMOLSCRIPT{rotate x 15; zoom 50; set axes on;}

Important: Using the filter in quizzes

The filter can be used to display molecular viewers in quiz questions. But please make sure you use the ?f=0 parameter at the end of each URL, to prevent the filter outputting its own "form" tags.

The title tag is also essential for the filter to operate.