Browse Source

Atualizar 'ilm_handlers/java.php'

Changed comments and added test before and after "$content_or_id_from_ilm_security = $fileid;"
leo 1 year ago
parent
commit
75ab4067df
1 changed files with 10 additions and 6 deletions
  1. 10 6
      ilm_handlers/java.php

+ 10 - 6
ilm_handlers/java.php

@@ -3,9 +3,9 @@
 /**
  * Class that implements ilm_handle, in order to allow manipulation and management of Java iLM
  * 
- * @author Igor Moreira Félix
+ * @author Igor Moreira Fe'lix
  * @author Patricia Alves Rodrigues
- * @author Leônidas O. Brandão
+ * @author Leo^nidas de Oliveira Branda~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)
@@ -172,7 +172,7 @@ class java implements ilm_handle {
         var newText  = document.createTextNode("'.get_string('applet_blocked', 'iassign').'");
         newCell.appendChild(newText);
       }
-      </script>';
+      </script>'; // '
     return $verify_java . $html;
     }
 
@@ -212,19 +212,23 @@ class java implements ilm_handle {
 
     if ($ilm_name == "igeom") { // is iGeom exercise
       $is_igeom = true;
-      $content_or_id_from_ilm_security = $fileid; // $iassign_statement_activity_item->file;
+      if (isset($fileid))
+        $content_or_id_from_ilm_security = $fileid; // $iassign_statement_activity_item->file;
       if ($special_param1 == 1 && !empty($student_answer) && (!$view_teacherfileversion)) { // is script
         $view_teacherfileversion = true; // here when student is doing/redoing his activity
         }
-      elseif (!$view_teacherfileversion) { // Student seem his solution or teacher it (of one student)
+      elseif (!$view_teacherfileversion) { // Student seem his solution or teacher seem it (of one student)
         $content_or_id_from_ilm_security = $student_answer;
         }
+      else //TODO 2021/02 $fileid is used?
+        $content_or_id_from_ilm_security = $fileid; // $iassign_statement_activity_item->file;
       }
     else {
       if ($view_teacherfileversion) { // $view_teacherfileversion==1 => load the exercise ('activity') from the 'moodledata' (id in 'files')
         // $content_or_id_from_ilm_security = $this->context->id;
         $content_or_id_from_ilm_security = $fileid; // $iassign_statement_activity_item->file;
-        } else { // $view_teacherfileversion==null => load the learner answer from the data base (iassign_submission)
+        }
+      else { // $view_teacherfileversion==null => load the learner answer from the data base (iassign_submission)
         $content_or_id_from_ilm_security = $student_answer;
         }
       }