Browse Source

Commit inicial

Igor 6 years ago
commit
1e1ba88ac3
25 changed files with 3627 additions and 0 deletions
  1. 51 0
      README.txt
  2. 530 0
      css/bootstrap.css
  3. 72 0
      db/access.php
  4. 26 0
      db/install.php
  5. 62 0
      db/install.xml
  6. 24 0
      db/log.php
  7. 16 0
      db/uninstall.php
  8. 149 0
      db/upgrade.php
  9. 19 0
      grade.php
  10. 74 0
      index.php
  11. 4 0
      js/jquery.js
  12. 40 0
      lang/en/nasatlx.php
  13. 380 0
      lib.php
  14. 24 0
      locallib.php
  15. 63 0
      mod_form.php
  16. 85 0
      nasatlx.php
  17. 199 0
      nasatlx_leo_mac115_2015.php
  18. 85 0
      nasatlx_pesq.php
  19. 63 0
      nasatlx_romenig.php
  20. BIN
      pix/icon.gif
  21. 1 0
      teste.php
  22. 20 0
      version.php
  23. 524 0
      view.php
  24. 571 0
      view.php-
  25. 545 0
      view_2014_04_21.php

+ 51 - 0
README.txt

@@ -0,0 +1,51 @@
+
+LInE - http://www.ime.usp.br/line
+
+The following steps should get you up and running with
+this module template code.
+
+* DO NOT PANIC!
+
+* Unzip the archive and read this file
+
+* Rename the nasatlx/ folder to the name of your module (eg "widget").
+  The module folder MUST be lower case and can't contain underscores. You should check the CVS contrib
+  area at http://cvs.moodle.org/contrib/plugins/mod/ to make sure that
+  your name is not already used by an other module. Registering the plugin
+  name @ http://moodle.org/plugins will secure it for you.
+
+* Edit all the files in this directory and its subdirectories and change
+  all the instances of the string "nasatlx" to your module name
+  (eg "widget"). If you are using Linux, you can use the following command
+  $ find . -type f -exec sed -i 's/nasatlx/widget/g' {} \;
+  
+  On a mac, use:
+  $ find . -type f -exec sed -i '' 's/nasatlx/widget/g' {} \;
+
+* Rename the file lang/en/nasatlx.php to lang/en/widget.php
+  where "widget" is the name of your module
+
+* Place the widget folder into the /mod folder of the moodle
+  directory.
+
+* Go to Settings > Site Administration > Development > XMLDB editor
+  and modify the module's tables.
+  Make sure, that the web server has write-access to the db/ folder.
+  You need at least one table, even if your module doesn't use it.
+
+* Modify version.php and set the initial version of you module.
+
+* Visit Settings > Site Administration > Notifications, you should find
+  the module's tables successfully created
+
+* Go to Site Administration > Plugins > Activity modules > Manage activities
+  and you should find that this nasatlx has been added to the list of
+  installed modules.
+
+* You may now proceed to run your own code in an attempt to develop
+  your module. You will probably want to modify mod_form.php and view.php
+  as a first step. Check db/access.php to add capabilities.
+
+We encourage you to share your code and experience - visit http://moodle.org
+
+Good luck!

+ 530 - 0
css/bootstrap.css

@@ -0,0 +1,530 @@
+/*!
+ * Bootstrap v3.1.1 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
+button,
+input,
+optgroup,
+select,
+textarea {
+  color: inherit;
+  font: inherit;
+  margin: 0;
+}
+button {
+  overflow: visible;
+}
+button,
+select {
+  text-transform: none;
+}
+button,
+html input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+  -webkit-appearance: button;
+  cursor: pointer;
+}
+button[disabled],
+html input[disabled] {
+  cursor: default;
+}
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+  border: 0;
+  padding: 0;
+}
+input {
+  line-height: normal;
+}
+input[type="checkbox"],
+input[type="radio"] {
+  box-sizing: border-box;
+  padding: 0;
+}
+input[type="number"]::-webkit-inner-spin-button,
+input[type="number"]::-webkit-outer-spin-button {
+  height: auto;
+}
+input[type="search"] {
+  -webkit-appearance: textfield;
+  -moz-box-sizing: content-box;
+  -webkit-box-sizing: content-box;
+  box-sizing: content-box;
+}
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+  -webkit-appearance: none;
+}
+fieldset {
+  border: 1px solid #c0c0c0;
+  margin: 0 2px;
+  padding: 0.35em 0.625em 0.75em;
+}
+legend {
+  border: 0;
+  padding: 0;
+}
+textarea {
+  overflow: auto;
+}
+optgroup {
+  font-weight: bold;
+}
+* {
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+}
+*:before,
+*:after {
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+}
+input,
+button,
+select,
+textarea {
+  font-family: inherit;
+  font-size: inherit;
+  line-height: inherit;
+}
+.btn {
+  display: inline-block;
+  margin-bottom: 0;
+  font-weight: normal;
+  text-align: center;
+  vertical-align: middle;
+  cursor: pointer;
+  background-image: none;
+  border: 1px solid transparent;
+  white-space: nowrap;
+  padding: 6px 12px;
+  font-size: 14px;
+  line-height: 1.42857143;
+  border-radius: 4px;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+.btn:focus,
+.btn:active:focus,
+.btn.active:focus {
+  outline: thin dotted;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+.btn:hover,
+.btn:focus {
+  color: #333333;
+  text-decoration: none;
+}
+.btn:active,
+.btn.active {
+  outline: 0;
+  background-image: none;
+  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+}
+.btn.disabled,
+.btn[disabled],
+fieldset[disabled] .btn {
+  cursor: not-allowed;
+  pointer-events: none;
+  opacity: 0.65;
+  filter: alpha(opacity=65);
+  -webkit-box-shadow: none;
+  box-shadow: none;
+}
+.btn-default {
+  color: #333333;
+  background-color: #ffffff;
+  border-color: #cccccc;
+}
+.btn-default:hover,
+.btn-default:focus,
+.btn-default:active,
+.btn-default.active,
+.open .dropdown-toggle.btn-default {
+  color: #333333;
+  background-color: #ebebeb;
+  border-color: #adadad;
+}
+.btn-default:active,
+.btn-default.active,
+.open .dropdown-toggle.btn-default {
+  background-image: none;
+}
+.btn-default.disabled,
+.btn-default[disabled],
+fieldset[disabled] .btn-default,
+.btn-default.disabled:hover,
+.btn-default[disabled]:hover,
+fieldset[disabled] .btn-default:hover,
+.btn-default.disabled:focus,
+.btn-default[disabled]:focus,
+fieldset[disabled] .btn-default:focus,
+.btn-default.disabled:active,
+.btn-default[disabled]:active,
+fieldset[disabled] .btn-default:active,
+.btn-default.disabled.active,
+.btn-default[disabled].active,
+fieldset[disabled] .btn-default.active {
+  background-color: #ffffff;
+  border-color: #cccccc;
+}
+.btn-default .badge {
+  color: #ffffff;
+  background-color: #333333;
+}
+.btn-primary {
+  color: #ffffff;
+  background-color: #428bca;
+  border-color: #357ebd;
+}
+.btn-primary:hover,
+.btn-primary:focus,
+.btn-primary:active,
+.btn-primary.active,
+.open .dropdown-toggle.btn-primary {
+  color: #ffffff;
+  background-color: #3276b1;
+  border-color: #285e8e;
+}
+.btn-primary:active,
+.btn-primary.active,
+.open .dropdown-toggle.btn-primary {
+  background-image: none;
+}
+.btn-primary.disabled,
+.btn-primary[disabled],
+fieldset[disabled] .btn-primary,
+.btn-primary.disabled:hover,
+.btn-primary[disabled]:hover,
+fieldset[disabled] .btn-primary:hover,
+.btn-primary.disabled:focus,
+.btn-primary[disabled]:focus,
+fieldset[disabled] .btn-primary:focus,
+.btn-primary.disabled:active,
+.btn-primary[disabled]:active,
+fieldset[disabled] .btn-primary:active,
+.btn-primary.disabled.active,
+.btn-primary[disabled].active,
+fieldset[disabled] .btn-primary.active {
+  background-color: #428bca;
+  border-color: #357ebd;
+}
+.btn-primary .badge {
+  color: #428bca;
+  background-color: #ffffff;
+}
+.btn-success {
+  color: #ffffff;
+  background-color: #5cb85c;
+  border-color: #4cae4c;
+}
+.btn-success:hover,
+.btn-success:focus,
+.btn-success:active,
+.btn-success.active,
+.open .dropdown-toggle.btn-success {
+  color: #ffffff;
+  background-color: #47a447;
+  border-color: #398439;
+}
+.btn-success:active,
+.btn-success.active,
+.open .dropdown-toggle.btn-success {
+  background-image: none;
+}
+.btn-success.disabled,
+.btn-success[disabled],
+fieldset[disabled] .btn-success,
+.btn-success.disabled:hover,
+.btn-success[disabled]:hover,
+fieldset[disabled] .btn-success:hover,
+.btn-success.disabled:focus,
+.btn-success[disabled]:focus,
+fieldset[disabled] .btn-success:focus,
+.btn-success.disabled:active,
+.btn-success[disabled]:active,
+fieldset[disabled] .btn-success:active,
+.btn-success.disabled.active,
+.btn-success[disabled].active,
+fieldset[disabled] .btn-success.active {
+  background-color: #5cb85c;
+  border-color: #4cae4c;
+}
+.btn-success .badge {
+  color: #5cb85c;
+  background-color: #ffffff;
+}
+.btn-info {
+  color: #ffffff;
+  background-color: #5bc0de;
+  border-color: #46b8da;
+}
+.btn-info:hover,
+.btn-info:focus,
+.btn-info:active,
+.btn-info.active,
+.open .dropdown-toggle.btn-info {
+  color: #ffffff;
+  background-color: #39b3d7;
+  border-color: #269abc;
+}
+.btn-info:active,
+.btn-info.active,
+.open .dropdown-toggle.btn-info {
+  background-image: none;
+}
+.btn-info.disabled,
+.btn-info[disabled],
+fieldset[disabled] .btn-info,
+.btn-info.disabled:hover,
+.btn-info[disabled]:hover,
+fieldset[disabled] .btn-info:hover,
+.btn-info.disabled:focus,
+.btn-info[disabled]:focus,
+fieldset[disabled] .btn-info:focus,
+.btn-info.disabled:active,
+.btn-info[disabled]:active,
+fieldset[disabled] .btn-info:active,
+.btn-info.disabled.active,
+.btn-info[disabled].active,
+fieldset[disabled] .btn-info.active {
+  background-color: #5bc0de;
+  border-color: #46b8da;
+}
+.btn-info .badge {
+  color: #5bc0de;
+  background-color: #ffffff;
+}
+.btn-warning {
+  color: #ffffff;
+  background-color: #f0ad4e;
+  border-color: #eea236;
+}
+.btn-warning:hover,
+.btn-warning:focus,
+.btn-warning:active,
+.btn-warning.active,
+.open .dropdown-toggle.btn-warning {
+  color: #ffffff;
+  background-color: #ed9c28;
+  border-color: #d58512;
+}
+.btn-warning:active,
+.btn-warning.active,
+.open .dropdown-toggle.btn-warning {
+  background-image: none;
+}
+.btn-warning.disabled,
+.btn-warning[disabled],
+fieldset[disabled] .btn-warning,
+.btn-warning.disabled:hover,
+.btn-warning[disabled]:hover,
+fieldset[disabled] .btn-warning:hover,
+.btn-warning.disabled:focus,
+.btn-warning[disabled]:focus,
+fieldset[disabled] .btn-warning:focus,
+.btn-warning.disabled:active,
+.btn-warning[disabled]:active,
+fieldset[disabled] .btn-warning:active,
+.btn-warning.disabled.active,
+.btn-warning[disabled].active,
+fieldset[disabled] .btn-warning.active {
+  background-color: #f0ad4e;
+  border-color: #eea236;
+}
+.btn-warning .badge {
+  color: #f0ad4e;
+  background-color: #ffffff;
+}
+.btn-danger {
+  color: #ffffff;
+  background-color: #d9534f;
+  border-color: #d43f3a;
+}
+.btn-danger:hover,
+.btn-danger:focus,
+.btn-danger:active,
+.btn-danger.active,
+.open .dropdown-toggle.btn-danger {
+  color: #ffffff;
+  background-color: #d2322d;
+  border-color: #ac2925;
+}
+.btn-danger:active,
+.btn-danger.active,
+.open .dropdown-toggle.btn-danger {
+  background-image: none;
+}
+.btn-danger.disabled,
+.btn-danger[disabled],
+fieldset[disabled] .btn-danger,
+.btn-danger.disabled:hover,
+.btn-danger[disabled]:hover,
+fieldset[disabled] .btn-danger:hover,
+.btn-danger.disabled:focus,
+.btn-danger[disabled]:focus,
+fieldset[disabled] .btn-danger:focus,
+.btn-danger.disabled:active,
+.btn-danger[disabled]:active,
+fieldset[disabled] .btn-danger:active,
+.btn-danger.disabled.active,
+.btn-danger[disabled].active,
+fieldset[disabled] .btn-danger.active {
+  background-color: #d9534f;
+  border-color: #d43f3a;
+}
+.btn-danger .badge {
+  color: #d9534f;
+  background-color: #ffffff;
+}
+.btn-link {
+  color: #428bca;
+  font-weight: normal;
+  cursor: pointer;
+  border-radius: 0;
+}
+.btn-link,
+.btn-link:active,
+.btn-link[disabled],
+fieldset[disabled] .btn-link {
+  background-color: transparent;
+  -webkit-box-shadow: none;
+  box-shadow: none;
+}
+.btn-link,
+.btn-link:hover,
+.btn-link:focus,
+.btn-link:active {
+  border-color: transparent;
+}
+.btn-link:hover,
+.btn-link:focus {
+  color: #2a6496;
+  text-decoration: underline;
+  background-color: transparent;
+}
+.btn-link[disabled]:hover,
+fieldset[disabled] .btn-link:hover,
+.btn-link[disabled]:focus,
+fieldset[disabled] .btn-link:focus {
+  color: #999999;
+  text-decoration: none;
+}
+.btn-lg {
+  padding: 10px 16px;
+  font-size: 18px;
+  line-height: 1.33;
+  border-radius: 6px;
+}
+.btn-sm {
+  padding: 5px 10px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+.btn-xs {
+  padding: 1px 5px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+.btn-block {
+  display: block;
+  width: 100%;
+  padding-left: 0;
+  padding-right: 0;
+}
+.btn-block + .btn-block {
+  margin-top: 5px;
+}
+input[type="submit"].btn-block,
+input[type="reset"].btn-block,
+input[type="button"].btn-block {
+  width: 100%;
+}
+@-webkit-keyframes progress-bar-stripes {
+  from {
+    background-position: 40px 0;
+  }
+  to {
+    background-position: 0 0;
+  }
+}
+@keyframes progress-bar-stripes {
+  from {
+    background-position: 40px 0;
+  }
+  to {
+    background-position: 0 0;
+  }
+}
+.progress {
+  overflow: hidden;
+  height: 20px;
+  margin-bottom: 20px;
+  background-color: #f5f5f5;
+  border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+.progress-bar {
+  float: left;
+  width: 0%;
+  height: 100%;
+  font-size: 12px;
+  line-height: 20px;
+  color: #ffffff;
+  text-align: center;
+  background-color: #428bca;
+  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+  -webkit-transition: width 0.6s ease;
+  transition: width 0.6s ease;
+}
+.progress-striped .progress-bar {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-size: 40px 40px;
+}
+.progress.active .progress-bar {
+  -webkit-animation: progress-bar-stripes 2s linear infinite;
+  animation: progress-bar-stripes 2s linear infinite;
+}
+.progress-bar-success {
+  background-color: #5cb85c;
+}
+.progress-striped .progress-bar-success {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+.progress-bar-info {
+  background-color: #5bc0de;
+}
+.progress-striped .progress-bar-info {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+.progress-bar-warning {
+  background-color: #f0ad4e;
+}
+.progress-striped .progress-bar-warning {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+.progress-bar-danger {
+  background-color: #d9534f;
+}
+.progress-striped .progress-bar-danger {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}

+ 72 - 0
db/access.php

@@ -0,0 +1,72 @@
+<?php
+
+/**
+ * Capability definitions for the nasatlx module
+ *
+ * The capabilities are loaded into the database table when the module is
+ * installed or updated. Whenever the capability definitions are updated,
+ * the module version number should be bumped up.
+ *
+ * The system has four possible values for a capability:
+ * CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
+ *
+ * It is important that capability names are unique. The naming convention
+ * for capabilities that are specific to modules and blocks is as follows:
+ *   [mod/block]/<plugin_name>:<capabilityname>
+ *
+ * component_name should be the same as the directory name of the mod or block.
+ *
+ * Core moodle capabilities are defined thus:
+ *    moodle/<capabilityclass>:<capabilityname>
+ *
+ * Examples: mod/forum:viewpost
+ *           block/recent_activity:view
+ *           moodle/site:deleteuser
+ *
+ * The variable name for the capability definitions array is $capabilities
+ *
+ * @package    mod_nasatlx
+ * @copyright  2014 LInE - http://line.ime.usp.br
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$capabilities = array(
+/***************************** remove these comment marks and modify the code as needed
+
+ 'mod/nasatlx:addinstance' => array(
+   'riskbitmask' => RISK_XSS,
+
+   'captype' => 'write',
+   'contextlevel' => CONTEXT_COURSE,
+   'archetypes' => array(
+     'editingteacher' => CAP_ALLOW,
+     'manager' => CAP_ALLOW
+   ),
+   'clonepermissionsfrom' => 'moodle/course:manageactivities'
+ ),
+
+    'mod/nasatlx:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_MODULE,
+        'legacy' => array(
+            'guest' => CAP_ALLOW,
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    ),
+
+    'mod/nasatlx:submit' => array(
+        'riskbitmask' => RISK_SPAM,
+        'captype' => 'write',
+        'contextlevel' => CONTEXT_MODULE,
+        'legacy' => array(
+            'student' => CAP_ALLOW
+        )
+    ),
+******************************/
+);
+

+ 26 - 0
db/install.php

@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * This file replaces the legacy STATEMENTS section in db/install.xml,
+ * lib.php/modulename_install() post installation hook and partially defaults.php
+ *
+ * @package    mod_nasatlx
+ * @copyright  2014 LInE - http://line.ime.usp.br
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+/**
+ * Post installation procedure
+ *
+ * @see upgrade_plugins_modules()
+ */
+function xmldb_nasatlx_install() {
+}
+
+/**
+ * Post installation recovery procedure
+ *
+ * @see upgrade_plugins_modules()
+ */
+function xmldb_nasatlx_install_recovery() {
+}

+ 62 - 0
db/install.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<XMLDB PATH="mod/nasatlx/db" VERSION="20101203" COMMENT="XMLDB file for Moodle mod/nasatlx"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
+>
+  <TABLES>
+    <TABLE NAME="nasatlx" COMMENT="Default comment for nasatlx, please edit me">
+      <FIELDS>
+        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="course"/>
+        <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="Course nasatlx activity belongs to" PREVIOUS="id" NEXT="name"/>
+        <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="name field for moodle instances" PREVIOUS="course" NEXT="intro"/>
+        <FIELD NAME="intro" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="General introduction of the nasatlx activity" PREVIOUS="name" NEXT="introformat"/>
+        <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Format of the intro field (MOODLE, HTML, MARKDOWN...)" PREVIOUS="intro" NEXT="timecreated"/>
+        <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="introformat" NEXT="timemodified"/>
+        <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timecreated"/>
+      </FIELDS>
+      <KEYS>
+        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
+      </KEYS>
+      <INDEXES>
+        <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
+      </INDEXES>
+    </TABLE>
+    <TABLE NAME="nasatlx_resps" COMMENT="Respostas da pesquisa NASA-TLX">
+      <FIELDS>
+        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="course"/>
+        <FIELD NAME="scale1" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="scale2"/>
+        <FIELD NAME="scale2" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="scale1" NEXT="scale3"/>
+        <FIELD NAME="scale3" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="scale2" NEXT="scale4"/>
+        <FIELD NAME="scale4" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="scale3" NEXT="scale5"/>
+        <FIELD NAME="scale5" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="scale4" NEXT="scale6"/>
+        <FIELD NAME="scale6" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="scale5" NEXT="calc1"/>
+
+        <FIELD NAME="calc1" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="scale6" NEXT="calc2"/>
+        <FIELD NAME="calc2" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="calc1" NEXT="calc3"/>
+        <FIELD NAME="calc3" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="calc2" NEXT="calc4"/>
+        <FIELD NAME="calc4" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="calc3" NEXT="calc5"/>
+        <FIELD NAME="calc5" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="calc4" NEXT="calc6"/>
+        <FIELD NAME="calc6" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="calc5" NEXT="peso1"/>
+
+        <FIELD NAME="peso1" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="calc6" NEXT="peso2"/>
+        <FIELD NAME="peso2" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="peso1" NEXT="peso3"/>
+        <FIELD NAME="peso3" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="peso2" NEXT="peso4"/>
+        <FIELD NAME="peso4" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="peso3" NEXT="peso5"/>
+        <FIELD NAME="peso5" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="peso4" NEXT="peso6"/>
+        <FIELD NAME="peso6" TYPE="float" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="peso5" NEXT="pares"/>
+
+        <FIELD NAME="pares" TYPE="text" LENGHT="500" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="peso6" NEXT="cmid"/>
+
+        <FIELD NAME="cmid" TYPE="text" LENGHT="200" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="pares" NEXT="course"/>
+        <FIELD NAME="course" TYPE="text" LENGHT="200" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="cm_id" NEXT="user"/>
+        <FIELD NAME="user" TYPE="text" LENGHT="200" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="course" NEXT="created"/>
+        <FIELD NAME="created" TYPE="datetime" NOTNULL="false" SEQUENCE="false" PREVIOUS="user" />
+      </FIELDS>
+      <KEYS>
+        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
+      </KEYS>
+      <INDEXES>
+      </INDEXES>
+    </TABLE>
+  </TABLES>
+</XMLDB>

+ 24 - 0
db/log.php

@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Definition of log events
+ *
+ * NOTE: this is an example how to insert log event during installation/update.
+ * It is not really essential to know about it, but these logs were created as example
+ * in the previous 1.9 NEWMODULE.
+ *
+ * @package    mod_nasatlx
+ * @copyright  2014 LInE - http://line.ime.usp.br
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+global $DB;
+
+$logs = array(
+    array('module'=>'nasatlx', 'action'=>'add', 'mtable'=>'nasatlx', 'field'=>'name'),
+    array('module'=>'nasatlx', 'action'=>'update', 'mtable'=>'nasatlx', 'field'=>'name'),
+    array('module'=>'nasatlx', 'action'=>'view', 'mtable'=>'nasatlx', 'field'=>'name'),
+    array('module'=>'nasatlx', 'action'=>'view all', 'mtable'=>'nasatlx', 'field'=>'name')
+);

+ 16 - 0
db/uninstall.php

@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @see uninstall_plugin()
+ *
+ * @package    mod_nasatlx
+ * @copyright  2014 LInE - http://line.ime.usp.br
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+/**
+ * Custom uninstallation procedure
+ */
+function xmldb_nasatlx_uninstall() {
+    return true;
+}

+ 149 - 0
db/upgrade.php

@@ -0,0 +1,149 @@
+<?php
+
+/**
+ * This file keeps track of upgrades to the nasatlx module
+ *
+ * Sometimes, changes between versions involve alterations to database
+ * structures and other major things that may break installations. The upgrade
+ * function in this file will attempt to perform all the necessary actions to
+ * upgrade your older installation to the current version. If there's something
+ * it cannot do itself, it will tell you what you need to do.  The commands in
+ * here will all be database-neutral, using the functions defined in DLL libraries.
+ *
+ * @package    mod_nasatlx
+ * @copyright  2014 LInE - http://line.ime.usp.br
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * Execute nasatlx upgrade from the given old version
+ *
+ * @param int $oldversion
+ * @return bool
+ */
+function xmldb_nasatlx_upgrade($oldversion) {
+    global $DB;
+
+    $dbman = $DB->get_manager(); // loads ddl manager and xmldb classes
+
+    // And upgrade begins here. For each one, you'll need one
+    // block of code similar to the next one. Please, delete
+    // this comment lines once this file start handling proper
+    // upgrade code.
+
+    // if ($oldversion < YYYYMMDD00) { //New version in version.php
+    //
+    // }
+
+    // Lines below (this included)  MUST BE DELETED once you get the first version
+    // of your module ready to be installed. They are here only
+    // for demonstrative purposes and to show how the nasatlx
+    // iself has been upgraded.
+
+    // For each upgrade block, the file nasatlx/version.php
+    // needs to be updated . Such change allows Moodle to know
+    // that this file has to be processed.
+
+    // To know more about how to write correct DB upgrade scripts it's
+    // highly recommended to read information available at:
+    //   http://docs.moodle.org/en/Development:XMLDB_Documentation
+    // and to play with the XMLDB Editor (in the admin menu) and its
+    // PHP generation posibilities.
+
+    // First example, some fields were added to install.xml on 2007/04/01
+    if ($oldversion < 2007040100) {
+
+        // Define field course to be added to nasatlx
+        $table = new xmldb_table('nasatlx');
+        $field = new xmldb_field('course', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'id');
+
+        // Add field course
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+
+        // Define field intro to be added to nasatlx
+        $table = new xmldb_table('nasatlx');
+        $field = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'medium', null, null, null, null,'name');
+
+        // Add field intro
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+
+        // Define field introformat to be added to nasatlx
+        $table = new xmldb_table('nasatlx');
+        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0',
+            'intro');
+
+        // Add field introformat
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+
+        // Once we reach this point, we can store the new version and consider the module
+        // upgraded to the version 2007040100 so the next time this block is skipped
+        upgrade_mod_savepoint(true, 2007040100, 'nasatlx');
+    }
+
+    // Second example, some hours later, the same day 2007/04/01
+    // two more fields and one index were added to install.xml (note the micro increment
+    // "01" in the last two digits of the version
+    if ($oldversion < 2007040101) {
+
+        // Define field timecreated to be added to nasatlx
+        $table = new xmldb_table('nasatlx');
+        $field = new xmldb_field('timecreated', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0',
+            'introformat');
+
+        // Add field timecreated
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+
+        // Define field timemodified to be added to nasatlx
+        $table = new xmldb_table('nasatlx');
+        $field = new xmldb_field('timemodified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0',
+            'timecreated');
+
+        // Add field timemodified
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+
+        // Define index course (not unique) to be added to nasatlx
+        $table = new xmldb_table('nasatlx');
+        $index = new xmldb_index('courseindex', XMLDB_INDEX_NOTUNIQUE, array('course'));
+
+        // Add index to course field
+        if (!$dbman->index_exists($table, $index)) {
+            $dbman->add_index($table, $index);
+        }
+
+        // Another save point reached
+        upgrade_mod_savepoint(true, 2007040101, 'nasatlx');
+    }
+
+    // Third example, the next day, 2007/04/02 (with the trailing 00), some actions were performed to install.php,
+    // related with the module
+    if ($oldversion < 2007040200) {
+
+        // insert here code to perform some actions (same as in install.php)
+
+        upgrade_mod_savepoint(true, 2007040200, 'nasatlx');
+    }
+
+    // And that's all. Please, examine and understand the 3 example blocks above. Also
+    // it's interesting to look how other modules are using this script. Remember that
+    // the basic idea is to have "blocks" of code (each one being executed only once,
+    // when the module version (version.php) is updated.
+
+    // Lines above (this included) MUST BE DELETED once you get the first version of
+    // yout module working. Each time you need to modify something in the module (DB
+    // related, you'll raise the version and add one upgrade block here.
+
+    // Final return of upgrade result (true, all went good) to Moodle.
+    return true;
+}

+ 19 - 0
grade.php

@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * Redirect the user to the appropriate submission related page
+ *
+ * @package   mod_nasatlx
+ * @category  grade
+ * @copyright 2014 LInE - http://line.ime.usp.br
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+require_once(__DIR__ . "../../config.php");
+
+$id = required_param('id', PARAM_INT);          // Course module ID
+$itemnumber = optional_param('itemnumber', 0, PARAM_INT); // Item number, may be != 0 for activities that allow more than one grade per user
+$userid = optional_param('userid', 0, PARAM_INT); // Graded user ID (optional)
+
+//in the simplest case just redirect to the view page
+redirect('view.php?id='.$id);

+ 74 - 0
index.php

@@ -0,0 +1,74 @@
+<?php
+
+
+/**
+ * This is a one-line short description of the file
+ *
+ * You can have a rather longer description of the file as well,
+ * if you like, and it can span multiple lines.
+ *
+ * @package    mod_nasatlx
+ * @copyright  2014 LInE
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+/// Replace nasatlx with the name of your module and remove this line
+
+require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
+require_once(dirname(__FILE__).'/lib.php');
+
+$id = required_param('id', PARAM_INT);   // course
+
+$course = $DB->get_record('course', array('id' => $id), '*', MUST_EXIST);
+
+require_course_login($course);
+
+add_to_log($course->id, 'nasatlx', 'view all', 'index.php?id='.$course->id, '');
+
+$coursecontext = context_course::instance($course->id);
+
+$PAGE->set_url('/mod/nasatlx/index.php', array('id' => $id));
+$PAGE->set_title(format_string($course->fullname));
+$PAGE->set_heading(format_string($course->fullname));
+$PAGE->set_context($coursecontext);
+
+echo $OUTPUT->header();
+
+if (! $nasatlxs = get_all_instances_in_course('nasatlx', $course)) {
+    notice(get_string('nonasatlxs', 'nasatlx'), new moodle_url('/course/view.php', array('id' => $course->id)));
+}
+
+$table = new html_table();
+if ($course->format == 'weeks') {
+    $table->head  = array(get_string('week'), get_string('name'));
+    $table->align = array('center', 'left');
+} else if ($course->format == 'topics') {
+    $table->head  = array(get_string('topic'), get_string('name'));
+    $table->align = array('center', 'left', 'left', 'left');
+} else {
+    $table->head  = array(get_string('name'));
+    $table->align = array('left', 'left', 'left');
+}
+
+foreach ($nasatlxs as $nasatlx) {
+    if (!$nasatlx->visible) {
+        $link = html_writer::link(
+            new moodle_url('/mod/nasatlx.php', array('id' => $nasatlx->coursemodule)),
+            format_string($nasatlx->name, true),
+            array('class' => 'dimmed'));
+    } else {
+        $link = html_writer::link(
+            new moodle_url('/mod/nasatlx.php', array('id' => $nasatlx->coursemodule)),
+            format_string($nasatlx->name, true));
+    }
+
+    if ($course->format == 'weeks' or $course->format == 'topics') {
+        $table->data[] = array($nasatlx->section, $link);
+    } else {
+        $table->data[] = array($link);
+    }
+}
+
+echo $OUTPUT->heading(get_string('modulenameplural', 'nasatlx'), 2);
+echo html_writer::table($table);
+echo $OUTPUT->footer();

File diff suppressed because it is too large
+ 4 - 0
js/jquery.js


+ 40 - 0
lang/en/nasatlx.php

@@ -0,0 +1,40 @@
+<?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/>.
+
+
+/**
+ * English strings for nasatlx
+ *
+ * You can have a rather longer description of the file as well,
+ * if you like, and it can span multiple lines.
+ *
+ * @package    mod_nasatlx
+ * @copyright  2011 Your Name
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$string['modulename'] = 'nasatlx';
+$string['modulenameplural'] = 'nasatlxs';
+$string['modulename_help'] = 'Use the nasatlx module for... | The nasatlx module allows...';
+$string['nasatlxfieldset'] = 'Custom example fieldset';
+$string['nasatlxname'] = 'nasatlx name';
+$string['nasatlxname_help'] = 'This is the content of the help tooltip associated with the nasatlxname field. Markdown syntax is supported.';
+$string['nasatlx'] = 'nasatlx';
+$string['pluginadministration'] = 'nasatlx administration';
+$string['pluginname'] = 'nasatlx';

+ 380 - 0
lib.php

@@ -0,0 +1,380 @@
+<?php
+
+/**
+ * Library of interface functions and constants for module nasatlx
+ *
+ * All the core Moodle functions, neeeded to allow the module to work
+ * integrated in Moodle should be placed here.
+ * All the nasatlx specific functions, needed to implement all the module
+ * logic, should go to locallib.php. This will help to save some memory when
+ * Moodle is performing actions across all modules.
+ *
+ * @package    mod_nasatlx
+ * @copyright  2014 LInE - http://line.ime.usp.br
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+/** example constant */
+//define('NEWMODULE_ULTIMATE_ANSWER', 42);
+
+////////////////////////////////////////////////////////////////////////////////
+// Moodle core API                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Returns the information on whether the module supports a feature
+ *
+ * @see plugin_supports() in lib/moodlelib.php
+ * @param string $feature FEATURE_xx constant for requested feature
+ * @return mixed true if the feature is supported, null if unknown
+ */
+function nasatlx_supports($feature) {
+    switch($feature) {
+        case FEATURE_MOD_INTRO:         return true;
+        case FEATURE_SHOW_DESCRIPTION:  return true;
+
+        default:                        return null;
+    }
+}
+
+/**
+ * Saves a new instance of the nasatlx into the database
+ *
+ * Given an object containing all the necessary data,
+ * (defined by the form in mod_form.php) this function
+ * will create a new instance and return the id number
+ * of the new instance.
+ *
+ * @param object $nasatlx An object from the form in mod_form.php
+ * @param mod_nasatlx_mod_form $mform
+ * @return int The id of the newly inserted nasatlx record
+ */
+function nasatlx_add_instance(stdClass $nasatlx, mod_nasatlx_mod_form $mform = null) {
+    global $DB;
+
+    $nasatlx->timecreated = time();
+
+    # You may have to add extra stuff in here #
+
+    return $DB->insert_record('nasatlx', $nasatlx);
+}
+
+/**
+ * Updates an instance of the nasatlx in the database
+ *
+ * Given an object containing all the necessary data,
+ * (defined by the form in mod_form.php) this function
+ * will update an existing instance with new data.
+ *
+ * @param object $nasatlx An object from the form in mod_form.php
+ * @param mod_nasatlx_mod_form $mform
+ * @return boolean Success/Fail
+ */
+function nasatlx_update_instance(stdClass $nasatlx, mod_nasatlx_mod_form $mform = null) {
+    global $DB;
+
+    $nasatlx->timemodified = time();
+    $nasatlx->id = $nasatlx->instance;
+
+    # You may have to add extra stuff in here #
+
+    return $DB->update_record('nasatlx', $nasatlx);
+}
+
+/**
+ * Removes an instance of the nasatlx from the database
+ *
+ * Given an ID of an instance of this module,
+ * this function will permanently delete the instance
+ * and any data that depends on it.
+ *
+ * @param int $id Id of the module instance
+ * @return boolean Success/Failure
+ */
+function nasatlx_delete_instance($id) {
+    global $DB;
+
+    if (! $nasatlx = $DB->get_record('nasatlx', array('id' => $id))) {
+        return false;
+    }
+
+    # Delete any dependent records here #
+
+    $DB->delete_records('nasatlx', array('id' => $nasatlx->id));
+
+    return true;
+}
+
+/**
+ * Returns a small object with summary information about what a
+ * user has done with a given particular instance of this module
+ * Used for user activity reports.
+ * $return->time = the time they did it
+ * $return->info = a short text description
+ *
+ * @return stdClass|null
+ */
+function nasatlx_user_outline($course, $user, $mod, $nasatlx) {
+
+    $return = new stdClass();
+    $return->time = 0;
+    $return->info = '';
+    return $return;
+}
+
+/**
+ * Prints a detailed representation of what a user has done with
+ * a given particular instance of this module, for user activity reports.
+ *
+ * @param stdClass $course the current course record
+ * @param stdClass $user the record of the user we are generating report for
+ * @param cm_info $mod course module info
+ * @param stdClass $nasatlx the module instance record
+ * @return void, is supposed to echp directly
+ */
+function nasatlx_user_complete($course, $user, $mod, $nasatlx) {
+}
+
+/**
+ * Given a course and a time, this module should find recent activity
+ * that has occurred in nasatlx activities and print it out.
+ * Return true if there was output, or false is there was none.
+ *
+ * @return boolean
+ */
+function nasatlx_print_recent_activity($course, $viewfullnames, $timestart) {
+    return false;  //  True if anything was printed, otherwise false
+}
+
+/**
+ * Prepares the recent activity data
+ *
+ * This callback function is supposed to populate the passed array with
+ * custom activity records. These records are then rendered into HTML via
+ * {@link nasatlx_print_recent_mod_activity()}.
+ *
+ * @param array $activities sequentially indexed array of objects with the 'cmid' property
+ * @param int $index the index in the $activities to use for the next record
+ * @param int $timestart append activity since this time
+ * @param int $courseid the id of the course we produce the report for
+ * @param int $cmid course module id
+ * @param int $userid check for a particular user's activity only, defaults to 0 (all users)
+ * @param int $groupid check for a particular group's activity only, defaults to 0 (all groups)
+ * @return void adds items into $activities and increases $index
+ */
+function nasatlx_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) {
+}
+
+/**
+ * Prints single activity item prepared by {@see nasatlx_get_recent_mod_activity()}
+
+ * @return void
+ */
+function nasatlx_print_recent_mod_activity($activity, $courseid, $detail, $modnames, $viewfullnames) {
+}
+
+/**
+ * Function to be run periodically according to the moodle cron
+ * This function searches for things that need to be done, such
+ * as sending out mail, toggling flags etc ...
+ *
+ * @return boolean
+ * @todo Finish documenting this function
+ **/
+function nasatlx_cron () {
+    return true;
+}
+
+/**
+ * Returns all other caps used in the module
+ *
+ * @example return array('moodle/site:accessallgroups');
+ * @return array
+ */
+function nasatlx_get_extra_capabilities() {
+    return array();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Gradebook API                                                              //
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Is a given scale used by the instance of nasatlx?
+ *
+ * This function returns if a scale is being used by one nasatlx
+ * if it has support for grading and scales. Commented code should be
+ * modified if necessary. See forum, glossary or journal modules
+ * as reference.
+ *
+ * @param int $nasatlxid ID of an instance of this module
+ * @return bool true if the scale is used by the given nasatlx instance
+ */
+function nasatlx_scale_used($nasatlxid, $scaleid) {
+    global $DB;
+
+    /** @example */
+    if ($scaleid and $DB->record_exists('nasatlx', array('id' => $nasatlxid, 'grade' => -$scaleid))) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+/**
+ * Checks if scale is being used by any instance of nasatlx.
+ *
+ * This is used to find out if scale used anywhere.
+ *
+ * @param $scaleid int
+ * @return boolean true if the scale is used by any nasatlx instance
+ */
+function nasatlx_scale_used_anywhere($scaleid) {
+    global $DB;
+
+    /** @example */
+    if ($scaleid and $DB->record_exists('nasatlx', array('grade' => -$scaleid))) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+/**
+ * Creates or updates grade item for the give nasatlx instance
+ *
+ * Needed by grade_update_mod_grades() in lib/gradelib.php
+ *
+ * @param stdClass $nasatlx instance object with extra cmidnumber and modname property
+ * @param mixed optional array/object of grade(s); 'reset' means reset grades in gradebook
+ * @return void
+ */
+function nasatlx_grade_item_update(stdClass $nasatlx, $grades=null) {
+    global $CFG;
+    require_once($CFG->libdir.'/gradelib.php');
+
+    /** @example */
+    $item = array();
+    $item['itemname'] = clean_param($nasatlx->name, PARAM_NOTAGS);
+    $item['gradetype'] = GRADE_TYPE_VALUE;
+    $item['grademax']  = $nasatlx->grade;
+    $item['grademin']  = 0;
+
+    grade_update('mod/nasatlx', $nasatlx->course, 'mod', 'nasatlx', $nasatlx->id, 0, null, $item);
+}
+
+/**
+ * Update nasatlx grades in the gradebook
+ *
+ * Needed by grade_update_mod_grades() in lib/gradelib.php
+ *
+ * @param stdClass $nasatlx instance object with extra cmidnumber and modname property
+ * @param int $userid update grade of specific user only, 0 means all participants
+ * @return void
+ */
+function nasatlx_update_grades(stdClass $nasatlx, $userid = 0) {
+    global $CFG, $DB;
+    require_once($CFG->libdir.'/gradelib.php');
+
+    /** @example */
+    $grades = array(); // populate array of grade objects indexed by userid
+
+    grade_update('mod/nasatlx', $nasatlx->course, 'mod', 'nasatlx', $nasatlx->id, 0, $grades);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// File API                                                                   //
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Returns the lists of all browsable file areas within the given module context
+ *
+ * The file area 'intro' for the activity introduction field is added automatically
+ * by {@link file_browser::get_file_info_context_module()}
+ *
+ * @param stdClass $course
+ * @param stdClass $cm
+ * @param stdClass $context
+ * @return array of [(string)filearea] => (string)description
+ */
+function nasatlx_get_file_areas($course, $cm, $context) {
+    return array();
+}
+
+/**
+ * File browsing support for nasatlx file areas
+ *
+ * @package mod_nasatlx
+ * @category files
+ *
+ * @param file_browser $browser
+ * @param array $areas
+ * @param stdClass $course
+ * @param stdClass $cm
+ * @param stdClass $context
+ * @param string $filearea
+ * @param int $itemid
+ * @param string $filepath
+ * @param string $filename
+ * @return file_info instance or null if not found
+ */
+function nasatlx_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) {
+    return null;
+}
+
+/**
+ * Serves the files from the nasatlx file areas
+ *
+ * @package mod_nasatlx
+ * @category files
+ *
+ * @param stdClass $course the course object
+ * @param stdClass $cm the course module object
+ * @param stdClass $context the nasatlx's context
+ * @param string $filearea the name of the file area
+ * @param array $args extra arguments (itemid, path)
+ * @param bool $forcedownload whether or not force download
+ * @param array $options additional options affecting the file serving
+ */
+function nasatlx_pluginfile($course, $cm, $context, $filearea, array $args, $forcedownload, array $options=array()) {
+    global $DB, $CFG;
+
+    if ($context->contextlevel != CONTEXT_MODULE) {
+        send_file_not_found();
+    }
+
+    require_login($course, true, $cm);
+
+    send_file_not_found();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Navigation API                                                             //
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Extends the global navigation tree by adding nasatlx nodes if there is a relevant content
+ *
+ * This can be called by an AJAX request so do not rely on $PAGE as it might not be set up properly.
+ *
+ * @param navigation_node $navref An object representing the navigation tree node of the nasatlx module instance
+ * @param stdClass $course
+ * @param stdClass $module
+ * @param cm_info $cm
+ */
+function nasatlx_extend_navigation(navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm) {
+}
+
+/**
+ * Extends the settings navigation with the nasatlx settings
+ *
+ * This function is called when the context for the page is a nasatlx module. This is not called by AJAX
+ * so it is safe to rely on the $PAGE.
+ *
+ * @param settings_navigation $settingsnav {@link settings_navigation}
+ * @param navigation_node $nasatlxnode {@link navigation_node}
+ */
+function nasatlx_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $nasatlxnode=null) {
+}

+ 24 - 0
locallib.php

@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Internal library of functions for module nasatlx
+ *
+ * All the nasatlx specific functions, needed to implement the module
+ * logic, should go here. Never include this file from your lib.php!
+ *
+ * @package    mod_nasatlx
+ * @copyright  2014 LInE - http://line.ime.usp.br
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * Does something really useful with the passed things
+ *
+ * @param array $things
+ * @return object
+ */
+//function nasatlx_do_something_useful(array $things) {
+//    return new stdClass();
+//}

+ 63 - 0
mod_form.php

@@ -0,0 +1,63 @@
+<?php
+
+/**
+ * The main nasatlx configuration form
+ *
+ * It uses the standard core Moodle formslib. For more info about them, please
+ * visit: http://docs.moodle.org/en/Development:lib/formslib.php
+ *
+ * @package    mod_nasatlx
+ * @copyright  2014 LInE - http://line.ime.usp.br
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+require_once($CFG->dirroot.'/course/moodleform_mod.php');
+
+/**
+ * Module instance settings form
+ */
+class mod_nasatlx_mod_form extends moodleform_mod {
+
+    /**
+     * Defines forms elements
+     */
+    public function definition() {
+
+        $mform = $this->_form;
+
+        //-------------------------------------------------------------------------------
+        // Adding the "general" fieldset, where all the common settings are showed
+        $mform->addElement('header', 'general', get_string('general', 'form'));
+
+        // Adding the standard "name" field
+        $mform->addElement('text', 'name', get_string('nasatlxname', 'nasatlx'), array('size'=>'64'));
+        if (!empty($CFG->formatstringstriptags)) {
+            $mform->setType('name', PARAM_TEXT);
+        } else {
+            $mform->setType('name', PARAM_CLEAN);
+        }
+        $mform->addRule('name', null, 'required', null, 'client');
+        $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
+        $mform->addHelpButton('name', 'nasatlxname', 'nasatlx');
+
+        // Adding the standard "intro" and "introformat" fields
+        $this->add_intro_editor();
+
+        //-------------------------------------------------------------------------------
+        // Adding the rest of nasatlx settings, spreeading all them into this fieldset
+        // or adding more fieldsets ('header' elements) if needed for better logic
+        $mform->addElement('static', 'label1', 'nasatlxsetting1', 'Your nasatlx fields go here. Replace me!');
+
+        $mform->addElement('header', 'nasatlxfieldset', get_string('nasatlxfieldset', 'nasatlx'));
+        $mform->addElement('static', 'label2', 'nasatlxsetting2', 'Your nasatlx fields go here. Replace me!');
+
+        //-------------------------------------------------------------------------------
+        // add standard elements, common to all modules
+        $this->standard_coursemodule_elements();
+        //-------------------------------------------------------------------------------
+        // add standard buttons, common to all modules
+        $this->add_action_buttons();
+    }
+}

+ 85 - 0
nasatlx.php

@@ -0,0 +1,85 @@
+<?php
+
+ // @copyright  2014 LInE - http://line.ime.usp.br
+
+ $conn = mysql_connect("localhost", "root", "XYZAdminLMDlA00--");
+ $db = mysql_select_db("moodle2_6_1_2014_02");
+
+ //$query_a = mysql_query("select m_course.*, m_nasatlx.course as cid, m_nasatlx.name from m_nasatlx, m_course where m_nasatlx.course = m_course.id");
+ $query_a = mysql_query("select * from m_nasatlx_resps group by cmid");
+ $cont = 0;
+
+ $cmids = array();
+ $cmids[30] = "1 - T1";
+ $cmids[193] = "2.4 - T1";
+ $cmids[196] = "2.x Desafio - T1";
+ $cmids[309] = "3.4 - T1";
+ $cmids[314] = "Discursiva - T1";
+
+
+ $cmids[68] = "1 - T2";
+ $cmids[203] = "2 - T2";
+ $cmids[204] = "2 Desafio - T2";
+ $cmids[321] = "3.4 - T2";
+ $cmids[324] = "Discursiva - T2";
+
+ $cmids[88] = "1 - T3";
+ $cmids[209] = "2 - T3";
+ $cmids[215] = "2 Desafio - T3";
+ $cmids[330] = "3.4 - T3";
+ $cmids[333] = "Discursiva - T3";
+
+ while ($d = mysql_fetch_array($query_a)) {
+   print $cmids[intVal(strval(($d["cmid"])))]. " " ." - " . intVal(strval(($d["cmid"])))."\n";
+   $query_r = mysql_query("select * from m_nasatlx_resps where cmid = ".$d["cmid"]." and user > 7");
+
+   print "ESCALA";
+   while($d2 = mysql_fetch_array($query_r)) {
+      print ";".$d2["user"]."";
+      }
+   print "\n";
+   
+   mysql_data_seek($query_r, 0);
+
+   $escalas = array();
+   for($i=0;$i<6;$i++)
+    $escalas[] = "scale".($i+1);
+   for($i=0;$i<6;$i++)
+    $escalas[] = "peso".($i+1);
+   for($i=0;$i<6;$i++)
+    $escalas[] = "calc".($i+1);
+
+   foreach($escalas as $e){
+    mysql_data_seek($query_r, 0);
+
+    print $e."";
+    while($d2 = mysql_fetch_array($query_r)){
+     print ";".str_replace(".", ",", $d2[$e]);
+    }
+    print "\n";
+   }
+
+  /*while($d2 = mysql_fetch_array($query_r)){
+   print 
+   $d2["scale1"].";".
+   $d2["scale2"].";".
+   $d2["scale3"].";".
+   $d2["scale4"].";".
+   $d2["scale5"].";".
+   $d2["scale6"].";";
+   print 
+   $d2["peso1"].";".
+   $d2["peso2"].";".
+   $d2["peso3"].";".
+   $d2["peso4"].";".
+   $d2["peso5"].";".
+   $d2["peso6"].";";
+   print 
+   $d2["calc1"].";".
+   $d2["calc2"].";".
+   $d2["calc3"].";".
+   $d2["calc4"].";".
+   $d2["calc5"].";".
+   $d2["calc6"].";\n";
+   }*/
+   }

+ 199 - 0
nasatlx_leo_mac115_2015.php

@@ -0,0 +1,199 @@
+<?php
+
+// 2016/04/18
+// Dados do curso: "2015_2 - MAC115 - Introdução à Computação para Ciências Exatas e Tecnologia"
+// http://www.usp.br/line/mooc/course/view.php?id=21
+// Curso para IAG semestre 2 de 2015
+
+// Questionario NASA-TLX
+// Itens: "Demanda mental", "Demanda fisica", "Demanda de tempo", "Desempenho", "Esforco", "Frustracao"
+
+// O '$LST = 1' e' melhor para gerar tabelas para o R
+// $LST = 0; // 0 => lista por colunas (colunas formadas com todas as resposta dos alunos para cada tipo 'scale, peso ou calc')
+$LST = 1; // 1 => lista por linhas (cada linha tem as resposta de todos os alunos para cada tipo 'scale, peso ou calc')
+
+// $conn = mysql_connect("localhost", "root", "XYZAdminLMDlA00--"); // no 'www.usp.br/line/mooc'
+$conn = mysql_connect("localhost", "root", "sawgeo"); 
+$db = mysql_select_db("moodle2_6_1_2014_02");
+
+//$query = ""; echo "Aqui: " . $query . "<br/>"; exit;
+
+//$query_a = mysql_query("SELECT m_course.*, m_nasatlx.course as cid, m_nasatlx.name from m_nasatlx, m_course where m_nasatlx.course = m_course.id");
+//$query = "SELECT * FROM m_nasatlx_resps";
+$query = "SELECT * FROM m_nasatlx_resps GROUP BY cmid"; // group para evitar repetir
+$query_a = mysql_query($query);
+$cont = 0;
+
+// m_modules.id = 28 ; name = nasatlx
+// m_course = 21, 24
+// SELECT id,course,module,instance FROM m_course_modules WHERE m_course_modules.course = 21 AND m_course_modules.module = 28;
+// * 2015: MAC115: Detectando dificuldades em Introducao a Programacao
+//   m_course_modules : id,course,module,instance = 1446 24 28 25
+//   m_course_modules : id,course,module,instance = 1483 24 28 26
+// * "2015_2 - MAC115 - Introducao a Computacao para Ciencias Exatas e Tecnologia"
+//   m_course_modules : id,course,module,instance = 1195 21 28 23
+//   m_course_modules : id,course,module,instance = 1196 21 28 24
+
+// * 2015: MAC115: Detectando dificuldades em Introducão à Programacão
+//   m_course_modules.course = 24 => http://www.usp.br/line/mooc/course/view.php?id=24
+//     http://www.usp.br/line/mooc/mod/nasatlx/view.php?id=1446   Ao terminarem os exercícios: Avaliação de carga de trabalho
+//     http://www.usp.br/line/mooc/mod/nasatlx/view.php?id=1483   Ao terminarem os exercícios: Avaliação de carga de trabalho
+
+// * "2015_2 - MAC115 - Introdução à Computação para Ciências Exatas e Tecnologia"
+//   m_course_modules.course = 21 => http://www.usp.br/line/mooc/course/view.php?id=21
+//     http://www.usp.br/line/mooc/mod/nasatlx/view.php?id=1195   Nasa-TLX: questionário 1 sobre iVProg
+//     http://www.usp.br/line/mooc/mod/nasatlx/view.php?id=1196   Nasa-TLX: questionário 1 sobre VPL (linguagem C)
+
+// echo $query . "<br/>";
+
+// MAC115 - Semestre
+//  Nasa-TLX: questionário 1 sobre VPL (linguagem C)
+//   1196 : http://www.usp.br/line/mooc/mod/nasatlx/view.php?id=1196
+//  Nasa-TLX: questionário 1 sobre iVProg
+//   1195 : http://www.usp.br/line/mooc/mod/nasatlx/view.php?id=1195
+// MAC115 - Dificuldades
+//   1446 : http://www.usp.br/line/mooc/mod/nasatlx/view.php?id=1446
+//   1483 : http://www.usp.br/line/mooc/mod/nasatlx/view.php?id=1483 (ainda nao respondido!)
+// $vet_cmid = array(1446, 1483, 1195, 1196); // digitar aqui o vetor com todos os ''
+
+// MOOC - VPL 
+// Turma 1 -- VPL = http://localhost/mooc/course/view.php?id=2
+//  1. Algoritmos
+//      30  Nasa TLX - Como foram as atividades? -- http://localhost/mooc/mod/nasatlx/view.php?id=30
+//  2. Selecao
+//     193  Nasa TLX - Como foram as atividades? -- http://localhost/mooc/mod/nasatlx/view.php?id=193
+// MOOC - iVprog Java
+// Turma 2 -- iVProg Java = http://localhost/mooc/course/view.php?id=4
+//  1. Algoritmos
+//      68  MOOC - iVProg Java -- http://localhost/mooc/mod/nasatlx/view.php?id=68
+//  2. Selecao
+//     209  Nasa TLX - Como foram as atividades? -- http://localhost/mooc/mod/nasatlx/view.php?id=209
+$vet_cmid = array(30, 193, 68, 209, 1446, 1483, 1195, 1196); // digitar aqui o vetor com todos os ''
+
+$cmids = array(); // digitar aqui o vetor com todos os ''
+$cmids[1446] = "MAC115 - Dificuldades - Quinzena1";
+$cmids[1483] = "MAC115 - Dificuldades - Quinzena1";
+$cmids[1195] = "MAC115 - questionario 1 iVProg";
+$cmids[1196] = "MAC115 - questionario 1 VPL";
+$cmids[30]   = "MOOC - VPL : Turma 1 : 1. Algoritmos";
+$cmids[193]  = "MOOC - VPL : Turma 1 : 2. Selecao";
+$cmids[68]   = "MOOC - iVprog Java : Turma 2 : 1. Algoritmos";
+$cmids[209]  = "MOOC - iVprog Java : Turma 2 : 2. Selecao";
+
+/*
+// Listando respostas de questionario Nasa-TLX por
+while ($row = mysql_fetch_array($query_a)) {
+  $m_modules_id = intVal(strval(($row["cmid"])));
+  if (!in_array($m_modules_id, $vet_cmid))
+    continue;
+  echo "<h2>" . $cmids[$m_modules_id] . " " ." (m_modules.id = " . $m_modules_id . ") " . $row["cmid"] . "</h2>\n";
+  $query_r = mysql_query("SELECT * FROM m_nasatlx_resps WHERE cmid = " . $row["cmid"]);
+  echo "scale1;scale2;scale3;scale4;scale5;scale6;peso1;peso2;peso3;peso4;peso5;peso6;calc1;calc2;calc3;calc4;calc5;calc6\n";
+
+  while ($row2 = mysql_fetch_array($query_r)) {
+    echo 
+      $row2["scale1"] . ";" .
+      $row2["scale2"] . ";" .
+      $row2["scale3"] . ";" .
+      $row2["scale4"] . ";" .
+      $row2["scale5"] . ";" .
+      $row2["scale6"] . ";";
+    echo 
+      $row2["peso1"] . ";" .
+      $row2["peso2"] . ";" .
+      $row2["peso3"] . ";" .
+      $row2["peso4"] . ";" .
+      $row2["peso5"] . ";" .
+      $row2["peso6"] . ";";
+    echo 
+      $row2["calc1"] . ";" .
+      $row2["calc2"] . ";" .
+      $row2["calc3"] . ";" .
+      $row2["calc4"] . ";" .
+      $row2["calc5"] . ";" .
+      $row2["calc6"] . ";\n";
+    } // while ($row2 = mysql_fetch_array($query_r))
+  } // while ($row = mysql_fetch_array($query_a))
+*/
+
+
+
+// $LST = 0 => lista por colunas (colunas formadas com todas as resposta dos alunos para cada tipo 'scale, peso ou calc')
+// $LST = 1 => lista por linhas (cada linha tem as resposta de todos os alunos para cada tipo 'scale, peso ou calc')
+if ($LST==1) {
+
+  // Listando questionario Nasa-TLX por item
+  while ($row = mysql_fetch_array($query_a)) { // "SELECT * FROM m_nasatlx_resps GROUP BY cmid"
+
+    $m_modules_id = intVal(strval(($row["cmid"])));
+    if (!in_array($m_modules_id, $vet_cmid))
+      continue;
+    echo "<h3>" . $cmids[$m_modules_id] . " " ." (m_modules.id = " . $m_modules_id . ") " . $row["cmid"] . "</h3>\n";
+    // echo $cmids[intVal(strval(($row["cmid"])))]. " " ." - " . intVal(strval(($row["cmid"])))."\n";
+
+    $query_r = mysql_query("SELECT * FROM m_nasatlx_resps WHERE cmid = " . $row["cmid"] . " AND user > 7");
+
+    echo "ESCALA";
+    while ($row2 = mysql_fetch_array($query_r)) { // "SELECT * FROM m_nasatlx_resps WHERE cmid = " . $row["cmid"] . " AND user > 7"
+      echo ";" . $row2["user"] . "";
+      }
+    echo "<br/>\n";
+
+    mysql_data_seek($query_r, 0);
+
+    $escalas = array(); // array("scale1","scale2","scale3","scale4","scale5","scale6","peso1","peso2","peso3","peso4","peso5","peso6","calc1","calc2","calc3","calc4","calc5","calc6");
+    for ($i=0; $i<6; $i++) $escalas[] = "scale" . ($i+1);
+    for ($i=0; $i<6; $i++) $escalas[] = "peso" . ($i+1);
+    for ($i=0; $i<6; $i++) $escalas[] = "calc" . ($i+1);
+
+    foreach ($escalas as $e) {
+      mysql_data_seek($query_r, 0);
+      echo $e . "";
+      while ($row2 = mysql_fetch_array($query_r)) {
+        echo ";" . str_replace(".", ",", $row2[$e]);
+        }
+      echo "<br/>\n";
+      }
+
+    } // while ($row = mysql_fetch_array($query_a))
+
+  } // if ($LST==1)
+else { // else if ($LST==1)
+
+  //D echo "#vet_cmid = " . count($vet_cmid) . "<br/>\n";
+
+  // Listando questionarios Nasa-TLX
+  // Dados: "scale1","scale2","scale3","scale4","scale5","scale6","peso1","peso2","peso3","peso4","peso5","peso6","calc1","calc2","calc3","calc4","calc5","calc6"
+  for ($ii=0; $ii<count($vet_cmid); $ii++) {
+
+    // m_nasatlx_resps : id scale1 scale2 scale3 scale4 scale5 scale6 calc1 calc2 calc3 calc4 calc5 calc6 peso1 peso2 peso3 peso4 peso5 peso6 cmid course user created 
+    $query_questionario = "SELECT * FROM m_nasatlx_resps WHERE cmid = " . $vet_cmid[$ii] . " AND user > 7"; // nao pegar admins -  GROUP BY cmid
+    $result_questionario = mysql_query($query_questionario) or die(mysql_error());
+    $num1 = mysql_affected_rows(); // número de linhas removidas
+
+    //D echo "ii=$ii : vet_cmid[$ii]=$vet_cmid[$ii] : $query_questionario: $result_questionario => #=" . $num1 . "<br/>";
+
+    // Pegando dados do questionario $ii
+    for ($jj=0; $jj<$num1; $jj++) {
+      $row = mysql_fetch_array($result_questionario);
+      if (!$row)
+        continue;
+      $m_modules_id = intVal(strval(($row["cmid"])));
+      if ($jj==0)
+        echo "<h3>" . $cmids[$m_modules_id] . " " ." (m_modules.id = " . $m_modules_id . ") </h3>\n";
+
+      // cmid , course , user , created , scale1 , scale2 , scale3 , scale4 , scale5 , scale6 , peso1 , peso2 , peso3 , peso4 , peso5 , peso6 , calc1 , calc2 , calc3 , calc4 , calc5 , calc6
+      echo $row["cmid"] . ";" . $row["course"] . ";" . $row["user"] . ";" . $row["created"] . ";" .
+           $row["scale1"] . ";" . $row["scale2"] . ";" . $row["scale3"] . ";" . $row["scale4"] . ";" . $row["scale5"] . ";" . $row["scale6"] . ";" .
+           $row["peso1"] . ";" . $row["peso2"] . ";" . $row["peso3"] . ";" . $row["peso4"] . ";" . $row["peso5"] . ";" . $row["peso6"] . ";" .
+           $row["calc1"] . ";" . $row["calc2"] . ";" . $row["calc3"] . ";" . $row["calc4"] . ";" . $row["calc5"] . ";" . $row["calc6"] . "<br/>\n";
+      } // for ($jj=0; $jj<$num1; $jj++)
+
+    }  //for ($ii=0; $ii<count($vet_cmid); $ii)
+
+  } // else if ($LST==1)
+
+
+//echo "||" . $cont;
+
+?>

+ 85 - 0
nasatlx_pesq.php

@@ -0,0 +1,85 @@
+<?php
+
+ // @copyright  2014 LInE - http://line.ime.usp.br
+
+ $conn = mysql_connect("localhost", "root", "XYZAdminLMDlA00--");
+ $db = mysql_select_db("moodle2_6_1_2014_02");
+
+ //$query_a = mysql_query("select m_course.*, m_nasatlx.course as cid, m_nasatlx.name from m_nasatlx, m_course where m_nasatlx.course = m_course.id");
+ $query_a = mysql_query("select * from m_nasatlx_resps where user in (115,49,15,100,122,158,180,112,193,130,137,138,41,75,210,174,37,165,102) group by cmid");
+ $cont = 0;
+
+ $cmids = array();
+ $cmids[30] = "1 - T1";
+ $cmids[193] = "2.4 - T1";
+ $cmids[196] = "2.x Desafio - T1";
+ $cmids[309] = "3.4 - T1";
+ $cmids[314] = "Discursiva - T1";
+
+
+ $cmids[68] = "1 - T2";
+ $cmids[203] = "2 - T2";
+ $cmids[204] = "2 Desafio - T2";
+ $cmids[321] = "3.4 - T2";
+ $cmids[324] = "Discursiva - T2";
+
+ $cmids[88] = "1 - T3";
+ $cmids[209] = "2 - T3";
+ $cmids[215] = "2 Desafio - T3";
+ $cmids[330] = "3.4 - T3";
+ $cmids[333] = "Discursiva - T3";
+
+
+
+ while ($d = mysql_fetch_array($query_a)) {
+  print $cmids[intVal(strval(($d["cmid"])))]. " " ." - " . intVal(strval(($d["cmid"])))."\n";
+  $query_r = mysql_query("select * from m_nasatlx_resps where  user in (115,49,15,100,122,158,180,112,193,130,137,138,41,75,210,174,37,165,102) and cmid = ".$d["cmid"]." and user > 7");
+  print "ESCALA";
+  while($d2 = mysql_fetch_array($query_r)){
+    print ";".$d2["user"]."";
+    }
+  print "\n";
+  
+  mysql_data_seek($query_r, 0);
+
+  $escalas = array();
+  for($i=0;$i<6;$i++)
+   $escalas[] = "scale".($i+1);
+  for($i=0;$i<6;$i++)
+   $escalas[] = "peso".($i+1);
+  for($i=0;$i<6;$i++)
+   $escalas[] = "calc".($i+1);
+
+  foreach($escalas as $e){
+    mysql_data_seek($query_r, 0);
+    print $e."";
+    while ($d2 = mysql_fetch_array($query_r)) {
+      print ";".str_replace(".", ",", $d2[$e]);
+      }
+    print "\n";
+    }
+
+  /*while($d2 = mysql_fetch_array($query_r)){
+   print 
+    $d2["scale1"].";".
+    $d2["scale2"].";".
+    $d2["scale3"].";".
+    $d2["scale4"].";".
+    $d2["scale5"].";".
+    $d2["scale6"].";";
+   print 
+    $d2["peso1"].";".
+    $d2["peso2"].";".
+    $d2["peso3"].";".
+    $d2["peso4"].";".
+    $d2["peso5"].";".
+    $d2["peso6"].";";
+   print 
+    $d2["calc1"].";".
+    $d2["calc2"].";".
+    $d2["calc3"].";".
+    $d2["calc4"].";".
+    $d2["calc5"].";".
+    $d2["calc6"].";\n";
+  }*/
+   }

+ 63 - 0
nasatlx_romenig.php

@@ -0,0 +1,63 @@
+<pre><?
+	$conn = mysql_connect("localhost", "root", "XYZAdminLMDlA00--");
+	$db = mysql_select_db("moodle2_6_1_2014_02");
+
+	//$query_a = mysql_query("select m_course.*, m_nasatlx.course as cid, m_nasatlx.name from m_nasatlx, m_course where m_nasatlx.course = m_course.id");
+	$query_a = mysql_query("select * from m_nasatlx_resps group by cmid");
+	$cont = 0;
+
+	$cmids = array();
+	$cmids[30] = "1 Exercícios - T1";
+	$cmids[193] = "2 Exercícios - T1";
+	$cmids[196] = "2 Desafio - T1";
+	$cmids[309] = "3 Exercícios - T1";
+	$cmids[314] = "3 Discursiva - T1";
+
+	$cmids[68] = "1 Exercícios - T2";
+	$cmids[203] = "2 Exercícios - T2";
+	$cmids[204] = "2 Desafio - T2";
+	$cmids[321] = "3 Exercícios - T2";
+	$cmids[324] = "3 Discursiva - T2";
+
+	$cmids[88] = "1 Exercícios - T3";
+	$cmids[209] = "2 Exercícios - T3";
+	$cmids[215] = "2 Desafio - T3";
+	$cmids[330] = "3 Exercícios - T3";
+	$cmids[333] = "3 Discursiva - T3";
+
+?>
+<? while($d = mysql_fetch_array($query_a)){ ?>
+			<h2><? echo $cmids[intVal(strval(($d["cmid"])))]. " " ." - " . intVal(strval(($d["cmid"]))); ?></h2>
+<?
+				$query_r = mysql_query("select * from m_nasatlx_resps where cmid = ".$d["cmid"]);
+				echo "scale1;scale2;scale3;scale4;scale5;scale6;peso1;peso2;peso3;peso4;peso5;peso6;calc1;calc2;calc3;calc4;calc5;calc6\n";
+				
+				while($d2 = mysql_fetch_array($query_r)){
+					echo 
+						$d2["scale1"].";".
+						$d2["scale2"].";".
+						$d2["scale3"].";".
+						$d2["scale4"].";".
+						$d2["scale5"].";".
+						$d2["scale6"].";";
+					echo 
+						$d2["peso1"].";".
+						$d2["peso2"].";".
+						$d2["peso3"].";".
+						$d2["peso4"].";".
+						$d2["peso5"].";".
+						$d2["peso6"].";";
+					echo 
+						$d2["calc1"].";".
+						$d2["calc2"].";".
+						$d2["calc3"].";".
+						$d2["calc4"].";".
+						$d2["calc5"].";".
+						$d2["calc6"].";\n";
+				}
+			?>
+		<? 
+			}
+
+			echo "||".$cont;
+		 ?>

BIN
pix/icon.gif


+ 1 - 0
teste.php

@@ -0,0 +1 @@
+<?php echo phpinfo(); ?>

+ 20 - 0
version.php

@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Defines the version of nasatlx
+ *
+ * This code fragment is called by moodle_needs_upgrading() and
+ * /admin/index.php
+ *
+ * @package    mod_nasatlx
+ * @copyright  2014 LInE - http://line.ime.usp.br
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->version   = 2010032200;      // The current module version (Date: YYYYMMDDXX)
+$plugin->requires  = 2014021100;      // Requires this Moodle version
+$plugin->cron      = 60;               // Period for cron to check this module (secs)
+$plugin->maturity = MATURITY_STABLE;
+$plugin->component = 'mod_nasatlx'; // To check on upgrade, that module sits in correct place

File diff suppressed because it is too large
+ 524 - 0
view.php


File diff suppressed because it is too large
+ 571 - 0
view.php-


File diff suppressed because it is too large
+ 545 - 0
view_2014_04_21.php