Browse Source

Update several codes in 2019/04/03

Leonidas O Brandao 5 years ago
parent
commit
671aa39536
100 changed files with 9752 additions and 692 deletions
  1. 6 26
      classes/event/course_module_instance_list_viewed.php
  2. 21 56
      classes/event/course_module_viewed.php
  3. 22 56
      classes/event/iassign_created.php
  4. 22 56
      classes/event/iassign_deleted.php
  5. 22 56
      classes/event/iassign_updated.php
  6. 22 56
      classes/event/submission_comment_created.php
  7. 22 56
      classes/event/submission_comment_updated.php
  8. 21 55
      classes/event/submission_created.php
  9. 22 56
      classes/event/submission_updated.php
  10. 22 57
      classes/event/submission_viewed.php
  11. 34 21
      db/install.php
  12. 9 11
      db/uninstall.php
  13. 127 118
      db/upgrade.php
  14. 104 12
      iassign_form.php
  15. 10 0
      igeom.cfg
  16. 9 0
      ilm/Risko/2.2.23/index.html
  17. 9 0
      ilm/Risko/index.html
  18. 9 0
      ilm/iComb/0.9.5/index.html
  19. 9 0
      ilm/iComb/index.html
  20. 9 0
      ilm/iFractions/index.html
  21. 9 0
      ilm/iGeom/5.9.22/index.html
  22. 9 0
      ilm/iGeom/index.html
  23. 9 0
      ilm/iGraf/4.4.0.10/index.html
  24. 9 0
      ilm/iGraf/index.html
  25. 9 0
      ilm/iHanoi/3.1.0/index.html
  26. 9 0
      ilm/iHanoi/index.html
  27. 9 0
      ilm/iTangram2/0.4.6/index.html
  28. 9 0
      ilm/iTangram2/index.html
  29. 9 0
      ilm/iVProg2/2.1.0/index.html
  30. 9 0
      ilm/iVProg2/index.html
  31. 0 0
      ilm/iVProgH/0.1.20190307/index.html
  32. 122 0
      ilm/iVProgH/0.1.20190307/ivprog-html/index.html
  33. 9 0
      ilm/iVProgH/index.html
  34. 0 0
      ilm/iVProgH5/0.0.2/README.md
  35. 0 0
      ilm/iVProgH5/0.0.2/README.txt
  36. 0 0
      ilm/iVProgH5/0.0.2/css/bootstrap-editable.css
  37. 0 0
      ilm/iVProgH5/0.0.2/css/bootstrap.css
  38. 0 0
      ilm/iVProgH5/0.0.2/css/bootstrap.min.css
  39. 0 0
      ilm/iVProgH5/0.0.2/css/font-awesome.css
  40. 0 0
      ilm/iVProgH5/0.0.2/css/font-awesome.min.css
  41. 0 0
      ilm/iVProgH5/0.0.2/css/ivprog.css
  42. 0 0
      ilm/iVProgH5/0.0.2/embed.html
  43. 0 0
      ilm/iVProgH5/0.0.2/fonts/FontAwesome.otf
  44. 0 0
      ilm/iVProgH5/0.0.2/fonts/fontawesome-webfont.eot
  45. 0 0
      ilm/iVProgH5/0.0.2/fonts/fontawesome-webfont.svg
  46. 0 0
      ilm/iVProgH5/0.0.2/fonts/fontawesome-webfont.ttf
  47. 0 0
      ilm/iVProgH5/0.0.2/fonts/fontawesome-webfont.woff
  48. 0 0
      ilm/iVProgH5/0.0.2/fonts/glyphicons-halflings-regular.eot
  49. 0 0
      ilm/iVProgH5/0.0.2/fonts/glyphicons-halflings-regular.svg
  50. 0 0
      ilm/iVProgH5/0.0.2/fonts/glyphicons-halflings-regular.ttf
  51. 0 0
      ilm/iVProgH5/0.0.2/fonts/glyphicons-halflings-regular.woff
  52. 0 0
      ilm/iVProgH5/0.0.2/get.php
  53. 0 0
      ilm/iVProgH5/0.0.2/gravar.php
  54. 0 0
      ilm/iVProgH5/0.0.2/img/att.png
  55. 0 0
      ilm/iVProgH5/0.0.2/img/autochecking.png
  56. 0 0
      ilm/iVProgH5/0.0.2/img/botao_rodar.png
  57. 0 0
      ilm/iVProgH5/0.0.2/img/bs-docs-masthead-pattern.png
  58. 0 0
      ilm/iVProgH5/0.0.2/img/download.png
  59. 0 0
      ilm/iVProgH5/0.0.2/img/expand_down.png
  60. 0 0
      ilm/iVProgH5/0.0.2/img/expand_up.png
  61. 0 0
      ilm/iVProgH5/0.0.2/img/if.png
  62. 0 0
      ilm/iVProgH5/0.0.2/img/locker_closed.png
  63. 0 0
      ilm/iVProgH5/0.0.2/img/locker_opened.png
  64. 0 0
      ilm/iVProgH5/0.0.2/img/logo.png
  65. 0 0
      ilm/iVProgH5/0.0.2/img/logo_ivprog.png
  66. 0 0
      ilm/iVProgH5/0.0.2/img/loop-n.png
  67. 0 0
      ilm/iVProgH5/0.0.2/img/mode1.png
  68. 0 0
      ilm/iVProgH5/0.0.2/img/mode2.png
  69. 0 0
      ilm/iVProgH5/0.0.2/img/mode3.png
  70. 0 0
      ilm/iVProgH5/0.0.2/img/operations.png
  71. 0 0
      ilm/iVProgH5/0.0.2/img/redo.png
  72. 0 0
      ilm/iVProgH5/0.0.2/img/undo.png
  73. 0 0
      ilm/iVProgH5/0.0.2/img/upload.png
  74. 9 0
      ilm/iVProgH5/0.0.2/index.html
  75. 25 0
      ilm/iVProgH5/0.0.2/ivprog-html/README.md
  76. 25 0
      ilm/iVProgH5/0.0.2/ivprog-html/README.txt
  77. 651 0
      ilm/iVProgH5/0.0.2/ivprog-html/css/bootstrap-editable.css
  78. 5967 0
      ilm/iVProgH5/0.0.2/ivprog-html/css/bootstrap.css
  79. 11 0
      ilm/iVProgH5/0.0.2/ivprog-html/css/bootstrap.min.css
  80. 1338 0
      ilm/iVProgH5/0.0.2/ivprog-html/css/font-awesome.css
  81. 4 0
      ilm/iVProgH5/0.0.2/ivprog-html/css/font-awesome.min.css
  82. 213 0
      ilm/iVProgH5/0.0.2/ivprog-html/css/ivprog.css
  83. 32 0
      ilm/iVProgH5/0.0.2/ivprog-html/embed.html
  84. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/fonts/FontAwesome.otf
  85. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/fonts/fontawesome-webfont.eot
  86. 414 0
      ilm/iVProgH5/0.0.2/ivprog-html/fonts/fontawesome-webfont.svg
  87. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/fonts/fontawesome-webfont.ttf
  88. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/fonts/fontawesome-webfont.woff
  89. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/fonts/glyphicons-halflings-regular.eot
  90. 229 0
      ilm/iVProgH5/0.0.2/ivprog-html/fonts/glyphicons-halflings-regular.svg
  91. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/fonts/glyphicons-halflings-regular.ttf
  92. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/fonts/glyphicons-halflings-regular.woff
  93. 16 0
      ilm/iVProgH5/0.0.2/ivprog-html/get.php
  94. 66 0
      ilm/iVProgH5/0.0.2/ivprog-html/gravar.php
  95. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/img/att.png
  96. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/img/autochecking.png
  97. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/img/botao_rodar.png
  98. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/img/bs-docs-masthead-pattern.png
  99. BIN
      ilm/iVProgH5/0.0.2/ivprog-html/img/download.png
  100. 0 0
      ilm/iVProgH5/0.0.2/ivprog-html/img/expand_down.png

+ 6 - 26
classes/event/course_module_instance_list_viewed.php

@@ -1,20 +1,5 @@
 <?php
 
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
 /**
  * The mod_iassign submission created event.
  *
@@ -33,19 +18,14 @@ defined('MOODLE_INTERNAL') || die();
 
 class course_module_instance_list_viewed extends \core\event\course_module_instance_list_viewed {
 
-  /**
-   * Create the event from course record.
-   *
-   * @param \stdClass $course
-   * @return course_module_instance_list_viewed
-   */
+  /// Create the event from course record.
+  //  @param \stdClass $course
+  //  @return course_module_instance_list_viewed
   public static function create_from_course (\stdClass $course) {
-    $params = array(
-      'context' => \context_course::instance($course->id)
-    );
+    $params = array('context' => \context_course::instance($course->id));
     $event = \mod_iassign\event\course_module_instance_list_viewed::create($params);
     $event->add_record_snapshot('course', $course);
     return $event;
-  }
+    }
 
-}
+  }

+ 21 - 56
classes/event/course_module_viewed.php

@@ -1,20 +1,5 @@
 <?php
 
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
 /**
  * The mod_iassign course module viewed event.
  *
@@ -33,67 +18,47 @@ defined('MOODLE_INTERNAL') || die();
 
 class course_module_viewed extends \core\event\course_module_viewed {
 
-  /**
-   * Init method.
-   */
+  /// Init method.
   protected function init () {
     $this->data['crud'] = 'r'; // c(reate), r(ead), u(pdate), d(elete)
     $this->data['edulevel'] = self::LEVEL_PARTICIPATING;
     $this->data['objecttable'] = 'iassign';
-  }
+    }
 
-  /**
-   * Returns localised general event name.
-   *
-   * @return string
-   */
+  /// Returns localised general event name.
+  //  @return string
   public static function get_name () {
     return get_string('eventcoursemoduleviewed', 'mod_iassign');
-  }
+    }
 
-  /**
-   * Returns non-localised event description with id's for admin use only.
-   *
-   * @return string
-   */
+  /// Returns non-localised event description with id's for admin use only.
+  //  @return string
   public function get_description () {
     return "The user with id '$this->userid' has viewed the iAssign with id '$this->objectid' in " .
-        "the iAssign activity with course module id '$this->contextinstanceid'.";
-  }
+           "the iAssign activity with course module id '$this->contextinstanceid'.";
+    }
 
-  /**
-   * Get URL related to the action.
-   *
-   * @return \moodle_url
-   */
+  /// Get URL related to the action.
+  //  @return \moodle_url
   public function get_url () {
     return new \moodle_url('/mod/iassign/view.php', array('id' => $this->contextinstanceid));
-  }
+    }
 
-  /**
-   * Return the legacy event log data.
-   *
-   * @return array|null
-   */
+  /// Return the legacy event log data.
+  //  @return array|null
   public function get_legacy_logdata () {
+    return array($this->courseid, 'iassign', 'view', "view.php?id={$this->contextinstanceid}", $this->objectid, $this->contextinstanceid);
+    }
 
-    return array($this->courseid, 'iassign', 'view',
-      "view.php?id={$this->contextinstanceid}",
-      $this->objectid, $this->contextinstanceid);
-  }
-
-  /**
-   * Custom validation.
-   *
-   * @throws \coding_exception
-   * @return void
-   */
+  /// Custom validation.
+  //  @throws \coding_exception
+  //  @return void
   protected function validate_data () {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
     if(!$this->contextlevel === CONTEXT_MODULE) {
       throw new \coding_exception('Context level must be CONTEXT_MODULE.');
+      }
     }
-  }
 
-}
+  }

+ 22 - 56
classes/event/iassign_created.php

@@ -1,20 +1,5 @@
 <?php
 
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
 /**
  * The mod_iassign created event.
  *
@@ -33,67 +18,48 @@ defined('MOODLE_INTERNAL') || die();
 
 class iassign_created extends \core\event\base {
 
-  /**
-   * Init method.
-   */
+  /// Init method.
   protected function init () {
     $this->data['crud'] = 'c'; // c(reate), r(ead), u(pdate), d(elete)
     $this->data['edulevel'] = self::LEVEL_TEACHING;
     $this->data['objecttable'] = 'iassign';
-  }
+    }
 
-  /**
-   * Returns localised general event name.
-   *
-   * @return string
-   */
+  /// Returns localised general event name.
+  //  @return string
   public static function get_name () {
     return get_string('eventiassigncreated', 'mod_iassign');
-  }
+    }
 
-  /**
-   * Returns non-localised event description with id's for admin use only.
-   *
-   * @return string
-   */
+  /// Returns non-localised event description with id's for admin use only.
+  //  @return string
   public function get_description () {
     return "The user with id '$this->userid' has created the iAssign with id '$this->objectid' in " .
-        "the iAssign activity with course module id '$this->contextinstanceid'.";
-  }
+           "the iAssign activity with course module id '$this->contextinstanceid'.";
+    }
 
-  /**
-   * Get URL related to the action.
-   *
-   * @return \moodle_url
-   */
+  /// Get URL related to the action.
+  //  @return \moodle_url
   public function get_url () {
     return new \moodle_url('/mod/iassign/view.php', array('id' => $this->contextinstanceid));
-  }
+    }
 
-  /**
-   * Return the legacy event log data.
-   *
-   * @return array|null
-   */
+  /// Return the legacy event log data.
+  //  @return array|null
   public function get_legacy_logdata () {
-
     return array($this->courseid, 'iassign', 'add',
-      "view.php?id={$this->contextinstanceid}",
-      $this->objectid, $this->contextinstanceid);
-  }
+      "view.php?id={$this->contextinstanceid}", $this->objectid, $this->contextinstanceid);
+    }
 
-  /**
-   * Custom validation.
-   *
-   * @throws \coding_exception
-   * @return void
-   */
+  /// Custom validation.
+  //  @throws \coding_exception
+  //  @return void
   protected function validate_data () {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
-    if(!$this->contextlevel === CONTEXT_MODULE) {
+    if (!$this->contextlevel === CONTEXT_MODULE) {
       throw new \coding_exception('Context level must be CONTEXT_MODULE.');
+      }
     }
-  }
 
-}
+  }

+ 22 - 56
classes/event/iassign_deleted.php

@@ -1,20 +1,5 @@
 <?php
 
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
 /**
  * The mod_iassign deleted event.
  *
@@ -33,67 +18,48 @@ defined('MOODLE_INTERNAL') || die();
 
 class iassign_deleted extends \core\event\base {
 
-  /**
-   * Init method.
-   */
+  /// Init method.
   protected function init () {
     $this->data['crud'] = 'd'; // c(reate), r(ead), u(pdate), d(elete)
     $this->data['edulevel'] = self::LEVEL_TEACHING; // LEVEL_TEACHING , LEVEL_PARTICIPATING, LEVEL_OTHER
     $this->data['objecttable'] = 'iassign';
-  }
+    }
 
-  /**
-   * Returns localised general event name.
-   *
-   * @return string
-   */
+  /// Returns localised general event name.
+  //  @return string
   public static function get_name () {
     return get_string('eventiassigndeleted', 'mod_iassign');
-  }
+    }
 
-  /**
-   * Returns non-localised event description with id's for admin use only.
-   *
-   * @return string
-   */
+  /// Returns non-localised event description with id's for admin use only.
+  //  @return string
   public function get_description () {
     return "The user with id '$this->userid' has deleted the iAssign with id '$this->objectid' in " .
-        "the iAssign activity with course module id '$this->contextinstanceid'.";
-  }
+           "the iAssign activity with course module id '$this->contextinstanceid'.";
+    }
 
-  /**
-   * Get URL related to the action.
-   *
-   * @return \moodle_url
-   */
+  /// Get URL related to the action.
+  //  @return \moodle_url
   public function get_url () {
     return new \moodle_url('/mod/iassign/view.php', array('id' => $this->contextinstanceid));
-  }
+    }
 
-  /**
-   * Return the legacy event log data.
-   *
-   * @return array|null
-   */
+  /// Return the legacy event log data.
+  //  @return array|null
   public function get_legacy_logdata () {
-
     return array($this->courseid, 'iassign', 'delete iassign',
-      "view.php?id={$this->contextinstanceid}",
-      $this->objectid, $this->contextinstanceid);
-  }
+      "view.php?id={$this->contextinstanceid}", $this->objectid, $this->contextinstanceid);
+    }
 
-  /**
-   * Custom validation.
-   *
-   * @throws \coding_exception
-   * @return void
-   */
+  /// Custom validation.
+  //  @throws \coding_exception
+  //  @return void
   protected function validate_data () {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
-    if(!$this->contextlevel === CONTEXT_MODULE) {
+    if (!$this->contextlevel === CONTEXT_MODULE) {
       throw new \coding_exception('Context level must be CONTEXT_MODULE.');
+      }
     }
-  }
 
-}
+  }

+ 22 - 56
classes/event/iassign_updated.php

@@ -1,20 +1,5 @@
 <?php
 
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
 /**
  * The mod_iassign updated event.
  *
@@ -33,67 +18,48 @@ defined('MOODLE_INTERNAL') || die();
 
 class iassign_updated extends \core\event\base {
 
-  /**
-   * Init method.
-   */
+  /// Init method.
   protected function init () {
     $this->data['crud'] = 'u'; // c(reate), r(ead), u(pdate), d(elete)
     $this->data['edulevel'] = self::LEVEL_TEACHING; // LEVEL_TEACHING , LEVEL_PARTICIPATING, LEVEL_OTHER
     $this->data['objecttable'] = 'iassign';
-  }
+    }
 
-  /**
-   * Returns localised general event name.
-   *
-   * @return string
-   */
+  /// Returns localised general event name.
+  //  @return string
   public static function get_name () {
     return get_string('eventiassignupdated', 'mod_iassign');
-  }
+    }
 
-  /**
-   * Returns non-localised event description with id's for admin use only.
-   *
-   * @return string
-   */
+  /// Returns non-localised event description with id's for admin use only.
+  //  @return string
   public function get_description () {
     return "The user with id '$this->userid' has updated the iAssign with id '$this->objectid' in " .
-        "the iAssign activity with course module id '$this->contextinstanceid'.";
-  }
+           "the iAssign activity with course module id '$this->contextinstanceid'.";
+    }
 
-  /**
-   * Get URL related to the action.
-   *
-   * @return \moodle_url
-   */
+  /// Get URL related to the action.
+  //  @return \moodle_url
   public function get_url () {
     return new \moodle_url('/mod/iassign/view.php', array('id' => $this->contextinstanceid));
-  }
+    }
 
-  /**
-   * Return the legacy event log data.
-   *
-   * @return array|null
-   */
+  /// Return the legacy event log data.
+  //  @return array|null
   public function get_legacy_logdata () {
-
     return array($this->courseid, 'iassign', 'update',
-      "view.php?id={$this->contextinstanceid}",
-      $this->objectid, $this->contextinstanceid);
-  }
+      "view.php?id={$this->contextinstanceid}", $this->objectid, $this->contextinstanceid);
+    }
 
-  /**
-   * Custom validation.
-   *
-   * @throws \coding_exception
-   * @return void
-   */
+  /// Custom validation.
+  //  @throws \coding_exception
+  //  @return void
   protected function validate_data () {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
-    if(!$this->contextlevel === CONTEXT_MODULE) {
+    if (!$this->contextlevel === CONTEXT_MODULE) {
       throw new \coding_exception('Context level must be CONTEXT_MODULE.');
+      }
     }
-  }
 
-}
+  }

+ 22 - 56
classes/event/submission_comment_created.php

@@ -1,20 +1,5 @@
 <?php
 
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
 /**
  * The mod_iassign submission comment created event.
  *
@@ -33,67 +18,48 @@ defined('MOODLE_INTERNAL') || die();
 
 class submission_comment_created extends \core\event\base {
 
-  /**
-   * Init method.
-   */
+  /// Init method.
   protected function init () {
     $this->data['crud'] = 'c'; // c(reate), r(ead), u(pdate), d(elete)
     $this->data['edulevel'] = self::LEVEL_PARTICIPATING; // LEVEL_TEACHING , LEVEL_PARTICIPATING, LEVEL_OTHER
     $this->data['objecttable'] = 'iassign';
-  }
+    }
 
-  /**
-   * Returns localised general event name.
-   *
-   * @return string
-   */
+  /// Returns localised general event name.
+  //  @return string
   public static function get_name () {
     return get_string('eventsubmissioncommentcreated', 'mod_iassign');
-  }
+    }
 
-  /**
-   * Returns non-localised event description with id's for admin use only.
-   *
-   * @return string
-   */
+  /// Returns non-localised event description with id's for admin use only.
+  //  @return string
   public function get_description () {
     return "The user with id '$this->userid' has created submission of comment updated the iAssign with id '$this->objectid' in " .
-        "the iAssign activity with course module id '$this->contextinstanceid'.";
-  }
+           "the iAssign activity with course module id '$this->contextinstanceid'.";
+    }
 
-  /**
-   * Get URL related to the action.
-   *
-   * @return \moodle_url
-   */
+  /// Get URL related to the action.
+  //  @return \moodle_url
   public function get_url () {
     return new \moodle_url('/mod/iassign/view.php', array('id' => $this->contextinstanceid));
-  }
+    }
 
-  /**
-   * Return the legacy event log data.
-   *
-   * @return array|null
-   */
+  /// Return the legacy event log data.
+  //  @return array|null
   public function get_legacy_logdata () {
-
     return array($this->courseid, 'iassign', 'add comment',
-      "view.php?id={$this->contextinstanceid}",
-      $this->objectid, $this->contextinstanceid);
-  }
+      "view.php?id={$this->contextinstanceid}", $this->objectid, $this->contextinstanceid);
+    }
 
-  /**
-   * Custom validation.
-   *
-   * @throws \coding_exception
-   * @return void
-   */
+  /// Custom validation.
+  //  @throws \coding_exception
+  //  @return void
   protected function validate_data () {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
-    if(!$this->contextlevel === CONTEXT_MODULE) {
+    if (!$this->contextlevel === CONTEXT_MODULE) {
       throw new \coding_exception('Context level must be CONTEXT_MODULE.');
+      }
     }
-  }
 
-}
+  }

+ 22 - 56
classes/event/submission_comment_updated.php

@@ -1,20 +1,5 @@
 <?php
 
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
 /**
  * The mod_iassign submission comment update event.
  *
@@ -33,67 +18,48 @@ defined('MOODLE_INTERNAL') || die();
 
 class submission_comment_updated extends \core\event\base {
 
-  /**
-   * Init method.
-   */
+  /// Init method.
   protected function init () {
     $this->data['crud'] = 'u'; // c(reate), r(ead), u(pdate), d(elete)
     $this->data['edulevel'] = self::LEVEL_PARTICIPATING; // LEVEL_TEACHING , LEVEL_PARTICIPATING, LEVEL_OTHER
     $this->data['objecttable'] = 'iassign';
-  }
+    }
 
-  /**
-   * Returns localised general event name.
-   *
-   * @return string
-   */
+  /// Returns localised general event name.
+  //  @return string
   public static function get_name () {
     return get_string('eventsubmissioncommentupdated', 'mod_iassign');
-  }
+    }
 
-  /**
-   * Returns non-localised event description with id's for admin use only.
-   *
-   * @return string
-   */
+  /// Returns non-localised event description with id's for admin use only.
+  //  @return string
   public function get_description () {
     return "The user with id '$this->userid' has viewed  activity submission of comment updated the iAssign with id '$this->objectid' in " .
-        "the iAssign activity with course module id '$this->contextinstanceid'.";
-  }
+           "the iAssign activity with course module id '$this->contextinstanceid'.";
+    }
 
-  /**
-   * Get URL related to the action.
-   *
-   * @return \moodle_url
-   */
+  /// Get URL related to the action.
+  //  @return \moodle_url
   public function get_url () {
     return new \moodle_url('/mod/iassign/view.php', array('id' => $this->contextinstanceid));
-  }
+    }
 
-  /**
-   * Return the legacy event log data.
-   *
-   * @return array|null
-   */
+  /// Return the legacy event log data.
+  //  @return array|null
   public function get_legacy_logdata () {
-
     return array($this->courseid, 'iassign', 'update comment',
-      "view.php?id={$this->contextinstanceid}",
-      $this->objectid, $this->contextinstanceid);
-  }
+      "view.php?id={$this->contextinstanceid}", $this->objectid, $this->contextinstanceid);
+    }
 
-  /**
-   * Custom validation.
-   *
-   * @throws \coding_exception
-   * @return void
-   */
+  /// Custom validation.
+  //  @throws \coding_exception
+  //  @return void
   protected function validate_data () {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
-    if(!$this->contextlevel === CONTEXT_MODULE) {
+    if (!$this->contextlevel === CONTEXT_MODULE) {
       throw new \coding_exception('Context level must be CONTEXT_MODULE.');
+      }
     }
-  }
 
-}
+  }

+ 21 - 55
classes/event/submission_created.php

@@ -1,20 +1,5 @@
 <?php
 
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
 /**
  * The mod_iassign submission created event.
  *
@@ -33,67 +18,48 @@ defined('MOODLE_INTERNAL') || die();
 
 class submission_created extends \core\event\base {
 
-  /**
-   * Init method.
-   */
+  /// Init method.
   protected function init () {
     $this->data['crud'] = 'c'; // c(reate), r(ead), u(pdate), d(elete)
     $this->data['edulevel'] = self::LEVEL_PARTICIPATING; // LEVEL_TEACHING , LEVEL_PARTICIPATING, LEVEL_OTHER
     $this->data['objecttable'] = 'iassign';
-  }
+    }
 
-  /**
-   * Returns localised general event name.
-   *
-   * @return string
-   */
+  /// Returns localised general event name.
+  //  @return string
   public static function get_name () {
     return get_string('eventsubmissioncreated', 'mod_iassign');
-  }
+    }
 
-  /**
-   * Returns non-localised event description with id's for admin use only.
-   *
-   * @return string
-   */
+  /// Returns non-localised event description with id's for admin use only.
+  //  @return string
   public function get_description () {
     return "The user with id '$this->userid' has created submission the iAssign with id '$this->objectid' in " .
-        "the iAssign activity with course module id '$this->contextinstanceid'.";
-  }
+            "the iAssign activity with course module id '$this->contextinstanceid'.";
+    }
 
-  /**
-   * Get URL related to the action.
-   *
-   * @return \moodle_url
-   */
+  /// Get URL related to the action.
+  //  @return \moodle_url
   public function get_url () {
     return new \moodle_url('/mod/iassign/view.php', array('id' => $this->contextinstanceid));
-  }
+    }
 
-  /**
-   * Return the legacy event log data.
-   *
-   * @return array|null
-   */
+  /// Return the legacy event log data.
+  //  @return array|null
   public function get_legacy_logdata () {
-
     return array($this->courseid, 'iassign', 'add submission',
-      "view.php?id={$this->contextinstanceid}",
-      $this->objectid, $this->contextinstanceid);
-  }
+      "view.php?id={$this->contextinstanceid}", $this->objectid, $this->contextinstanceid);
+    }
 
-  /**
-   * Custom validation.
-   *
-   * @throws \coding_exception
-   * @return void
-   */
+  /// Custom validation.
+  //  @throws \coding_exception
+  //  @return void
   protected function validate_data () {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
     if(!$this->contextlevel === CONTEXT_MODULE) {
       throw new \coding_exception('Context level must be CONTEXT_MODULE.');
+      }
     }
-  }
 
-}
+  }

+ 22 - 56
classes/event/submission_updated.php

@@ -1,20 +1,5 @@
 <?php
 
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
 /**
  * The mod_iassign submission updated event.
  *
@@ -33,67 +18,48 @@ defined('MOODLE_INTERNAL') || die();
 
 class submission_updated extends \core\event\base {
 
-  /**
-   * Init method.
-   */
+  /// Init method.
   protected function init () {
     $this->data['crud'] = 'u'; // c(reate), r(ead), u(pdate), d(elete)
     $this->data['edulevel'] = self::LEVEL_PARTICIPATING; // LEVEL_TEACHING , LEVEL_PARTICIPATING, LEVEL_OTHER
     $this->data['objecttable'] = 'iassign';
-  }
+    }
 
-  /**
-   * Returns localised general event name.
-   *
-   * @return string
-   */
+  /// Returns localised general event name.
+  //  @return string
   public static function get_name () {
     return get_string('eventsubmissionupdated', 'mod_iassign');
-  }
+    }
 
-  /**
-   * Returns non-localised event description with id's for admin use only.
-   *
-   * @return string
-   */
+  /// Returns non-localised event description with id's for admin use only.
+  //  @return string
   public function get_description () {
     return "The user with id '$this->userid' has update submission the iAssign with id '$this->objectid' in " .
-        "the iAssign activity with course module id '$this->contextinstanceid'.";
-  }
+           "the iAssign activity with course module id '$this->contextinstanceid'.";
+    }
 
-  /**
-   * Get URL related to the action.
-   *
-   * @return \moodle_url
-   */
+  /// Get URL related to the action.
+  //  @return \moodle_url
   public function get_url () {
     return new \moodle_url('/mod/iassign/view.php', array('id' => $this->contextinstanceid));
-  }
+    }
 
-  /**
-   * Return the legacy event log data.
-   *
-   * @return array|null
-   */
+  /// Return the legacy event log data.
+  //  @return array|null
   public function get_legacy_logdata () {
-
     return array($this->courseid, 'iassign', 'update submission',
-      "view.php?id={$this->contextinstanceid}",
-      $this->objectid, $this->contextinstanceid);
-  }
+      "view.php?id={$this->contextinstanceid}", $this->objectid, $this->contextinstanceid);
+    }
 
-  /**
-   * Custom validation.
-   *
-   * @throws \coding_exception
-   * @return void
-   */
+  /// Custom validation.
+  //  @throws \coding_exception
+  //  @return void
   protected function validate_data () {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
-    if(!$this->contextlevel === CONTEXT_MODULE) {
+    if (!$this->contextlevel === CONTEXT_MODULE) {
       throw new \coding_exception('Context level must be CONTEXT_MODULE.');
+      }
     }
-  }
 
-}
+  }

+ 22 - 57
classes/event/submission_viewed.php

@@ -1,20 +1,5 @@
 <?php
 
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
 /**
  * The mod_iassign submission viewed event.
  *
@@ -33,67 +18,47 @@ defined('MOODLE_INTERNAL') || die();
 
 class submission_viewed extends \core\event\base {
 
-  /**
-   * Init method.
-   */
+  /// Init method.
   protected function init () {
     $this->data['crud'] = 'r'; // c(reate), r(ead), u(pdate), d(elete)
     $this->data['edulevel'] = self::LEVEL_PARTICIPATING; // LEVEL_TEACHING , LEVEL_PARTICIPATING, LEVEL_OTHER
     $this->data['objecttable'] = 'iassign';
-  }
+    }
 
-  /**
-   * Returns localised general event name.
-   *
-   * @return string
-   */
+  /// Returns localised general event name.
+  //  @return string
   public static function get_name () {
     return get_string('eventsubmissionviewed', 'mod_iassign');
-  }
+    }
 
-  /**
-   * Returns non-localised event description with id's for admin use only.
-   *
-   * @return string
-   */
+  /// Returns non-localised event description with id's for admin use only.
+  //  @return string
   public function get_description () {
     return "The user with id '$this->userid' has viewed  activity submission the iAssign with id '$this->objectid' in " .
-        "the iAssign activity with course module id '$this->contextinstanceid'.";
-  }
+           "the iAssign activity with course module id '$this->contextinstanceid'.";
+    }
 
-  /**
-   * Get URL related to the action.
-   *
-   * @return \moodle_url
-   */
+  /// Get URL related to the action.
+  //  @return \moodle_url
   public function get_url () {
     return new \moodle_url('/mod/iassign/view.php', array('id' => $this->contextinstanceid));
-  }
+    }
 
-  /**
-   * Return the legacy event log data.
-   *
-   * @return array|null
-   */
+  /// Return the legacy event log data.
+  //  @return array|null
   public function get_legacy_logdata () {
+    return array($this->courseid, 'iassign', 'view submission', "view.php?id={$this->contextinstanceid}", $this->objectid, $this->contextinstanceid);
+    }
 
-    return array($this->courseid, 'iassign', 'view submission',
-      "view.php?id={$this->contextinstanceid}",
-      $this->objectid, $this->contextinstanceid);
-  }
-
-  /**
-   * Custom validation.
-   *
-   * @throws \coding_exception
-   * @return void
-   */
+  /// Custom validation.
+  //  @throws \coding_exception
+  //  @return void
   protected function validate_data () {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
-    if(!$this->contextlevel === CONTEXT_MODULE) {
+    if (!$this->contextlevel === CONTEXT_MODULE) {
       throw new \coding_exception('Context level must be CONTEXT_MODULE.');
+      }
     }
-  }
 
-}
+  }

+ 34 - 21
db/install.php

@@ -17,11 +17,11 @@
  *
  * @author Patricia Alves Rodrigues
  * @author Leônidas O. Brandão
- * @author Luciano Oliveira Borges
+ * @version v 1.3 2019/03/13
  * @version v 1.2 2013/09/19
  * @package mod_iassign_db
  * @since 2010/09/27
- * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
+ * @copyright iMath (http://www.matematica.br) and LInE (http://line.ime.usp.br) - Computer Science Dep. of IME-USP (Brazil)
  *
  * <b>License</b>
  *  - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -31,39 +31,52 @@ require_once ($CFG->dirroot . '/mod/iassign/locallib.php');
 function xmldb_iassign_install() {
   global $DB, $USER, $CFG;
 
-  $records = array(
+  $records = array(		   
+    // iLM in HTML/CSS/JavaScript format
+    //
+    // iVProgH 0.1.1 - HTML5
+    array_combine(
+     array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), 
+     array('iVProgH', 'http://www.matematica.br/ivprogh', '0.1.20190307', 'HTML5', '{"en":"Visual Interactive Programming on the Internet (HTML)","pt_br":"Programação visual interativa na Internet"}', 'ivph', 'ilm/iVProgH/0.1.20190307/ivprog-html/', 'index.html', 800, 600, 1, time(), $USER->id, time(), 1)),
+    // iVProgH5 0.0.2 - HTML5 (version used in 2014)
+    array_combine(
+     array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), 
+     array('iVProgH', 'http://www.matematica.br/ivprogh', '0.0.2', 'HTML5', '{"en":"Visual Interactive Programming on the Internet (HTML)","pt_br":"Programação visual interativa na Internet"}', 'ivph', 'ilm/iVProgH5/0.0.2/ivprog-html/', 'main.html', 800, 600, 1, time(), $USER->id, time(), 1)),
+    // fractions 0.1.2017.11.22 - HTML5
+    array_combine(
+     array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+     array('iFractions', 'http://www.matematica.br/ifractions', '0.1.2017.11.22', 'HTML5', '{"en":"Interactive Fractions game","pt_br":"Jogo interativa de frações"}', 'frc', 'ilm/iFractions/0.1.2017.11.22/ifractions/', 'index.html', 1000, 600, 1, time(), $USER->id, time(), 1))
+
+    // iLM in Java/JAR format
+    //
     // iGeom 5.9.22
     array_combine(
-            array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), array('iGeom', 'http://www.matematica.br/igeom', '5.9.22', 'Java', '{"en":"Interactive Geometry on the Internet","pt_br":"Geometria Interativa na Internet"}', 'geo', 'ilm/iGeom/5.9.22/iGeom.jar', 'IGeomApplet.class', 800, 600, 1, time(), $USER->id, time(), 1)),
+      array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+      array('iGeom', 'http://www.matematica.br/igeom', '5.9.22', 'Java', '{"en":"Interactive Geometry on the Internet","pt_br":"Geometria Interativa na Internet"}', 'geo', 'ilm/iGeom/5.9.22/iGeom.jar', 'IGeomApplet.class', 800, 600, 1, time(), $USER->id, time(), 1)),
     // iGraf 4.4.0.10
     array_combine(
-            array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), array('iGraf', 'http://www.matematica.br/igraf', '4.4.0.10', 'Java', '{"en":"Interactive Graphic on the Internet","pt_br":"Gráficos Interativos na Internet"}', 'grf', 'ilm/iGraf/4.4.0.10/iGraf.jar', 'igraf.IGraf.class', 840, 600, 1, time(), $USER->id, time(), 1)),
+      array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+      array('iGraf', 'http://www.matematica.br/igraf', '4.4.0.10', 'Java', '{"en":"Interactive Graphic on the Internet","pt_br":"Gráficos Interativos na Internet"}', 'grf', 'ilm/iGraf/4.4.0.10/iGraf.jar', 'igraf.IGraf.class', 840, 600, 1, time(), $USER->id, time(), 1)),
     // iComb 0.9.5
     array_combine(
-            array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), array('iComb', 'http://www.matematica.br/icomb', '0.9.5', 'Java', '{"en":"Combinatorics Interactive on the Internet","pt_br":"Combinatória Interativa na Internet"}', 'icb,cmb', 'ilm/iComb/0.9.5/iComb.jar', 'icomb.IComb.class', 750, 685, 1, time(), $USER->id, time(), 1)),
+      array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+      array('iComb', 'http://www.matematica.br/icomb', '0.9.5', 'Java', '{"en":"Combinatorics Interactive on the Internet","pt_br":"Combinatória Interativa na Internet"}', 'icb,cmb', 'ilm/iComb/0.9.5/iComb.jar', 'icomb.IComb.class', 750, 685, 1, time(), $USER->id, time(), 1)),
     // iVProg2 2.1.0
     array_combine(
-            array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), array('iVProg2', 'http://www.matematica.br/ivprog2', '2.1.0', 'Java', '{"en":"Visual Interactive Programming on the Internet","pt_br":"Programação visual interativa na Internet"}', 'ivp2', 'ilm/iVProg2/2.1.0/iVProg2.jar', 'usp.ime.line.ivprog.Ilm.class', 800, 700, 1, time(), $USER->id, time(), 1)),
+      array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+      array('iVProg2', 'http://www.matematica.br/ivprog2', '2.1.0', 'Java', '{"en":"Visual Interactive Programming on the Internet","pt_br":"Programação visual interativa na Internet"}', 'ivp2', 'ilm/iVProg2/2.1.0/iVProg2.jar', 'usp.ime.line.ivprog.Ilm.class', 800, 700, 1, time(), $USER->id, time(), 1)),
     // iTangram2 0.4.6
     array_combine(
-            array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
-            array('iTangram2', 'http://www.matematica.br/itangram', '0.4.6', 'Java', '{"en":"The Objective of the game is to reproduce the form of the model using all 7 pieces of iTangram","pt_br":"O Objetivo do jogo é reproduzir a forma do modelo usando todas as 7 peças do iTangram"}', 'itg2', 'ilm/iTangram2/0.4.6/iTangram2.jar', 'ilm.line.itangram2.Tangram', 800, 600, 1, time(), $USER->id, time(), 1)),
+      array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+      array('iTangram2', 'http://www.matematica.br/itangram', '0.4.6', 'Java', '{"en":"interactive Tangram (by LInE)","pt_br":" Tangram interativo (do LInE)"}', 'itg2', 'ilm/iTangram2/0.4.6/iTangram2.jar', 'ilm.line.itangram2.Tangram', 800, 600, 1, time(), $USER->id, time(), 1)),
     // iHanoi 3.1.0
     array_combine(
-            array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
-            array('iHanoi', 'http://www.matematica.br/ihanoi', '3.1.0', 'Java', '{"en":"The Objective to move N discs from stick A to C, following some rule (from the game Towers of Hanoi)","pt_br":"O objetivo é mover N discos da haste A para C, seguindo algumas regras (implementa o jogo Torres de Hanói)"}', 'ihn', 'ilm/iHanoi/3.1.0/iHanoi.jar', 'ihanoi.iHanoi', 730, 450, 1, time(), $USER->id, time(), 1)),
+      array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+      array('iHanoi', 'http://www.matematica.br/ihanoi', '3.1.0', 'Java', '{"en":"interactive Tower os Hanoi (by LInE)", "pt_br":"Torres de Hanói (do LInE)"}',  'ihn', 'ilm/iHanoi/3.1.0/iHanoi.jar', 'ihanoi.iHanoi', 730, 450, 1, time(), $USER->id, time(), 1)),
     // Risco 2
     array_combine(
-            array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
-            array('Risko', 'http://risko.pcc.usp.br/', '2.2.23', 'Java', '{"en":"Interactive computational tool for teaching geometry","pt_br":"Ferramenta computacional interativa para o ensino de geometria"}', 'rsk', 'ilm/Risko/2.2.23/Risko.jar', 'RiskoApplet.class', 800, 600, 1, time(), $USER->id, time(), 0)),
-    // iVProgH5 0.1 - HTML5
-    array_combine(
-             array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), 
-             array('iVProgH5', 'http://www.matematica.br/ivprogh5', '0.1.0', 'HTML5', '{"en":"Visual Interactive Programming on the Internet HTML5","pt_br":"Programação visual interativa na Internet"}', 'ivph', 'ilm/iVProgH5/0.1.0/ivprog-html/', 'main.html', 800, 600, 1, time(), $USER->id, time(), 1)),
-    // fractions 0.1.2017.11.22 - HTML5
-    array_combine(
-             array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), 
-             array('iFractions', 'http://www.matematica.br/ifractions', '0.1.2017.11.22', 'HTML5', '{"en":"Visual Interactive Fractions Learning","pt_br":"Aprendizagem visual interativa de frações"}', 'frc', 'ilm/iFractions/0.1.2017.11.22/ifractions/', 'index.html', 1000, 600, 1, time(), $USER->id, time(), 1))
+      array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+      array('Risko', 'http://risko.pcc.usp.br/', '2.2.23', 'Java', '{"en":"Technical drawing with triangle and ruler","pt_br":"Desenho Geomẽtrico com esquadro"}', 'rsk', 'ilm/Risko/2.2.23/Risko.jar', 'RiskoApplet.class', 800, 600, 1, time(), $USER->id, time(), 0))
       );
 
   foreach ($records as $record) {

+ 9 - 11
db/uninstall.php

@@ -6,7 +6,6 @@
  *
  * @author Patricia Alves Rodrigues
  * @author Leônidas O. Brandão
- * @author Luciano Oliveira Borges
  * @version v 1.2 2013/08/20
  * @package mod_iassign_db
  * @since 2010/09/27
@@ -15,16 +14,15 @@
  * <b>License</b> 
  *  - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-/**
- * Moodle core defines constant MOODLE_INTERNAL which shall be used to make sure that the script is included and not called directly.
- */
+
+
+/// Moodle core defines constant MOODLE_INTERNAL which shall be used to make sure that the script is included and not called directly.
 defined('MOODLE_INTERNAL') || die();
 
-/**
- * This is called at the beginning of the uninstallation process to give the module
- * a chance to clean-up its hacks, bits etc. where possible.
- * @return bool Return true if success.
- */
+/// This is called at the beginning of the uninstallation process to give the module
+//  a chance to clean-up its hacks, bits etc. where possible.
+//  @return bool Return true if success.
+
 require_once ($CFG->dirroot . '/mod/iassign/locallib.php');
 
 function xmldb_iassign_uninstall () {
@@ -39,7 +37,7 @@ function xmldb_iassign_uninstall () {
     $context_course = context_course::instance($course->id);
     $fs->delete_area_files($context_course->id, 'mod_iassign', 'exercise');
     $fs->delete_area_files($context_course->id, 'mod_iassign', 'activity');
-  }
+    }
 
   return true;
-}
+  }

+ 127 - 118
db/upgrade.php

@@ -23,11 +23,11 @@
  * 
  * @author Patricia Alves Rodrigues
  * @author Leônidas O. Brandão
- * @author Luciano Oliveira Borges
+ * @version v 1.5 2019/03/13
  * @version v 1.4 2013/09/19
  * @package mod_iassign_db
  * @since 2010/12/21
- * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
+ * @copyright iMath (http://www.matematica.br) and LInE (http://line.ime.usp.br) - Computer Science Dep. of IME-USP (Brazil)
  * 
  * <b>License</b> 
  *  - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -192,11 +192,11 @@ function xmldb_iassign_upgrade ($oldversion) {
       $newentry = new stdClass();
       $newentry->name = 'iVProgH5';
       $newentry->url = 'http://www.matematica.br/ivprogh5';
-      $newentry->version = '0.1.0';
+      $newentry->version = '0.1.1';
       $newentry->description = '{"en":"Visual Interactive Programming on the Internet HTML5","pt_br":"Programação visual interativa na Internet"}';
       $newentry->extension = 'ivph';
       $newentry->file_jar = 'iVProgH5'; // to JAR this is the '*_files.id' correponding to the iLM storaged in '/var/moodledata/filedir/'
-      $newentry->file_class = 'ivprog-html/main.html';
+      $newentry->file_class = 'ivprog-html/index.html';
       $newentry->width = 800;
       $newentry->height = 700;
       $newentry->enable = 1;
@@ -247,7 +247,7 @@ function xmldb_iassign_upgrade ($oldversion) {
       } // foreach
 
     //---
-    // Insert in talbe '{iassign_ilm}' the new iLM iFractions version 0.1.2017.11.22
+    // Insert in table '{iassign_ilm}' the new iLM iFractions version 0.1.2017.11.22
     // Table 'iassign_ilm' : id name version type description url extension parent file_jar file_class width height enable timemodified author timecreated evaluate
     /*$new_ilm_ifractions['name'] = 'iFractions';
     $new_ilm_ifractions['version'] = '0.1.2017.11.22';
@@ -269,150 +269,159 @@ function xmldb_iassign_upgrade ($oldversion) {
 
     } // if ($oldversion < 2017120101)
 
-    if ($oldversion < 2018031000) {
-      // Verify if exist iLM with the same name
-      // then, update the version and file_jar
-
-      $records = array(
-        // iGeom 5.9.22
-        array_combine(
-                array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), array('iGeom', 'http://www.matematica.br/igeom', '5.9.22', 'Java', '{"en":"Interactive Geometry on the Internet","pt_br":"Geometria Interativa na Internet"}', 'geo', 'ilm/iGeom/5.9.22/iGeom.jar', 'IGeomApplet.class', 800, 600, 1, time(), $USER->id, time(), 1)),
-        // iGraf 4.4.0.10
-        array_combine(
-                array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), array('iGraf', 'http://www.matematica.br/igraf', '4.4.0.10', 'Java', '{"en":"Interactive Graphic on the Internet","pt_br":"Gráficos Interativos na Internet"}', 'grf', 'ilm/iGraf/4.4.0.10/iGraf.jar', 'igraf.IGraf.class', 840, 600, 1, time(), $USER->id, time(), 1)),
-        // iComb 0.9.5
-        array_combine(
-                array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), array('iComb', 'http://www.matematica.br/icomb', '0.9.5', 'Java', '{"en":"Combinatorics Interactive on the Internet","pt_br":"Combinatória Interativa na Internet"}', 'icb,cmb', 'ilm/iComb/0.9.5/iComb.jar', 'icomb.IComb.class', 750, 685, 1, time(), $USER->id, time(), 1)),
-        // iVProg2 2.1.0
-        array_combine(
-                array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), array('iVProg2', 'http://www.matematica.br/ivprog2', '2.1.0', 'Java', '{"en":"Visual Interactive Programming on the Internet","pt_br":"Programação visual interativa na Internet"}', 'ivp2', 'ilm/iVProg2/2.1.0/iVProg2.jar', 'usp.ime.line.ivprog.Ilm.class', 800, 700, 1, time(), $USER->id, time(), 1)),
-        // iTangram2 0.4.6
-        array_combine(
-                array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
-                array('iTangram2', 'http://www.matematica.br/itangram', '0.4.6', 'Java', '{"en":"The Objective of the game is to reproduce the form of the model using all 7 pieces of iTangram","pt_br":"O Objetivo do jogo é reproduzir a forma do modelo usando todas as 7 peças do iTangram"}', 'itg2', 'ilm/iTangram2/0.4.6/iTangram2.jar', 'ilm.line.itangram2.Tangram', 800, 600, 1, time(), $USER->id, time(), 1)),
-        // iHanoi 3.1.0
-        array_combine(
-                array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
-                array('iHanoi', 'http://www.matematica.br/ihanoi', '3.1.0', 'Java', '{"en":"The Objective to move N discs from stick A to C, following some rule (from the game Towers of Hanoi)","pt_br":"O objetivo é mover N discos da haste A para C, seguindo algumas regras (implementa o jogo Torres de Hanói)"}', 'ihn', 'ilm/iHanoi/3.1.0/iHanoi.jar', 'ihanoi.iHanoi', 730, 450, 1, time(), $USER->id, time(), 1)),
-        // Risco 2
-        array_combine(
-                array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
-                array('Risko', 'http://risko.pcc.usp.br/', '2.2.23', 'Java', '{"en":"Interactive computational tool for teaching geometry","pt_br":"Ferramenta computacional interativa para o ensino de geometria"}', 'rsk', 'ilm/Risko/2.2.23/Risko.jar', 'RiskoApplet.class', 800, 600, 1, time(), $USER->id, time(), 0)),
-        // iVProgH5 0.1 - HTML5
-        array_combine(
-                 array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), 
-                 array('iVProgH5', 'http://www.matematica.br/ivprogh5', '0.1.0', 'HTML5', '{"en":"Visual Interactive Programming on the Internet HTML5","pt_br":"Programação visual interativa na Internet"}', 'ivph', 'ilm/iVProgH5/0.1.0/ivprog-html/', 'main.html', 800, 600, 1, time(), $USER->id, time(), 1)),
-        // fractions 0.1.2017.11.22 - HTML5
-        array_combine(
-                 array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), 
-                 array('iFractions', 'http://www.matematica.br/ifractions', '0.1.2017.11.22', 'HTML5', '{"en":"Visual Interactive Fractions Learning","pt_br":"Aprendizagem visual interativa de frações"}', 'frc', 'ilm/iFractions/0.1.2017.11.22/ifractions/', 'index.html', 1000, 600, 1, time(), $USER->id, time(), 1))
-          );
-
-      foreach ($records as $record) {
-
-        if ($record['type'] == 'HTML5') {
-
-        // Verify if there is a HTML5 iLM register to update it
+  if ($oldversion < 2018031000) {
+    // Verify if exist iLM with the same name
+    // then, update the version and file_jar
+
+    $records = array(
+      // iGeom 5.9.22
+      array_combine(
+        array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+        array('iGeom', 'http://www.matematica.br/igeom', '5.9.22', 'Java', '{"en":"Interactive Geometry on the Internet","pt_br":"Geometria Interativa na Internet"}', 'geo', 'ilm/iGeom/5.9.22/iGeom.jar', 'IGeomApplet.class', 800, 600, 1, time(), $USER->id, time(), 1)),
+      // iGraf 4.4.0.10
+      array_combine(
+        array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+        array('iGraf', 'http://www.matematica.br/igraf', '4.4.0.10', 'Java', '{"en":"Interactive Graphic on the Internet","pt_br":"Gráficos Interativos na Internet"}', 'grf', 'ilm/iGraf/4.4.0.10/iGraf.jar', 'igraf.IGraf.class', 840, 600, 1, time(), $USER->id, time(), 1)),
+      // iComb 0.9.5
+      array_combine(
+        array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+        array('iComb', 'http://www.matematica.br/icomb', '0.9.5', 'Java', '{"en":"Combinatorics Interactive on the Internet","pt_br":"Combinatória Interativa na Internet"}', 'icb,cmb', 'ilm/iComb/0.9.5/iComb.jar', 'icomb.IComb.class', 750, 685, 1, time(), $USER->id, time(), 1)),
+      // iVProg2 2.1.0
+      array_combine(
+        array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+        array('iVProg2', 'http://www.matematica.br/ivprog2', '2.1.0', 'Java', '{"en":"Visual Interactive Programming on the Internet","pt_br":"Programação visual interativa na Internet"}', 'ivp2', 'ilm/iVProg2/2.1.0/iVProg2.jar', 'usp.ime.line.ivprog.Ilm.class', 800, 700, 1, time(), $USER->id, time(), 1)),
+      // iTangram2 0.4.6
+      array_combine(
+        array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+        array('iTangram2', 'http://www.matematica.br/itangram', '0.4.6', 'Java', '{"en":"interactive Tangram (by LInE)","pt_br":"Tangram interativo (do LInE)"}', 'itg2', 'ilm/iTangram2/0.4.6/iTangram2.jar', 'ilm.line.itangram2.Tangram', 800, 600, 1, time(), $USER->id, time(), 1)),
+      // iHanoi 3.1.0
+      array_combine(
+        array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+        array('iHanoi', 'http://www.matematica.br/ihanoi', '3.1.0', 'Java', '{"en":"interactive Tower os Hanoi (by LInE)", "pt_br":"Torres de Hanói (do LInE)"}', 'ihn', 'ilm/iHanoi/3.1.0/iHanoi.jar', 'ihanoi.iHanoi', 730, 450, 1, time(), $USER->id, time(), 1)),
+      // Risco 2
+      array_combine(
+        array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'),
+        array('Risko', 'http://risko.pcc.usp.br/', '2.2.23', 'Java', '{"en":"Technical drawing with triangle and ruler","pt_br":"Desenho Geomẽtrico com esquadro"}', 'rsk', 'ilm/Risko/2.2.23/Risko.jar', 'RiskoApplet.class', 800, 600, 1, time(), $USER->id, time(), 0)),
+      // iVProgH5 0.1.1 - HTML5
+      array_combine(
+        array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), 
+        array('iVProgH', 'http://www.matematica.br/ivprogh', '0.1.20190307', 'HTML5', '{"en":"Visual Interactive Programming on the Internet HTML5","pt_br":"Programação visual interativa na Internet"}', 'ivph', 'ilm/iVProgH/0.1.20190307/ivprog-html/', 'index.html', 800, 600, 1, time(), $USER->id, time(), 1)),
+      // fractions 0.1.2017.11.22 - HTML5
+      array_combine(
+        array('name', 'url', 'version', 'type', 'description', 'extension', 'file_jar', 'file_class', 'width', 'height', 'enable', 'timemodified', 'author', 'timecreated', 'evaluate'), 
+        array('iFractions', 'http://www.matematica.br/ifractions', '0.1.2017.11.22', 'HTML5', '{"en":"Interactive Fractions game","pt_br":"Jogo interativa de frações"}', 'frc', 'ilm/iFractions/0.1.2017.11.22/ifractions/', 'index.html', 1000, 600, 1, time(), $USER->id, time(), 1))
+        );
+
+    foreach ($records as $record) {
+      if ($record['type'] == 'HTML5') {
+
+        //D echo " * iMA versao HTML<br/>\n";
+        // Verify if there is a HTML5 iLM register => update it
         $iassign_ilm = $DB->get_records('iassign_ilm', array('name' => $record['name']));
 
         if ($iassign_ilm) {
           // Update file_jar and file_class
 
           foreach ($iassign_ilm as $iassign) {
-
+            $iassign->name = trim($iassign->name);
+            $iassign->version = trim($iassign->version);
+            //D echo " &nbsp;&nbsp;&nbsp;" . $iassign->id . ", " . $iassign->name . "<br/>\n";
             // If HTML5 iLM is the same version, only update the path
             if ($iassign->version == $record['version']) {
+              //D echo " &nbsp;&nbsp;&nbsp;&nbsp; mesma versao " . $iassign->version . "<br/>\n";
               $newentry = new stdClass();
               $newentry->id = $iassign->id;
               $newentry->file_jar = $record['file_jar'];
               $newentry->file_class = $record['file_class'];
 
               $DB->update_record("iassign_ilm", $newentry);
-              } else { // If HTML5 iLM is NOT the same version, make a copy of the iLM
-                $dest = $CFG->dirroot . '/mod/iassign/ilm/' . $iassign->name . '/' . $iassign->version . '/';
-                mkdir($dest, 0777);
-
-                $source = $CFG->dirroot . '/mod/iassign/ilm/' . $iassign->name . '/' . $record['version'] . '/';
-
-                foreach (
-                  $iterator = new \RecursiveIteratorIterator(
-                    new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS),
-                    \RecursiveIteratorIterator::SELF_FIRST) as $item
-                   ) {
-                     if ($item->isDir()) {
-                       mkdir($dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
-                       } else {
-                         copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
-                         }
-                     }
-
-                $newentry = new stdClass();
-                $newentry->id = $iassign->id;
-                $newentry->file_jar = 'ilm/' . $iassign->name . '/' . $iassign->version . '/' . basename($record['file_jar']) . '/';
-                $newentry->file_class = $record['file_class'];
-
-                $DB->update_record("iassign_ilm", $newentry);
-
               }
-            }
-          
-          } else {
-            // If not found a iLM with the same name
-            $DB->insert_record('iassign_ilm', $record, false); // insert new iLM in the table '*_iassign_ilm'
+            else { // If HTML5 iLM is NOT the same version, make a copy of the iLM
+              $dest = $CFG->dirroot . '/mod/iassign/ilm/' . $iassign->name . '/' . $iassign->version . '/';
+              mkdir($dest, 0755); // permissions "drwxr-xr-x"
+
+              $source = $CFG->dirroot . '/mod/iassign/ilm/' . $iassign->name . '/' . $record['version'] . '/';
+
+              foreach (
+                $iterator = new \RecursiveIteratorIterator(
+                  new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS),
+                  \RecursiveIteratorIterator::SELF_FIRST) as $item) {
+                if ($item->isDir()) {
+                  mkdir($dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
+                  }
+                else { // copy or move?
+                  copy($item, $dest . $iterator->getSubPathName());
+                  // copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
+                  // rename($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
+                  }
+                }
 
-            }
+              $newentry = new stdClass();
+              $newentry->id = $iassign->id;
+              $newentry->file_jar = 'ilm/' . $iassign->name . '/' . $iassign->version . '/' . basename($record['file_jar']) . '/';
+              $newentry->file_class = $record['file_class'];
 
-          }  // if ($record['type'] == 'HTML5')
-           else {
+              $DB->update_record("iassign_ilm", $newentry);
+              }
+            } // foreach ($iassign_ilm as $iassign)
 
-             // Verify if there is a Java iLM register to update it
-             $iassign_ilm = $DB->get_record('iassign_ilm', array('name' => $record['name'], 'version' => $record['version']));
+          }
+        else { // if ($iassign_ilm)
+          // If not found a iLM with the same name
+          $DB->insert_record('iassign_ilm', $record, false); // insert new iLM in the table '*_iassign_ilm'
+          }
 
-             if ($iassign_ilm) {
-               // Update file_jar and file_class
-               $newentry = new stdClass();
-               $newentry->id = $iassign_ilm->id;
-               $newentry->file_jar = $record['file_jar'];
-               $newentry->file_class = $record['file_class'];
+        } // if ($record['type'] == 'HTML5')
+      else {
 
-               $DB->update_record("iassign_ilm", $newentry);
-             } else {
-             
-             // If not found a Java iLM with the same name and version, search a
-             // different version, to use as parent of new version
+        // Verify if there is a Java iLM register to update it
+        $iassign_ilm = $DB->get_record('iassign_ilm', array('name' => $record['name'], 'version' => $record['version']));
 
-             $iassign_ilm_parent = $DB->get_record('iassign_ilm', array('name' => $record['name'], 'parent' => 0));
+        if ($iassign_ilm) {
+          // Update file_jar and file_class
+          $newentry = new stdClass();
+          $newentry->id = $iassign_ilm->id;
+          $newentry->file_jar = $record['file_jar'];
+          $newentry->file_class = $record['file_class'];
 
-             if ($iassign_ilm_parent) {
+          $DB->update_record("iassign_ilm", $newentry);
+          }
+        else { // if ($iassign_ilm) - I couldn't find an iLM with this name ($record['name']) and under this version ($record['version'])
+          // If not found a Java iLM with the same name and version, search a
+          // different version, to use as parent of new version
 
-               $record['parent'] = $iassign_ilm_parent->id;
-               $DB->insert_record('iassign_ilm', $record, false); // insert with parent
+          $iassign_ilm_parent = $DB->get_record('iassign_ilm', array('name' => $record['name'], 'parent' => 0));
 
-               // Download the JAR file of parent from MoodleData and put it in iassign/ilm/
-               $dest = $CFG->dirroot . '/mod/iassign/ilm/' . $iassign_ilm_parent->name . '/' . $iassign_ilm_parent->version . '/';
-               mkdir($dest, 0777);
+          if ($iassign_ilm_parent) {
+            $record['parent'] = $iassign_ilm_parent->id;
+            $DB->insert_record('iassign_ilm', $record, false); // insert with parent
 
-               $fs = get_file_storage();
-               $file = $fs->get_file_by_id($iassign_ilm_parent->file_jar);
-               $file->copy_content_to($dest . $file->get_filename());
+            // Download the JAR file of parent from MoodleData and put it in iassign/ilm/
+            $dest = $CFG->dirroot . '/mod/iassign/ilm/' . $iassign_ilm_parent->name . '/' . $iassign_ilm_parent->version . '/';
+            mkdir($dest, 0777);
+            //D echo " &nbsp;&nbsp;&nbsp;&nbsp; mover para " . $dest . "<br/>\n";
 
-               // Update file_jar of iLM parent
-               $update_parent = new stdClass();
-               $update_parent->id = $iassign_ilm_parent->id;
-               $update_parent->file_jar = 'ilm/' . $iassign_ilm_parent->name . '/' . $iassign_ilm_parent->version . '/' . $file->get_filename();
+            $fs = get_file_storage();
+            $file = $fs->get_file_by_id($iassign_ilm_parent->file_jar);
+            $file->copy_content_to($dest . $file->get_filename());
 
-               $DB->update_record("iassign_ilm", $update_parent);
+            // Update file_jar of iLM parent
+            $update_parent = new stdClass();
+            $update_parent->id = $iassign_ilm_parent->id;
+            $update_parent->file_jar = 'ilm/' . $iassign_ilm_parent->name . '/' . $iassign_ilm_parent->version . '/' . $file->get_filename();
 
-               } else {
-                 $DB->insert_record('iassign_ilm', $record, false); // insert new iLM in the table '*_iassign_ilm' without a parent
-                 }
-               }
-             }
+            $DB->update_record("iassign_ilm", $update_parent);
 
-        } // foreach ($records as $record)
+            }
+          else {
+            $DB->insert_record('iassign_ilm', $record, false); // insert new iLM in the table '*_iassign_ilm' without a parent
+            }
+          } // else if ($iassign_ilm)
+        } // else if ($record['type'] == 'HTML5')
 
-      } // if ($oldversion < 2018031000)
+      } // foreach ($records as $record)
 
+    } // if ($oldversion < 2018031000)
     
 
   // log event -----------------------------------------------------

+ 104 - 12
iassign_form.php

@@ -45,7 +45,7 @@ class mod_iassign_form extends moodleform {
 
   /// Add elements to form
   function definition () {
-    global $CFG, $COURSE, $USER, $DB;
+    global $CFG, $COURSE, $USER, $DB, $OUTPUT; // $OUTPUT only used to get '$OUTPUT->help_icon(...)'
     $mform = & $this->_form;
     $instance = $this->_customdata;
 
@@ -131,6 +131,7 @@ class mod_iassign_form extends moodleform {
     }
 
   function config_ilm (id) {
+    //alert('config_ilm('+id+'): idigeom=$idigeom, ilmid='+document.forms['mform1'].iassign_ilmid.value);
     if (id==$idigeom) {
       document.forms['mform1'].special_param1.style.display='block';
       document.forms['mform1'].special_param1.disabled=0;
@@ -213,13 +214,14 @@ class mod_iassign_form extends moodleform {
 
     //-------------------------------------------------------------------------------
     // Adding the "title_type_iassign" fieldset, where all the common settings are showed
+    // Data is insert through 'locallib.php ! action() -> new_iassign($param) : 3433/6441'
 
     $mform->addElement('header', 'title_type_iassign', get_string('type_iassign', 'iassign'));
     $type_iassign = array();
     $type_iassign[1] = get_string('example', 'iassign');
     $type_iassign[2] = get_string('test', 'iassign');
     $type_iassign[3] = get_string('exercise', 'iassign');
-      
+
     $mform->addElement('select', 'type_iassign', get_string('choose_type_activity', 'iassign'), $type_iassign, array('onChange' => 'config_type(this.value);'));
     $mform->setDefault('type_iassign', 3); // default type_iassign = 3
     $mform->addHelpButton('type_iassign', 'helptypeiassign', 'iassign');
@@ -236,7 +238,8 @@ class mod_iassign_form extends moodleform {
     $mform->addRule('name', get_string('required', 'iassign'), 'required');
 
     // Adding the standard "proposition" field
-    $mform->addElement('htmleditor', 'proposition', get_string('proposition', 'iassign'));
+    //moodle2: $mform->addElement('htmleditor', 'proposition', get_string('proposition', 'iassign'));
+    $mform->addElement('editor', 'proposition', get_string('proposition', 'iassign')); //moodle 3
     $mform->setType('proposition', PARAM_RAW);
     $mform->addRule('proposition', get_string('required', 'iassign'), 'required');
 
@@ -246,26 +249,95 @@ class mod_iassign_form extends moodleform {
     //$mform->setExpanded('interactivy_learning_module');
 
     // Search iLM registered in the database
+    // Field : 'iassign_ilmid'
     // $ilms = search_iLM(1);
     $ilms = $all_ilm;
 
-    $applets = array();
-    foreach ($ilms as $ilm)
-      $applets[$ilm->id] = $ilm->name . ' ' . $ilm->version;
-    $mform->addElement('select', 'iassign_ilmid', get_string('choose_iLM', 'iassign'), $applets, array('onChange' => 'config_ilm(this.value);'));
-    $mform->addHelpButton('iassign_ilmid', 'helpchoose_ilm', 'iassign');
-
+    //TODO Trick: was difficult to use 'mform->addGroup(...)', then I made by hand <select name='iassign_ilmid'...>' with 'optgroup' by hand!
+    //TODO But MoodleForm clear/do not register the 'iassign_ilmid' in 'locallib.php!new_iassign($param)'
+    //TODO Then (in 'new_iassign(...)') get $_POST['iassign_ilmid'] directly!!
+    //TODO See: 'locallib.php!add_edit_iassign()', 'locallib.php!function add_edit_iassign()' and 'locallib.php!function new_iassign($param)'
+
+    //2019 $applets = array();
+    //2019 foreach ($ilms as $ilm)
+    //2019   $applets[$ilm->id] = $ilm->name . ' ' . $ilm->version;
+    //2019 $mform->addElement('select', 'iassign_ilmid', get_string('choose_iLM', 'iassign'), $applets, array('onChange' => 'config_ilm(this.value);'));
+    //2019 $mform->addHelpButton('iassign_ilmid', 'helpchoose_ilm', 'iassign');
+
+    //D echo "<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>iassign_form.php:<br/>";
+    // Split all iLM in those HTML from Java
+    $list_html = array(); $list_html_id = array();
+    $list_applets = array(); $list_applets_id = array();
+
+    $num_iLM_html = $num_iLM_java = 0;
+    foreach ($ilms as $ilm) {
+      $type4 = substr($ilm->type, 0,4); // ensure the use of the only first 4 character (avoid difference if type is defined as 'HTML5')
+      if (strcasecmp($type4, "HTML") == 0) { //  Returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal. 
+        $list_html[$num_iLM_html] = $ilm->name . ' (' . $ilm->version . ')';
+        $list_html_id[$num_iLM_html] = $ilm->id;
+        $num_iLM_html++;
+      } else {
+        $list_applets[$num_iLM_java] = $ilm->name . ' (' . $ilm->version . ')';
+        $list_applets_id[$num_iLM_java] = $ilm->id;
+        $num_iLM_java++;
+        } //D echo $ilm->id . " : " . $ilm->type . " <br/>";
+      }
+    //D echo "" . get_string('interactivy_learning_module', 'iassign') . ": num_iLM_html=$num_iLM_html, num_iLM_java=$num_iLM_java<br/>";
+    //D Interactive Learning Modules: num_iLM_html=0, num_iLM_java=9
+
+    //TODO Assim o '/lib/formslib.php : get_data()' destroi o campo 'iassign_ilmid'...
+    $html_sel = "\n        <select class=\"custom-select\" name=\"iassign_ilmid\" id=\"id_iassign_ilmid\" onChange=\"config_ilm(this.value);\">\n";
+    $html_sel .= "        <optgroup label=\"Group HTML\">\n";
+    if ($num_iLM_html>0)
+      $html_sel .= "          <option selected value=\"" . $list_html_id[0] . "\">" . $list_html[0] . "</option>\n";
+    else echo "iassign_form.php: ERRO, num_iLM_html=$num_iLM_html<br/>\n";
+    for ($ii=1; $ii<$num_iLM_html; $ii++)
+      $html_sel .= "          <option value=\"" . $list_html_id[$ii] . "\">" . $list_html[$ii] . "</option>\n";
+    $html_sel .= "        </optgroup>\n        <optgroup label=\"Group Java\">\n";
+    for ($ii=0; $ii<$num_iLM_java; $ii++)
+      $html_sel .= "          <option value=\"" . $list_applets_id[$ii] . "\">" . $list_applets[$ii] . "</option>\n";
+    $html_sel .= "        </optgroup>\n";
+    $html_sel .= "        </select>\n";
+
+    // choose_file = 'Choose the file with the iLM activity' / choose_iLM = 'Choose the interactive Learning Module (iLM)'
+    $mform->addElement('html', get_string('choose_iLM', 'iassign'));//, 'iassign_ilmid');//, $html_sel, array('onChange' => 'config_ilm(this.value);'));
+    $html_sel .= $OUTPUT->help_icon('choose_iLM', 'iassign'); // choose_iLM_help
+    $html_sel .= "     <div class=\"form-control-feedback invalid-feedback\" id=\"id_error_iassign_ilmid\" ></div>\n";
+
+    $mform->addElement('html', $html_sel); //, 'iassign_ilmid');
+    $mform->setDefault('iassign_ilmid', 0);
+
+    //TODO Adaptives to use API of MoodleForm
+    // addOption($optgroup, $text, $value, $attributes=null)
+    // $allOptions = array(); $ilmHtml = array(); $ilmJava = array();
+    // $ilmHtml[] = $mform->createElement('optgroup', 'groupHtml', 'Group HTML');
+    // for ($ii=0; $ii<$num_iLM_html; $ii++) $ilmHtml[] = $mform->createElement('optgroup', 'groupHtml', 'Group HTML'); //$allOptions[] = $mform->addOption('Group HTML', $list_html[$ii], $list_html_id[$ii]);
+    // $mform->addGroup($ilmHtml, 'groupHtml', '', array(' '), false);
+    // $list_html $list_html_id  $num_iLM_html
+    // $list_applets $list_applets_id   $num_iLM_java
+    // echo "<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>iassign_form.php: num_iLM_html=$num_iLM_html, num_iLM_java=$num_iLM_java<br/>";exit;
+    // $allOptions[] = array('-1' => 'Group HTML'); for ($ii=0; $ii<$num_iLM_html; $ii++) $allOptions[] = array(''.$list_html_id[$ii] => $list_html[$ii]);
+    // $allOptions[] = array('-2' => 'Group Java'); for ($ii=0; $ii<$num_iLM_java; $ii++) $allOptions[] = array(''.$list_applets_id[$ii] => $list_applets[$ii]);
+    //  $allOptions[$ilm->id] = $ilm->name . ' ' . $ilm->version;
+    // $mform->addElement('select', 'iassign_ilmid', get_string('choose_iLM', 'iassign'), $allOptions, array('onChange' => 'config_ilm(this.value);'));
+    // for ($ii=0; $ii<$num_iLM_html; $ii++) $allOptions[] = $list_html[$ii];
+    // for ($jj=0; $jj<$num_iLM_java; $jj++) $allOptions[] = $list_applets[$jj];
+    // $mform->addElement('select', 'iassign_ilmid', get_string('choose_iLM', 'iassign'), $allOptions, array('onChange' => 'config_ilm(this.value);'));
+    // $mform->addHelpButton('iassign_ilmid', 'helpchoose_ilm', 'iassign');
+
+    // Field 'action'
     $fileurl = "";
     $filename = "";
     if (!is_null($COURSE->iassign_file_id)) {
+      $mform->addElement('hidden', 'action', 'viewpluginpage');
       $fs = get_file_storage();
       $file = $fs->get_file_by_id($COURSE->iassign_file_id);
       $fileurl = $CFG->wwwroot . "/pluginfile.php/" . $file->get_contextid() . "/mod_iassign/exercise" . '/' . $file->get_itemid() . $file->get_filepath() . $file->get_filename();
       $filename = $file->get_filename();
       }
     //D echo "123";
-    $html_div = '<div id="fitem_id_iassign_file_id" class="fitem required fitem_fgroup">';
-    $html_div .= '<div class="fitemtitle"><label for="id_iassign_file_id">' . get_string('choose_file', 'iassign');
+    $html_div = '<br/>&nbsp;<br/><div id="fitem_id_iassign_file_id" class="fitem required fitem_fgroup">';
+    $html_div .= '<div class="fitemtitle"><label for="id_iassign_file_id">' . get_string('choose_file', 'iassign'); // 'Choose the file with the iLM activity'
     $html_div .= '<img class="req" title="' . get_string('requiredelement', 'form') . '" alt="' . get_string('requiredelement', 'form') . '" src="' . $CFG->wwwroot . '/theme/image.php/standard/core/1379534589/req"></label></div>';
     $html_div .= '<div class="felement fselect">';
     $html_div .= '<span id="iassign_file_link" style="color:#000000;"><a href="' . $fileurl . '" target="_blank" title="' . get_string('download_file', 'iassign') . $filename . '">' . $filename . '</a></span>';
@@ -276,6 +348,7 @@ class mod_iassign_form extends moodleform {
     $html_div .= '</div>';
     $mform->addElement('html', $html_div);
 
+
     //Applies only iLM iGeom
     $mform->addElement('selectyesno', 'special_param1', get_string('special_param', 'iassign')); //$ynoptions
     $mform->setDefault('special_param1', 0);
@@ -411,18 +484,37 @@ class mod_iassign_form extends moodleform {
       }
 
     if ($mform->elementExists('proposition')) {
-      $value = trim($data['proposition']);
+      // echo "iassign_form.php : data['proposition'] :<br/>"; print_r($data['proposition']);
+      // $data['proposition'] = Array ([text] => ...  [format] => ) - segundo esta' vazio!
+      if (is_array($data['proposition'])) {
+
+        // foreach ($data['proposition'] as $key => $value) echo "key=" . $key . " - value=" . $value . "<br/>";
+        // $data['proposition'] = [format] => ) key=text - value=
+
+        $aux = $data['proposition']; // Format JSON: {"em":"...","pt":"..."}
+        if (isset($aux['text']))
+          $value = trim($aux['text']);
+        else
+          $value = trim($aux[0]);
+
+        }
+      else
+        $value = trim($data['proposition']);
+
       if ($value == '') {
         $errors['proposition'] = get_string('required', 'iassign');
         }
       }
 
+    // echo "iassign_form.php : mform :<br/>"; // print_r($mform); exit();
+
     if ($mform->elementExists('file')) {
       $value = trim($data['file']);
       if ($value == 0) {
         $errors['iassign_ilmid'] = get_string('required_iassign_file', 'iassign');
         }
       }
+
     return $errors;
     } // function validation($data, $files)
 

+ 10 - 0
igeom.cfg

@@ -0,0 +1,10 @@
+# igeom: http://www.matematica.br
+version = 5.9.14
+created = Feb 22, 2019 10:38:50 PM
+modified = Feb 22, 2019 10:38:50 PM
+user.name = leo
+java.version = 1.8.0_131
+java.vendor = Oracle Corporation
+os.name = Linux
+lang = pt_BR
+save = false

+ 9 - 0
ilm/Risko/2.2.23/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/Risko/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iComb/0.9.5/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iComb/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iFractions/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iGeom/5.9.22/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iGeom/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iGraf/4.4.0.10/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iGraf/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iHanoi/3.1.0/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iHanoi/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iTangram2/0.4.6/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iTangram2/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iVProg2/2.1.0/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 9 - 0
ilm/iVProg2/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 0 - 0
ilm/iVProgH/0.1.20190307/index.html


+ 122 - 0
ilm/iVProgH/0.1.20190307/ivprog-html/index.html

@@ -0,0 +1,122 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+    <meta http-equiv="cache-control" content="no-cache">
+    <meta http-equiv="cache-control" content="no-store">
+    <meta http-equiv="cache-control" content="max-age=0">
+    <meta http-equiv="expires" content="-1">
+    <meta http-equiv="pragma" content="no-cache">
+    <title></title>
+    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
+    <link rel="stylesheet" type="text/css" href="js/semantic/semantic.min.css">
+    <link rel="stylesheet" type="text/css" href="css/ivprog-visual-1.0.css">
+    <link rel="stylesheet" type="text/css" href="css/ivprog-term.css">
+    <script src="js/jquery-3.3.1.min.js"></script>
+    <script src="js/iassign-integration-functions.js"></script>
+    <script src="build/ivprog.bundle.js"></script>
+    <script src="js/semantic/semantic.min.js"></script>
+    <script src="js/semantic/semantic-buttons.js"></script>
+
+    <script src="js/jquery-ui.js"></script>
+    <script src="js/Sortable.js"></script>
+    
+  </head>
+  <body>
+
+    <div class="ui height_100 add_accordion" id="ui_main_div">
+
+      <div class="title default_visual_title">
+        <i class="dropdown icon"></i>
+      </div>
+
+    <div class="content height_100">
+   
+      <div class="ui raised container segment div_to_body">
+
+        <div class="ui container main_title only_in_frame">
+          <h2>iVProg</h2>
+        </div>
+
+        <div class="ui icon menu center aligned container" style="width: 438px; margin-top: -20px;">
+          <a class="item active visual_coding_button">
+            <i class="window maximize outline icon"></i>
+          </a>
+          <a class="item textual_coding_button">
+            <i class="code icon"></i>
+          </a>
+          <a class="item upload_file_button disabled">
+            <i class="upload icon"></i>
+          </a>
+          <a class="item download_file_button disabled">
+            <i class="download icon"></i>
+          </a>
+          <a class="item undo_button disabled">
+            <i class="undo icon"></i>
+          </a>
+          <a class="item redo_button disabled">
+            <i class="redo icon"></i>
+          </a>
+          <a class="item run_button">
+            <i class="play icon"></i>
+          </a>
+          <a class="item assessment assessment_button">
+            <i class="check icon"></i>
+          </a>
+          <!--<a class="item expand_button">
+            <i class="expand arrows alternate icon"></i>
+          </a>-->
+          <a class="item help_button">
+            <i class="help icon"></i>
+          </a>
+        </div>
+
+        <div class="ui one column container segment ivprog_visual_panel loading">
+
+          <div class="global_var">
+            <i class="icon plus circle purple add_global_button"></i>
+            <i class="icon circle white back"></i>
+
+            <div class="ui icon button add-globalVar-button add_global_button purple"><i class="icon superscript"></i></div>
+
+            <div class="list_globals" id="listGlobalsHandle"></div>
+
+          </div>
+
+          <div class="all_functions list-group" id="listWithHandle">
+
+          </div>
+
+
+          <div class="ui teal small labeled icon button add_function_button">
+            <data class="i18n" value="ui:btn_function">Function</data>
+            <i class="add icon"></i>
+          </div>
+          <div class="program_final"></div>
+
+        </div>
+
+
+        <div class="ui one column container segment ivprog_textual_panel loading" style="display: none;">
+          <textarea class="ivprog_textual_code" readonly></textarea>
+        </div>
+
+        <div id='ivprog-term' class="six column wide">
+          <div class="div_toggle_console"><i class="inverted terminal icon green button_toggle_console"></i></div>
+        </div>
+      </div>
+
+    </div>
+
+  </div>
+
+    <script>
+      $(document).ready(() => {
+        ivprogCore.LocalizedStrings.updateTagText();
+        ivprogCore.initVisualUI();
+        prepareEnvironment();
+      });
+    </script>
+
+  </body>
+</html>

+ 9 - 0
ilm/iVProgH/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

ilm/iVProgH5/0.1.0/ivprog-html/README.md → ilm/iVProgH5/0.0.2/README.md


ilm/iVProgH5/0.1.0/ivprog-html/README.txt → ilm/iVProgH5/0.0.2/README.txt


ilm/iVProgH5/0.1.0/ivprog-html/css/bootstrap-editable.css → ilm/iVProgH5/0.0.2/css/bootstrap-editable.css


ilm/iVProgH5/0.1.0/ivprog-html/css/bootstrap.css → ilm/iVProgH5/0.0.2/css/bootstrap.css


ilm/iVProgH5/0.1.0/ivprog-html/css/bootstrap.min.css → ilm/iVProgH5/0.0.2/css/bootstrap.min.css


ilm/iVProgH5/0.1.0/ivprog-html/css/font-awesome.css → ilm/iVProgH5/0.0.2/css/font-awesome.css


ilm/iVProgH5/0.1.0/ivprog-html/css/font-awesome.min.css → ilm/iVProgH5/0.0.2/css/font-awesome.min.css


ilm/iVProgH5/0.1.0/ivprog-html/css/ivprog.css → ilm/iVProgH5/0.0.2/css/ivprog.css


ilm/iVProgH5/0.1.0/ivprog-html/embed.html → ilm/iVProgH5/0.0.2/embed.html


ilm/iVProgH5/0.1.0/ivprog-html/fonts/FontAwesome.otf → ilm/iVProgH5/0.0.2/fonts/FontAwesome.otf


ilm/iVProgH5/0.1.0/ivprog-html/fonts/fontawesome-webfont.eot → ilm/iVProgH5/0.0.2/fonts/fontawesome-webfont.eot


ilm/iVProgH5/0.1.0/ivprog-html/fonts/fontawesome-webfont.svg → ilm/iVProgH5/0.0.2/fonts/fontawesome-webfont.svg


ilm/iVProgH5/0.1.0/ivprog-html/fonts/fontawesome-webfont.ttf → ilm/iVProgH5/0.0.2/fonts/fontawesome-webfont.ttf


ilm/iVProgH5/0.1.0/ivprog-html/fonts/fontawesome-webfont.woff → ilm/iVProgH5/0.0.2/fonts/fontawesome-webfont.woff


ilm/iVProgH5/0.1.0/ivprog-html/fonts/glyphicons-halflings-regular.eot → ilm/iVProgH5/0.0.2/fonts/glyphicons-halflings-regular.eot


ilm/iVProgH5/0.1.0/ivprog-html/fonts/glyphicons-halflings-regular.svg → ilm/iVProgH5/0.0.2/fonts/glyphicons-halflings-regular.svg


ilm/iVProgH5/0.1.0/ivprog-html/fonts/glyphicons-halflings-regular.ttf → ilm/iVProgH5/0.0.2/fonts/glyphicons-halflings-regular.ttf


ilm/iVProgH5/0.1.0/ivprog-html/fonts/glyphicons-halflings-regular.woff → ilm/iVProgH5/0.0.2/fonts/glyphicons-halflings-regular.woff


ilm/iVProgH5/0.1.0/ivprog-html/get.php → ilm/iVProgH5/0.0.2/get.php


ilm/iVProgH5/0.1.0/ivprog-html/gravar.php → ilm/iVProgH5/0.0.2/gravar.php


ilm/iVProgH5/0.1.0/ivprog-html/img/att.png → ilm/iVProgH5/0.0.2/img/att.png


ilm/iVProgH5/0.1.0/ivprog-html/img/autochecking.png → ilm/iVProgH5/0.0.2/img/autochecking.png


ilm/iVProgH5/0.1.0/ivprog-html/img/botao_rodar.png → ilm/iVProgH5/0.0.2/img/botao_rodar.png


ilm/iVProgH5/0.1.0/ivprog-html/img/bs-docs-masthead-pattern.png → ilm/iVProgH5/0.0.2/img/bs-docs-masthead-pattern.png


ilm/iVProgH5/0.1.0/ivprog-html/img/download.png → ilm/iVProgH5/0.0.2/img/download.png


ilm/iVProgH5/0.1.0/ivprog-html/img/expand_down.png → ilm/iVProgH5/0.0.2/img/expand_down.png


ilm/iVProgH5/0.1.0/ivprog-html/img/expand_up.png → ilm/iVProgH5/0.0.2/img/expand_up.png


ilm/iVProgH5/0.1.0/ivprog-html/img/if.png → ilm/iVProgH5/0.0.2/img/if.png


ilm/iVProgH5/0.1.0/ivprog-html/img/locker_closed.png → ilm/iVProgH5/0.0.2/img/locker_closed.png


ilm/iVProgH5/0.1.0/ivprog-html/img/locker_opened.png → ilm/iVProgH5/0.0.2/img/locker_opened.png


ilm/iVProgH5/0.1.0/ivprog-html/img/logo.png → ilm/iVProgH5/0.0.2/img/logo.png


ilm/iVProgH5/0.1.0/ivprog-html/img/logo_ivprog.png → ilm/iVProgH5/0.0.2/img/logo_ivprog.png


ilm/iVProgH5/0.1.0/ivprog-html/img/loop-n.png → ilm/iVProgH5/0.0.2/img/loop-n.png


ilm/iVProgH5/0.1.0/ivprog-html/img/mode1.png → ilm/iVProgH5/0.0.2/img/mode1.png


ilm/iVProgH5/0.1.0/ivprog-html/img/mode2.png → ilm/iVProgH5/0.0.2/img/mode2.png


ilm/iVProgH5/0.1.0/ivprog-html/img/mode3.png → ilm/iVProgH5/0.0.2/img/mode3.png


ilm/iVProgH5/0.1.0/ivprog-html/img/operations.png → ilm/iVProgH5/0.0.2/img/operations.png


ilm/iVProgH5/0.1.0/ivprog-html/img/redo.png → ilm/iVProgH5/0.0.2/img/redo.png


ilm/iVProgH5/0.1.0/ivprog-html/img/undo.png → ilm/iVProgH5/0.0.2/img/undo.png


ilm/iVProgH5/0.1.0/ivprog-html/img/upload.png → ilm/iVProgH5/0.0.2/img/upload.png


+ 9 - 0
ilm/iVProgH5/0.0.2/index.html

@@ -0,0 +1,9 @@
+<html>
+    <head>
+        <title>Acess not allowed! - Acesso não permitido</title>
+    </head>
+    <body style="color: #FF0000">
+        <p>Acesso não permitido!</p>
+        <p>Acess not allowed!</p>
+    </body>
+</html>

+ 25 - 0
ilm/iVProgH5/0.0.2/ivprog-html/README.md

@@ -0,0 +1,25 @@
+iVProg
+======
+
+iVProgH5
+
+The iVProg is a free software under development by Laboratory of Informatics in Education (LInE) - IME - USP,
+focused on the teach and learning of algorithms and programming principles. It use the Visual Programming paradigm.
+
+This is the HTML5 version of iVProg, it uses the frameworks AngularJS (www.angularjs.org) and Bootstrap.
+
+The main home page of iVProgH5 is under: http://www.matematica.br/ivprogh5/
+The iVProgH5 also can be tested under: http://www.usp.br/line/ivprogH5
+
+The source code can be downloaded under: https://github.com/LInE-IME-USP/ivprog-html
+
+History:
+ - Tulio
+ - Gabriel
+
+---
+Leo^nidas de Oliveira Branda~o
+LInE Coordinator
+https://www.ime.usp.br/~leo
+http://www.matematica.br
+https://line.ime.usp.br

+ 25 - 0
ilm/iVProgH5/0.0.2/ivprog-html/README.txt

@@ -0,0 +1,25 @@
+iVProg
+======
+
+iVProgH5
+
+The iVProg is a free software under development by Laboratory of Informatics in Education (LInE) - IME - USP,
+focused on the teach and learning of algorithms and programming principles. It use the Visual Programming paradigm.
+
+This is the HTML5 version of iVProg, it uses the frameworks AngularJS (www.angularjs.org) and Bootstrap.
+
+The main home page of iVProgH5 is under: http://www.matematica.br/ivprogh5/
+The iVProgH5 also can be tested under: http://www.usp.br/line/ivprogH5
+
+The source code can be downloaded under: https://github.com/LInE-IME-USP/ivprog-html
+
+History:
+ - Tulio
+ - Gabriel
+
+---
+Leo^nidas de Oliveira Branda~o
+LInE Coordinator
+https://www.ime.usp.br/~leo
+http://www.matematica.br
+https://line.ime.usp.br

+ 651 - 0
ilm/iVProgH5/0.0.2/ivprog-html/css/bootstrap-editable.css

@@ -0,0 +1,651 @@
+/*! X-editable - v1.4.5 
+* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
+* http://github.com/vitalets/x-editable
+* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
+
+.editableform {
+    margin-bottom: 0; /* overwrites bootstrap margin */
+}
+
+.editableform .control-group {
+    margin-bottom: 0; /* overwrites bootstrap margin */
+    white-space: nowrap; /* prevent wrapping buttons on new line */
+    line-height: 20px; /* overwriting bootstrap line-height. See #133 */
+}
+
+.editable-buttons {
+   display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */
+   vertical-align: top;
+   margin-left: 7px;
+   /* inline-block emulation for IE7*/
+   zoom: 1; 
+   *display: inline;
+}
+
+.editable-buttons.editable-buttons-bottom {
+   display: block; 
+   margin-top: 7px;
+   margin-left: 0;
+}
+
+.editable-input {
+    vertical-align: top; 
+    display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */
+    width: auto; /* bootstrap-responsive has width: 100% that breakes layout */
+    white-space: normal; /* reset white-space decalred in parent*/
+   /* display-inline emulation for IE7*/
+   zoom: 1; 
+   *display: inline;   
+}
+
+.editable-buttons .editable-cancel {
+   margin-left: 7px; 
+}
+
+/*for jquery-ui buttons need set height to look more pretty*/
+.editable-buttons button.ui-button-icon-only {
+   height: 24px; 
+   width: 30px;
+}
+
+.editableform-loading {
+    background: url('../img/loading.gif') center center no-repeat;  
+    height: 25px;
+    width: auto; 
+    min-width: 25px; 
+}
+
+.editable-inline .editableform-loading {
+    background-position: left 5px;      
+}
+
+ .editable-error-block {
+    max-width: 300px;
+    margin: 5px 0 0 0;
+    width: auto;
+    white-space: normal;
+}
+
+/*add padding for jquery ui*/
+.editable-error-block.ui-state-error {
+    padding: 3px;  
+}  
+
+.editable-error {
+   color: red;  
+}
+
+/* ---- For specific types ---- */
+
+.editableform .editable-date {
+    padding: 0; 
+    margin: 0;
+    float: left;
+}
+
+/* move datepicker icon to center of add-on button. See https://github.com/vitalets/x-editable/issues/183 */
+.editable-inline .add-on .icon-th {
+   margin-top: 3px;
+   margin-left: 1px; 
+}
+
+
+/* checklist vertical alignment */
+.editable-checklist label input[type="checkbox"], 
+.editable-checklist label span {
+    vertical-align: middle;
+    margin: 0;
+}
+
+.editable-checklist label {
+    white-space: nowrap; 
+}
+
+/* set exact width of textarea to fit buttons toolbar */
+.editable-wysihtml5 {
+    width: 566px; 
+    height: 250px; 
+}
+
+/* clear button shown as link in date inputs */
+.editable-clear {
+   clear: both;
+   font-size: 0.9em;
+   text-decoration: none;
+   text-align: right;
+}
+
+/* IOS-style clear button for text inputs */
+.editable-clear-x {
+   background: url('../img/clear.png') center center no-repeat;
+   display: block;
+   width: 13px;    
+   height: 13px;
+   position: absolute;
+   opacity: 0.6;
+   z-index: 100;
+   
+   top: 50%;
+   right: 6px;
+   margin-top: -6px;
+   
+}
+
+.editable-clear-x:hover {
+   opacity: 1;
+}
+.editable-container.editable-popup {
+    max-width: none !important; /* without this rule poshytip/tooltip does not stretch */
+}  
+
+.editable-container.popover {
+    width: auto; /* without this rule popover does not stretch */
+}
+
+.editable-container.editable-inline {
+    display: inline-block; 
+    vertical-align: middle;
+    width: auto;
+    /* inline-block emulation for IE7*/
+    zoom: 1; 
+    *display: inline;    
+}
+
+.editable-container.ui-widget {
+   font-size: inherit;  /* jqueryui widget font 1.1em too big, overwrite it */
+}
+.editable-click, 
+a.editable-click, 
+a.editable-click:hover {
+    text-decoration: none;
+    border-bottom: dashed 1px #0088cc;
+}
+
+.editable-click.editable-disabled, 
+a.editable-click.editable-disabled, 
+a.editable-click.editable-disabled:hover {
+   color: #585858;  
+   cursor: default;
+   border-bottom: none;
+}
+
+.editable-empty, .editable-empty:hover, .editable-empty:focus{
+  font-style: italic; 
+  color: #DD1144;  
+  /* border-bottom: none; */
+  text-decoration: none;
+}
+
+.editable-unsaved {
+  font-weight: bold; 
+}
+
+.editable-unsaved:after {
+/*    content: '*'*/
+}
+
+.editable-bg-transition {
+  -webkit-transition: background-color 1400ms ease-out;
+  -moz-transition: background-color 1400ms ease-out;
+  -o-transition: background-color 1400ms ease-out;
+  -ms-transition: background-color 1400ms ease-out;
+  transition: background-color 1400ms ease-out;  
+}
+
+/*see https://github.com/vitalets/x-editable/issues/139 */
+.form-horizontal .editable
+{ 
+    padding-top: 5px;
+    display:inline-block;
+}
+
+
+/*!
+ * Datepicker for Bootstrap
+ *
+ * Copyright 2012 Stefan Petre
+ * Improvements by Andrew Rowls
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+.datepicker {
+  padding: 4px;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+  direction: ltr;
+  /*.dow {
+		border-top: 1px solid #ddd !important;
+	}*/
+
+}
+.datepicker-inline {
+  width: 220px;
+}
+.datepicker.datepicker-rtl {
+  direction: rtl;
+}
+.datepicker.datepicker-rtl table tr td span {
+  float: right;
+}
+.datepicker-dropdown {
+  top: 0;
+  left: 0;
+}
+.datepicker-dropdown:before {
+  content: '';
+  display: inline-block;
+  border-left: 7px solid transparent;
+  border-right: 7px solid transparent;
+  border-bottom: 7px solid #ccc;
+  border-bottom-color: rgba(0, 0, 0, 0.2);
+  position: absolute;
+  top: -7px;
+  left: 6px;
+}
+.datepicker-dropdown:after {
+  content: '';
+  display: inline-block;
+  border-left: 6px solid transparent;
+  border-right: 6px solid transparent;
+  border-bottom: 6px solid #ffffff;
+  position: absolute;
+  top: -6px;
+  left: 7px;
+}
+.datepicker > div {
+  display: none;
+}
+.datepicker.days div.datepicker-days {
+  display: block;
+}
+.datepicker.months div.datepicker-months {
+  display: block;
+}
+.datepicker.years div.datepicker-years {
+  display: block;
+}
+.datepicker table {
+  margin: 0;
+}
+.datepicker td,
+.datepicker th {
+  text-align: center;
+  width: 20px;
+  height: 20px;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+  border: none;
+}
+.table-striped .datepicker table tr td,
+.table-striped .datepicker table tr th {
+  background-color: transparent;
+}
+.datepicker table tr td.day:hover {
+  background: #eeeeee;
+  cursor: pointer;
+}
+.datepicker table tr td.old,
+.datepicker table tr td.new {
+  color: #999999;
+}
+.datepicker table tr td.disabled,
+.datepicker table tr td.disabled:hover {
+  background: none;
+  color: #999999;
+  cursor: default;
+}
+.datepicker table tr td.today,
+.datepicker table tr td.today:hover,
+.datepicker table tr td.today.disabled,
+.datepicker table tr td.today.disabled:hover {
+  background-color: #fde19a;
+  background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
+  background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
+  background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
+  background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
+  background-image: linear-gradient(top, #fdd49a, #fdf59a);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
+  border-color: #fdf59a #fdf59a #fbed50;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #000;
+}
+.datepicker table tr td.today:hover,
+.datepicker table tr td.today:hover:hover,
+.datepicker table tr td.today.disabled:hover,
+.datepicker table tr td.today.disabled:hover:hover,
+.datepicker table tr td.today:active,
+.datepicker table tr td.today:hover:active,
+.datepicker table tr td.today.disabled:active,
+.datepicker table tr td.today.disabled:hover:active,
+.datepicker table tr td.today.active,
+.datepicker table tr td.today:hover.active,
+.datepicker table tr td.today.disabled.active,
+.datepicker table tr td.today.disabled:hover.active,
+.datepicker table tr td.today.disabled,
+.datepicker table tr td.today:hover.disabled,
+.datepicker table tr td.today.disabled.disabled,
+.datepicker table tr td.today.disabled:hover.disabled,
+.datepicker table tr td.today[disabled],
+.datepicker table tr td.today:hover[disabled],
+.datepicker table tr td.today.disabled[disabled],
+.datepicker table tr td.today.disabled:hover[disabled] {
+  background-color: #fdf59a;
+}
+.datepicker table tr td.today:active,
+.datepicker table tr td.today:hover:active,
+.datepicker table tr td.today.disabled:active,
+.datepicker table tr td.today.disabled:hover:active,
+.datepicker table tr td.today.active,
+.datepicker table tr td.today:hover.active,
+.datepicker table tr td.today.disabled.active,
+.datepicker table tr td.today.disabled:hover.active {
+  background-color: #fbf069 \9;
+}
+.datepicker table tr td.today:hover:hover {
+  color: #000;
+}
+.datepicker table tr td.today.active:hover {
+  color: #fff;
+}
+.datepicker table tr td.range,
+.datepicker table tr td.range:hover,
+.datepicker table tr td.range.disabled,
+.datepicker table tr td.range.disabled:hover {
+  background: #eeeeee;
+  -webkit-border-radius: 0;
+  -moz-border-radius: 0;
+  border-radius: 0;
+}
+.datepicker table tr td.range.today,
+.datepicker table tr td.range.today:hover,
+.datepicker table tr td.range.today.disabled,
+.datepicker table tr td.range.today.disabled:hover {
+  background-color: #f3d17a;
+  background-image: -moz-linear-gradient(top, #f3c17a, #f3e97a);
+  background-image: -ms-linear-gradient(top, #f3c17a, #f3e97a);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f3c17a), to(#f3e97a));
+  background-image: -webkit-linear-gradient(top, #f3c17a, #f3e97a);
+  background-image: -o-linear-gradient(top, #f3c17a, #f3e97a);
+  background-image: linear-gradient(top, #f3c17a, #f3e97a);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3c17a', endColorstr='#f3e97a', GradientType=0);
+  border-color: #f3e97a #f3e97a #edde34;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  -webkit-border-radius: 0;
+  -moz-border-radius: 0;
+  border-radius: 0;
+}
+.datepicker table tr td.range.today:hover,
+.datepicker table tr td.range.today:hover:hover,
+.datepicker table tr td.range.today.disabled:hover,
+.datepicker table tr td.range.today.disabled:hover:hover,
+.datepicker table tr td.range.today:active,
+.datepicker table tr td.range.today:hover:active,
+.datepicker table tr td.range.today.disabled:active,
+.datepicker table tr td.range.today.disabled:hover:active,
+.datepicker table tr td.range.today.active,
+.datepicker table tr td.range.today:hover.active,
+.datepicker table tr td.range.today.disabled.active,
+.datepicker table tr td.range.today.disabled:hover.active,
+.datepicker table tr td.range.today.disabled,
+.datepicker table tr td.range.today:hover.disabled,
+.datepicker table tr td.range.today.disabled.disabled,
+.datepicker table tr td.range.today.disabled:hover.disabled,
+.datepicker table tr td.range.today[disabled],
+.datepicker table tr td.range.today:hover[disabled],
+.datepicker table tr td.range.today.disabled[disabled],
+.datepicker table tr td.range.today.disabled:hover[disabled] {
+  background-color: #f3e97a;
+}
+.datepicker table tr td.range.today:active,
+.datepicker table tr td.range.today:hover:active,
+.datepicker table tr td.range.today.disabled:active,
+.datepicker table tr td.range.today.disabled:hover:active,
+.datepicker table tr td.range.today.active,
+.datepicker table tr td.range.today:hover.active,
+.datepicker table tr td.range.today.disabled.active,
+.datepicker table tr td.range.today.disabled:hover.active {
+  background-color: #efe24b \9;
+}
+.datepicker table tr td.selected,
+.datepicker table tr td.selected:hover,
+.datepicker table tr td.selected.disabled,
+.datepicker table tr td.selected.disabled:hover {
+  background-color: #9e9e9e;
+  background-image: -moz-linear-gradient(top, #b3b3b3, #808080);
+  background-image: -ms-linear-gradient(top, #b3b3b3, #808080);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#b3b3b3), to(#808080));
+  background-image: -webkit-linear-gradient(top, #b3b3b3, #808080);
+  background-image: -o-linear-gradient(top, #b3b3b3, #808080);
+  background-image: linear-gradient(top, #b3b3b3, #808080);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#808080', GradientType=0);
+  border-color: #808080 #808080 #595959;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #fff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.datepicker table tr td.selected:hover,
+.datepicker table tr td.selected:hover:hover,
+.datepicker table tr td.selected.disabled:hover,
+.datepicker table tr td.selected.disabled:hover:hover,
+.datepicker table tr td.selected:active,
+.datepicker table tr td.selected:hover:active,
+.datepicker table tr td.selected.disabled:active,
+.datepicker table tr td.selected.disabled:hover:active,
+.datepicker table tr td.selected.active,
+.datepicker table tr td.selected:hover.active,
+.datepicker table tr td.selected.disabled.active,
+.datepicker table tr td.selected.disabled:hover.active,
+.datepicker table tr td.selected.disabled,
+.datepicker table tr td.selected:hover.disabled,
+.datepicker table tr td.selected.disabled.disabled,
+.datepicker table tr td.selected.disabled:hover.disabled,
+.datepicker table tr td.selected[disabled],
+.datepicker table tr td.selected:hover[disabled],
+.datepicker table tr td.selected.disabled[disabled],
+.datepicker table tr td.selected.disabled:hover[disabled] {
+  background-color: #808080;
+}
+.datepicker table tr td.selected:active,
+.datepicker table tr td.selected:hover:active,
+.datepicker table tr td.selected.disabled:active,
+.datepicker table tr td.selected.disabled:hover:active,
+.datepicker table tr td.selected.active,
+.datepicker table tr td.selected:hover.active,
+.datepicker table tr td.selected.disabled.active,
+.datepicker table tr td.selected.disabled:hover.active {
+  background-color: #666666 \9;
+}
+.datepicker table tr td.active,
+.datepicker table tr td.active:hover,
+.datepicker table tr td.active.disabled,
+.datepicker table tr td.active.disabled:hover {
+  background-color: #006dcc;
+  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
+  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
+  background-image: linear-gradient(top, #0088cc, #0044cc);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
+  border-color: #0044cc #0044cc #002a80;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #fff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.datepicker table tr td.active:hover,
+.datepicker table tr td.active:hover:hover,
+.datepicker table tr td.active.disabled:hover,
+.datepicker table tr td.active.disabled:hover:hover,
+.datepicker table tr td.active:active,
+.datepicker table tr td.active:hover:active,
+.datepicker table tr td.active.disabled:active,
+.datepicker table tr td.active.disabled:hover:active,
+.datepicker table tr td.active.active,
+.datepicker table tr td.active:hover.active,
+.datepicker table tr td.active.disabled.active,
+.datepicker table tr td.active.disabled:hover.active,
+.datepicker table tr td.active.disabled,
+.datepicker table tr td.active:hover.disabled,
+.datepicker table tr td.active.disabled.disabled,
+.datepicker table tr td.active.disabled:hover.disabled,
+.datepicker table tr td.active[disabled],
+.datepicker table tr td.active:hover[disabled],
+.datepicker table tr td.active.disabled[disabled],
+.datepicker table tr td.active.disabled:hover[disabled] {
+  background-color: #0044cc;
+}
+.datepicker table tr td.active:active,
+.datepicker table tr td.active:hover:active,
+.datepicker table tr td.active.disabled:active,
+.datepicker table tr td.active.disabled:hover:active,
+.datepicker table tr td.active.active,
+.datepicker table tr td.active:hover.active,
+.datepicker table tr td.active.disabled.active,
+.datepicker table tr td.active.disabled:hover.active {
+  background-color: #003399 \9;
+}
+.datepicker table tr td span {
+  display: block;
+  width: 23%;
+  height: 54px;
+  line-height: 54px;
+  float: left;
+  margin: 1%;
+  cursor: pointer;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+}
+.datepicker table tr td span:hover {
+  background: #eeeeee;
+}
+.datepicker table tr td span.disabled,
+.datepicker table tr td span.disabled:hover {
+  background: none;
+  color: #999999;
+  cursor: default;
+}
+.datepicker table tr td span.active,
+.datepicker table tr td span.active:hover,
+.datepicker table tr td span.active.disabled,
+.datepicker table tr td span.active.disabled:hover {
+  background-color: #006dcc;
+  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
+  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
+  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
+  background-image: linear-gradient(top, #0088cc, #0044cc);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
+  border-color: #0044cc #0044cc #002a80;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #fff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.datepicker table tr td span.active:hover,
+.datepicker table tr td span.active:hover:hover,
+.datepicker table tr td span.active.disabled:hover,
+.datepicker table tr td span.active.disabled:hover:hover,
+.datepicker table tr td span.active:active,
+.datepicker table tr td span.active:hover:active,
+.datepicker table tr td span.active.disabled:active,
+.datepicker table tr td span.active.disabled:hover:active,
+.datepicker table tr td span.active.active,
+.datepicker table tr td span.active:hover.active,
+.datepicker table tr td span.active.disabled.active,
+.datepicker table tr td span.active.disabled:hover.active,
+.datepicker table tr td span.active.disabled,
+.datepicker table tr td span.active:hover.disabled,
+.datepicker table tr td span.active.disabled.disabled,
+.datepicker table tr td span.active.disabled:hover.disabled,
+.datepicker table tr td span.active[disabled],
+.datepicker table tr td span.active:hover[disabled],
+.datepicker table tr td span.active.disabled[disabled],
+.datepicker table tr td span.active.disabled:hover[disabled] {
+  background-color: #0044cc;
+}
+.datepicker table tr td span.active:active,
+.datepicker table tr td span.active:hover:active,
+.datepicker table tr td span.active.disabled:active,
+.datepicker table tr td span.active.disabled:hover:active,
+.datepicker table tr td span.active.active,
+.datepicker table tr td span.active:hover.active,
+.datepicker table tr td span.active.disabled.active,
+.datepicker table tr td span.active.disabled:hover.active {
+  background-color: #003399 \9;
+}
+.datepicker table tr td span.old,
+.datepicker table tr td span.new {
+  color: #999999;
+}
+.datepicker th.datepicker-switch {
+  width: 145px;
+}
+.datepicker thead tr:first-child th,
+.datepicker tfoot tr th {
+  cursor: pointer;
+}
+.datepicker thead tr:first-child th:hover,
+.datepicker tfoot tr th:hover {
+  background: #eeeeee;
+}
+.datepicker .cw {
+  font-size: 10px;
+  width: 12px;
+  padding: 0 2px 0 5px;
+  vertical-align: middle;
+}
+.datepicker thead tr:first-child th.cw {
+  cursor: default;
+  background-color: transparent;
+}
+.input-append.date .add-on i,
+.input-prepend.date .add-on i {
+  display: block;
+  cursor: pointer;
+  width: 16px;
+  height: 16px;
+}
+.input-daterange input {
+  text-align: center;
+}
+.input-daterange input:first-child {
+  -webkit-border-radius: 3px 0 0 3px;
+  -moz-border-radius: 3px 0 0 3px;
+  border-radius: 3px 0 0 3px;
+}
+.input-daterange input:last-child {
+  -webkit-border-radius: 0 3px 3px 0;
+  -moz-border-radius: 0 3px 3px 0;
+  border-radius: 0 3px 3px 0;
+}
+.input-daterange .add-on {
+  display: inline-block;
+  width: auto;
+  min-width: 16px;
+  height: 18px;
+  padding: 4px 5px;
+  font-weight: normal;
+  line-height: 18px;
+  text-align: center;
+  text-shadow: 0 1px 0 #ffffff;
+  vertical-align: middle;
+  background-color: #eeeeee;
+  border: 1px solid #ccc;
+  margin-left: -5px;
+  margin-right: -5px;
+}

File diff suppressed because it is too large
+ 5967 - 0
ilm/iVProgH5/0.0.2/ivprog-html/css/bootstrap.css


File diff suppressed because it is too large
+ 11 - 0
ilm/iVProgH5/0.0.2/ivprog-html/css/bootstrap.min.css


File diff suppressed because it is too large
+ 1338 - 0
ilm/iVProgH5/0.0.2/ivprog-html/css/font-awesome.css


File diff suppressed because it is too large
+ 4 - 0
ilm/iVProgH5/0.0.2/ivprog-html/css/font-awesome.min.css


+ 213 - 0
ilm/iVProgH5/0.0.2/ivprog-html/css/ivprog.css

@@ -0,0 +1,213 @@
+.header{
+  position: relative;
+  padding: 10px 0;
+  color: #fff;
+  text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075);
+  background: #001373; /* Old browsers */
+  background: -moz-linear-gradient(45deg,  #001373 0%, #33536D 100%); /* FF3.6+ */
+  background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#001373), color-stop(100%,#33536D)); /* Chrome,Safari4+ */
+  background: -webkit-linear-gradient(45deg,  #001373 0%,#33536D 100%); /* Chrome10+,Safari5.1+ */
+  background: -o-linear-gradient(45deg,  #001373 0%,#33536D 100%); /* Opera 11.10+ */
+  background: -ms-linear-gradient(45deg,  #001373 0%,#33536D 100%); /* IE10+ */
+  background: linear-gradient(45deg,  #001373 0%,#33536D 100%); /* W3C */
+  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#001373', endColorstr='#33536D',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
+  -webkit-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
+     -moz-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
+          box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
+
+}
+/* Gradiente: #020031 -> #001373 e #6d3353 -> #33536D */
+
+.header .container {
+  position: relative;
+  z-index: 2;
+}
+.header:after {
+  content: '';
+  display: block;
+  position: absolute;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  background: url(../img/bs-docs-masthead-pattern.png) repeat center center;
+  opacity: .4;
+}
+
+.header h1{
+  margin: 0 0 0 30px;
+}
+
+
+.header .i18n {
+  position: absolute;
+  top: 10px;
+  right: 10px;
+  margin-top: 0 !important;
+  padding: 15px;
+  height: auto !important;
+  overflow: hidden; /* clearfix */
+  font-size: 13px !important;
+  line-height: 16px !important;
+  background: #222 !important; /* reset image and color in one line */
+  background: rgba(0,0,0,.5) !important;
+  border: 0 !important;
+  border-radius: 4px;
+  box-shadow: inset 0 3px 5px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.1);
+  z-index: 1000;
+}
+
+.instrs{
+  list-style: none;
+  margin: 0;
+  padding: 0;
+}
+
+
+
+
+.select-variable-value{
+  display: inline-block;
+  cursor: pointer;
+}
+.need-to-set > a{
+  border: 1px dashed #000;
+}
+.select-variable-value > a{
+  padding: 4px;
+}
+.select-variable-value > a:hover{
+  background: yellow;
+}
+.select-variable-value a:hover{
+  text-decoration: none;
+}
+
+
+
+.edit-in-place span span.editing {
+  cursor: pointer;
+  border: 1px dashed #000;
+  padding: 4px;
+}
+
+.edit-in-place input, .edit-in-place select {
+  display: none;
+}
+span.normal{
+  font-weight: bold;
+  color: blue;
+}
+a.normal{
+  font-weight: bold;
+  color: blue; 
+}
+.edit-in-place.active span.normal {
+  display: none;
+}
+
+.edit-in-place.active input, .edit-in-place.active select {
+  display: inline-block;
+}
+.input-edit{
+  display: inline;
+  width: 80px;
+}
+
+.over{
+  background: yellow;
+}
+
+.ivprog{
+  
+}
+.ivprog h5{
+  font-family: arial;
+  font-size: 12px;
+  text-transform: uppercase;
+  padding: 0 10px 0 0;
+  margin: 0 0 0 5px;
+}
+.ivprog .variables{
+  background: #EFEFEF;
+  -webkit-border-radius: 5px;
+  -moz-border-radius: 5px;
+  border-radius: 5px;
+  margin: 10px 0;
+  padding: 3px 10px 10px 3px;
+}
+.ivprog .variables .var{
+  background: #FFFFFF;
+  -webkit-border-radius: 5px;
+  -moz-border-radius: 5px;
+  border-radius: 5px;
+  margin: 5px;
+  padding: 3px 10px;
+  display: block;
+  float: left;
+}
+.ivprog .parameters{
+  background: #EFEFEF;
+  -webkit-border-radius: 5px;
+  -moz-border-radius: 5px;
+  border-radius: 5px;
+  margin: 10px 0;
+  padding: 3px 10px 10px 3px;
+}
+.ivprog .parameters .var{
+  background: #FFFFFF;
+  -webkit-border-radius: 5px;
+  -moz-border-radius: 5px;
+  border-radius: 5px;
+  margin: 5px;
+  padding: 3px 10px;
+  display: block;
+  float: left;
+}
+
+.source, .output{
+  background: #6E6E6E;
+  margin: 5px;
+  font-family: "Lucida Console", Monaco, monospace;
+  font-weight: normal;
+  -webkit-border-radius: 5px;
+  -moz-border-radius: 5px;
+  border-radius: 5px;
+  margin: 5px;
+  padding: 6px 20px;
+  color: #FFF;
+}
+
+.ivprog .btn-delete{
+  position: absolute;
+  top: 5px;
+  right: 5px;
+}
+.ivprog .instr{
+  position: relative;
+  background: #EFEFEF;
+  -webkit-border-radius: 5px;
+  -moz-border-radius: 5px;
+  border-radius: 5px;
+  margin: 10px 0;
+  padding: 10px;
+  border: 1px solid #AEAEAE;
+}
+
+.ivprog .node-with-error{
+  border: 2px solid red;
+  padding: 4px 0;
+}
+
+.handle{
+  height: 20px;
+  width: 20px;
+  margin: 0px 5px 20px -5px;
+  float: left;
+  text-align: center;
+  background: #EFEFEF;
+  cursor: move;
+  -webkit-border-radius: 5px;
+  -moz-border-radius: 5px;
+  border-radius: 5px;
+}

+ 32 - 0
ilm/iVProgH5/0.0.2/ivprog-html/embed.html

@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html ng-app="ivprog">
+  <head>
+    <title>iVProg - versão HTML</title>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen" />
+    <link href="css/font-awesome.css" rel="stylesheet" media="screen" />
+    <link href="css/bootstrap-editable.css" rel="stylesheet" media="screen" />
+    <link href="css/ivprog.css" rel="stylesheet" media="screen" />
+  </head>
+  <body>
+    <h1>Embed example to be used in iAssign:</h1>
+    <input type="button" class="btn" value="call getAnswer()" id="getAnswer" />
+    <input type="button" class="btn" value="call getEvaluation()" id="getEvaluation" />
+    <br>
+    <iframe src="main.html" style="width: 100%; height: 600px;" id="ivprog" name="ivprog"></iframe>
+    
+
+    <script src="js/jquery.1.8.3.js"></script>
+    <script>
+        $(function(){
+            $("#getAnswer").click(function(){
+                alert(window.frames.ivprog.getAnswer());
+            });
+            $("#getEvaluation").click(function(){
+                alert(window.frames.ivprog.getEvaluation());
+            });
+        });
+    </script>
+  </body>
+</html>

BIN
ilm/iVProgH5/0.0.2/ivprog-html/fonts/FontAwesome.otf


BIN
ilm/iVProgH5/0.0.2/ivprog-html/fonts/fontawesome-webfont.eot


File diff suppressed because it is too large
+ 414 - 0
ilm/iVProgH5/0.0.2/ivprog-html/fonts/fontawesome-webfont.svg


BIN
ilm/iVProgH5/0.0.2/ivprog-html/fonts/fontawesome-webfont.ttf


BIN
ilm/iVProgH5/0.0.2/ivprog-html/fonts/fontawesome-webfont.woff


BIN
ilm/iVProgH5/0.0.2/ivprog-html/fonts/glyphicons-halflings-regular.eot


File diff suppressed because it is too large
+ 229 - 0
ilm/iVProgH5/0.0.2/ivprog-html/fonts/glyphicons-halflings-regular.svg


BIN
ilm/iVProgH5/0.0.2/ivprog-html/fonts/glyphicons-halflings-regular.ttf


BIN
ilm/iVProgH5/0.0.2/ivprog-html/fonts/glyphicons-halflings-regular.woff


+ 16 - 0
ilm/iVProgH5/0.0.2/ivprog-html/get.php

@@ -0,0 +1,16 @@
+<?
+	session_start();
+	$id = $_GET["id"];
+	$src = $_SESSION["src_".$id];
+
+	header('Content-Description: File Transfer');
+	header('Content-Disposition: attachment; filename="ivprog_'.$id.'.ivp"');
+	header('Content-Type: application/octet-stream');
+	header('Content-Transfer-Encoding: binary');
+	header('Content-Length: ' . strlen($src));
+	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+	header('Pragma: public');
+	header('Expires: 0');
+
+	echo $src;
+

+ 66 - 0
ilm/iVProgH5/0.0.2/ivprog-html/gravar.php

@@ -0,0 +1,66 @@
+<?php
+
+/*
+ * LInE - Laboratorio de Informatica na Educacao
+ * http://line.ime.usp.br
+ * 
+ * Programa para simular a gravar de um conteudo de um particular iMA (o iVProgH5).
+ * Na verdade aqui apenas sera' listado na tela o conteudo do arquivo.
+ * 
+ */
+
+session_start();
+?>
+
+
+<!DOCTYPE html>
+<html ng-app="ivprog">
+  <head>
+  <title>iVProgH5 : Visual Programming (LInE-IME-USP)</title>
+  <meta charset="utf-8" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen" />
+    <link href="css/ivprog.css" rel="stylesheet" media="screen" />
+</head>
+
+<body>
+    <div class="header">
+      <h1><img src="img/logo_ivprog.png" title="iVProg" /></h1>
+    </div>
+
+    <h2>&nbsp;iVProg : Visual Programming (LInE-IME-USP)</h2>
+
+    <a href="http://www.usp.br/line" title="Uma das paginas do LInE">LInE</a>.
+    <a href="https://github.com/LInE-IME-USP" title="LInE no GitHub">Software educacional livre</a>.
+    <a href="http://www.usp.br/line/wp" title="Prototipo ambiente LInE">Interatividade na Internet para aprendizagem</a>.
+
+<?php
+print "
+<h3>Resultado de envia pelo iVProgH5</h3>
+
+Abaixo o codigo enviado pelo iVProgH5.
+Se copia-lo em um arquivo de nome 'exemplo.ivph' sob o diretorio './exerc' e copiar o 'index.html' trocando a linha com
+<pre>src=\"main.html?iLM_PARAM_Assignment=./exerc/exerc_ivprogh5_somar2inteiros_digitados.ivph& ... \"</pre>
+por
+<pre>src=\"main.html?iLM_PARAM_Assignment=./exerc/exemplo.ivph& ... \"</pre>
+sua solucao sera aberta no iVProgH5.
+<br/><br/>\n";
+if (isset($_POST["iLM_PARAM_ArchiveContent"])) {
+  print "Resultado da avaliacao automatica: <b>" . $_POST["iLM_PARAM_ActivityEvaluation"] . "</b><br/><br/>\n";
+  $src = $_POST["iLM_PARAM_ArchiveContent"];
+  $id = time();
+  $_SESSION["src_".$id] = $src;
+  print "<pre>" . $src . "</pre>";
+  }
+else
+ print "ERRO: variavel POST 'iLM_PARAM_ArchiveContent' nao foi definida ou esta vazia!";
+?>
+
+  <div class="foot"><center>
+   <a href="http://www.ime.usp.br/line">LInE</a> |
+   <a href="http://www.matematica.br">iM&aacute;tica</a> |
+   <a href="http://www.usp.br/line/mooc">MOOC</a>
+  </center></div>
+
+  </body>
+</html>

BIN
ilm/iVProgH5/0.0.2/ivprog-html/img/att.png


BIN
ilm/iVProgH5/0.0.2/ivprog-html/img/autochecking.png


BIN
ilm/iVProgH5/0.0.2/ivprog-html/img/botao_rodar.png


BIN
ilm/iVProgH5/0.0.2/ivprog-html/img/bs-docs-masthead-pattern.png


BIN
ilm/iVProgH5/0.0.2/ivprog-html/img/download.png


+ 0 - 0
ilm/iVProgH5/0.0.2/ivprog-html/img/expand_down.png


Some files were not shown because too many files changed in this diff