Browse Source

remove extra call to useless method

Bernardo Martins 2 years ago
parent
commit
b60fa47ee1
2 changed files with 25 additions and 26 deletions
  1. 19 16
      ilm_handlers/html5.php
  2. 6 10
      locallib.php

+ 19 - 16
ilm_handlers/html5.php

@@ -2,15 +2,15 @@
 
 /**
  * Class that implements ilm_handle, in order to allow manipulation and management of HTML5 iLM
- * 
+ *
  * @author Igor Moreira Félix
  * @author Patricia Alves Rodrigues
  * @author Leônidas O. Brandão
  * @version v 1 2017/17/10
  * @package mod_iassign_ilm_handlers
  * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
- * 
- * <b>License</b> 
+ *
+ * <b>License</b>
  *  - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
@@ -114,7 +114,7 @@ class html5 implements ilm_handle {
             //T if ($iassign_activity_item_configs) {
             //T   foreach ($iassign_activity_item_configs as $iassign_activity_item_config)
             //T     $paramsStr .= "&" . $iassign_activity_item_config->param_name . "=" . urlencode($iassign_activity_item_config->param_value);
-            //T       }      
+            //T       }
             break;
           case "editor_new":
             $paramsStr .= "&iLM_PARAM_AssignmentURL=true";
@@ -152,13 +152,13 @@ class html5 implements ilm_handle {
       //requestFullscreen is used to display an element in full screen mode.
       if('requestFullscreen' in element) {
         element.requestFullscreen();
-      } 
+      }
       else if ('webkitRequestFullscreen' in element) {
         element.webkitRequestFullscreen();
-      } 
+      }
       else if ('mozRequestFullScreen' in element) {
         element.mozRequestFullScreen();
-      } 
+      }
       else if ('msRequestFullscreen' in element) {
         element.msRequestFullscreen();
       }
@@ -187,6 +187,7 @@ class html5 implements ilm_handle {
     //TODO Given an activity => find its correspondent file in Moodle data. Bad solution!
     //TODO Change the meaning of 'iassign_statement.file' from insertion order to the ID in table 'files'.
     //TODO This demands update to each 'iassign_statement', find its corresponding on in 'files', and update 'iassign_statement.file = files.id'
+
     if ($view_teacherfileversion) { // get the exercise in Moodle data (teacher file)
       $fileid = "";
       $fs = get_file_storage();
@@ -277,7 +278,7 @@ class html5 implements ilm_handle {
     let submissionbehavior = " . $ilm->submissionbehavior . ";
     evaluationResult = evaluation;
     //leo 2017/11/22 strAnswer = window.frames.iLM.getAnswer();
-    strAnswer = window.frames[0].getAnswer();      
+    strAnswer = window.frames[0].getAnswer();
     // alert('getEvaluationCallback(...)' + evaluation + ', strAnswer=' + strAnswer);
     //comment = document.formEnvio.submission_comment.value;
     //leo alert('getEvaluationCallback: enviando evaluationResult=' + evaluation + ', strAnswer=' + strAnswer);
@@ -307,7 +308,7 @@ class html5 implements ilm_handle {
           if (request.readyState === 4) {
             if (request.status === 200) {
               document.getElementById('check-message-success-submission').style.visibility = 'visible';
-              
+
               setTimeout(function(){
                 document.getElementById('check-message-success-submission').style.visibility = 'hidden';
               }, 3000);
@@ -331,7 +332,7 @@ class html5 implements ilm_handle {
     // 'MA_PARAM_Proposition' to request the content.
     // Calls static function bellow: parameters are data to store in table '*_iassign_submission'
     // In 'locallib.php ! class ilm_settings ! static function build_ilm_tags($ilm_id, $options = array())' that calls 'build_ilm_tags(.)' from here
-    $iassign .= ilm_settings::build_ilm_tags($ilm->id, array(
+    $iassign .= html5::build_ilm_tags($ilm->id, array(
       "type" => "activity",
       "notSEND" => "false",
       "addresPOST" => $enderecoPOST,
@@ -381,6 +382,8 @@ class html5 implements ilm_handle {
       }
 
     $iassign .= "</form></center>\n\n";
+    print '<br/><br/><br/><br/><br/><br/>ABUBLÉEÉÉÉÉÉÁDÁSDPOÁSKDOISAKDPOA<br/><br/><br/>';
+
     return $iassign;
     } // public static function show_activity_in_ilm($iassign_statement_activity_item, $student_answer, $enderecoPOST, $view_teacherfileversion)
 
@@ -827,7 +830,7 @@ class html5 implements ilm_handle {
         $msg_error = get_string('error_add_ilm', 'iassign') . "<br/>In new_ilm: file_jar empty, files_extract=" . $files_extract . "<br/>\n";
         print_error($msg_error);
         //xx print_error('error_add_ilm', 'iassign');
-        //print("New file = " . file_jar . "<br/>");	  
+        //print("New file = " . file_jar . "<br/>");
         }
       else { // if (empty($file_jar))
         $iassign_ilm = $DB->get_record('iassign_ilm', array("parent" => 0, "name" => (String) $application_xml->name));
@@ -919,8 +922,8 @@ class html5 implements ilm_handle {
         $msg_error = get_string('error_add_ilm', 'iassign') . "<br/>In import_ilm: file_jar empty, files_extract=" . $files_extract . "<br/>\n";
         print_error($msg_error);
         //xx print_error('error_add_ilm', 'iassign');
-        //print("Import file = " . file_jar . "<br/>");	  
-        }	
+        //print("Import file = " . file_jar . "<br/>");
+        }
       else { // if (empty($file_jar))
         $iassign_ilm = $DB->get_record('iassign_ilm', array("parent" => 0, "name" => (String) $application_xml->name));
         if (!$iassign_ilm) {
@@ -994,7 +997,7 @@ class html5 implements ilm_handle {
     if (!is_writable("ilm/")) {
       print($OUTPUT->notification(get_string('error_folder_permission_denied', 'iassign'), 'notifyproblem'));
       exit;
-      // return null; // Is safer to stop the processing in order to allow the reader of this error! 
+      // return null; // Is safer to stop the processing in order to allow the reader of this error!
       }
 
     // The filter 'filename_from_iLM_name(...)' is essential to clear the name for directory from the iLM original name
@@ -1038,11 +1041,11 @@ class html5 implements ilm_handle {
     //D foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item
     foreach ($iterator = new RecursiveIteratorIterator(
       new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST) as $item) {
-      $directory_name = $diretorio . DIRECTORY_SEPARATOR . $iterator->getSubPathName();	
+      $directory_name = $diretorio . DIRECTORY_SEPARATOR . $iterator->getSubPathName();
       if ($item->isDir()) {
         mkdir($directory_name);
         touch($directory_name . DIRECTORY_SEPARATOR . "index.html");
-        } 
+        }
       else {
         copy($item, $directory_name);
         }

+ 6 - 10
locallib.php

@@ -244,24 +244,21 @@ class iassign {
 
     if ($this->action) { // when student do/redo activity or teacher see student solution
       $this->action(); // calls '$this->view_iLM();'
-      }
-    else {
+    } else {
       print $OUTPUT->header();
       $this->view_iassigns(); // show the iLM with the content
       print $OUTPUT->footer();
-      }
+    }
 
     // Security: delete all records with an error loading iLM - 'iassign_security : id iassign_statementid userid file timecreated view'
     //D $DB->delete_records("iassign_security", array("userid" => $USER->id, "view" => 1));
     //D $iassign_iLM_security = $DB->get_record("iassign_security", array("iassign_statementid" => $iassign_statementid));
     //D foreach ($iassign_iLM_security as $item) { echo $iassign_iLM_security->id . " ; " . $iassign_iLM_security->iassign_statementid . " ; " . $iassign_iLM_security->userid . " ; "  . $iassign_iLM_security->timecreated . " ; " .  $iassign_iLM_security->view . " ; " . $iassign_iLM_security->file . "<br/>\n"   }
     $DB->delete_records("iassign_security", array("userid" => $USER->id, "iassign_statementid" => $iassign_statementid));
-    //D $iassign_iLM_security = $DB->get_record("iassign_security", array("iassign_statementid" => $iassign_statementid));
-    //D if ($iassign_iLM_security) foreach ($iassign_iLM_security as $item) { echo $iassign_iLM_security->id . " ; " . $iassign_iLM_security->iassign_statementid . " ; " . $iassign_iLM_security->userid . " ; "  . $iassign_iLM_security->timecreated . " ; " .  $iassign_iLM_security->view . " ; " . $iassign_iLM_security->file . "<br/>\n"   }
-    //D else echo "Apagou!<br/>";
-
-    die();
-    } // function view()
+    // D $iassign_iLM_security = $DB->get_record("iassign_security", array("iassign_statementid" => $iassign_statementid));
+    // D if ($iassign_iLM_security) foreach ($iassign_iLM_security as $item) { echo $iassign_iLM_security->id . " ; " . $iassign_iLM_security->iassign_statementid . " ; " . $iassign_iLM_security->userid . " ; "  . $iassign_iLM_security->timecreated . " ; " .  $iassign_iLM_security->view . " ; " . $iassign_iLM_security->file . "<br/>\n"   }
+    // D else echo "Apagou!<br/>";
+  } // End function view()
 
 
   /// Execute the action from Moodle (move, make visible, register the exercise (teacher) or its answer (learner)...)
@@ -2843,7 +2840,6 @@ var exercises = [ '; // '
         $this->bottonPost = 1;
 
       print $OUTPUT->box('<p><strong>' . get_string('area_specific_teacher', 'iassign') . '</strong></p>');
-
       $this->activity->view_dates();
       $USER->iassignEdit = $this->bottonPost;
       $this->activity->show_info_iassign();