4 Commit-ok f62cb39f49 ... 75ab4067df

Szerző SHA1 Üzenet Dátum
  leo 75ab4067df Atualizar 'ilm_handlers/java.php' 2 éve
  leo fa72f4bbb5 Atualizar 'lib.php' 2 éve
  leo 3206774bd0 Delete 'view.php0' 2 éve
  leo fdb2dda3b0 Merge branch 'master' of thiagogomesverissimo/iassign into master 2 éve
3 módosított fájl, 15 hozzáadás és 92 törlés
  1. 10 6
      ilm_handlers/java.php
  2. 5 4
      lib.php
  3. 0 82
      view.php0

+ 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;
         }
       }

+ 5 - 4
lib.php

@@ -3,11 +3,12 @@
 /**
  *  Library of functions and constants for module of activities iAssign.
  *  
+ *  - v 1.3.1 2022/09/19
+ *    + Changes in comments (erased accents)
  *  - v 1.3 2014/01/10
- *  		+ Insert comment unread in course module (iassign_cm_info_view).
- *  
+ *    + Insert comment unread in course module (iassign_cm_info_view).
  *  - v 1.2 2013/12/13
- *  		+ Insert log in iAssign actions.
+ *    + Insert log in iAssign actions.
  *  
  *  @author Patricia Alves Rodrigues
  *  @author Leônidas O. Brandão
@@ -505,4 +506,4 @@ function display_url_ilm ($url) {
     }
 
   return $url;
-  }
+  }

+ 0 - 82
view.php0

@@ -1,82 +0,0 @@
-<?php
-
-/**
- * This php script contains all the stuff to display iAssign.
- * 
- * @author Patricia Alves Rodrigues
- * @author Leo^nidas O. Branda~o
- * @version v 1.0 2012/10/16
- * @package mod_iassign
- * @since 2010/09/27
- * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
- * 
- * <b>License</b> 
- *  - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-require_once("../../config.php");
-require_once("lib.php");
-require_once($CFG->libdir . '/completionlib.php');
-require_once($CFG->libdir . '/plagiarismlib.php');
-
-//Parameters GET e POST (parâmetros GET e POST)
-$id = optional_param('id', 0, PARAM_INT); // Course Module ID
-$a = optional_param('a', 0, PARAM_INT); //  iAssign instance id (from table 'iassign')
-
-$mood_url = new moodle_url('/mod/iassign/view.php');
-
-if ($id) {
-  // ./lib/datalib.php : function get_coursemodule_from_id($modulename, $cmid, $courseid=0, $sectionnum=false, $strictness=IGNORE_MISSING): returns 'course_modules.*' and 'modules.name'
-  $cm = get_coursemodule_from_id('iassign', $id);
-  if (!$cm) { // Moodle function 'get_coursemodule_from_id(...)' returns the object from table '*_iassign_statement'
-    print_error('invalidcoursemodule');
-    }
-
-  $iassign = $DB->get_record("iassign", array("id" => $cm->instance));
-  if (!$iassign) { // 'course_modules.instance = iassign.id'
-    print_error('invalidid', 'iassign');
-    }
-
-  $course = $DB->get_record("course", array("id" => $iassign->course));
-  if (!$course) {
-    print_error('coursemisconf', 'iassign');
-    }
-  $mood_url->param('id', $id);
-  }
-else {
-  $iassign = $DB->get_record("iassign", array("id" => $a));
-  if (!$iassign) {
-    print_error('invalidid', 'iassign');
-    }
-  $course = $DB->get_record("course", array("id" => $iassign->course));
-  if (!$course) {
-    print_error('coursemisconf', 'iassign');
-    }
-  $cm = get_coursemodule_from_instance("iassign", $iassign->id, $course->id);
-  if (!$cm) {
-    print_error('invalidcoursemodule');
-    }
-  $mood_url->param('a', $a);
-  }
-
-$PAGE->set_url($mood_url);
-
-require_login($course, true, $cm);
-
-$PAGE->set_title(format_string($iassign->name));
-$PAGE->set_heading($course->fullname);
-
-// Mark viewed by user (if required)
-$completion = new completion_info($course);
-$completion->set_module_viewed($cm);
-
-// About each object
-// - $iassing :: object from table '*_iassign_statement'
-// - $cm      :: object from table '*_course_modules'
-// - $course  :: object from table '*_course_modules_completion'
-
-$write_solution = 1;
-//$iassigninstance = new iassign($iassign, $cm, $course, array('write_solution' => 1)); // locallib.php : class iassign : function __construct ($iassign, $cm, $course)
-$iassigninstance = new iassign($iassign, $cm, $course); // locallib.php : class iassign : function __construct ($iassign, $cm, $course)
-
-$iassigninstance->view(); // ./mod/iassign/locallib.php : actually who display the iAssign whose id is '$id'! (this function ignores parameters)