|
@@ -2,15 +2,15 @@
|
|
|
|
|
|
/**
|
|
/**
|
|
* Class that implements ilm_handle, in order to allow manipulation and management of HTML5 iLM
|
|
* Class that implements ilm_handle, in order to allow manipulation and management of HTML5 iLM
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @author Igor Moreira Félix
|
|
* @author Igor Moreira Félix
|
|
* @author Patricia Alves Rodrigues
|
|
* @author Patricia Alves Rodrigues
|
|
* @author Leônidas O. Brandão
|
|
* @author Leônidas O. Brandão
|
|
* @version v 1 2017/17/10
|
|
* @version v 1 2017/17/10
|
|
* @package mod_iassign_ilm_handlers
|
|
* @package mod_iassign_ilm_handlers
|
|
* @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
|
|
* @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
|
|
* - 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 if ($iassign_activity_item_configs) {
|
|
//T foreach ($iassign_activity_item_configs as $iassign_activity_item_config)
|
|
//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 $paramsStr .= "&" . $iassign_activity_item_config->param_name . "=" . urlencode($iassign_activity_item_config->param_value);
|
|
- //T }
|
|
|
|
|
|
+ //T }
|
|
break;
|
|
break;
|
|
case "editor_new":
|
|
case "editor_new":
|
|
$paramsStr .= "&iLM_PARAM_AssignmentURL=true";
|
|
$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.
|
|
//requestFullscreen is used to display an element in full screen mode.
|
|
if('requestFullscreen' in element) {
|
|
if('requestFullscreen' in element) {
|
|
element.requestFullscreen();
|
|
element.requestFullscreen();
|
|
- }
|
|
|
|
|
|
+ }
|
|
else if ('webkitRequestFullscreen' in element) {
|
|
else if ('webkitRequestFullscreen' in element) {
|
|
element.webkitRequestFullscreen();
|
|
element.webkitRequestFullscreen();
|
|
- }
|
|
|
|
|
|
+ }
|
|
else if ('mozRequestFullScreen' in element) {
|
|
else if ('mozRequestFullScreen' in element) {
|
|
element.mozRequestFullScreen();
|
|
element.mozRequestFullScreen();
|
|
- }
|
|
|
|
|
|
+ }
|
|
else if ('msRequestFullscreen' in element) {
|
|
else if ('msRequestFullscreen' in element) {
|
|
element.msRequestFullscreen();
|
|
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 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 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'
|
|
//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)
|
|
if ($view_teacherfileversion) { // get the exercise in Moodle data (teacher file)
|
|
$fileid = "";
|
|
$fileid = "";
|
|
$fs = get_file_storage();
|
|
$fs = get_file_storage();
|
|
@@ -277,7 +278,7 @@ class html5 implements ilm_handle {
|
|
let submissionbehavior = " . $ilm->submissionbehavior . ";
|
|
let submissionbehavior = " . $ilm->submissionbehavior . ";
|
|
evaluationResult = evaluation;
|
|
evaluationResult = evaluation;
|
|
//leo 2017/11/22 strAnswer = window.frames.iLM.getAnswer();
|
|
//leo 2017/11/22 strAnswer = window.frames.iLM.getAnswer();
|
|
- strAnswer = window.frames[0].getAnswer();
|
|
|
|
|
|
+ strAnswer = window.frames[0].getAnswer();
|
|
// alert('getEvaluationCallback(...)' + evaluation + ', strAnswer=' + strAnswer);
|
|
// alert('getEvaluationCallback(...)' + evaluation + ', strAnswer=' + strAnswer);
|
|
//comment = document.formEnvio.submission_comment.value;
|
|
//comment = document.formEnvio.submission_comment.value;
|
|
//leo alert('getEvaluationCallback: enviando evaluationResult=' + evaluation + ', strAnswer=' + strAnswer);
|
|
//leo alert('getEvaluationCallback: enviando evaluationResult=' + evaluation + ', strAnswer=' + strAnswer);
|
|
@@ -307,7 +308,7 @@ class html5 implements ilm_handle {
|
|
if (request.readyState === 4) {
|
|
if (request.readyState === 4) {
|
|
if (request.status === 200) {
|
|
if (request.status === 200) {
|
|
document.getElementById('check-message-success-submission').style.visibility = 'visible';
|
|
document.getElementById('check-message-success-submission').style.visibility = 'visible';
|
|
-
|
|
|
|
|
|
+
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
document.getElementById('check-message-success-submission').style.visibility = 'hidden';
|
|
document.getElementById('check-message-success-submission').style.visibility = 'hidden';
|
|
}, 3000);
|
|
}, 3000);
|
|
@@ -331,7 +332,7 @@ class html5 implements ilm_handle {
|
|
// 'MA_PARAM_Proposition' to request the content.
|
|
// 'MA_PARAM_Proposition' to request the content.
|
|
// Calls static function bellow: parameters are data to store in table '*_iassign_submission'
|
|
// 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
|
|
// 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",
|
|
"type" => "activity",
|
|
"notSEND" => "false",
|
|
"notSEND" => "false",
|
|
"addresPOST" => $enderecoPOST,
|
|
"addresPOST" => $enderecoPOST,
|
|
@@ -381,6 +382,8 @@ class html5 implements ilm_handle {
|
|
}
|
|
}
|
|
|
|
|
|
$iassign .= "</form></center>\n\n";
|
|
$iassign .= "</form></center>\n\n";
|
|
|
|
+ print '<br/><br/><br/><br/><br/><br/>ABUBLÉEÉÉÉÉÉÁDÁSDPOÁSKDOISAKDPOA<br/><br/><br/>';
|
|
|
|
+
|
|
return $iassign;
|
|
return $iassign;
|
|
} // public static function show_activity_in_ilm($iassign_statement_activity_item, $student_answer, $enderecoPOST, $view_teacherfileversion)
|
|
} // 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";
|
|
$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);
|
|
print_error($msg_error);
|
|
//xx print_error('error_add_ilm', 'iassign');
|
|
//xx print_error('error_add_ilm', 'iassign');
|
|
- //print("New file = " . file_jar . "<br/>");
|
|
|
|
|
|
+ //print("New file = " . file_jar . "<br/>");
|
|
}
|
|
}
|
|
else { // if (empty($file_jar))
|
|
else { // if (empty($file_jar))
|
|
$iassign_ilm = $DB->get_record('iassign_ilm', array("parent" => 0, "name" => (String) $application_xml->name));
|
|
$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";
|
|
$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);
|
|
print_error($msg_error);
|
|
//xx print_error('error_add_ilm', 'iassign');
|
|
//xx print_error('error_add_ilm', 'iassign');
|
|
- //print("Import file = " . file_jar . "<br/>");
|
|
|
|
- }
|
|
|
|
|
|
+ //print("Import file = " . file_jar . "<br/>");
|
|
|
|
+ }
|
|
else { // if (empty($file_jar))
|
|
else { // if (empty($file_jar))
|
|
$iassign_ilm = $DB->get_record('iassign_ilm', array("parent" => 0, "name" => (String) $application_xml->name));
|
|
$iassign_ilm = $DB->get_record('iassign_ilm', array("parent" => 0, "name" => (String) $application_xml->name));
|
|
if (!$iassign_ilm) {
|
|
if (!$iassign_ilm) {
|
|
@@ -994,7 +997,7 @@ class html5 implements ilm_handle {
|
|
if (!is_writable("ilm/")) {
|
|
if (!is_writable("ilm/")) {
|
|
print($OUTPUT->notification(get_string('error_folder_permission_denied', 'iassign'), 'notifyproblem'));
|
|
print($OUTPUT->notification(get_string('error_folder_permission_denied', 'iassign'), 'notifyproblem'));
|
|
exit;
|
|
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
|
|
// 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
|
|
//D foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item
|
|
foreach ($iterator = new RecursiveIteratorIterator(
|
|
foreach ($iterator = new RecursiveIteratorIterator(
|
|
new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST) as $item) {
|
|
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()) {
|
|
if ($item->isDir()) {
|
|
mkdir($directory_name);
|
|
mkdir($directory_name);
|
|
touch($directory_name . DIRECTORY_SEPARATOR . "index.html");
|
|
touch($directory_name . DIRECTORY_SEPARATOR . "index.html");
|
|
- }
|
|
|
|
|
|
+ }
|
|
else {
|
|
else {
|
|
copy($item, $directory_name);
|
|
copy($item, $directory_name);
|
|
}
|
|
}
|