فهرست منبع

iassign_filter unknwon version

Lucas de Souza 6 سال پیش
کامیت
7cbe0f19c8
12فایلهای تغییر یافته به همراه433 افزوده شده و 0 حذف شده
  1. 69 0
      README
  2. 32 0
      db/install.php
  3. 184 0
      filter.php
  4. 9 0
      index.html
  5. 16 0
      lang/en/filter_iassign_filter.php
  6. 9 0
      lang/en/index.html
  7. 9 0
      lang/index.html
  8. 16 0
      lang/pt_br/filter_iassign_filter.php
  9. 9 0
      lang/pt_br/index.html
  10. BIN
      pix/icon.gif
  11. 9 0
      pix/index.html
  12. 71 0
      version.php

+ 69 - 0
README

@@ -0,0 +1,69 @@
+iAssign version 2.1.70
+------------------------
+
+By iMatica/iMath - free interactive tools for teaching-learning Math
+   Patricia Rodrigues <patricnet@ig.com.br>, Leônidas O. Brandão <leo@ime.usp.br>
+
+
+.: About iAssign :.
+
+This is the iAssign (Interactive Assignment) package, an iMath free system to enrich activities in Moodle. 
+It is created by Patricia Rodrigues and Leônidas de Oliveira Brandão.
+
+iAssign's goal is to increase interactivity in activities related to specific subjects (such as Geometry, Functions, Programming,...)
+in a flexible way. 
+
+In order to improve interactivity, iAssign makes use of iLM (interactive Learning Module),
+that is any interactive tool that runs under a Web browser.
+Typically an iLM is a Java applet with a few (mandatory) communication methods, all based on HTTP protocol.
+This implies that any applet can easily became an iLM and can be integrated to Moodle under iAssign package. 
+
+If the iLM offers automatic assessment functionality, iAssign is able
+to deal with it. Under such iLM, iAssign provides immediate feedback to
+the student, and the teachers can get instant information about their
+activities (including reports about the student performance).
+
+It can be added new iLM into iAssign, at any time, but (for security
+reason), only the administrator has the privilege of integrating new iLM into iAssign.
+Once integrated, an iLM can be used by anyone registered in its Moodle.
+For instance, an user with privileges of "teacher" is allowed to use
+the iAssign authoring tools to create activities with any iLM
+(like iGeom, iGraf, or iVprog, respectively to related to the subjects, Geometry, Functions and Programming).
+
+The main features of iAssign package are:
+ - The authoring tool to allow any teacher to easily prepare activities to students. Activities can be:
+   + an exercise (the student must send an answer, and if the iLM has automatic assessment, its results (right/wrong) is also registered);
+   + a test (the student does the activity, if iLM has automatic assessment, the student gets immediate feedback, but no data is recorded in Moodle's database);
+   + an example (the student can interact with the example, but nothing is recorded).
+ - Reports about students activities: 
+   + teachers can see, e.g., a survey or statistics about student's answers and can have quick access to any submited answer;
+   + the students have a survey of their activities (including their grades)
+ - Integration with general Moodle grades
+ - A filter that allows the insertion of iLM content into any (asynchronous) Moodle text.
+
+Besides, as the majority of Moodle modules, iAssign can export (as backup) one activity or a complete lesson (a set of activities).
+
+Note: This plugin is part of iAssign SET see more in https://moodle.org/plugins/browse.php?list=set&id=54
+
+.: Quick install instructions (to be used by the system administrator) :.
+
+0) Be sure you have (at least) Moodle 2.4 until Moodle 2.6 installed
+1) Be sure to have the latest language package, such as English (en), Portuguese (pt_br).
+2) Be sure to have the latest version of the module iAssign (see in https://github.com/leonidasbrandao/iAssign master)
+3) Unpack 'iAssign.2.1.x.zip' (or 'iAssign.2.1.x.tgz')
+4) Copy the 'iassign' filter directory into the "filter" subdirectory of Moodle installation
+5) Under role "administrator", go to the 'Site administration' and click on 'Notifications'
+6) Have fun.
+
+See more documentation in http://docs.moodle.org/en/iAssign_Filter
+
+Comments and suggestions are always welcome at http://www.matematica.br/iassign or https://github.com/leonidasbrandao/iAssign.
+(if the comment area is missing, please send us an email).
+
+
+Best regards,
+
+Leônidas <leo@ime.usp.br> and Patricia <patricnet@ig.com.br>
+
+Institute of Mathematics and Statistics - University of São Paulo
+iMath/LInE : http://www.matematica.br : http://line.ime.usp.br

+ 32 - 0
db/install.php

@@ -0,0 +1,32 @@
+<?php
+/**
+ * Script for install iassign filter in moodle.
+ *
+ * Release Notes:
+ * - v 1.0 2013/11/28
+ * 		+ Enable by default filter
+ * 		+ Enable filter content and titles.
+ *
+ * @author Luciano Oliveira Borges
+ * @author Patricia Alves Rodrigues
+ * @author Leônidas O. Brandão
+ * @version v 1.0 2013/11/28
+ * @package iassign_filter
+ * @since 2010/11/28
+ * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @see moodle_text_filter
+ */
+
+/**
+ * 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();
+
+function xmldb_filter_iassign_filter_install() {
+	global $CFG;
+	require_once("$CFG->libdir/filterlib.php");
+
+	filter_set_global_state('filter/iassign_filter', TEXTFILTER_ON);
+	filter_set_applies_to_strings('filter/iassign_filter', true);
+}

+ 184 - 0
filter.php

@@ -0,0 +1,184 @@
+<?php
+/**
+ * Filter iAssign
+ * 
+ * Release Notes:
+ * - v 1.2 2014/01/10
+ * 		+ Remove comment unread function of filter module.
+ * 
+ * - v 1.1 2013/10/31
+ * 		+ Fix bugs in message alert in iassign title and remove message alert of the description by cache error.
+ *
+ * @author Patricia Alves Rodrigues
+ * @author Leônidas O. Brandão
+ * @author Luciano Oliveira Borges
+ * @version v 1.2 2014/01/10
+ * @package iassign_filter
+ * @since 2010/09/27
+ * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @see moodle_text_filter
+ */
+
+/**
+ * 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 class looks for email addresses in Moodle text and
+ * hides them using the Moodle obfuscate_text function.
+ * @see moodle_text_filter
+ */
+class filter_iassign_filter extends moodle_text_filter {
+
+    /**
+     * This takes the HTML to be filtered as an argument
+     * @param string $text The text for filter
+     * @param array $options An array for option in the filter
+     * @return string Return the text with filter
+     */
+    function filter($text, array $options = array()) {
+
+        global $CFG, $DB, $USER, $COURSE;
+
+        if(file_exists($CFG->dirroot . '/mod/iassign/version.php')){
+        	
+	        $strs = explode("&lt;/ia&gt;", $text); // < (&lt;) - >(&gt;)
+	        if (count($strs) > 1) {
+	            $expressions = array();
+	            foreach ($strs as $str) {
+	                $tmp = explode("&lt;ia", $str); // < (&lt;) - / (&frasl;) >(&gt;)
+	                if (count($tmp) > 1)
+	                    $expressions[] = trim($tmp[1]);
+	            } //foreach($strs as $str)
+	
+	            $text = str_replace("&lt;/ia&gt;", "<br/>", $text);
+	            $text = str_replace("&lt;ia", "<br/>", $text);
+	
+	            foreach ($expressions as $expression) {
+	                // default
+	                $toolbar = 'disable'; // enable (habilita a barra de botões) disable (desabilita a barra de botões)
+	                $width = 800;
+	                $height = 600;
+	
+	                $tmp = explode("&gt;", $expression); //  >(&gt;)
+	                $params = trim($tmp[0]);
+	                $fileid = trim($tmp[1]);
+	
+	                $params = str_replace("'", "", $params);
+	                $params = str_replace("&quot;", "", $params);
+	                $params = explode(" ", $params);
+	
+	                foreach ($params as $param) {
+	                    $tmp1 = explode("=", $param);
+	
+	                    if ($tmp1[0] == "toolbar")
+	                        $toolbar = $tmp1[1];
+	
+	                    if ($tmp1[0] == "width")
+	                        $width = $tmp1[1];
+	
+	                    if ($tmp1[0] == "height")
+	                        $height = $tmp1[1];
+	                } //foreach($params as $param)
+	
+	
+	                $fs = get_file_storage();
+	                $file = $fs->get_file_by_id($fileid);
+	                $ia_content = '';
+	                $filename = '';
+	                $output = '';
+	                if ($file) {
+	                    $filename = $file->get_filename();
+	                    $ia_content = $file->get_content();
+	                    $file_string = utf8_encode($ia_content);
+	                    $output = $this->convert_applet($filename, $width, $height, $toolbar, $file_string, $fileid);
+	                } else {
+	                    $output = "<strong>" . get_string('filenotfound', 'filter_iassign_filter') . "</strong>";
+	                }
+	
+	                $text = str_replace($expression, $output, $text);
+	            } // foreach($expressions as $expression)
+	        } // if (count($strs)>1)
+	        	
+	        //TODO Retirar quando atualizar todo os iassign que estão com a tag &lt;ia_uc&gt;
+	        $strs = explode("&lt;ia_uc&gt;", $text);
+	        if (count($strs) > 1) {
+	        	$tmp = explode("&lt;/ia_uc&gt;", $strs[1]);
+	        	$expression = trim($tmp[0]);
+	        	$text = $strs[0];
+	        }
+	        	
+        }
+
+        return $text;
+    }
+
+    /**
+     * Convert paramms to html tag for applet
+     * @param string $file Filename of applet
+     * @param string $width Width of applet in html page
+     * @param string $height Height of applet in html page
+     * @param string $toolbar Enable toolbar of applet
+     * @param string $file_string The content for applet load
+     * @param string $fileid Id for identify of applet
+     * @return string Return html tag with a string  
+     */
+    function convert_applet($file, $width, $height, $toolbar, $file_string, $fileid) {
+        global $CFG, $DB;
+
+        $tmp = explode(".", $file);
+        $extension = $tmp[1];
+
+        $iassign_ilms = $DB->get_records("iassign_ilm", array('enable' => 1, 'parent' => 0));
+        foreach($iassign_ilms as $value) {
+			$extensions = explode(",", $value->extension);
+			if(in_array($extension, $extensions))   
+				$iassign_ilm = $value;
+        }
+
+        $output = '';
+        if (empty($iassign_ilm)) {
+            $output = "<strong>" . $extension . ": " . get_string('extensionnotfound', 'filter_iassign_filter') . "</strong>";
+        } else {
+
+            $lang = substr(current_language(), 0, 2);
+            $file_class = $iassign_ilm->file_class;
+            $notSEND = true;
+            
+            $file_url = array();
+            $fs = get_file_storage();
+            $files_jar = explode(",", $iassign_ilm->file_jar);
+            foreach($files_jar as $fj) {
+            	$file = $fs->get_file_by_id($fj);
+            	if (!$file)
+            		die($OUTPUT->notification ( get_string ( 'error_confirms_jar', 'iassign' ), 'notifyproblem' ));
+            	$url = moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(), $file->get_filearea(), $file->get_itemid(), $file->get_filepath(), $file->get_filename());
+            	array_push($file_url, $url);
+            }
+
+            $enderecoPOST = "";
+            $iassignid = 0;
+
+            $view = -1;
+            $token = '';
+            $end_file = $CFG->wwwroot .  '/mod/iassign/ilm_security.php?id=' . $fileid . '&token=' . $token . '&view=' . $view;
+
+            $output .= "
+               <applet name='iLM' code='$file_class' archive='".implode(",", $file_url)."' width='$width' height='$height' vspace=10 hspace=10>
+              ";
+            if ($toolbar == "disable")
+                $output .="<param name='SOH_ADD' value='ADD'>";
+            $output .="
+          
+           <param name='MA_PARAM_PropositionURL' value='true'/>
+           <param name='MA_PARAM_notSEND' value='false'/>
+           <param name='lang' value='$lang'/>
+           <param name='MA_PARAM_addresPOST' value='$enderecoPOST'> <!-- 2 -->
+           <param name='MA_PARAM_Proposition' value='" . $end_file . "'>
+           </applet> ";
+        }
+        return $output;
+    }
+}

+ 9 - 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>

+ 16 - 0
lang/en/filter_iassign_filter.php

@@ -0,0 +1,16 @@
+<?php
+/**
+ * This is french language file
+ * @author Patricia Alves Rodrigues
+ * @author Leônidas O. Brandão
+ * @version v 1.1 2013/08/29
+ * @package iassign_filter_lang
+ * @since 2010/09/27
+ * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+ 
+$string['filter_iassign_filter'] = 'iAssign filter';
+$string['filtername'] = 'iAssign filter';
+$string['extensionnotfound'] = 'No E-Learning Modules was found with that extension';
+$string['filenotfound'] = 'File not found in the activity. Notify the teacher';

+ 9 - 0
lang/en/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
lang/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>

+ 16 - 0
lang/pt_br/filter_iassign_filter.php

@@ -0,0 +1,16 @@
+<?php
+/**
+ * This is portuguese language file
+ * @author Patricia Alves Rodrigues
+ * @author Leônidas O. Brandão
+ * @version v 1.1 2012/08/29
+ * @package iassign_filter_lang
+ * @since 2010/09/27
+ * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+$string['filter_iassign_filter'] = 'Filtro iTarefa';
+$string['filtername'] = 'Filtro iTarefa';
+$string['extensionnotfound'] = 'Nenhum Módulo de Aprendizagem com essa extensão foi encontrado';
+$string['filenotfound'] = 'Arquivo da atividade não encontrado. Informe o professor.';

+ 9 - 0
lang/pt_br/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>

BIN
pix/icon.gif


+ 9 - 0
pix/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>

+ 71 - 0
version.php

@@ -0,0 +1,71 @@
+<?php
+/**
+ * @mainpage
+ * This is the iAssign (Interactive Assignment) package, an iMath free system to enrich activities in Moodle.
+ * It is created by Patricia Rodrigues and Leônidas de Oliveira Brandão.
+ *
+ * iAssign's goal is to increase interactivity in activities related to specific subjects (such as Geometry, Functions, Programming,...)
+ * in a flexible way.
+ *
+ * In order to improve interactivity, iAssign makes use of iLM (interactive Learning Module),
+ * that is any interactive tool that runs under a Web browser.
+ * Typically an iLM is a Java applet with a few (mandatory) communication methods, all based on HTTP protocol.
+ * This implies that any applet can easily became an iLM and can be integrated to Moodle under iAssign package.
+ *
+ * If the iLM offers automatic assessment functionality, iAssign is able
+ * to deal with it. Under such iLM, iAssign provides immediate feedback to
+ * the student, and the teachers can get instant information about their
+ * activities (including reports about the student performance).
+ *
+ * It can be added new iLM into iAssign, at any time, but (for security
+ * reason), only the administrator has the privilege of integrating new iLM into iAssign.
+ * Once integrated, an iLM can be used by anyone registered in its Moodle.
+ * For instance, an user with privileges of "teacher" is allowed to use
+ * the iAssign authoring tools to create activities with any iLM
+ * (like iGeom, iGraf, or iVprog, respectively to related to the subjects, Geometry, Functions and Programming).
+ *
+ * The main features of iAssign package are:
+ * - The authoring tool to allow any teacher to easily prepare activities to students. Activities can be:
+ *    + an exercise (the student must send an answer, and if the iLM has automatic assessment, its results (right/wrong) is also registered);
+ *    + a test (the student does the activity, if iLM has automatic assessment, the student gets immediate feedback, but no data is recorded in Moodle's database);
+ *    + an example (the student can interact with the example, but nothing is recorded).
+ *  - Reports about students activities:
+ *    + teachers can see, e.g., a survey or statistics about student's answers and can have quick access to any submited answer;
+ *    + the students have a survey of their activities (including their grades)
+ *  - Integration with general Moodle grades
+ *  - A filter that allows the insertion of iLM content into any (asynchronous) Moodle text.
+ *
+ * @author Patricia Alves Rodrigues <<patricnet@ig.com.br>>
+ * @author Leônidas O. Brandão  <<leo@ime.usp.br>>
+ *
+ * @version v 2.1.16 2013/10/31
+ * @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
+ *
+ *  <br><br><a href="../index.html"><b>Return to iAssign Documentation</b></a>
+ */
+/**
+ * Version File
+ * @author Patricia Alves Rodrigues
+ * @author Leônidas O. Brandão
+ * @version v 1.0 2012/01/10
+ * @package iassign_filter_version
+ * @since 2012/10/10
+ * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
+ * @license 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.
+ */
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'filter_iassign_filter'; // Full name of the plugin (used for diagnostics)
+$plugin->release = '2.1.87 (Build: 2014070100)';	// Human-readable version name
+$plugin->version  = 2014070100;    // The current module version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900;    // Requires this Moodle version
+$plugin->maturity = MATURITY_STABLE;	// How stable the plugin is: MATURITY_ALPHA, MATURITY_BETA, MATURITY_RC, MATURITY_STABLE (Moodle 2.0 and above)
+$plugin->dependencies = array('mod_iassign' => 2014012100);