Posts made by Valery Fremaux

Hi,

With Angela helping me, some tightenings of the techproject module code, such as definitive XMLDB install and some small fixes and bug-follow for over 1.8 moodles.

Get the complete 1.8 version at. Database unchanged, just update the module's code. Version number unchanged.

http://www.ethnoinformatique.fr/course/view.php?id=37

As a reminder : full docs in http://docs.moodle.org/en/mod/techproject/view

Key future features :

  • timestamping all records so we know who wrote what at what time, and thus printing project activity charts.
  • testboard allowing opening checklists based on requirements, so it can be used as delivery control board (marking "exists", "good" or "buggy"'), tagged by date/or version.
Average of ratings: -

Angela,

I released a new techproject pack, with some fixes and Moodle 1.8 titghenings.

http://www.ethnoinformatique.fr/course/view.php?id=37

I didn't noticed any loss of editing on this one wich is the most up to date, with XMLDB install fully revised. I should make more tests in "teacher mode" and in "student mode" to check out how it behaves with operative roles. Anyway, this code is seemfully better. 

The fact is that just adding ajaxlib.php only loads a small set of functions that allows setting up ajax gently. (such as loading require_js() ). It does not include anything about YUI within the page. All client ajax code should be added from here, once you ensured all the necessary YUI js libs are in the place.

The way synchronizing data base with a change performed client side is to use a YAHOO.Util.Connect object. Here is a piece of code that implements that kind of query :

            <script type="text/javascript">

// this is an array capable of providing adequate handlers
// to some response code from the server. sectionSpan gets
// an element reference the handlers does somethin with.

            var ajaxSectionLoaderResponse = {
              success: function(o) {
                    sectionSpan = document.getElementById('sections');
                    sectionSpan.innerHTML = o.responseText;
              },
              failure: function(o) {
                    sectionSpan = document.getElementById('sections');
                    sectionSpan.innerHTML = '<?php print_string('nosectionsfailure', 'coursexfers') ?>';
              }
            }
           
// I call the asynchronous request on a "onChange" situation
// in this example, though this function : 

            function ajaxSectionUpdater(choiceobj){
                sectionSpan = document.getElementById('sections');
                if (choiceobj.selectedIndex != 0){
// allows me to display a waiting gif in the meanwhile :
                    sectionSpan.innerHTML = '<img src="<?php echo $CFG->pixpath.'/i/ajaxloader.gif' ?>" />';
// calling the ajax asynchronous server side handler :
                    var sUrl = '<?php echo $CFG->wwwroot.'/course/ajaxsectionloader.php?course='; ?>' + choiceobj.options[choiceobj.selectedIndex].value;
// performing the query, the event handlers will be triggered in a while :
                    var transaction = YAHOO.util.Connect.asyncRequest('GET', sUrl, ajaxSectionLoaderResponse, null);
                }
                else{
                    sectionSpan.innerHTML = '<?php print_string('coursechoicerequired','coursexfers') ?>';
                }
            }
            </script>
  

Now can just the server side handler, basing its work on sufficiant parameters, perform all the database changes we expect.

Note that YUI Connect object also allows you to perform POST queries, where the amount of send data can be higher than using GET. 

Je reprends le fil http://moodle.org/mod/forum/discuss.php?d=78402 ici pour réinitialiser un dialogue propre sur la finalisation de cette mise à jour.

Après quelques prises de têtes avec XMLDB et la perte d'un article sur "les effets pervers du dogme XML" pour le forum anglais des développeurs (là je suis en colère... 40 minutes de rédac en anglais... pfuit!!), voici une livraison qui devrait approcher de quelque chose d'opérationnel.

J'ai mis les instructions pour la personnalisation locale de chaque jeu de cartes directement dans le formulaire. Le module avait initialement des problèmes de desinstall/réinstall. Cela semble réglé maintenant.

Average of ratings: -