From 9fc6a4db9a5db5beccfaf92030f1033de7f914c0 Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 30 Aug 2017 22:58:53 +0200 Subject: [PATCH 01/38] 2017083000 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 ++++++++++++++++++++++++++++++++++++- quizzes/lib/integration.ini | 12 ++++----- thirdpartylibs.xml | 2 +- version.php | 4 +-- 5 files changed, 66 insertions(+), 14 deletions(-) diff --git a/info.php b/info.php index ade6ab29..82b1d043 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index ee141f35..cfef649d 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,4 +74,56 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; +$string['wq_help'] = 'Generic WIRIS quizzes Help'; +$string['editingwq'] = 'Editing a generic WIRIS question'; +$string['addingwq'] = 'Adding a generic WIRIS question'; +$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; +$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; +$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; +$string['cachedef_images'] = "WIRIS Quizzes images."; +$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; +$string['info_tableheader_test'] = "Test"; +$string['info_tableheader_report'] = "Report"; +$string['info_tableheader_status'] = "Status"; +$string['info_disabled'] = "DISABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; +$string['info_test1_name'] = "WIRIS quizzes version"; +$string['info_test1_rt1'] = "WIRIS quizzes version is "; +$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; +$string['info_test2_name'] = "WIRIS plugin version"; +$string['info_test2_info'] = "Check WIRIS plugin "; +$string['info_test2_infopage'] = "info page"; +$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; +$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; +$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; +$string['info_test3_name'] = "Moodle version"; +$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; +$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; +$string['info_test3_rt3'] = "Impossible to find Moodle version file."; +$string['info_test4_name'] = "Plugins"; +$string['info_test4_pluginname1'] = "True/False question type"; +$string['info_test4_pluginname2'] = "Short-Answer question type"; +$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; +$string['info_test4_pluginname4'] = "Multi Choice question type"; +$string['info_test4_pluginname5'] = "Matching question type"; +$string['info_test4_pluginname6'] = "Essay question type"; +$string['info_test4_pluginname7'] = "Commons question type"; +$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; +$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; +$string['info_test4_rt3'] = "Install"; +$string['info_test5_name'] = "Database"; +$string['info_test5_rt1'] = "All WIRIS tables are present."; +$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; +$string['info_test6_name'] = "WIRIS quizzes"; +$string['info_test7_name'] = "Checking WIRIS configuration"; +$string['info_test8_name'] = "Checking if WIRIS server is reachable"; +$string['info_test8_rt1'] = "Connecting to %s at port %s"; +$string['info_test9_name'] = "WIRIS quizzes service"; +$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; +$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; +$string['info_test12_name'] = "Max server connections"; +$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; +$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index 404c265e..c07bb334 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" - ; - ; Classpath and Class used in Moodle to overwrite service.php and cache folder path - ; +; +; Classpath and Class used in Moodle to overwrite service.php and cache folder path +; - quizzes.configuration.classpath = "../classes" - quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file +quizzes.configuration.classpath = "../classes" +quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 615e0dae..453c2435 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.56.1.1026 + 3.55.0.1025 GPL 3.0+ diff --git a/version.php b/version.php index 98827044..adaf5f42 100644 --- a/version.php +++ b/version.php @@ -18,8 +18,8 @@ $plugin->version = 2017083000; $plugin->requires = 2011120500; // Moodle 2.2. -$plugin->release = '3.56.1.1026'; -$plugin->maturity = MATURITY_STABLE; + +$plugin->maturity = MATURITY_BETA; $plugin->component = 'qtype_wq'; $plugin->dependencies = array ( 'filter_wiris' => ANY_VERSION From bdcd4ca2c9e6df7893b99b3b1793b750f9f9de51 Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 1 Sep 2017 01:32:52 +0200 Subject: [PATCH 02/38] 2017090100 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 +------------------------------------ quizzes/lib/integration.ini | 12 ++++----- thirdpartylibs.xml | 2 +- version.php | 2 +- 5 files changed, 13 insertions(+), 65 deletions(-) diff --git a/info.php b/info.php index 82b1d043..ade6ab29 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index cfef649d..ee141f35 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,56 +74,4 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; -$string['wq_help'] = 'Generic WIRIS quizzes Help'; -$string['editingwq'] = 'Editing a generic WIRIS question'; -$string['addingwq'] = 'Adding a generic WIRIS question'; -$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; -$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; -$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['cachedef_images'] = "WIRIS Quizzes images."; -$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; -$string['info_tableheader_test'] = "Test"; -$string['info_tableheader_report'] = "Report"; -$string['info_tableheader_status'] = "Status"; -$string['info_disabled'] = "DISABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; -$string['info_test1_name'] = "WIRIS quizzes version"; -$string['info_test1_rt1'] = "WIRIS quizzes version is "; -$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; -$string['info_test2_name'] = "WIRIS plugin version"; -$string['info_test2_info'] = "Check WIRIS plugin "; -$string['info_test2_infopage'] = "info page"; -$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; -$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; -$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; -$string['info_test3_name'] = "Moodle version"; -$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; -$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; -$string['info_test3_rt3'] = "Impossible to find Moodle version file."; -$string['info_test4_name'] = "Plugins"; -$string['info_test4_pluginname1'] = "True/False question type"; -$string['info_test4_pluginname2'] = "Short-Answer question type"; -$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; -$string['info_test4_pluginname4'] = "Multi Choice question type"; -$string['info_test4_pluginname5'] = "Matching question type"; -$string['info_test4_pluginname6'] = "Essay question type"; -$string['info_test4_pluginname7'] = "Commons question type"; -$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; -$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; -$string['info_test4_rt3'] = "Install"; -$string['info_test5_name'] = "Database"; -$string['info_test5_rt1'] = "All WIRIS tables are present."; -$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; -$string['info_test6_name'] = "WIRIS quizzes"; -$string['info_test7_name'] = "Checking WIRIS configuration"; -$string['info_test8_name'] = "Checking if WIRIS server is reachable"; -$string['info_test8_rt1'] = "Connecting to %s at port %s"; -$string['info_test9_name'] = "WIRIS quizzes service"; -$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; -$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; -$string['info_test12_name'] = "Max server connections"; -$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; -$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index c07bb334..404c265e 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" -; -; Classpath and Class used in Moodle to overwrite service.php and cache folder path -; + ; + ; Classpath and Class used in Moodle to overwrite service.php and cache folder path + ; -quizzes.configuration.classpath = "../classes" -quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file + quizzes.configuration.classpath = "../classes" + quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 453c2435..615e0dae 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.55.0.1025 + 3.56.1.1026 GPL 3.0+ diff --git a/version.php b/version.php index adaf5f42..d3c763fd 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017083000; +$plugin->version = 2017090100; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From e968cae60203989c0be2a7c78449867925b00830 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 2 Sep 2017 01:04:49 +0200 Subject: [PATCH 03/38] 2017090200 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index d3c763fd..fdf50955 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017090100; +$plugin->version = 2017090200; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From c45edb12fb15ea37c7aa60cbe8399e640588ed07 Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 4 Sep 2017 09:40:19 +0200 Subject: [PATCH 04/38] 2017090400 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 ++++++++++++++++++++++++++++++++++++- quizzes/lib/integration.ini | 12 ++++----- thirdpartylibs.xml | 2 +- version.php | 2 +- 5 files changed, 65 insertions(+), 13 deletions(-) diff --git a/info.php b/info.php index ade6ab29..82b1d043 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index ee141f35..cfef649d 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,4 +74,56 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; +$string['wq_help'] = 'Generic WIRIS quizzes Help'; +$string['editingwq'] = 'Editing a generic WIRIS question'; +$string['addingwq'] = 'Adding a generic WIRIS question'; +$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; +$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; +$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; +$string['cachedef_images'] = "WIRIS Quizzes images."; +$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; +$string['info_tableheader_test'] = "Test"; +$string['info_tableheader_report'] = "Report"; +$string['info_tableheader_status'] = "Status"; +$string['info_disabled'] = "DISABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; +$string['info_test1_name'] = "WIRIS quizzes version"; +$string['info_test1_rt1'] = "WIRIS quizzes version is "; +$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; +$string['info_test2_name'] = "WIRIS plugin version"; +$string['info_test2_info'] = "Check WIRIS plugin "; +$string['info_test2_infopage'] = "info page"; +$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; +$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; +$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; +$string['info_test3_name'] = "Moodle version"; +$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; +$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; +$string['info_test3_rt3'] = "Impossible to find Moodle version file."; +$string['info_test4_name'] = "Plugins"; +$string['info_test4_pluginname1'] = "True/False question type"; +$string['info_test4_pluginname2'] = "Short-Answer question type"; +$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; +$string['info_test4_pluginname4'] = "Multi Choice question type"; +$string['info_test4_pluginname5'] = "Matching question type"; +$string['info_test4_pluginname6'] = "Essay question type"; +$string['info_test4_pluginname7'] = "Commons question type"; +$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; +$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; +$string['info_test4_rt3'] = "Install"; +$string['info_test5_name'] = "Database"; +$string['info_test5_rt1'] = "All WIRIS tables are present."; +$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; +$string['info_test6_name'] = "WIRIS quizzes"; +$string['info_test7_name'] = "Checking WIRIS configuration"; +$string['info_test8_name'] = "Checking if WIRIS server is reachable"; +$string['info_test8_rt1'] = "Connecting to %s at port %s"; +$string['info_test9_name'] = "WIRIS quizzes service"; +$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; +$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; +$string['info_test12_name'] = "Max server connections"; +$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; +$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index 404c265e..c07bb334 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" - ; - ; Classpath and Class used in Moodle to overwrite service.php and cache folder path - ; +; +; Classpath and Class used in Moodle to overwrite service.php and cache folder path +; - quizzes.configuration.classpath = "../classes" - quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file +quizzes.configuration.classpath = "../classes" +quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 615e0dae..453c2435 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.56.1.1026 + 3.55.0.1025 GPL 3.0+ diff --git a/version.php b/version.php index fdf50955..0f1736e0 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017090200; +$plugin->version = 2017090400; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 89aecc9ae22e8d42ae328fc67722b01ea1682dcf Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 5 Sep 2017 00:23:08 +0200 Subject: [PATCH 05/38] 2017090500 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 +------------------------------------ quizzes/lib/integration.ini | 12 ++++----- thirdpartylibs.xml | 2 +- version.php | 2 +- 5 files changed, 13 insertions(+), 65 deletions(-) diff --git a/info.php b/info.php index 82b1d043..ade6ab29 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index cfef649d..ee141f35 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,56 +74,4 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; -$string['wq_help'] = 'Generic WIRIS quizzes Help'; -$string['editingwq'] = 'Editing a generic WIRIS question'; -$string['addingwq'] = 'Adding a generic WIRIS question'; -$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; -$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; -$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['cachedef_images'] = "WIRIS Quizzes images."; -$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; -$string['info_tableheader_test'] = "Test"; -$string['info_tableheader_report'] = "Report"; -$string['info_tableheader_status'] = "Status"; -$string['info_disabled'] = "DISABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; -$string['info_test1_name'] = "WIRIS quizzes version"; -$string['info_test1_rt1'] = "WIRIS quizzes version is "; -$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; -$string['info_test2_name'] = "WIRIS plugin version"; -$string['info_test2_info'] = "Check WIRIS plugin "; -$string['info_test2_infopage'] = "info page"; -$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; -$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; -$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; -$string['info_test3_name'] = "Moodle version"; -$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; -$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; -$string['info_test3_rt3'] = "Impossible to find Moodle version file."; -$string['info_test4_name'] = "Plugins"; -$string['info_test4_pluginname1'] = "True/False question type"; -$string['info_test4_pluginname2'] = "Short-Answer question type"; -$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; -$string['info_test4_pluginname4'] = "Multi Choice question type"; -$string['info_test4_pluginname5'] = "Matching question type"; -$string['info_test4_pluginname6'] = "Essay question type"; -$string['info_test4_pluginname7'] = "Commons question type"; -$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; -$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; -$string['info_test4_rt3'] = "Install"; -$string['info_test5_name'] = "Database"; -$string['info_test5_rt1'] = "All WIRIS tables are present."; -$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; -$string['info_test6_name'] = "WIRIS quizzes"; -$string['info_test7_name'] = "Checking WIRIS configuration"; -$string['info_test8_name'] = "Checking if WIRIS server is reachable"; -$string['info_test8_rt1'] = "Connecting to %s at port %s"; -$string['info_test9_name'] = "WIRIS quizzes service"; -$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; -$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; -$string['info_test12_name'] = "Max server connections"; -$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; -$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index c07bb334..404c265e 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" -; -; Classpath and Class used in Moodle to overwrite service.php and cache folder path -; + ; + ; Classpath and Class used in Moodle to overwrite service.php and cache folder path + ; -quizzes.configuration.classpath = "../classes" -quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file + quizzes.configuration.classpath = "../classes" + quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 453c2435..615e0dae 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.55.0.1025 + 3.56.1.1026 GPL 3.0+ diff --git a/version.php b/version.php index 0f1736e0..5841e0c2 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017090400; +$plugin->version = 2017090500; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 2112f5b338abcef516d350bfe09143a2bafa9c97 Mon Sep 17 00:00:00 2001 From: Manuel Date: Thu, 7 Sep 2017 00:05:54 +0200 Subject: [PATCH 06/38] 2017090700 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 ++++++++++++++++++++++++++++++++++++- quizzes/lib/integration.ini | 12 ++++----- thirdpartylibs.xml | 2 +- version.php | 2 +- 5 files changed, 65 insertions(+), 13 deletions(-) diff --git a/info.php b/info.php index ade6ab29..82b1d043 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index ee141f35..cfef649d 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,4 +74,56 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; +$string['wq_help'] = 'Generic WIRIS quizzes Help'; +$string['editingwq'] = 'Editing a generic WIRIS question'; +$string['addingwq'] = 'Adding a generic WIRIS question'; +$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; +$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; +$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; +$string['cachedef_images'] = "WIRIS Quizzes images."; +$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; +$string['info_tableheader_test'] = "Test"; +$string['info_tableheader_report'] = "Report"; +$string['info_tableheader_status'] = "Status"; +$string['info_disabled'] = "DISABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; +$string['info_test1_name'] = "WIRIS quizzes version"; +$string['info_test1_rt1'] = "WIRIS quizzes version is "; +$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; +$string['info_test2_name'] = "WIRIS plugin version"; +$string['info_test2_info'] = "Check WIRIS plugin "; +$string['info_test2_infopage'] = "info page"; +$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; +$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; +$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; +$string['info_test3_name'] = "Moodle version"; +$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; +$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; +$string['info_test3_rt3'] = "Impossible to find Moodle version file."; +$string['info_test4_name'] = "Plugins"; +$string['info_test4_pluginname1'] = "True/False question type"; +$string['info_test4_pluginname2'] = "Short-Answer question type"; +$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; +$string['info_test4_pluginname4'] = "Multi Choice question type"; +$string['info_test4_pluginname5'] = "Matching question type"; +$string['info_test4_pluginname6'] = "Essay question type"; +$string['info_test4_pluginname7'] = "Commons question type"; +$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; +$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; +$string['info_test4_rt3'] = "Install"; +$string['info_test5_name'] = "Database"; +$string['info_test5_rt1'] = "All WIRIS tables are present."; +$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; +$string['info_test6_name'] = "WIRIS quizzes"; +$string['info_test7_name'] = "Checking WIRIS configuration"; +$string['info_test8_name'] = "Checking if WIRIS server is reachable"; +$string['info_test8_rt1'] = "Connecting to %s at port %s"; +$string['info_test9_name'] = "WIRIS quizzes service"; +$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; +$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; +$string['info_test12_name'] = "Max server connections"; +$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; +$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index 404c265e..c07bb334 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" - ; - ; Classpath and Class used in Moodle to overwrite service.php and cache folder path - ; +; +; Classpath and Class used in Moodle to overwrite service.php and cache folder path +; - quizzes.configuration.classpath = "../classes" - quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file +quizzes.configuration.classpath = "../classes" +quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 615e0dae..453c2435 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.56.1.1026 + 3.55.0.1025 GPL 3.0+ diff --git a/version.php b/version.php index 5841e0c2..3d142755 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017090500; +$plugin->version = 2017090700; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 6cd6f17551b0054a3cff849c7fabc6b6b1f91aab Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 8 Sep 2017 00:59:10 +0200 Subject: [PATCH 07/38] 2017090800 development version --- info.php | 8 +-- lang/en/qtype_wq.php | 54 +------------------ .../com/wiris/quizzes/test/Tester.class.php | 41 ++++++++++---- quizzes/lib/integration.ini | 14 ++--- thirdpartylibs.xml | 2 +- version.php | 2 +- 6 files changed, 45 insertions(+), 76 deletions(-) diff --git a/info.php b/info.php index 82b1d043..ade6ab29 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index cfef649d..ee141f35 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,56 +74,4 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; -$string['wq_help'] = 'Generic WIRIS quizzes Help'; -$string['editingwq'] = 'Editing a generic WIRIS question'; -$string['addingwq'] = 'Adding a generic WIRIS question'; -$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; -$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; -$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['cachedef_images'] = "WIRIS Quizzes images."; -$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; -$string['info_tableheader_test'] = "Test"; -$string['info_tableheader_report'] = "Report"; -$string['info_tableheader_status'] = "Status"; -$string['info_disabled'] = "DISABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; -$string['info_test1_name'] = "WIRIS quizzes version"; -$string['info_test1_rt1'] = "WIRIS quizzes version is "; -$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; -$string['info_test2_name'] = "WIRIS plugin version"; -$string['info_test2_info'] = "Check WIRIS plugin "; -$string['info_test2_infopage'] = "info page"; -$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; -$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; -$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; -$string['info_test3_name'] = "Moodle version"; -$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; -$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; -$string['info_test3_rt3'] = "Impossible to find Moodle version file."; -$string['info_test4_name'] = "Plugins"; -$string['info_test4_pluginname1'] = "True/False question type"; -$string['info_test4_pluginname2'] = "Short-Answer question type"; -$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; -$string['info_test4_pluginname4'] = "Multi Choice question type"; -$string['info_test4_pluginname5'] = "Matching question type"; -$string['info_test4_pluginname6'] = "Essay question type"; -$string['info_test4_pluginname7'] = "Commons question type"; -$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; -$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; -$string['info_test4_rt3'] = "Install"; -$string['info_test5_name'] = "Database"; -$string['info_test5_rt1'] = "All WIRIS tables are present."; -$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; -$string['info_test6_name'] = "WIRIS quizzes"; -$string['info_test7_name'] = "Checking WIRIS configuration"; -$string['info_test8_name'] = "Checking if WIRIS server is reachable"; -$string['info_test8_rt1'] = "Connecting to %s at port %s"; -$string['info_test9_name'] = "WIRIS quizzes service"; -$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; -$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; -$string['info_test12_name'] = "Max server connections"; -$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; -$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; diff --git a/quizzes/lib/com/wiris/quizzes/test/Tester.class.php b/quizzes/lib/com/wiris/quizzes/test/Tester.class.php index 9146767d..d74e4a66 100644 --- a/quizzes/lib/com/wiris/quizzes/test/Tester.class.php +++ b/quizzes/lib/com/wiris/quizzes/test/Tester.class.php @@ -38,7 +38,7 @@ public function testCompatibility() { if($qi2->getCompoundAnswerGrade(0, 0, 1, $q) !== 0.0) { throw new HException(new com_wiris_system_Exception("Failed compatibility test!", null)); } - haxe_Log::trace("Test compatibility OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1186, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testCompatibility"))); + haxe_Log::trace("Test compatibility OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1208, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testCompatibility"))); } public function testSubQuestion4() { $question = "12a=5b=42]]>true"; @@ -69,7 +69,7 @@ public function testSubQuestion4() { if(_hx_index_of($s, "0_c0", null) < 0 || _hx_index_of($s, "0_c1", null) < 0) { throw new HException(new com_wiris_system_Exception("Failed test subquestion 4! Compound indices not found", null)); } - haxe_Log::trace("Test subquestion4 OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1165, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testSubQuestion4"))); + haxe_Log::trace("Test subquestion4 OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1187, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testSubQuestion4"))); } public function responseSubQuestion3($s, $q, $qi) { $qii = $qi; @@ -274,7 +274,11 @@ public function onServiceResponse($id, $res, $q, $qi) { if($id === "subquestion3") { $this->responseSubQuestion3($res, $q, $qi); } else { - throw new HException(new com_wiris_system_Exception("Unknown test id.", null)); + if($id === "joaquim") { + $this->testJoaquimResponse($res, $q, $qi); + } else { + throw new HException(new com_wiris_system_Exception("Unknown test id.", null)); + } } } } @@ -304,13 +308,13 @@ public function onServiceResponse($id, $res, $q, $qi) { } } } - haxe_Log::trace("Test " . $id . " OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1036, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "onServiceResponse"))); + haxe_Log::trace("Test " . $id . " OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1058, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "onServiceResponse"))); $this->endCall(); }catch(Exception $»e) { $_ex_ = ($»e instanceof HException) ? $»e->e : $»e; $e = $_ex_; { - haxe_Log::trace("Failed test " . $id . "!!!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1039, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "onServiceResponse"))); + haxe_Log::trace("Failed test " . $id . "!!!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1061, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "onServiceResponse"))); throw new HException($e); } } @@ -476,7 +480,7 @@ public function testCache() { throw new HException("Failed test"); } if($t2 >= $t1) { - haxe_Log::trace("WARNING: Uncached question was faster than cached one! time miss: " . _hx_string_rec($t1, "") . "ms, time hit: " . _hx_string_rec($t2, "") . "ms.", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 801, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testCache"))); + haxe_Log::trace("WARNING: Uncached question was faster than cached one! time miss: " . _hx_string_rec($t1, "") . "ms, time hit: " . _hx_string_rec($t2, "") . "ms.", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 821, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testCache"))); } } public function testFilter() { @@ -499,7 +503,7 @@ public function testPerformance() { $r = $qb->newVariablesRequest($text, $q, $qi); $qi->update($qb->getQuizzesService()->execute($r)); $expanded = $qi->expandVariables($text); - haxe_Log::trace($expanded, _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 759, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testPerformance"))); + haxe_Log::trace($expanded, _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 779, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testPerformance"))); } public function responseTranslation1($s, $q) { $fr = "librarya=aléa(1..10)"; @@ -1063,15 +1067,31 @@ public function testHandwritingConstraints() { $this->numCalls++; $qb->getQuizzesService()->executeAsync($r, new com_wiris_quizzes_test_TestIdServiceListener("handwritingConstraints", $this, $q, $qi)); } + public function testJoaquimResponse($r, $q, $qi) { + $qi->update($r); + if($qi->getAnswerGrade(0, 0, $q) !== 0.0) { + throw new HException(new com_wiris_system_Exception("Failed test!", null)); + } + haxe_Log::trace("Test Joaquim Ok!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 117, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testJoaquimResponse"))); + } + public function testJoaquim() { + $question = "variablesD=random{8,10}J=random(2,4)repeatR=random(1,D-1)gcd(R,D)=1N=J*D+RN,R,D,J19,3,8,2]]>3110]]>., \\,M, k, c, m(,[,{falsefalse"; + $qb = com_wiris_quizzes_api_QuizzesBuilder::getInstance(); + $q = $qb->readQuestion($question); + $qi = $qb->newQuestionInstance($q); + $r = $qb->newEvalRequest(null, null, $q, $qi); + haxe_Log::trace($r->serialize(), _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 108, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testJoaquim"))); + $qb->getQuizzesService()->executeAsync($r, new com_wiris_quizzes_test_TestIdServiceListener("joaquim", $this, $q, $qi)); + } public function run() { $g = new com_wiris_quizzes_impl_HTMLGui("en"); $c = new com_wiris_quizzes_impl_HTMLGuiConfig(""); - haxe_Log::trace("Starting generic integration test...", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 56, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "run"))); + haxe_Log::trace("Starting generic integration test...", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 57, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "run"))); $this->numCalls++; $this->start = Date::now(); $h = new com_wiris_quizzes_impl_HTMLToolsUnitTests(); $h->run(); - haxe_Log::trace("HTML unit test OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 64, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "run"))); + haxe_Log::trace("HTML unit test OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 65, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "run"))); $this->testUnicode(); $this->testCompatibility(); $this->testSubQuestion2(); @@ -1104,13 +1124,14 @@ public function run() { $this->testDeprecated(); $this->testLang(); $this->testSubQuestion1(); + $this->testJoaquim(); $this->endCall(); } public function endCall() { $this->numCalls--; if($this->numCalls <= 0) { $end = Date::now(); - haxe_Log::trace("Successful test!. Time: " . _hx_string_rec(($end->getTime() - $this->start->getTime()), "") . "ms.", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 45, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "endCall"))); + haxe_Log::trace("Successful test!. Time: " . _hx_string_rec(($end->getTime() - $this->start->getTime()), "") . "ms.", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 46, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "endCall"))); } } public $numCalls; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index c07bb334..536b1560 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -38,7 +38,7 @@ quizzes.configuration.file = "../configuration.ini" ; ; URL to connect to WIRIS quizzes service. -quizzes.service.url = "http://www.wiris.net/demo/quizzes" +quizzes.service.url = "http://localhost:8080/quizzes" ; ; URL where to get the JNLP file for WIRIS CAS app. @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" -; -; Classpath and Class used in Moodle to overwrite service.php and cache folder path -; + ; + ; Classpath and Class used in Moodle to overwrite service.php and cache folder path + ; -quizzes.configuration.classpath = "../classes" -quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file + quizzes.configuration.classpath = "../classes" + quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 453c2435..615e0dae 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.55.0.1025 + 3.56.1.1026 GPL 3.0+ diff --git a/version.php b/version.php index 3d142755..7b165df6 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017090700; +$plugin->version = 2017090800; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 28f6dd1b9000d91134115de74030be9386406ed0 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 9 Sep 2017 00:34:33 +0200 Subject: [PATCH 08/38] 2017090900 development version --- info.php | 8 +-- lang/en/qtype_wq.php | 54 ++++++++++++++++- .../quizzes/impl/QuizzesBuilderImpl.class.php | 9 ++- .../com/wiris/quizzes/test/Tester.class.php | 58 ++++++++++--------- quizzes/lib/integration.ini | 14 ++--- quizzes/lib/quizzes.js | 16 +++-- quizzes/lib/version.txt | 2 +- thirdpartylibs.xml | 2 +- version.php | 2 +- 9 files changed, 113 insertions(+), 52 deletions(-) diff --git a/info.php b/info.php index ade6ab29..82b1d043 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index ee141f35..cfef649d 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,4 +74,56 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; +$string['wq_help'] = 'Generic WIRIS quizzes Help'; +$string['editingwq'] = 'Editing a generic WIRIS question'; +$string['addingwq'] = 'Adding a generic WIRIS question'; +$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; +$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; +$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; +$string['cachedef_images'] = "WIRIS Quizzes images."; +$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; +$string['info_tableheader_test'] = "Test"; +$string['info_tableheader_report'] = "Report"; +$string['info_tableheader_status'] = "Status"; +$string['info_disabled'] = "DISABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; +$string['info_test1_name'] = "WIRIS quizzes version"; +$string['info_test1_rt1'] = "WIRIS quizzes version is "; +$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; +$string['info_test2_name'] = "WIRIS plugin version"; +$string['info_test2_info'] = "Check WIRIS plugin "; +$string['info_test2_infopage'] = "info page"; +$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; +$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; +$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; +$string['info_test3_name'] = "Moodle version"; +$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; +$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; +$string['info_test3_rt3'] = "Impossible to find Moodle version file."; +$string['info_test4_name'] = "Plugins"; +$string['info_test4_pluginname1'] = "True/False question type"; +$string['info_test4_pluginname2'] = "Short-Answer question type"; +$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; +$string['info_test4_pluginname4'] = "Multi Choice question type"; +$string['info_test4_pluginname5'] = "Matching question type"; +$string['info_test4_pluginname6'] = "Essay question type"; +$string['info_test4_pluginname7'] = "Commons question type"; +$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; +$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; +$string['info_test4_rt3'] = "Install"; +$string['info_test5_name'] = "Database"; +$string['info_test5_rt1'] = "All WIRIS tables are present."; +$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; +$string['info_test6_name'] = "WIRIS quizzes"; +$string['info_test7_name'] = "Checking WIRIS configuration"; +$string['info_test8_name'] = "Checking if WIRIS server is reachable"; +$string['info_test8_rt1'] = "Connecting to %s at port %s"; +$string['info_test9_name'] = "WIRIS quizzes service"; +$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; +$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; +$string['info_test12_name'] = "Max server connections"; +$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; +$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; diff --git a/quizzes/lib/com/wiris/quizzes/impl/QuizzesBuilderImpl.class.php b/quizzes/lib/com/wiris/quizzes/impl/QuizzesBuilderImpl.class.php index 91c8c6af..8dde6c58 100644 --- a/quizzes/lib/com/wiris/quizzes/impl/QuizzesBuilderImpl.class.php +++ b/quizzes/lib/com/wiris/quizzes/impl/QuizzesBuilderImpl.class.php @@ -430,9 +430,12 @@ public function newEvalMultipleAnswersRequest($correctAnswers, $userAnswers, $qu while($_g1 < $_g) { $j1 = $_g1++; $ass = $qq->assertions[$j1]; + $corr = $this->getIndex($ass->getCorrectAnswer()); $ans = $this->getIndex($ass->getAnswer()); if($ass->isEquivalence()) { - $usedcorrectanswers[$this->getIndex($ass->getCorrectAnswer())] = true; + if($corr < $usedcorrectanswers->length) { + $usedcorrectanswers[$corr] = true; + } if($ans < $usedanswers->length) { $usedanswers[$ans] = true; } @@ -443,7 +446,7 @@ public function newEvalMultipleAnswersRequest($correctAnswers, $userAnswers, $qu } } } - unset($j1,$ass,$ans); + unset($j1,$corr,$ass,$ans); } unset($_g1,$_g); } @@ -651,7 +654,7 @@ public function removeAnswerVariables($variables, $q, $qi) { $i1 = $_g1++; if(StringTools::startsWith($variables[$i1], $name)) { $after = _hx_substr($variables[$i1], strlen($name), null); - if(strlen($after) === 0 || com_wiris_util_type_IntegerTools::isInt($after) && Std::parseInt($after) <= $qi->getStudentAnswersLength()) { + if(strlen($after) === 0 || $qq->getLocalData(com_wiris_quizzes_impl_LocalData::$KEY_OPENANSWER_COMPOUND_ANSWER) === com_wiris_quizzes_impl_LocalData::$VALUE_OPENANSWER_COMPOUND_ANSWER_FALSE && com_wiris_util_type_IntegerTools::isInt($after) && Std::parseInt($after) <= $qi->getStudentAnswersLength()) { $variables[$i1] = null; $n++; } diff --git a/quizzes/lib/com/wiris/quizzes/test/Tester.class.php b/quizzes/lib/com/wiris/quizzes/test/Tester.class.php index d74e4a66..b95fc0ef 100644 --- a/quizzes/lib/com/wiris/quizzes/test/Tester.class.php +++ b/quizzes/lib/com/wiris/quizzes/test/Tester.class.php @@ -38,7 +38,7 @@ public function testCompatibility() { if($qi2->getCompoundAnswerGrade(0, 0, 1, $q) !== 0.0) { throw new HException(new com_wiris_system_Exception("Failed compatibility test!", null)); } - haxe_Log::trace("Test compatibility OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1208, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testCompatibility"))); + haxe_Log::trace("Test compatibility OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1209, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testCompatibility"))); } public function testSubQuestion4() { $question = "12a=5b=42]]>true"; @@ -69,7 +69,7 @@ public function testSubQuestion4() { if(_hx_index_of($s, "0_c0", null) < 0 || _hx_index_of($s, "0_c1", null) < 0) { throw new HException(new com_wiris_system_Exception("Failed test subquestion 4! Compound indices not found", null)); } - haxe_Log::trace("Test subquestion4 OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1187, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testSubQuestion4"))); + haxe_Log::trace("Test subquestion4 OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1188, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testSubQuestion4"))); } public function responseSubQuestion3($s, $q, $qi) { $qii = $qi; @@ -171,6 +171,24 @@ public function testSubQuestion1() { $this->numCalls++; $builder->getQuizzesService()->executeAsync($qr, new com_wiris_quizzes_test_TestIdServiceListener("subquestion1", $this, $q, $qi)); } + public function responseFeedback3($r, $q, $qi) { + $qi->update($r); + if(!($qi->expandVariablesText("#answer1") === "2" && $qi->expandVariablesText("#answer2") === "3")) { + throw new HException(new com_wiris_system_Exception("Failed test feedback3!", null)); + } + } + public function testFeedback3() { + $qb = com_wiris_quizzes_api_QuizzesBuilder::getInstance(); + $q = $qb->readQuestion("variablesparameter answer1=0parameter answer2=0]]>a=1b=2]]>popupEditorandtrue"); + $qi = $qb->newQuestionInstance($q); + $u = new com_wiris_quizzes_impl_UserData(); + $u->setUserCompoundAnswer(0, 0, "2"); + $u->setUserCompoundAnswer(0, 1, "3"); + $qi->setStudentAnswer(0, _hx_array_get($u->answers, 0)->content); + $r = $qb->newFeedbackRequest("

a=#answer1

b=#answer2

", $q, $qi); + $this->numCalls++; + $qb->getQuizzesService()->executeAsync($r, new com_wiris_quizzes_test_TestIdServiceListener("feedback3", $this, $q, $qi)); + } public function inArray($a, $b) { $i = null; { @@ -274,8 +292,8 @@ public function onServiceResponse($id, $res, $q, $qi) { if($id === "subquestion3") { $this->responseSubQuestion3($res, $q, $qi); } else { - if($id === "joaquim") { - $this->testJoaquimResponse($res, $q, $qi); + if($id === "feedback3") { + $this->responseFeedback3($res, $q, $qi); } else { throw new HException(new com_wiris_system_Exception("Unknown test id.", null)); } @@ -308,13 +326,13 @@ public function onServiceResponse($id, $res, $q, $qi) { } } } - haxe_Log::trace("Test " . $id . " OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1058, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "onServiceResponse"))); + haxe_Log::trace("Test " . $id . " OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1039, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "onServiceResponse"))); $this->endCall(); }catch(Exception $»e) { $_ex_ = ($»e instanceof HException) ? $»e->e : $»e; $e = $_ex_; { - haxe_Log::trace("Failed test " . $id . "!!!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1061, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "onServiceResponse"))); + haxe_Log::trace("Failed test " . $id . "!!!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 1042, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "onServiceResponse"))); throw new HException($e); } } @@ -480,7 +498,7 @@ public function testCache() { throw new HException("Failed test"); } if($t2 >= $t1) { - haxe_Log::trace("WARNING: Uncached question was faster than cached one! time miss: " . _hx_string_rec($t1, "") . "ms, time hit: " . _hx_string_rec($t2, "") . "ms.", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 821, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testCache"))); + haxe_Log::trace("WARNING: Uncached question was faster than cached one! time miss: " . _hx_string_rec($t1, "") . "ms, time hit: " . _hx_string_rec($t2, "") . "ms.", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 802, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testCache"))); } } public function testFilter() { @@ -503,7 +521,7 @@ public function testPerformance() { $r = $qb->newVariablesRequest($text, $q, $qi); $qi->update($qb->getQuizzesService()->execute($r)); $expanded = $qi->expandVariables($text); - haxe_Log::trace($expanded, _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 779, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testPerformance"))); + haxe_Log::trace($expanded, _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 760, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testPerformance"))); } public function responseTranslation1($s, $q) { $fr = "librarya=aléa(1..10)"; @@ -1067,31 +1085,15 @@ public function testHandwritingConstraints() { $this->numCalls++; $qb->getQuizzesService()->executeAsync($r, new com_wiris_quizzes_test_TestIdServiceListener("handwritingConstraints", $this, $q, $qi)); } - public function testJoaquimResponse($r, $q, $qi) { - $qi->update($r); - if($qi->getAnswerGrade(0, 0, $q) !== 0.0) { - throw new HException(new com_wiris_system_Exception("Failed test!", null)); - } - haxe_Log::trace("Test Joaquim Ok!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 117, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testJoaquimResponse"))); - } - public function testJoaquim() { - $question = "variablesD=random{8,10}J=random(2,4)repeatR=random(1,D-1)gcd(R,D)=1N=J*D+RN,R,D,J19,3,8,2]]>3110]]>., \\,M, k, c, m(,[,{falsefalse"; - $qb = com_wiris_quizzes_api_QuizzesBuilder::getInstance(); - $q = $qb->readQuestion($question); - $qi = $qb->newQuestionInstance($q); - $r = $qb->newEvalRequest(null, null, $q, $qi); - haxe_Log::trace($r->serialize(), _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 108, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "testJoaquim"))); - $qb->getQuizzesService()->executeAsync($r, new com_wiris_quizzes_test_TestIdServiceListener("joaquim", $this, $q, $qi)); - } public function run() { $g = new com_wiris_quizzes_impl_HTMLGui("en"); $c = new com_wiris_quizzes_impl_HTMLGuiConfig(""); - haxe_Log::trace("Starting generic integration test...", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 57, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "run"))); + haxe_Log::trace("Starting generic integration test...", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 56, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "run"))); $this->numCalls++; $this->start = Date::now(); $h = new com_wiris_quizzes_impl_HTMLToolsUnitTests(); $h->run(); - haxe_Log::trace("HTML unit test OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 65, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "run"))); + haxe_Log::trace("HTML unit test OK!", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 64, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "run"))); $this->testUnicode(); $this->testCompatibility(); $this->testSubQuestion2(); @@ -1103,6 +1105,7 @@ public function run() { $this->testBugs(); $this->testOpenQuestion(); $this->testFeedback(); + $this->testFeedback3(); $this->testOpenQuestionHand(); $this->testAnyAnswer(); if(!(com_wiris_settings_PlatformSettings::$IS_FLASH || com_wiris_settings_PlatformSettings::$IS_JAVASCRIPT)) { @@ -1124,14 +1127,13 @@ public function run() { $this->testDeprecated(); $this->testLang(); $this->testSubQuestion1(); - $this->testJoaquim(); $this->endCall(); } public function endCall() { $this->numCalls--; if($this->numCalls <= 0) { $end = Date::now(); - haxe_Log::trace("Successful test!. Time: " . _hx_string_rec(($end->getTime() - $this->start->getTime()), "") . "ms.", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 46, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "endCall"))); + haxe_Log::trace("Successful test!. Time: " . _hx_string_rec(($end->getTime() - $this->start->getTime()), "") . "ms.", _hx_anonymous(array("fileName" => "Tester.hx", "lineNumber" => 45, "className" => "com.wiris.quizzes.test.Tester", "methodName" => "endCall"))); } } public $numCalls; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index 536b1560..c07bb334 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -38,7 +38,7 @@ quizzes.configuration.file = "../configuration.ini" ; ; URL to connect to WIRIS quizzes service. -quizzes.service.url = "http://localhost:8080/quizzes" +quizzes.service.url = "http://www.wiris.net/demo/quizzes" ; ; URL where to get the JNLP file for WIRIS CAS app. @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" - ; - ; Classpath and Class used in Moodle to overwrite service.php and cache folder path - ; +; +; Classpath and Class used in Moodle to overwrite service.php and cache folder path +; - quizzes.configuration.classpath = "../classes" - quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file +quizzes.configuration.classpath = "../classes" +quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/quizzes/lib/quizzes.js b/quizzes/lib/quizzes.js index a6fa5054..a83e7f2d 100644 --- a/quizzes/lib/quizzes.js +++ b/quizzes/lib/quizzes.js @@ -2466,10 +2466,13 @@ com.wiris.quizzes.JsEditorInput.prototype = $extend(com.wiris.quizzes.JsInput.pr } this.editor.insertInto(this.element); this.setValue(this.value); - if(this.changeHandler == null) { - this.changeHandler = function(value) { - _g.value = value; - }; + var setHandler = this.startHandler == null || this.changeHandler == null; + if(this.startHandler == null) this.startHandler = function() { + }; + if(this.changeHandler == null) this.changeHandler = function(value) { + _g.value = value; + }; + if(setHandler) { this.setEditorListener(); this.setHandListener(); } @@ -4479,9 +4482,10 @@ com.wiris.quizzes.impl.QuizzesBuilderImpl.prototype = $extend(com.wiris.quizzes. while(_g1 < _g) { var j1 = _g1++; var ass = qq.assertions[j1]; + var corr = this.getIndex(ass.getCorrectAnswer()); var ans = this.getIndex(ass.getAnswer()); if(ass.isEquivalence()) { - usedcorrectanswers[this.getIndex(ass.getCorrectAnswer())] = true; + if(corr < usedcorrectanswers.length) usedcorrectanswers[corr] = true; if(ans < usedanswers.length) usedanswers[ans] = true; } else if(ass.isCheck()) { if(ans < usedanswers.length) usedanswers[ans] = true; @@ -4640,7 +4644,7 @@ com.wiris.quizzes.impl.QuizzesBuilderImpl.prototype = $extend(com.wiris.quizzes. var i1 = _g1++; if(StringTools.startsWith(variables[i1],name)) { var after = HxOverrides.substr(variables[i1],name.length,null); - if(after.length == 0 || com.wiris.util.type.IntegerTools.isInt(after) && Std.parseInt(after) <= qi.getStudentAnswersLength()) { + if(after.length == 0 || qq.getLocalData(com.wiris.quizzes.impl.LocalData.KEY_OPENANSWER_COMPOUND_ANSWER) == com.wiris.quizzes.impl.LocalData.VALUE_OPENANSWER_COMPOUND_ANSWER_FALSE && com.wiris.util.type.IntegerTools.isInt(after) && Std.parseInt(after) <= qi.getStudentAnswersLength()) { variables[i1] = null; n++; } diff --git a/quizzes/lib/version.txt b/quizzes/lib/version.txt index ba5e73f3..dcc4ee7e 100644 --- a/quizzes/lib/version.txt +++ b/quizzes/lib/version.txt @@ -1 +1 @@ -3.56.1 \ No newline at end of file +3.56.2 \ No newline at end of file diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 615e0dae..453c2435 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.56.1.1026 + 3.55.0.1025 GPL 3.0+ diff --git a/version.php b/version.php index 7b165df6..b3d48695 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017090800; +$plugin->version = 2017090900; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 692f05787244436a352fdd2de0daee999a57c807 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 10 Sep 2017 00:02:31 +0200 Subject: [PATCH 09/38] 2017091000 development version --- quizzes/lib/quizzes.js | 11 ++++------- version.php | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/quizzes/lib/quizzes.js b/quizzes/lib/quizzes.js index a83e7f2d..a44f475f 100644 --- a/quizzes/lib/quizzes.js +++ b/quizzes/lib/quizzes.js @@ -2466,13 +2466,10 @@ com.wiris.quizzes.JsEditorInput.prototype = $extend(com.wiris.quizzes.JsInput.pr } this.editor.insertInto(this.element); this.setValue(this.value); - var setHandler = this.startHandler == null || this.changeHandler == null; - if(this.startHandler == null) this.startHandler = function() { - }; - if(this.changeHandler == null) this.changeHandler = function(value) { - _g.value = value; - }; - if(setHandler) { + if(this.changeHandler == null) { + this.changeHandler = function(value) { + _g.value = value; + }; this.setEditorListener(); this.setHandListener(); } diff --git a/version.php b/version.php index b3d48695..2ebb8de7 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017090900; +$plugin->version = 2017091000; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From aed0ffc808e84c27642f61e3b7cf35b76a22d446 Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 11 Sep 2017 00:33:13 +0200 Subject: [PATCH 10/38] 2017091100 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 2ebb8de7..4eb9fdfd 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017091000; +$plugin->version = 2017091100; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From ff64be48e426417f38178cffe0935f99a07dcbb5 Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 13 Sep 2017 00:05:35 +0200 Subject: [PATCH 11/38] 2017091300 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 4eb9fdfd..677c9af6 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017091100; +$plugin->version = 2017091300; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From f240035ab10ba593bed2986a7db1d8820f9742fc Mon Sep 17 00:00:00 2001 From: Manuel Date: Thu, 14 Sep 2017 00:35:39 +0200 Subject: [PATCH 12/38] 2017091400 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 677c9af6..71feb58c 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017091300; +$plugin->version = 2017091400; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 1581cc4765301b1a6eeaac7b2e3071d38a07b319 Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 15 Sep 2017 00:32:55 +0200 Subject: [PATCH 13/38] 2017091500 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 71feb58c..d97db2b5 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017091400; +$plugin->version = 2017091500; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From ce62112ed256551d9fea192c20484d8799ac2e14 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 16 Sep 2017 00:35:49 +0200 Subject: [PATCH 14/38] 2017091600 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index d97db2b5..89fefaa8 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017091500; +$plugin->version = 2017091600; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From da2874fa64b0a54bda03a4bf24bf515cdf703bf6 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 17 Sep 2017 00:36:25 +0200 Subject: [PATCH 15/38] 2017091700 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 89fefaa8..d371537a 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017091600; +$plugin->version = 2017091700; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 719f5ffc8e0bf27586dc6be1340e28eba1470b65 Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 18 Sep 2017 00:32:53 +0200 Subject: [PATCH 16/38] 2017091800 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index d371537a..a874e628 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017091700; +$plugin->version = 2017091800; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From a7004c38ebd301dcbd6c17291b86815d894ab422 Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 19 Sep 2017 00:47:37 +0200 Subject: [PATCH 17/38] 2017091900 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index a874e628..b1c7d808 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017091800; +$plugin->version = 2017091900; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From e686a5760805975357ea57242dcce88f6ce88dea Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 20 Sep 2017 01:30:41 +0200 Subject: [PATCH 18/38] 2017092000 development version --- quizzes/lib/quizzes.js | 11 +++++++---- version.php | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/quizzes/lib/quizzes.js b/quizzes/lib/quizzes.js index a44f475f..a83e7f2d 100644 --- a/quizzes/lib/quizzes.js +++ b/quizzes/lib/quizzes.js @@ -2466,10 +2466,13 @@ com.wiris.quizzes.JsEditorInput.prototype = $extend(com.wiris.quizzes.JsInput.pr } this.editor.insertInto(this.element); this.setValue(this.value); - if(this.changeHandler == null) { - this.changeHandler = function(value) { - _g.value = value; - }; + var setHandler = this.startHandler == null || this.changeHandler == null; + if(this.startHandler == null) this.startHandler = function() { + }; + if(this.changeHandler == null) this.changeHandler = function(value) { + _g.value = value; + }; + if(setHandler) { this.setEditorListener(); this.setHandListener(); } diff --git a/version.php b/version.php index b1c7d808..81ffd345 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017091900; +$plugin->version = 2017092000; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 4c7821922b35bf4c1171729c55b852d6109034a3 Mon Sep 17 00:00:00 2001 From: Manuel Date: Thu, 21 Sep 2017 01:13:12 +0200 Subject: [PATCH 19/38] 2017092100 development version --- .../lib/com/wiris/util/type/Arrays.class.php | 4 ++-- quizzes/lib/quizzes.js | 21 ++++++++++--------- version.php | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/quizzes/lib/com/wiris/util/type/Arrays.class.php b/quizzes/lib/com/wiris/util/type/Arrays.class.php index e326400f..1f307b07 100644 --- a/quizzes/lib/com/wiris/util/type/Arrays.class.php +++ b/quizzes/lib/com/wiris/util/type/Arrays.class.php @@ -167,7 +167,7 @@ static function partition($elements, $lower, $higher, $comparator) { $i = $lower - 1; $j = $lower; while($j < $higher) { - if($comparator->compare($pivot, $elements[$j]) === 1) { + if($comparator->compare($pivot, $elements[$j]) > 0) { $i++; if($i !== $j) { $swapper = $elements[$i]; @@ -178,7 +178,7 @@ static function partition($elements, $lower, $higher, $comparator) { } $j++; } - if($comparator->compare($elements[$i + 1], $elements[$higher]) === 1) { + if($comparator->compare($elements[$i + 1], $elements[$higher]) > 0) { $finalSwap = $elements[$i + 1]; $elements[$i + 1] = $elements[$higher]; $elements[$higher] = $finalSwap; diff --git a/quizzes/lib/quizzes.js b/quizzes/lib/quizzes.js index a83e7f2d..f330cdff 100644 --- a/quizzes/lib/quizzes.js +++ b/quizzes/lib/quizzes.js @@ -2466,16 +2466,17 @@ com.wiris.quizzes.JsEditorInput.prototype = $extend(com.wiris.quizzes.JsInput.pr } this.editor.insertInto(this.element); this.setValue(this.value); - var setHandler = this.startHandler == null || this.changeHandler == null; - if(this.startHandler == null) this.startHandler = function() { - }; - if(this.changeHandler == null) this.changeHandler = function(value) { - _g.value = value; - }; - if(setHandler) { - this.setEditorListener(); + if(this.startHandler == null) { + this.startHandler = function() { + }; this.setHandListener(); } + if(this.changeHandler == null) { + this.changeHandler = function(value) { + _g.value = value; + }; + this.setEditorListener(); + } } else if(win != null && !win.closed) this.delay($bind(this,this.loadEditor),200); } ,isOffline: function() { @@ -15366,7 +15367,7 @@ com.wiris.util.type.Arrays.partition = function(elements,lower,higher,comparator var i = lower - 1; var j = lower; while(j < higher) { - if(comparator.compare(pivot,elements[j]) == 1) { + if(comparator.compare(pivot,elements[j]) > 0) { i++; if(i != j) { var swapper = elements[i]; @@ -15376,7 +15377,7 @@ com.wiris.util.type.Arrays.partition = function(elements,lower,higher,comparator } j++; } - if(comparator.compare(elements[i + 1],elements[higher]) == 1) { + if(comparator.compare(elements[i + 1],elements[higher]) > 0) { var finalSwap = elements[i + 1]; elements[i + 1] = elements[higher]; elements[higher] = finalSwap; diff --git a/version.php b/version.php index 81ffd345..bcb42232 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017092000; +$plugin->version = 2017092100; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 45fb70008b0dd704b5e162942e779313790e3c82 Mon Sep 17 00:00:00 2001 From: Manuel Date: Thu, 21 Sep 2017 16:06:51 +0200 Subject: [PATCH 20/38] 2017092100 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 +------------------------------------ quizzes/lib/integration.ini | 12 ++++----- thirdpartylibs.xml | 2 +- 4 files changed, 12 insertions(+), 64 deletions(-) diff --git a/info.php b/info.php index 82b1d043..ade6ab29 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index cfef649d..ee141f35 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,56 +74,4 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; -$string['wq_help'] = 'Generic WIRIS quizzes Help'; -$string['editingwq'] = 'Editing a generic WIRIS question'; -$string['addingwq'] = 'Adding a generic WIRIS question'; -$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; -$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; -$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['cachedef_images'] = "WIRIS Quizzes images."; -$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; -$string['info_tableheader_test'] = "Test"; -$string['info_tableheader_report'] = "Report"; -$string['info_tableheader_status'] = "Status"; -$string['info_disabled'] = "DISABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; -$string['info_test1_name'] = "WIRIS quizzes version"; -$string['info_test1_rt1'] = "WIRIS quizzes version is "; -$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; -$string['info_test2_name'] = "WIRIS plugin version"; -$string['info_test2_info'] = "Check WIRIS plugin "; -$string['info_test2_infopage'] = "info page"; -$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; -$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; -$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; -$string['info_test3_name'] = "Moodle version"; -$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; -$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; -$string['info_test3_rt3'] = "Impossible to find Moodle version file."; -$string['info_test4_name'] = "Plugins"; -$string['info_test4_pluginname1'] = "True/False question type"; -$string['info_test4_pluginname2'] = "Short-Answer question type"; -$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; -$string['info_test4_pluginname4'] = "Multi Choice question type"; -$string['info_test4_pluginname5'] = "Matching question type"; -$string['info_test4_pluginname6'] = "Essay question type"; -$string['info_test4_pluginname7'] = "Commons question type"; -$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; -$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; -$string['info_test4_rt3'] = "Install"; -$string['info_test5_name'] = "Database"; -$string['info_test5_rt1'] = "All WIRIS tables are present."; -$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; -$string['info_test6_name'] = "WIRIS quizzes"; -$string['info_test7_name'] = "Checking WIRIS configuration"; -$string['info_test8_name'] = "Checking if WIRIS server is reachable"; -$string['info_test8_rt1'] = "Connecting to %s at port %s"; -$string['info_test9_name'] = "WIRIS quizzes service"; -$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; -$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; -$string['info_test12_name'] = "Max server connections"; -$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; -$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index c07bb334..404c265e 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" -; -; Classpath and Class used in Moodle to overwrite service.php and cache folder path -; + ; + ; Classpath and Class used in Moodle to overwrite service.php and cache folder path + ; -quizzes.configuration.classpath = "../classes" -quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file + quizzes.configuration.classpath = "../classes" + quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 453c2435..615e0dae 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.55.0.1025 + 3.56.1.1026 GPL 3.0+ From 208e58b51711f30f7c28986bb87d33a50a00e4cd Mon Sep 17 00:00:00 2001 From: Manuel Date: Thu, 21 Sep 2017 23:35:25 +0200 Subject: [PATCH 21/38] 2017092100 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 ++++++++++++++++++++++++++++++++++++- quizzes/lib/integration.ini | 12 ++++----- thirdpartylibs.xml | 2 +- 4 files changed, 64 insertions(+), 12 deletions(-) diff --git a/info.php b/info.php index ade6ab29..82b1d043 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index ee141f35..cfef649d 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,4 +74,56 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; +$string['wq_help'] = 'Generic WIRIS quizzes Help'; +$string['editingwq'] = 'Editing a generic WIRIS question'; +$string['addingwq'] = 'Adding a generic WIRIS question'; +$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; +$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; +$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; +$string['cachedef_images'] = "WIRIS Quizzes images."; +$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; +$string['info_tableheader_test'] = "Test"; +$string['info_tableheader_report'] = "Report"; +$string['info_tableheader_status'] = "Status"; +$string['info_disabled'] = "DISABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; +$string['info_test1_name'] = "WIRIS quizzes version"; +$string['info_test1_rt1'] = "WIRIS quizzes version is "; +$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; +$string['info_test2_name'] = "WIRIS plugin version"; +$string['info_test2_info'] = "Check WIRIS plugin "; +$string['info_test2_infopage'] = "info page"; +$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; +$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; +$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; +$string['info_test3_name'] = "Moodle version"; +$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; +$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; +$string['info_test3_rt3'] = "Impossible to find Moodle version file."; +$string['info_test4_name'] = "Plugins"; +$string['info_test4_pluginname1'] = "True/False question type"; +$string['info_test4_pluginname2'] = "Short-Answer question type"; +$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; +$string['info_test4_pluginname4'] = "Multi Choice question type"; +$string['info_test4_pluginname5'] = "Matching question type"; +$string['info_test4_pluginname6'] = "Essay question type"; +$string['info_test4_pluginname7'] = "Commons question type"; +$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; +$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; +$string['info_test4_rt3'] = "Install"; +$string['info_test5_name'] = "Database"; +$string['info_test5_rt1'] = "All WIRIS tables are present."; +$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; +$string['info_test6_name'] = "WIRIS quizzes"; +$string['info_test7_name'] = "Checking WIRIS configuration"; +$string['info_test8_name'] = "Checking if WIRIS server is reachable"; +$string['info_test8_rt1'] = "Connecting to %s at port %s"; +$string['info_test9_name'] = "WIRIS quizzes service"; +$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; +$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; +$string['info_test12_name'] = "Max server connections"; +$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; +$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index 404c265e..c07bb334 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" - ; - ; Classpath and Class used in Moodle to overwrite service.php and cache folder path - ; +; +; Classpath and Class used in Moodle to overwrite service.php and cache folder path +; - quizzes.configuration.classpath = "../classes" - quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file +quizzes.configuration.classpath = "../classes" +quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 615e0dae..453c2435 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.56.1.1026 + 3.55.0.1025 GPL 3.0+ From 2bfd3e7d2b2d708584a57dc1d63b942e5c66ba75 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 23 Sep 2017 01:29:43 +0200 Subject: [PATCH 22/38] 2017092300 development version --- info.php | 8 +- lang/en/qtype_wq.php | 54 +------- .../wiris/quizzes/impl/HTMLTools.class.php | 127 +++++++++++------- .../impl/QuestionInstanceImpl.class.php | 16 ++- .../quizzes/impl/QuizzesBuilderImpl.class.php | 12 +- .../impl/SubQuestionInstance.class.php | 2 +- .../com/wiris/quizzes/test/Tester.class.php | 2 +- quizzes/lib/integration.ini | 12 +- quizzes/lib/quizzes.js | 80 +++++++---- thirdpartylibs.xml | 2 +- version.php | 2 +- 11 files changed, 169 insertions(+), 148 deletions(-) diff --git a/info.php b/info.php index 82b1d043..ade6ab29 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index cfef649d..ee141f35 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,56 +74,4 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; -$string['wq_help'] = 'Generic WIRIS quizzes Help'; -$string['editingwq'] = 'Editing a generic WIRIS question'; -$string['addingwq'] = 'Adding a generic WIRIS question'; -$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; -$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; -$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['cachedef_images'] = "WIRIS Quizzes images."; -$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; -$string['info_tableheader_test'] = "Test"; -$string['info_tableheader_report'] = "Report"; -$string['info_tableheader_status'] = "Status"; -$string['info_disabled'] = "DISABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; -$string['info_test1_name'] = "WIRIS quizzes version"; -$string['info_test1_rt1'] = "WIRIS quizzes version is "; -$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; -$string['info_test2_name'] = "WIRIS plugin version"; -$string['info_test2_info'] = "Check WIRIS plugin "; -$string['info_test2_infopage'] = "info page"; -$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; -$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; -$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; -$string['info_test3_name'] = "Moodle version"; -$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; -$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; -$string['info_test3_rt3'] = "Impossible to find Moodle version file."; -$string['info_test4_name'] = "Plugins"; -$string['info_test4_pluginname1'] = "True/False question type"; -$string['info_test4_pluginname2'] = "Short-Answer question type"; -$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; -$string['info_test4_pluginname4'] = "Multi Choice question type"; -$string['info_test4_pluginname5'] = "Matching question type"; -$string['info_test4_pluginname6'] = "Essay question type"; -$string['info_test4_pluginname7'] = "Commons question type"; -$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; -$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; -$string['info_test4_rt3'] = "Install"; -$string['info_test5_name'] = "Database"; -$string['info_test5_rt1'] = "All WIRIS tables are present."; -$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; -$string['info_test6_name'] = "WIRIS quizzes"; -$string['info_test7_name'] = "Checking WIRIS configuration"; -$string['info_test8_name'] = "Checking if WIRIS server is reachable"; -$string['info_test8_rt1'] = "Connecting to %s at port %s"; -$string['info_test9_name'] = "WIRIS quizzes service"; -$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; -$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; -$string['info_test12_name'] = "Max server connections"; -$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; -$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; diff --git a/quizzes/lib/com/wiris/quizzes/impl/HTMLTools.class.php b/quizzes/lib/com/wiris/quizzes/impl/HTMLTools.class.php index 996e6d74..20d76b97 100644 --- a/quizzes/lib/com/wiris/quizzes/impl/HTMLTools.class.php +++ b/quizzes/lib/com/wiris/quizzes/impl/HTMLTools.class.php @@ -4,39 +4,65 @@ class com_wiris_quizzes_impl_HTMLTools { public function __construct() { ; } - public function getAnswerVariables($answers, $keyword) { + public function isMathMLString($math) { + $math = trim($math); + return StringTools::startsWith($math, ""); + } + public function getAnswerVariables($answers, $keyword, $compound) { $h = new Hash(); $i = null; - { - $_g1 = 0; $_g = $answers->length; - while($_g1 < $_g) { - $i1 = $_g1++; - $a = $answers[$i1]; - if(!$h->exists($a->type)) { - $h->set($a->type, new Hash()); + if(!$compound) { + { + $_g1 = 0; $_g = $answers->length; + while($_g1 < $_g) { + $i1 = $_g1++; + $a = $answers[$i1]; + if(!$h->exists($a->type)) { + $h->set($a->type, new Hash()); + } + $h->get($a->type)->set($keyword . _hx_string_rec(($i1 + 1), ""), $a->content); + unset($i1,$a); } - $h->get($a->type)->set($keyword . _hx_string_rec(($i1 + 1), ""), $a->content); - unset($i1,$a); } - } - if($answers->length === 1) { - $h->get(_hx_array_get($answers, 0)->type)->set($keyword, _hx_array_get($answers, 0)->content); + if($answers->length === 1) { + $h->get(_hx_array_get($answers, 0)->type)->set($keyword, _hx_array_get($answers, 0)->content); + } + } else { + $answer = $answers[0]; + $a = com_wiris_quizzes_impl_HTMLTools::parseCompoundAnswer($answer); + { + $_g1 = 0; $_g = $a->length; + while($_g1 < $_g) { + $i1 = $_g1++; + $s = $a[$i1][1]; + $type = com_wiris_quizzes_impl_HTMLTools_0($this, $_g, $_g1, $a, $answer, $answers, $compound, $h, $i, $i1, $keyword, $s); + if(!$h->exists($type)) { + $h->set($type, new Hash()); + } + $h->get($type)->set($keyword . _hx_string_rec(($i1 + 1), ""), $s); + unset($type,$s,$i1); + } + } + if(!$h->exists($answer->type)) { + $h->set($answer->type, new Hash()); + } + $h->get($answer->type)->set($keyword, $answer->content); } return $h; } - public function expandAnswersText($text, $answers, $keyword) { + public function expandAnswersText($text, $answers, $keyword, $compound) { if($answers === null || $answers->length === 0 || _hx_index_of($text, "#" . $keyword, null) === -1) { return $text; } - $h = $this->getAnswerVariables($answers, $keyword); + $h = $this->getAnswerVariables($answers, $keyword, $compound); $textvariables = $h->get(com_wiris_quizzes_impl_MathContent::$TYPE_TEXT); return $this->expandVariablesText($text, $textvariables); } - public function expandAnswers($text, $answers, $keyword) { + public function expandAnswers($text, $answers, $keyword, $compound) { if($answers === null || $answers->length === 0 || _hx_index_of($text, "#" . $keyword, null) === -1) { return $text; } - $h = $this->getAnswerVariables($answers, $keyword); + $h = $this->getAnswerVariables($answers, $keyword, $compound); return $this->expandVariables($text, $h); } public function setItemSeparator($sep) { @@ -82,7 +108,7 @@ public function fullMathML2TextImpl($e) { $n = haxe_Utf8::length($separators); while($it->hasNext()) { if($i > 0 && $n > 0) { - $sb->add(com_wiris_quizzes_impl_HTMLTools_0($this, $close, $e, $i, $it, $n, $open, $sb, $separators)); + $sb->add(com_wiris_quizzes_impl_HTMLTools_1($this, $close, $e, $i, $it, $n, $open, $sb, $separators)); } $sb->add($this->fullMathML2TextImpl($it->next())); $i++; @@ -239,7 +265,7 @@ public function reservedWordTokens($elem, $words) { $mitexts->push($text); $mis->push($c); $index++; - $c = com_wiris_quizzes_impl_HTMLTools_1($this, $c, $children, $elem, $index, $it, $mis, $mitexts, $text, $words); + $c = com_wiris_quizzes_impl_HTMLTools_2($this, $c, $children, $elem, $index, $it, $mis, $mitexts, $text, $words); unset($text); } $k = 0; @@ -288,7 +314,7 @@ public function reservedWordTokens($elem, $words) { if($c->getNodeName() === "mn") { $first = $c; $index++; - $c = com_wiris_quizzes_impl_HTMLTools_2($this, $c, $children, $elem, $first, $index, $it, $words); + $c = com_wiris_quizzes_impl_HTMLTools_3($this, $c, $children, $elem, $first, $index, $it, $words); if($c !== null && $c->getNodeName() === "mn") { $mns = new _hx_array(array()); $num = new StringBuf(); @@ -297,7 +323,7 @@ public function reservedWordTokens($elem, $words) { $mns->push($c); $num->add(com_wiris_util_xml_WXmlUtils::getNodeValue($c->firstChild())); $index++; - $c = com_wiris_quizzes_impl_HTMLTools_3($this, $c, $children, $elem, $first, $index, $it, $mns, $num, $words); + $c = com_wiris_quizzes_impl_HTMLTools_4($this, $c, $children, $elem, $first, $index, $it, $mns, $num, $words); } $first->removeChild($first->firstChild()); $first->addChild(com_wiris_util_xml_WXmlUtils::createPCData($first, $num->b)); @@ -316,7 +342,7 @@ public function reservedWordTokens($elem, $words) { unset($first); } else { $index++; - $c = com_wiris_quizzes_impl_HTMLTools_4($this, $c, $children, $elem, $index, $it, $words); + $c = com_wiris_quizzes_impl_HTMLTools_5($this, $c, $children, $elem, $index, $it, $words); } } unset($c); @@ -596,7 +622,7 @@ public function extractTextFromMathML($formula) { $pos2 = _hx_index_of($formula, "", $start); $text = _hx_substr($formula, $start + 7, $pos2 - $start - 7); $text = com_wiris_util_xml_WXmlUtils::resolveEntities($text); - $nbsp = com_wiris_quizzes_impl_HTMLTools_5($this, $allowedTags, $beginformula, $end, $formula, $lasttag, $omittedcontent, $pos2, $spacepos, $stack, $start, $tag, $text, $trimmedTag); + $nbsp = com_wiris_quizzes_impl_HTMLTools_6($this, $allowedTags, $beginformula, $end, $formula, $lasttag, $omittedcontent, $pos2, $spacepos, $stack, $start, $tag, $text, $trimmedTag); $nbspLength = strlen($nbsp); if(strlen($text) >= $nbspLength) { if(_hx_substr($text, 0, $nbspLength) === $nbsp) { @@ -766,7 +792,7 @@ public function textToMathMLImpl($text) { if(com_wiris_util_xml_WCharacterBase::isLetter($c)) { $token = new StringBuf(); while($i < $n && com_wiris_util_xml_WCharacterBase::isLetter($c)) { - $token->add(com_wiris_quizzes_impl_HTMLTools_6($this, $c, $i, $mathml, $n, $text, $token)); + $token->add(com_wiris_quizzes_impl_HTMLTools_7($this, $c, $i, $mathml, $n, $text, $token)); $i++; if($i < $n) { $c = haxe_Utf8::charCodeAt($text, $i); @@ -784,7 +810,7 @@ public function textToMathMLImpl($text) { $_g = 0; while($_g < $m) { $j1 = $_g++; - $tokens[$j1] = com_wiris_quizzes_impl_HTMLTools_7($this, $_g, $c, $i, $j, $j1, $m, $mathml, $n, $text, $tok, $token, $tokens); + $tokens[$j1] = com_wiris_quizzes_impl_HTMLTools_8($this, $_g, $c, $i, $j, $j1, $m, $mathml, $n, $text, $tok, $token, $tokens); unset($j1); } unset($_g); @@ -809,7 +835,7 @@ public function textToMathMLImpl($text) { if($c === 32) { $c = 160; } - $mathml->add(com_wiris_util_xml_WXmlUtils::htmlEscape(com_wiris_quizzes_impl_HTMLTools_8($this, $c, $i, $mathml, $n, $text, $token))); + $mathml->add(com_wiris_util_xml_WXmlUtils::htmlEscape(com_wiris_quizzes_impl_HTMLTools_9($this, $c, $i, $mathml, $n, $text, $token))); $mathml->add(""); $i++; if($i < $n) { @@ -932,7 +958,7 @@ public function prepareFormulas($text) { $appendpos = $pos + 1; $character = com_wiris_util_xml_WXmlUtils::getUtf8Char($formula, $appendpos); while($this->isQuizzesIdentifierStart($character) || $this->isQuizzesIdentifierPart($character) && !$firstchar) { - $appendpos += strlen((com_wiris_quizzes_impl_HTMLTools_9($this, $appendpos, $character, $firstchar, $formula, $initag, $length, $parentpos, $parenttag, $parenttagname, $pos, $start, $text))); + $appendpos += strlen((com_wiris_quizzes_impl_HTMLTools_10($this, $appendpos, $character, $firstchar, $formula, $initag, $length, $parentpos, $parenttag, $parenttagname, $pos, $start, $text))); $character = com_wiris_util_xml_WXmlUtils::getUtf8Char($formula, $appendpos); $firstchar = false; } @@ -968,7 +994,7 @@ public function prepareFormulas($text) { $toappend = new StringBuf(); $character = com_wiris_util_xml_WXmlUtils::getUtf8Char($formula, $contentpos); while($this->isQuizzesIdentifierStart($character) || $this->isQuizzesIdentifierPart($character) && !$firstchar) { - $charstr = com_wiris_quizzes_impl_HTMLTools_10($this, $appendpos, $character, $contentpos, $end, $firstchar, $formula, $initag, $length, $nextpos, $nexttag, $nexttaglength, $nexttagname, $parentpos, $parenttag, $parenttagname, $pos, $speciallength, $specialtag, $start, $text, $toappend); + $charstr = com_wiris_quizzes_impl_HTMLTools_11($this, $appendpos, $character, $contentpos, $end, $firstchar, $formula, $initag, $length, $nextpos, $nexttag, $nexttaglength, $nexttagname, $parentpos, $parenttag, $parenttagname, $pos, $speciallength, $specialtag, $start, $text, $toappend); $contentpos += strlen($charstr); $toappend->add($charstr); $character = com_wiris_util_xml_WXmlUtils::getUtf8Char($formula, $contentpos); @@ -1096,11 +1122,11 @@ public function getVariableName($html, $pos) { if($end < strlen($html)) { $c = com_wiris_util_xml_WXmlUtils::getUtf8Char($html, $end); if($this->isQuizzesIdentifierStart($c)) { - $end += strlen((com_wiris_quizzes_impl_HTMLTools_11($this, $c, $end, $html, $name, $pos))); + $end += strlen((com_wiris_quizzes_impl_HTMLTools_12($this, $c, $end, $html, $name, $pos))); if($end < strlen($html)) { $c = com_wiris_util_xml_WXmlUtils::getUtf8Char($html, $end); while($c > 0 && $this->isQuizzesIdentifierPart($c)) { - $end += strlen((com_wiris_quizzes_impl_HTMLTools_12($this, $c, $end, $html, $name, $pos))); + $end += strlen((com_wiris_quizzes_impl_HTMLTools_13($this, $c, $end, $html, $name, $pos))); $c = (($end < strlen($html)) ? com_wiris_util_xml_WXmlUtils::getUtf8Char($html, $end) : -1); } } @@ -1593,7 +1619,7 @@ static function joinCompoundAnswer($answers) { $m = new com_wiris_quizzes_impl_MathContent(); if($answers->length > 0) { $mml = com_wiris_quizzes_impl_MathContent::getMathType($answers[0][0]) === com_wiris_quizzes_impl_MathContent::$TYPE_MATHML; - $m->type = com_wiris_quizzes_impl_HTMLTools_13($answers, $m, $mml, $sb); + $m->type = com_wiris_quizzes_impl_HTMLTools_14($answers, $m, $mml, $sb); $i = null; { $_g1 = 0; $_g = $answers->length; @@ -1697,97 +1723,104 @@ static function casSessionLang($value) { } function __toString() { return 'com.wiris.quizzes.impl.HTMLTools'; } } -function com_wiris_quizzes_impl_HTMLTools_0(&$»this, &$close, &$e, &$i, &$it, &$n, &$open, &$sb, &$separators) { +function com_wiris_quizzes_impl_HTMLTools_0(&$»this, &$_g, &$_g1, &$a, &$answer, &$answers, &$compound, &$h, &$i, &$i1, &$keyword, &$s) { + if($»this->isMathMLString($s)) { + return com_wiris_quizzes_impl_MathContent::$TYPE_MATHML; + } else { + return com_wiris_quizzes_impl_MathContent::$TYPE_TEXT; + } +} +function com_wiris_quizzes_impl_HTMLTools_1(&$»this, &$close, &$e, &$i, &$it, &$n, &$open, &$sb, &$separators) { { $s = new haxe_Utf8(null); - $s->addChar(haxe_Utf8::charCodeAt($separators, com_wiris_quizzes_impl_HTMLTools_14($close, $e, $i, $it, $n, $open, $s, $sb, $separators))); + $s->addChar(haxe_Utf8::charCodeAt($separators, com_wiris_quizzes_impl_HTMLTools_15($close, $e, $i, $it, $n, $open, $s, $sb, $separators))); return $s->toString(); } } -function com_wiris_quizzes_impl_HTMLTools_1(&$»this, &$c, &$children, &$elem, &$index, &$it, &$mis, &$mitexts, &$text, &$words) { +function com_wiris_quizzes_impl_HTMLTools_2(&$»this, &$c, &$children, &$elem, &$index, &$it, &$mis, &$mitexts, &$text, &$words) { if($index < $children->length) { return $children[$index]; } } -function com_wiris_quizzes_impl_HTMLTools_2(&$»this, &$c, &$children, &$elem, &$first, &$index, &$it, &$words) { +function com_wiris_quizzes_impl_HTMLTools_3(&$»this, &$c, &$children, &$elem, &$first, &$index, &$it, &$words) { if($index < $children->length) { return $children[$index]; } } -function com_wiris_quizzes_impl_HTMLTools_3(&$»this, &$c, &$children, &$elem, &$first, &$index, &$it, &$mns, &$num, &$words) { +function com_wiris_quizzes_impl_HTMLTools_4(&$»this, &$c, &$children, &$elem, &$first, &$index, &$it, &$mns, &$num, &$words) { if($index < $children->length) { return $children[$index]; } } -function com_wiris_quizzes_impl_HTMLTools_4(&$»this, &$c, &$children, &$elem, &$index, &$it, &$words) { +function com_wiris_quizzes_impl_HTMLTools_5(&$»this, &$c, &$children, &$elem, &$index, &$it, &$words) { if($index < $children->length) { return $children[$index]; } } -function com_wiris_quizzes_impl_HTMLTools_5(&$»this, &$allowedTags, &$beginformula, &$end, &$formula, &$lasttag, &$omittedcontent, &$pos2, &$spacepos, &$stack, &$start, &$tag, &$text, &$trimmedTag) { +function com_wiris_quizzes_impl_HTMLTools_6(&$»this, &$allowedTags, &$beginformula, &$end, &$formula, &$lasttag, &$omittedcontent, &$pos2, &$spacepos, &$stack, &$start, &$tag, &$text, &$trimmedTag) { { $s = new haxe_Utf8(null); $s->addChar(160); return $s->toString(); } } -function com_wiris_quizzes_impl_HTMLTools_6(&$»this, &$c, &$i, &$mathml, &$n, &$text, &$token) { +function com_wiris_quizzes_impl_HTMLTools_7(&$»this, &$c, &$i, &$mathml, &$n, &$text, &$token) { { $s = new haxe_Utf8(null); $s->addChar($c); return $s->toString(); } } -function com_wiris_quizzes_impl_HTMLTools_7(&$»this, &$_g, &$c, &$i, &$j, &$j1, &$m, &$mathml, &$n, &$text, &$tok, &$token, &$tokens) { +function com_wiris_quizzes_impl_HTMLTools_8(&$»this, &$_g, &$c, &$i, &$j, &$j1, &$m, &$mathml, &$n, &$text, &$tok, &$token, &$tokens) { { $s = new haxe_Utf8(null); $s->addChar(haxe_Utf8::charCodeAt($tok, $j1)); return $s->toString(); } } -function com_wiris_quizzes_impl_HTMLTools_8(&$»this, &$c, &$i, &$mathml, &$n, &$text, &$token) { +function com_wiris_quizzes_impl_HTMLTools_9(&$»this, &$c, &$i, &$mathml, &$n, &$text, &$token) { { $s = new haxe_Utf8(null); $s->addChar($c); return $s->toString(); } } -function com_wiris_quizzes_impl_HTMLTools_9(&$»this, &$appendpos, &$character, &$firstchar, &$formula, &$initag, &$length, &$parentpos, &$parenttag, &$parenttagname, &$pos, &$start, &$text) { +function com_wiris_quizzes_impl_HTMLTools_10(&$»this, &$appendpos, &$character, &$firstchar, &$formula, &$initag, &$length, &$parentpos, &$parenttag, &$parenttagname, &$pos, &$start, &$text) { { $s = new haxe_Utf8(null); $s->addChar($character); return $s->toString(); } } -function com_wiris_quizzes_impl_HTMLTools_10(&$»this, &$appendpos, &$character, &$contentpos, &$end, &$firstchar, &$formula, &$initag, &$length, &$nextpos, &$nexttag, &$nexttaglength, &$nexttagname, &$parentpos, &$parenttag, &$parenttagname, &$pos, &$speciallength, &$specialtag, &$start, &$text, &$toappend) { +function com_wiris_quizzes_impl_HTMLTools_11(&$»this, &$appendpos, &$character, &$contentpos, &$end, &$firstchar, &$formula, &$initag, &$length, &$nextpos, &$nexttag, &$nexttaglength, &$nexttagname, &$parentpos, &$parenttag, &$parenttagname, &$pos, &$speciallength, &$specialtag, &$start, &$text, &$toappend) { { $s = new haxe_Utf8(null); $s->addChar($character); return $s->toString(); } } -function com_wiris_quizzes_impl_HTMLTools_11(&$»this, &$c, &$end, &$html, &$name, &$pos) { +function com_wiris_quizzes_impl_HTMLTools_12(&$»this, &$c, &$end, &$html, &$name, &$pos) { { $s = new haxe_Utf8(null); $s->addChar($c); return $s->toString(); } } -function com_wiris_quizzes_impl_HTMLTools_12(&$»this, &$c, &$end, &$html, &$name, &$pos) { +function com_wiris_quizzes_impl_HTMLTools_13(&$»this, &$c, &$end, &$html, &$name, &$pos) { { $s = new haxe_Utf8(null); $s->addChar($c); return $s->toString(); } } -function com_wiris_quizzes_impl_HTMLTools_13(&$answers, &$m, &$mml, &$sb) { +function com_wiris_quizzes_impl_HTMLTools_14(&$answers, &$m, &$mml, &$sb) { if($mml) { return com_wiris_quizzes_impl_MathContent::$TYPE_MATHML; } else { return com_wiris_quizzes_impl_MathContent::$TYPE_TEXT; } } -function com_wiris_quizzes_impl_HTMLTools_14(&$close, &$e, &$i, &$it, &$n, &$open, &$s, &$sb, &$separators) { +function com_wiris_quizzes_impl_HTMLTools_15(&$close, &$e, &$i, &$it, &$n, &$open, &$s, &$sb, &$separators) { if($i < $n) { return $i; } else { diff --git a/quizzes/lib/com/wiris/quizzes/impl/QuestionInstanceImpl.class.php b/quizzes/lib/com/wiris/quizzes/impl/QuestionInstanceImpl.class.php index 664df4b5..3fe99c8d 100644 --- a/quizzes/lib/com/wiris/quizzes/impl/QuestionInstanceImpl.class.php +++ b/quizzes/lib/com/wiris/quizzes/impl/QuestionInstanceImpl.class.php @@ -9,6 +9,7 @@ public function __construct() { $this->variables = null; $this->checks = null; $this->subinstances = null; + $this->compoundChecks = null; }} public function pushSubinstance($subquestion) { $this->addSubinstance($subquestion->getStepNumber() - 1); @@ -863,7 +864,10 @@ public function storeImageVariable($v) { $w->name = $v->name; return $w; } - public function isCompoundAnswer($checks) { + public function isCompoundAnswer() { + return $this->compoundChecks !== null; + } + public function isCompoundAnswerChecks($checks) { if($checks !== null && $checks->length > 0) { $id = _hx_array_get($checks, 0)->getCorrectAnswer(); if(_hx_index_of($id, "c", null) > -1) { @@ -1005,7 +1009,7 @@ public function update($response) { while($_g3 < $_g2) { $j1 = $_g3++; $resultChecks = $subchecks[$j1]; - if($this->isCompoundAnswer($resultChecks)) { + if($this->isCompoundAnswerChecks($resultChecks)) { if($j1 === 0) { $this->collapseCompoundAnswerChecks($resultChecks); } else { @@ -1118,7 +1122,7 @@ public function expandVariablesText($text) { $text = $h->expandVariablesText($text, $textvars); } if($this->userData->answers !== null) { - $text = $h->expandAnswersText($text, $this->userData->answers, $this->getAnswerParameterName()); + $text = $h->expandAnswersText($text, $this->userData->answers, $this->getAnswerParameterName(), $this->isCompoundAnswer()); } return $text; } @@ -1165,7 +1169,7 @@ public function expandVariablesMathML($equation) { $equation = $h->textToMathML($equation); } $equation = $h->expandVariables($equation, $this->variables); - $equation = $h->expandAnswers($equation, $this->userData->answers, $this->getAnswerParameterName()); + $equation = $h->expandAnswers($equation, $this->userData->answers, $this->getAnswerParameterName(), $this->isCompoundAnswer()); return $equation; } public function expandVariables($text) { @@ -1175,7 +1179,7 @@ public function expandVariables($text) { $h = new com_wiris_quizzes_impl_HTMLTools(); $h->setItemSeparator($this->getLocalData(com_wiris_quizzes_impl_LocalData::$KEY_ITEM_SEPARATOR)); $text = $h->expandVariables($text, $this->variables); - $text = $h->expandAnswers($text, $this->userData->answers, $this->getAnswerParameterName()); + $text = $h->expandAnswers($text, $this->userData->answers, $this->getAnswerParameterName(), $this->isCompoundAnswer()); return $text; } public function defaultLocalData($name) { @@ -1248,7 +1252,7 @@ public function onSerialize($s) { $this->userData = $s->serializeChildName($this->userData, com_wiris_quizzes_impl_UserData::$TAGNAME); $this->setChecksCompoundAnswers(); $a = $s->serializeArrayName($this->hashToChecks($this->checks), "checks"); - if($this->isCompoundAnswer($a)) { + if($this->isCompoundAnswerChecks($a)) { $this->collapseCompoundAnswerChecks($a); } $this->checks = $this->checksToHash($a, null); diff --git a/quizzes/lib/com/wiris/quizzes/impl/QuizzesBuilderImpl.class.php b/quizzes/lib/com/wiris/quizzes/impl/QuizzesBuilderImpl.class.php index 8dde6c58..92f385cc 100644 --- a/quizzes/lib/com/wiris/quizzes/impl/QuizzesBuilderImpl.class.php +++ b/quizzes/lib/com/wiris/quizzes/impl/QuizzesBuilderImpl.class.php @@ -654,9 +654,19 @@ public function removeAnswerVariables($variables, $q, $qi) { $i1 = $_g1++; if(StringTools::startsWith($variables[$i1], $name)) { $after = _hx_substr($variables[$i1], strlen($name), null); - if(strlen($after) === 0 || $qq->getLocalData(com_wiris_quizzes_impl_LocalData::$KEY_OPENANSWER_COMPOUND_ANSWER) === com_wiris_quizzes_impl_LocalData::$VALUE_OPENANSWER_COMPOUND_ANSWER_FALSE && com_wiris_util_type_IntegerTools::isInt($after) && Std::parseInt($after) <= $qi->getStudentAnswersLength()) { + if(strlen($after) === 0 || com_wiris_util_type_IntegerTools::isInt($after) && Std::parseInt($after) <= $qi->getStudentAnswersLength()) { $variables[$i1] = null; $n++; + } else { + if($qq->getLocalData(com_wiris_quizzes_impl_LocalData::$KEY_OPENANSWER_COMPOUND_ANSWER) === com_wiris_quizzes_impl_LocalData::$VALUE_OPENANSWER_COMPOUND_ANSWER_TRUE) { + $qqi = $qi; + $parts = com_wiris_quizzes_impl_HTMLTools::parseCompoundAnswer($qqi->userData->answers[0]); + if(com_wiris_util_type_IntegerTools::isInt($after) && Std::parseInt($after) <= $parts->length) { + $variables[$i1] = null; + $n++; + } + unset($qqi,$parts); + } } unset($after); } diff --git a/quizzes/lib/com/wiris/quizzes/impl/SubQuestionInstance.class.php b/quizzes/lib/com/wiris/quizzes/impl/SubQuestionInstance.class.php index 06680050..b9b351f7 100644 --- a/quizzes/lib/com/wiris/quizzes/impl/SubQuestionInstance.class.php +++ b/quizzes/lib/com/wiris/quizzes/impl/SubQuestionInstance.class.php @@ -16,7 +16,7 @@ public function onSerialize($s) { $this->userData = $s->serializeChildName($this->userData, com_wiris_quizzes_impl_UserData::$TAGNAME); $this->setChecksCompoundAnswers(); $a = $s->serializeArrayName($this->hashToChecks($this->checks), "checks"); - if($this->isCompoundAnswer($a)) { + if($this->isCompoundAnswerChecks($a)) { $this->collapseCompoundAnswerChecks($a); } $this->checks = $this->checksToHash($a, null); diff --git a/quizzes/lib/com/wiris/quizzes/test/Tester.class.php b/quizzes/lib/com/wiris/quizzes/test/Tester.class.php index b95fc0ef..b8617827 100644 --- a/quizzes/lib/com/wiris/quizzes/test/Tester.class.php +++ b/quizzes/lib/com/wiris/quizzes/test/Tester.class.php @@ -173,7 +173,7 @@ public function testSubQuestion1() { } public function responseFeedback3($r, $q, $qi) { $qi->update($r); - if(!($qi->expandVariablesText("#answer1") === "2" && $qi->expandVariablesText("#answer2") === "3")) { + if(!($qi->expandVariables("#answer1") === "2" && $qi->expandVariables("#answer2") === "3")) { throw new HException(new com_wiris_system_Exception("Failed test feedback3!", null)); } } diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index c07bb334..404c265e 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" -; -; Classpath and Class used in Moodle to overwrite service.php and cache folder path -; + ; + ; Classpath and Class used in Moodle to overwrite service.php and cache folder path + ; -quizzes.configuration.classpath = "../classes" -quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file + quizzes.configuration.classpath = "../classes" + quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/quizzes/lib/quizzes.js b/quizzes/lib/quizzes.js index f330cdff..8922f605 100644 --- a/quizzes/lib/quizzes.js +++ b/quizzes/lib/quizzes.js @@ -1315,7 +1315,7 @@ com.wiris.quizzes.JsInput.__super__ = com.wiris.quizzes.JsComponent; com.wiris.quizzes.JsInput.prototype = $extend(com.wiris.quizzes.JsComponent.prototype,{ addQuizzesFieldListener: function(listener) { var _g = this; - if($bind(listener,listener.contentChanged)) this.addOnChangeHandler(function(value) { + if(listener.contentChanged) this.addOnChangeHandler(function(value) { listener.contentChanged(_g); }); } @@ -2466,16 +2466,12 @@ com.wiris.quizzes.JsEditorInput.prototype = $extend(com.wiris.quizzes.JsInput.pr } this.editor.insertInto(this.element); this.setValue(this.value); - if(this.startHandler == null) { - this.startHandler = function() { - }; - this.setHandListener(); - } if(this.changeHandler == null) { this.changeHandler = function(value) { _g.value = value; }; this.setEditorListener(); + this.setHandListener(); } } else if(win != null && !win.closed) this.delay($bind(this,this.loadEditor),200); } @@ -2569,7 +2565,7 @@ com.wiris.quizzes.JsStudentAnswerInput.prototype = $extend(com.wiris.quizzes.JsI ,addQuizzesFieldListener: function(listener) { var _g = this; com.wiris.quizzes.JsInput.prototype.addQuizzesFieldListener.call(this,listener); - if($bind(listener,listener.contentChangeStarted)) this.addOnChangeStartHandler(function() { + if(listener.contentChangeStarted) this.addOnChangeStartHandler(function() { listener.contentChangeStarted(_g); }); } @@ -4645,9 +4641,16 @@ com.wiris.quizzes.impl.QuizzesBuilderImpl.prototype = $extend(com.wiris.quizzes. var i1 = _g1++; if(StringTools.startsWith(variables[i1],name)) { var after = HxOverrides.substr(variables[i1],name.length,null); - if(after.length == 0 || qq.getLocalData(com.wiris.quizzes.impl.LocalData.KEY_OPENANSWER_COMPOUND_ANSWER) == com.wiris.quizzes.impl.LocalData.VALUE_OPENANSWER_COMPOUND_ANSWER_FALSE && com.wiris.util.type.IntegerTools.isInt(after) && Std.parseInt(after) <= qi.getStudentAnswersLength()) { + if(after.length == 0 || com.wiris.util.type.IntegerTools.isInt(after) && Std.parseInt(after) <= qi.getStudentAnswersLength()) { variables[i1] = null; n++; + } else if(qq.getLocalData(com.wiris.quizzes.impl.LocalData.KEY_OPENANSWER_COMPOUND_ANSWER) == com.wiris.quizzes.impl.LocalData.VALUE_OPENANSWER_COMPOUND_ANSWER_TRUE) { + var qqi = js.Boot.__cast(qi , com.wiris.quizzes.impl.QuestionInstanceImpl); + var parts = com.wiris.quizzes.impl.HTMLTools.parseCompoundAnswer(qqi.userData.answers[0]); + if(com.wiris.util.type.IntegerTools.isInt(after) && Std.parseInt(after) <= parts.length) { + variables[i1] = null; + n++; + } } } } @@ -9877,28 +9880,47 @@ com.wiris.quizzes.impl.HTMLTools.casSessionLang = function(value) { return HxOverrides.substr(value,start,2); } com.wiris.quizzes.impl.HTMLTools.prototype = { - getAnswerVariables: function(answers,keyword) { + isMathMLString: function(math) { + math = StringTools.trim(math); + return StringTools.startsWith(math,""); + } + ,getAnswerVariables: function(answers,keyword,compound) { var h = new Hash(); var i; - var _g1 = 0, _g = answers.length; - while(_g1 < _g) { - var i1 = _g1++; - var a = answers[i1]; - if(!h.exists(a.type)) h.set(a.type,new Hash()); - h.get(a.type).set(keyword + (i1 + 1),a.content); + if(!compound) { + var _g1 = 0, _g = answers.length; + while(_g1 < _g) { + var i1 = _g1++; + var a = answers[i1]; + if(!h.exists(a.type)) h.set(a.type,new Hash()); + h.get(a.type).set(keyword + (i1 + 1),a.content); + } + if(answers.length == 1) h.get(answers[0].type).set(keyword,answers[0].content); + } else { + var answer = answers[0]; + var a = com.wiris.quizzes.impl.HTMLTools.parseCompoundAnswer(answer); + var _g1 = 0, _g = a.length; + while(_g1 < _g) { + var i1 = _g1++; + var s = a[i1][1]; + var type = this.isMathMLString(s)?com.wiris.quizzes.impl.MathContent.TYPE_MATHML:com.wiris.quizzes.impl.MathContent.TYPE_TEXT; + if(!h.exists(type)) h.set(type,new Hash()); + h.get(type).set(keyword + (i1 + 1),s); + } + if(!h.exists(answer.type)) h.set(answer.type,new Hash()); + h.get(answer.type).set(keyword,answer.content); } - if(answers.length == 1) h.get(answers[0].type).set(keyword,answers[0].content); return h; } - ,expandAnswersText: function(text,answers,keyword) { + ,expandAnswersText: function(text,answers,keyword,compound) { if(answers == null || answers.length == 0 || text.indexOf("#" + keyword) == -1) return text; - var h = this.getAnswerVariables(answers,keyword); + var h = this.getAnswerVariables(answers,keyword,compound); var textvariables = h.get(com.wiris.quizzes.impl.MathContent.TYPE_TEXT); return this.expandVariablesText(text,textvariables); } - ,expandAnswers: function(text,answers,keyword) { + ,expandAnswers: function(text,answers,keyword,compound) { if(answers == null || answers.length == 0 || text.indexOf("#" + keyword) == -1) return text; - var h = this.getAnswerVariables(answers,keyword); + var h = this.getAnswerVariables(answers,keyword,compound); return this.expandVariables(text,h); } ,setItemSeparator: function(sep) { @@ -12334,6 +12356,7 @@ com.wiris.quizzes.impl.QuestionInstanceImpl = $hxClasses["com.wiris.quizzes.impl this.variables = null; this.checks = null; this.subinstances = null; + this.compoundChecks = null; }; com.wiris.quizzes.impl.QuestionInstanceImpl.__name__ = ["com","wiris","quizzes","impl","QuestionInstanceImpl"]; com.wiris.quizzes.impl.QuestionInstanceImpl.__interfaces__ = [com.wiris.quizzes.api.MultipleQuestionInstance]; @@ -12970,7 +12993,10 @@ com.wiris.quizzes.impl.QuestionInstanceImpl.prototype = $extend(com.wiris.util.x w.name = v.name; return w; } - ,isCompoundAnswer: function(checks) { + ,isCompoundAnswer: function() { + return this.compoundChecks != null; + } + ,isCompoundAnswerChecks: function(checks) { if(checks != null && checks.length > 0) { var id = checks[0].getCorrectAnswer(); if(id.indexOf("c") > -1) return true; @@ -13073,7 +13099,7 @@ com.wiris.quizzes.impl.QuestionInstanceImpl.prototype = $extend(com.wiris.util.x while(_g3 < _g2) { var j1 = _g3++; var resultChecks = subchecks[j1]; - if(this.isCompoundAnswer(resultChecks)) { + if(this.isCompoundAnswerChecks(resultChecks)) { if(j1 == 0) this.collapseCompoundAnswerChecks(resultChecks); else this.subinstances[j1 - 1].collapseCompoundAnswerChecks(resultChecks); } if(j1 == 0) this.checks = this.checksToHash(resultChecks,this.checks); else this.subinstances[j1 - 1].checks = this.checksToHash(resultChecks,this.subinstances[j1 - 1].checks); @@ -13139,7 +13165,7 @@ com.wiris.quizzes.impl.QuestionInstanceImpl.prototype = $extend(com.wiris.util.x var textvars = this.variables.get(com.wiris.quizzes.impl.MathContent.TYPE_TEXT); text = h.expandVariablesText(text,textvars); } - if(this.userData.answers != null) text = h.expandAnswersText(text,this.userData.answers,this.getAnswerParameterName()); + if(this.userData.answers != null) text = h.expandAnswersText(text,this.userData.answers,this.getAnswerParameterName(),this.isCompoundAnswer()); return text; } ,addAllHashElements: function(src,dest) { @@ -13176,7 +13202,7 @@ com.wiris.quizzes.impl.QuestionInstanceImpl.prototype = $extend(com.wiris.util.x var h = new com.wiris.quizzes.impl.HTMLTools(); if(com.wiris.quizzes.impl.MathContent.getMathType(equation) == com.wiris.quizzes.impl.MathContent.TYPE_TEXT) equation = h.textToMathML(equation); equation = h.expandVariables(equation,this.variables); - equation = h.expandAnswers(equation,this.userData.answers,this.getAnswerParameterName()); + equation = h.expandAnswers(equation,this.userData.answers,this.getAnswerParameterName(),this.isCompoundAnswer()); return equation; } ,expandVariables: function(text) { @@ -13184,7 +13210,7 @@ com.wiris.quizzes.impl.QuestionInstanceImpl.prototype = $extend(com.wiris.util.x var h = new com.wiris.quizzes.impl.HTMLTools(); h.setItemSeparator(this.getLocalData(com.wiris.quizzes.impl.LocalData.KEY_ITEM_SEPARATOR)); text = h.expandVariables(text,this.variables); - text = h.expandAnswers(text,this.userData.answers,this.getAnswerParameterName()); + text = h.expandAnswers(text,this.userData.answers,this.getAnswerParameterName(),this.isCompoundAnswer()); return text; } ,defaultLocalData: function(name) { @@ -13239,7 +13265,7 @@ com.wiris.quizzes.impl.QuestionInstanceImpl.prototype = $extend(com.wiris.util.x this.userData = s.serializeChildName(this.userData,com.wiris.quizzes.impl.UserData.TAGNAME); this.setChecksCompoundAnswers(); var a = s.serializeArrayName(this.hashToChecks(this.checks),"checks"); - if(this.isCompoundAnswer(a)) this.collapseCompoundAnswerChecks(a); + if(this.isCompoundAnswerChecks(a)) this.collapseCompoundAnswerChecks(a); this.checks = this.checksToHash(a,null); this.variables = this.variablesToHash(s.serializeArrayName(this.hashToVariables(this.variables,null),"variables"),null); this.serializeHandConstraints(); @@ -13687,7 +13713,7 @@ com.wiris.quizzes.impl.SubQuestionInstance.prototype = $extend(com.wiris.quizzes this.userData = s.serializeChildName(this.userData,com.wiris.quizzes.impl.UserData.TAGNAME); this.setChecksCompoundAnswers(); var a = s.serializeArrayName(this.hashToChecks(this.checks),"checks"); - if(this.isCompoundAnswer(a)) this.collapseCompoundAnswerChecks(a); + if(this.isCompoundAnswerChecks(a)) this.collapseCompoundAnswerChecks(a); this.checks = this.checksToHash(a,null); this.serializeHandConstraints(); this.localData = s.serializeArrayName(this.localData,"localData"); diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 453c2435..615e0dae 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.55.0.1025 + 3.56.1.1026 GPL 3.0+ diff --git a/version.php b/version.php index bcb42232..58989a3e 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017092100; +$plugin->version = 2017092300; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 89b03c615f7e7024eb43ba2cf9352c0fff5fe854 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 24 Sep 2017 01:01:38 +0200 Subject: [PATCH 23/38] 2017092400 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 58989a3e..b41b0610 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017092300; +$plugin->version = 2017092400; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From b2d7f05c5dfd345c4a5cec8f7fa4d4507559e9b3 Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 26 Sep 2017 08:07:51 +0200 Subject: [PATCH 24/38] 2017092600 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index b41b0610..1e1b3f95 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017092400; +$plugin->version = 2017092600; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 04c67b645040fae40d8ec88e8576e1b76b998708 Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 27 Sep 2017 00:24:11 +0200 Subject: [PATCH 25/38] 2017092700 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 ++++++++++++++++++++++++++++++++++++- quizzes/lib/integration.ini | 12 ++++----- thirdpartylibs.xml | 2 +- version.php | 2 +- 5 files changed, 65 insertions(+), 13 deletions(-) diff --git a/info.php b/info.php index ade6ab29..82b1d043 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index ee141f35..cfef649d 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,4 +74,56 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; +$string['wq_help'] = 'Generic WIRIS quizzes Help'; +$string['editingwq'] = 'Editing a generic WIRIS question'; +$string['addingwq'] = 'Adding a generic WIRIS question'; +$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; +$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; +$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; +$string['cachedef_images'] = "WIRIS Quizzes images."; +$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; +$string['info_tableheader_test'] = "Test"; +$string['info_tableheader_report'] = "Report"; +$string['info_tableheader_status'] = "Status"; +$string['info_disabled'] = "DISABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; +$string['info_test1_name'] = "WIRIS quizzes version"; +$string['info_test1_rt1'] = "WIRIS quizzes version is "; +$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; +$string['info_test2_name'] = "WIRIS plugin version"; +$string['info_test2_info'] = "Check WIRIS plugin "; +$string['info_test2_infopage'] = "info page"; +$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; +$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; +$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; +$string['info_test3_name'] = "Moodle version"; +$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; +$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; +$string['info_test3_rt3'] = "Impossible to find Moodle version file."; +$string['info_test4_name'] = "Plugins"; +$string['info_test4_pluginname1'] = "True/False question type"; +$string['info_test4_pluginname2'] = "Short-Answer question type"; +$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; +$string['info_test4_pluginname4'] = "Multi Choice question type"; +$string['info_test4_pluginname5'] = "Matching question type"; +$string['info_test4_pluginname6'] = "Essay question type"; +$string['info_test4_pluginname7'] = "Commons question type"; +$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; +$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; +$string['info_test4_rt3'] = "Install"; +$string['info_test5_name'] = "Database"; +$string['info_test5_rt1'] = "All WIRIS tables are present."; +$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; +$string['info_test6_name'] = "WIRIS quizzes"; +$string['info_test7_name'] = "Checking WIRIS configuration"; +$string['info_test8_name'] = "Checking if WIRIS server is reachable"; +$string['info_test8_rt1'] = "Connecting to %s at port %s"; +$string['info_test9_name'] = "WIRIS quizzes service"; +$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; +$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; +$string['info_test12_name'] = "Max server connections"; +$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; +$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index 404c265e..c07bb334 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" - ; - ; Classpath and Class used in Moodle to overwrite service.php and cache folder path - ; +; +; Classpath and Class used in Moodle to overwrite service.php and cache folder path +; - quizzes.configuration.classpath = "../classes" - quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file +quizzes.configuration.classpath = "../classes" +quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 615e0dae..453c2435 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.56.1.1026 + 3.55.0.1025 GPL 3.0+ diff --git a/version.php b/version.php index 1e1b3f95..934fcef1 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017092600; +$plugin->version = 2017092700; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From b94d609296ed3be6a7aaf31ecf75b544597acf9e Mon Sep 17 00:00:00 2001 From: Manuel Date: Thu, 28 Sep 2017 01:20:30 +0200 Subject: [PATCH 26/38] 2017092800 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 934fcef1..4d85ea87 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017092700; +$plugin->version = 2017092800; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From c200826687ebb551bb59bb616ee98267a9d483d8 Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 29 Sep 2017 01:24:41 +0200 Subject: [PATCH 27/38] 2017092900 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 4d85ea87..6be468b9 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017092800; +$plugin->version = 2017092900; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 488b0d6f48ab153c181bb3c82916f83307051810 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 30 Sep 2017 02:06:06 +0200 Subject: [PATCH 28/38] 2017093000 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 +------------------------------------ quizzes/lib/integration.ini | 12 ++++----- quizzes/lib/version.txt | 2 +- renderer.php | 11 +++----- thirdpartylibs.xml | 2 +- version.php | 2 +- 7 files changed, 18 insertions(+), 73 deletions(-) diff --git a/info.php b/info.php index 82b1d043..ade6ab29 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index cfef649d..ee141f35 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,56 +74,4 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; -$string['wq_help'] = 'Generic WIRIS quizzes Help'; -$string['editingwq'] = 'Editing a generic WIRIS question'; -$string['addingwq'] = 'Adding a generic WIRIS question'; -$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; -$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; -$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['cachedef_images'] = "WIRIS Quizzes images."; -$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; -$string['info_tableheader_test'] = "Test"; -$string['info_tableheader_report'] = "Report"; -$string['info_tableheader_status'] = "Status"; -$string['info_disabled'] = "DISABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; -$string['info_test1_name'] = "WIRIS quizzes version"; -$string['info_test1_rt1'] = "WIRIS quizzes version is "; -$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; -$string['info_test2_name'] = "WIRIS plugin version"; -$string['info_test2_info'] = "Check WIRIS plugin "; -$string['info_test2_infopage'] = "info page"; -$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; -$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; -$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; -$string['info_test3_name'] = "Moodle version"; -$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; -$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; -$string['info_test3_rt3'] = "Impossible to find Moodle version file."; -$string['info_test4_name'] = "Plugins"; -$string['info_test4_pluginname1'] = "True/False question type"; -$string['info_test4_pluginname2'] = "Short-Answer question type"; -$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; -$string['info_test4_pluginname4'] = "Multi Choice question type"; -$string['info_test4_pluginname5'] = "Matching question type"; -$string['info_test4_pluginname6'] = "Essay question type"; -$string['info_test4_pluginname7'] = "Commons question type"; -$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; -$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; -$string['info_test4_rt3'] = "Install"; -$string['info_test5_name'] = "Database"; -$string['info_test5_rt1'] = "All WIRIS tables are present."; -$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; -$string['info_test6_name'] = "WIRIS quizzes"; -$string['info_test7_name'] = "Checking WIRIS configuration"; -$string['info_test8_name'] = "Checking if WIRIS server is reachable"; -$string['info_test8_rt1'] = "Connecting to %s at port %s"; -$string['info_test9_name'] = "WIRIS quizzes service"; -$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; -$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; -$string['info_test12_name'] = "Max server connections"; -$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; -$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index c07bb334..404c265e 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" -; -; Classpath and Class used in Moodle to overwrite service.php and cache folder path -; + ; + ; Classpath and Class used in Moodle to overwrite service.php and cache folder path + ; -quizzes.configuration.classpath = "../classes" -quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file + quizzes.configuration.classpath = "../classes" + quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/quizzes/lib/version.txt b/quizzes/lib/version.txt index dcc4ee7e..76c4fc98 100644 --- a/quizzes/lib/version.txt +++ b/quizzes/lib/version.txt @@ -1 +1 @@ -3.56.2 \ No newline at end of file +3.57.0 \ No newline at end of file diff --git a/renderer.php b/renderer.php index c68b9b0c..9ee871df 100644 --- a/renderer.php +++ b/renderer.php @@ -63,18 +63,15 @@ protected function question(question_attempt $qa) { } protected function question_instance(question_attempt $qa) { // Add question instance. + $question = $qa->get_question(); $xml = $qa->get_last_qt_var('_sqi'); - if (empty($xml)) { - $question = $qa->get_question(); - $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); - $xml = $sqi->serialize(); - } else { + if (!empty($xml)) { $builder = com_wiris_quizzes_api_QuizzesBuilder::getInstance(); $sqi = $builder->readQuestionInstance($xml); - $question = $qa->get_question(); $question->wirisquestioninstance->updateFromStudentQuestionInstance($sqi); - $xml = $question->wirisquestioninstance->serialize(); } + $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); + $xml = $sqi->serialize(); $sqiname = $qa->get_qt_field_name('_sqi'); $wirisquestioninstanceattributes = array( diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 453c2435..615e0dae 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.55.0.1025 + 3.56.1.1026 GPL 3.0+ diff --git a/version.php b/version.php index 6be468b9..2690d8a3 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017092900; +$plugin->version = 2017093000; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From b61aed8e58a5fdfb982e7110035502aa710a0031 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 1 Oct 2017 01:31:00 +0200 Subject: [PATCH 29/38] 2017100100 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 ++++++++++++++++++++++++++++++++++++- quizzes/lib/integration.ini | 12 ++++----- renderer.php | 11 +++++--- thirdpartylibs.xml | 2 +- version.php | 2 +- 6 files changed, 72 insertions(+), 17 deletions(-) diff --git a/info.php b/info.php index ade6ab29..82b1d043 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index ee141f35..cfef649d 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,4 +74,56 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; +$string['wq_help'] = 'Generic WIRIS quizzes Help'; +$string['editingwq'] = 'Editing a generic WIRIS question'; +$string['addingwq'] = 'Adding a generic WIRIS question'; +$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; +$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; +$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; +$string['cachedef_images'] = "WIRIS Quizzes images."; +$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; +$string['info_tableheader_test'] = "Test"; +$string['info_tableheader_report'] = "Report"; +$string['info_tableheader_status'] = "Status"; +$string['info_disabled'] = "DISABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; +$string['info_test1_name'] = "WIRIS quizzes version"; +$string['info_test1_rt1'] = "WIRIS quizzes version is "; +$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; +$string['info_test2_name'] = "WIRIS plugin version"; +$string['info_test2_info'] = "Check WIRIS plugin "; +$string['info_test2_infopage'] = "info page"; +$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; +$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; +$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; +$string['info_test3_name'] = "Moodle version"; +$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; +$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; +$string['info_test3_rt3'] = "Impossible to find Moodle version file."; +$string['info_test4_name'] = "Plugins"; +$string['info_test4_pluginname1'] = "True/False question type"; +$string['info_test4_pluginname2'] = "Short-Answer question type"; +$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; +$string['info_test4_pluginname4'] = "Multi Choice question type"; +$string['info_test4_pluginname5'] = "Matching question type"; +$string['info_test4_pluginname6'] = "Essay question type"; +$string['info_test4_pluginname7'] = "Commons question type"; +$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; +$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; +$string['info_test4_rt3'] = "Install"; +$string['info_test5_name'] = "Database"; +$string['info_test5_rt1'] = "All WIRIS tables are present."; +$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; +$string['info_test6_name'] = "WIRIS quizzes"; +$string['info_test7_name'] = "Checking WIRIS configuration"; +$string['info_test8_name'] = "Checking if WIRIS server is reachable"; +$string['info_test8_rt1'] = "Connecting to %s at port %s"; +$string['info_test9_name'] = "WIRIS quizzes service"; +$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; +$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; +$string['info_test12_name'] = "Max server connections"; +$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; +$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index 404c265e..c07bb334 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" - ; - ; Classpath and Class used in Moodle to overwrite service.php and cache folder path - ; +; +; Classpath and Class used in Moodle to overwrite service.php and cache folder path +; - quizzes.configuration.classpath = "../classes" - quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file +quizzes.configuration.classpath = "../classes" +quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/renderer.php b/renderer.php index 9ee871df..c68b9b0c 100644 --- a/renderer.php +++ b/renderer.php @@ -63,15 +63,18 @@ protected function question(question_attempt $qa) { } protected function question_instance(question_attempt $qa) { // Add question instance. - $question = $qa->get_question(); $xml = $qa->get_last_qt_var('_sqi'); - if (!empty($xml)) { + if (empty($xml)) { + $question = $qa->get_question(); + $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); + $xml = $sqi->serialize(); + } else { $builder = com_wiris_quizzes_api_QuizzesBuilder::getInstance(); $sqi = $builder->readQuestionInstance($xml); + $question = $qa->get_question(); $question->wirisquestioninstance->updateFromStudentQuestionInstance($sqi); + $xml = $question->wirisquestioninstance->serialize(); } - $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); - $xml = $sqi->serialize(); $sqiname = $qa->get_qt_field_name('_sqi'); $wirisquestioninstanceattributes = array( diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 615e0dae..453c2435 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.56.1.1026 + 3.55.0.1025 GPL 3.0+ diff --git a/version.php b/version.php index 2690d8a3..dffaacf9 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017093000; +$plugin->version = 2017100100; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From b0b324ba516ffde3b9bfc8b013bcab0e7079c96c Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 2 Oct 2017 08:38:49 +0200 Subject: [PATCH 30/38] 2017100200 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index dffaacf9..e195c415 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017100100; +$plugin->version = 2017100200; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 1d5a713cc82721faf5b863452e7c11592ed63d6f Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 3 Oct 2017 00:37:29 +0200 Subject: [PATCH 31/38] 2017100300 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 +------------------------------------ quizzes/lib/integration.ini | 12 ++++----- renderer.php | 11 +++----- thirdpartylibs.xml | 2 +- version.php | 2 +- 6 files changed, 17 insertions(+), 72 deletions(-) diff --git a/info.php b/info.php index 82b1d043..ade6ab29 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index cfef649d..ee141f35 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,56 +74,4 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; -$string['wq_help'] = 'Generic WIRIS quizzes Help'; -$string['editingwq'] = 'Editing a generic WIRIS question'; -$string['addingwq'] = 'Adding a generic WIRIS question'; -$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; -$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; -$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['cachedef_images'] = "WIRIS Quizzes images."; -$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; -$string['info_tableheader_test'] = "Test"; -$string['info_tableheader_report'] = "Report"; -$string['info_tableheader_status'] = "Status"; -$string['info_disabled'] = "DISABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; -$string['info_test1_name'] = "WIRIS quizzes version"; -$string['info_test1_rt1'] = "WIRIS quizzes version is "; -$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; -$string['info_test2_name'] = "WIRIS plugin version"; -$string['info_test2_info'] = "Check WIRIS plugin "; -$string['info_test2_infopage'] = "info page"; -$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; -$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; -$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; -$string['info_test3_name'] = "Moodle version"; -$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; -$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; -$string['info_test3_rt3'] = "Impossible to find Moodle version file."; -$string['info_test4_name'] = "Plugins"; -$string['info_test4_pluginname1'] = "True/False question type"; -$string['info_test4_pluginname2'] = "Short-Answer question type"; -$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; -$string['info_test4_pluginname4'] = "Multi Choice question type"; -$string['info_test4_pluginname5'] = "Matching question type"; -$string['info_test4_pluginname6'] = "Essay question type"; -$string['info_test4_pluginname7'] = "Commons question type"; -$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; -$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; -$string['info_test4_rt3'] = "Install"; -$string['info_test5_name'] = "Database"; -$string['info_test5_rt1'] = "All WIRIS tables are present."; -$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; -$string['info_test6_name'] = "WIRIS quizzes"; -$string['info_test7_name'] = "Checking WIRIS configuration"; -$string['info_test8_name'] = "Checking if WIRIS server is reachable"; -$string['info_test8_rt1'] = "Connecting to %s at port %s"; -$string['info_test9_name'] = "WIRIS quizzes service"; -$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; -$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; -$string['info_test12_name'] = "Max server connections"; -$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; -$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index c07bb334..404c265e 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" -; -; Classpath and Class used in Moodle to overwrite service.php and cache folder path -; + ; + ; Classpath and Class used in Moodle to overwrite service.php and cache folder path + ; -quizzes.configuration.classpath = "../classes" -quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file + quizzes.configuration.classpath = "../classes" + quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/renderer.php b/renderer.php index c68b9b0c..9ee871df 100644 --- a/renderer.php +++ b/renderer.php @@ -63,18 +63,15 @@ protected function question(question_attempt $qa) { } protected function question_instance(question_attempt $qa) { // Add question instance. + $question = $qa->get_question(); $xml = $qa->get_last_qt_var('_sqi'); - if (empty($xml)) { - $question = $qa->get_question(); - $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); - $xml = $sqi->serialize(); - } else { + if (!empty($xml)) { $builder = com_wiris_quizzes_api_QuizzesBuilder::getInstance(); $sqi = $builder->readQuestionInstance($xml); - $question = $qa->get_question(); $question->wirisquestioninstance->updateFromStudentQuestionInstance($sqi); - $xml = $question->wirisquestioninstance->serialize(); } + $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); + $xml = $sqi->serialize(); $sqiname = $qa->get_qt_field_name('_sqi'); $wirisquestioninstanceattributes = array( diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 453c2435..615e0dae 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.55.0.1025 + 3.56.1.1026 GPL 3.0+ diff --git a/version.php b/version.php index e195c415..1d50e756 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017100200; +$plugin->version = 2017100300; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 38ac7224f9a7a05eee912d5169cf241e6bc38e6e Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 4 Oct 2017 00:02:16 +0200 Subject: [PATCH 32/38] 2017100400 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 ++++++++++++++++++++++++++++++++++++- quizzes/lib/integration.ini | 12 ++++----- renderer.php | 11 +++++--- thirdpartylibs.xml | 2 +- version.php | 2 +- 6 files changed, 72 insertions(+), 17 deletions(-) diff --git a/info.php b/info.php index ade6ab29..82b1d043 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index ee141f35..cfef649d 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,4 +74,56 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; +$string['wq_help'] = 'Generic WIRIS quizzes Help'; +$string['editingwq'] = 'Editing a generic WIRIS question'; +$string['addingwq'] = 'Adding a generic WIRIS question'; +$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; +$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; +$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; +$string['cachedef_images'] = "WIRIS Quizzes images."; +$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; +$string['info_tableheader_test'] = "Test"; +$string['info_tableheader_report'] = "Report"; +$string['info_tableheader_status'] = "Status"; +$string['info_disabled'] = "DISABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; +$string['info_test1_name'] = "WIRIS quizzes version"; +$string['info_test1_rt1'] = "WIRIS quizzes version is "; +$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; +$string['info_test2_name'] = "WIRIS plugin version"; +$string['info_test2_info'] = "Check WIRIS plugin "; +$string['info_test2_infopage'] = "info page"; +$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; +$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; +$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; +$string['info_test3_name'] = "Moodle version"; +$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; +$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; +$string['info_test3_rt3'] = "Impossible to find Moodle version file."; +$string['info_test4_name'] = "Plugins"; +$string['info_test4_pluginname1'] = "True/False question type"; +$string['info_test4_pluginname2'] = "Short-Answer question type"; +$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; +$string['info_test4_pluginname4'] = "Multi Choice question type"; +$string['info_test4_pluginname5'] = "Matching question type"; +$string['info_test4_pluginname6'] = "Essay question type"; +$string['info_test4_pluginname7'] = "Commons question type"; +$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; +$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; +$string['info_test4_rt3'] = "Install"; +$string['info_test5_name'] = "Database"; +$string['info_test5_rt1'] = "All WIRIS tables are present."; +$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; +$string['info_test6_name'] = "WIRIS quizzes"; +$string['info_test7_name'] = "Checking WIRIS configuration"; +$string['info_test8_name'] = "Checking if WIRIS server is reachable"; +$string['info_test8_rt1'] = "Connecting to %s at port %s"; +$string['info_test9_name'] = "WIRIS quizzes service"; +$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; +$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; +$string['info_test12_name'] = "Max server connections"; +$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; +$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index 404c265e..c07bb334 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" - ; - ; Classpath and Class used in Moodle to overwrite service.php and cache folder path - ; +; +; Classpath and Class used in Moodle to overwrite service.php and cache folder path +; - quizzes.configuration.classpath = "../classes" - quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file +quizzes.configuration.classpath = "../classes" +quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/renderer.php b/renderer.php index 9ee871df..c68b9b0c 100644 --- a/renderer.php +++ b/renderer.php @@ -63,15 +63,18 @@ protected function question(question_attempt $qa) { } protected function question_instance(question_attempt $qa) { // Add question instance. - $question = $qa->get_question(); $xml = $qa->get_last_qt_var('_sqi'); - if (!empty($xml)) { + if (empty($xml)) { + $question = $qa->get_question(); + $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); + $xml = $sqi->serialize(); + } else { $builder = com_wiris_quizzes_api_QuizzesBuilder::getInstance(); $sqi = $builder->readQuestionInstance($xml); + $question = $qa->get_question(); $question->wirisquestioninstance->updateFromStudentQuestionInstance($sqi); + $xml = $question->wirisquestioninstance->serialize(); } - $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); - $xml = $sqi->serialize(); $sqiname = $qa->get_qt_field_name('_sqi'); $wirisquestioninstanceattributes = array( diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 615e0dae..453c2435 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.56.1.1026 + 3.55.0.1025 GPL 3.0+ diff --git a/version.php b/version.php index 1d50e756..62006fa2 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017100300; +$plugin->version = 2017100400; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From eb82f9b5d0e7a2b7247a09c8df8228037ad9ba87 Mon Sep 17 00:00:00 2001 From: Manuel Date: Thu, 5 Oct 2017 22:56:48 +0200 Subject: [PATCH 33/38] 2017100500 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 +------------------------------------ quizzes/lib/integration.ini | 12 ++++----- renderer.php | 11 +++----- thirdpartylibs.xml | 2 +- version.php | 2 +- 6 files changed, 17 insertions(+), 72 deletions(-) diff --git a/info.php b/info.php index 82b1d043..ade6ab29 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index cfef649d..ee141f35 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,56 +74,4 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; -$string['wq_help'] = 'Generic WIRIS quizzes Help'; -$string['editingwq'] = 'Editing a generic WIRIS question'; -$string['addingwq'] = 'Adding a generic WIRIS question'; -$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; -$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; -$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['cachedef_images'] = "WIRIS Quizzes images."; -$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; -$string['info_tableheader_test'] = "Test"; -$string['info_tableheader_report'] = "Report"; -$string['info_tableheader_status'] = "Status"; -$string['info_disabled'] = "DISABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; -$string['info_test1_name'] = "WIRIS quizzes version"; -$string['info_test1_rt1'] = "WIRIS quizzes version is "; -$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; -$string['info_test2_name'] = "WIRIS plugin version"; -$string['info_test2_info'] = "Check WIRIS plugin "; -$string['info_test2_infopage'] = "info page"; -$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; -$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; -$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; -$string['info_test3_name'] = "Moodle version"; -$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; -$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; -$string['info_test3_rt3'] = "Impossible to find Moodle version file."; -$string['info_test4_name'] = "Plugins"; -$string['info_test4_pluginname1'] = "True/False question type"; -$string['info_test4_pluginname2'] = "Short-Answer question type"; -$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; -$string['info_test4_pluginname4'] = "Multi Choice question type"; -$string['info_test4_pluginname5'] = "Matching question type"; -$string['info_test4_pluginname6'] = "Essay question type"; -$string['info_test4_pluginname7'] = "Commons question type"; -$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; -$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; -$string['info_test4_rt3'] = "Install"; -$string['info_test5_name'] = "Database"; -$string['info_test5_rt1'] = "All WIRIS tables are present."; -$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; -$string['info_test6_name'] = "WIRIS quizzes"; -$string['info_test7_name'] = "Checking WIRIS configuration"; -$string['info_test8_name'] = "Checking if WIRIS server is reachable"; -$string['info_test8_rt1'] = "Connecting to %s at port %s"; -$string['info_test9_name'] = "WIRIS quizzes service"; -$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; -$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; -$string['info_test12_name'] = "Max server connections"; -$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; -$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index c07bb334..404c265e 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" -; -; Classpath and Class used in Moodle to overwrite service.php and cache folder path -; + ; + ; Classpath and Class used in Moodle to overwrite service.php and cache folder path + ; -quizzes.configuration.classpath = "../classes" -quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file + quizzes.configuration.classpath = "../classes" + quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/renderer.php b/renderer.php index c68b9b0c..9ee871df 100644 --- a/renderer.php +++ b/renderer.php @@ -63,18 +63,15 @@ protected function question(question_attempt $qa) { } protected function question_instance(question_attempt $qa) { // Add question instance. + $question = $qa->get_question(); $xml = $qa->get_last_qt_var('_sqi'); - if (empty($xml)) { - $question = $qa->get_question(); - $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); - $xml = $sqi->serialize(); - } else { + if (!empty($xml)) { $builder = com_wiris_quizzes_api_QuizzesBuilder::getInstance(); $sqi = $builder->readQuestionInstance($xml); - $question = $qa->get_question(); $question->wirisquestioninstance->updateFromStudentQuestionInstance($sqi); - $xml = $question->wirisquestioninstance->serialize(); } + $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); + $xml = $sqi->serialize(); $sqiname = $qa->get_qt_field_name('_sqi'); $wirisquestioninstanceattributes = array( diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 453c2435..615e0dae 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.55.0.1025 + 3.56.1.1026 GPL 3.0+ diff --git a/version.php b/version.php index 62006fa2..56921fec 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017100400; +$plugin->version = 2017100500; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 6e8d141dcb98cc3b191b342e21617bd8b5c3f40f Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 6 Oct 2017 23:28:05 +0200 Subject: [PATCH 34/38] 2017100600 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 ++++++++++++++++++++++++++++++++++++- quizzes/lib/integration.ini | 12 ++++----- renderer.php | 11 +++++--- thirdpartylibs.xml | 2 +- version.php | 2 +- 6 files changed, 72 insertions(+), 17 deletions(-) diff --git a/info.php b/info.php index ade6ab29..82b1d043 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->release)) { - $version = $plugin->release; +if (isset($plugin->version)) { + $version = $plugin->version; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index ee141f35..cfef649d 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,4 +74,56 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; +$string['wq_help'] = 'Generic WIRIS quizzes Help'; +$string['editingwq'] = 'Editing a generic WIRIS question'; +$string['addingwq'] = 'Adding a generic WIRIS question'; +$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; +$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; +$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; +$string['cachedef_images'] = "WIRIS Quizzes images."; +$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; +$string['info_tableheader_test'] = "Test"; +$string['info_tableheader_report'] = "Report"; +$string['info_tableheader_status'] = "Status"; +$string['info_disabled'] = "DISABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_enabled'] = "ENABLED"; +$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; +$string['info_test1_name'] = "WIRIS quizzes version"; +$string['info_test1_rt1'] = "WIRIS quizzes version is "; +$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; +$string['info_test2_name'] = "WIRIS plugin version"; +$string['info_test2_info'] = "Check WIRIS plugin "; +$string['info_test2_infopage'] = "info page"; +$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; +$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; +$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; +$string['info_test3_name'] = "Moodle version"; +$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; +$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; +$string['info_test3_rt3'] = "Impossible to find Moodle version file."; +$string['info_test4_name'] = "Plugins"; +$string['info_test4_pluginname1'] = "True/False question type"; +$string['info_test4_pluginname2'] = "Short-Answer question type"; +$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; +$string['info_test4_pluginname4'] = "Multi Choice question type"; +$string['info_test4_pluginname5'] = "Matching question type"; +$string['info_test4_pluginname6'] = "Essay question type"; +$string['info_test4_pluginname7'] = "Commons question type"; +$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; +$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; +$string['info_test4_rt3'] = "Install"; +$string['info_test5_name'] = "Database"; +$string['info_test5_rt1'] = "All WIRIS tables are present."; +$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; +$string['info_test6_name'] = "WIRIS quizzes"; +$string['info_test7_name'] = "Checking WIRIS configuration"; +$string['info_test8_name'] = "Checking if WIRIS server is reachable"; +$string['info_test8_rt1'] = "Connecting to %s at port %s"; +$string['info_test9_name'] = "WIRIS quizzes service"; +$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; +$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; +$string['info_test12_name'] = "Max server connections"; +$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; +$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index 404c265e..c07bb334 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" - ; - ; Classpath and Class used in Moodle to overwrite service.php and cache folder path - ; +; +; Classpath and Class used in Moodle to overwrite service.php and cache folder path +; - quizzes.configuration.classpath = "../classes" - quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file +quizzes.configuration.classpath = "../classes" +quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/renderer.php b/renderer.php index 9ee871df..c68b9b0c 100644 --- a/renderer.php +++ b/renderer.php @@ -63,15 +63,18 @@ protected function question(question_attempt $qa) { } protected function question_instance(question_attempt $qa) { // Add question instance. - $question = $qa->get_question(); $xml = $qa->get_last_qt_var('_sqi'); - if (!empty($xml)) { + if (empty($xml)) { + $question = $qa->get_question(); + $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); + $xml = $sqi->serialize(); + } else { $builder = com_wiris_quizzes_api_QuizzesBuilder::getInstance(); $sqi = $builder->readQuestionInstance($xml); + $question = $qa->get_question(); $question->wirisquestioninstance->updateFromStudentQuestionInstance($sqi); + $xml = $question->wirisquestioninstance->serialize(); } - $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); - $xml = $sqi->serialize(); $sqiname = $qa->get_qt_field_name('_sqi'); $wirisquestioninstanceattributes = array( diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 615e0dae..453c2435 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.56.1.1026 + 3.55.0.1025 GPL 3.0+ diff --git a/version.php b/version.php index 56921fec..9d9965ea 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017100500; +$plugin->version = 2017100600; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From ab2eaf78f94c489e01ce8488fc246eb3d2babf57 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 8 Oct 2017 00:01:55 +0200 Subject: [PATCH 35/38] 2017100700 development version --- info.php | 8 +++--- lang/en/qtype_wq.php | 54 +------------------------------------ quizzes/lib/integration.ini | 12 ++++----- renderer.php | 11 +++----- thirdpartylibs.xml | 2 +- version.php | 2 +- 6 files changed, 17 insertions(+), 72 deletions(-) diff --git a/info.php b/info.php index 82b1d043..ade6ab29 100644 --- a/info.php +++ b/info.php @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { $plugin = new stdClass(); require_once($CFG->dirroot . '/question/type/wq/version.php'); -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; $reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version; $condition = true; } else { @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) { require_once($CFG->dirroot . '/filter/wiris/version.php'); $plugininfo = get_string('info_test2_info', 'qtype_wq') . '' . get_string('info_test2_infopage', 'qtype_wq') . ''; -if (isset($plugin->version)) { - $version = $plugin->version; +if (isset($plugin->release)) { + $version = $plugin->release; if ($version >= '3.17.20') { $reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo; $condition = true; diff --git a/lang/en/qtype_wq.php b/lang/en/qtype_wq.php index cfef649d..ee141f35 100644 --- a/lang/en/qtype_wq.php +++ b/lang/en/qtype_wq.php @@ -74,56 +74,4 @@ $string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; $string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; $string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id';$string['pluginnamesummary'] = ''; -$string['wq_help'] = 'Generic WIRIS quizzes Help'; -$string['editingwq'] = 'Editing a generic WIRIS question'; -$string['addingwq'] = 'Adding a generic WIRIS question'; -$string['wqsummary'] = 'This adds a generic WIRIS question. Only for test purpose. It will be hide from here.'; -$string['wirisquestionincorrect'] = 'Sorry! The system can not generate one of the questions of the quiz.
Maybe there is a temporary connection problem right now.
Maybe the question algorithm has a bug, and fails sometimes.
Maybe it will fail always.
Don\'t panic...
You can retry the quiz, without penalty, just clicking Continue.
You can also tell the Teachers that there is an issue with the question titled: \'{$a->questionname}\''; -$string['wirisquizzeserror'] = 'Sorry! There was an error in WIRIS quizzes.'; -$string['cachedef_images'] = "WIRIS Quizzes images."; -$string['info_maintitle'] = "Moodle 2.x WIRIS quizzes test page"; -$string['info_tableheader_test'] = "Test"; -$string['info_tableheader_report'] = "Report"; -$string['info_tableheader_status'] = "Status"; -$string['info_disabled'] = "DISABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_enabled'] = "ENABLED"; -$string['info_information'] = "For more information or if you have any doubt contact WIRIS Support:"; -$string['info_test1_name'] = "WIRIS quizzes version"; -$string['info_test1_rt1'] = "WIRIS quizzes version is "; -$string['info_test1_rt2'] = "Impossible to find WIRIS quizzes version."; -$string['info_test2_name'] = "WIRIS plugin version"; -$string['info_test2_info'] = "Check WIRIS plugin "; -$string['info_test2_infopage'] = "info page"; -$string['info_test2_rt1'] = "WIRIS plugin is properly installed."; -$string['info_test2_rt2'] = "WIRIS quizzes requires WIRIS plugin 3.17.20 or greater. Your version is"; -$string['info_test2_rt3'] = "Impossible to find WIRIS plugin version file."; -$string['info_test3_name'] = "Moodle version"; -$string['info_test3_rt1'] = "Your moodle version is sufficiently new."; -$string['info_test3_rt2'] = "Your Moodle version is %s. WIRIS quizzes could not work correctly with Moodle version prior to 2011060313"; -$string['info_test3_rt3'] = "Impossible to find Moodle version file."; -$string['info_test4_name'] = "Plugins"; -$string['info_test4_pluginname1'] = "True/False question type"; -$string['info_test4_pluginname2'] = "Short-Answer question type"; -$string['info_test4_pluginname3'] = "Embedded answer (Cloze) question type"; -$string['info_test4_pluginname4'] = "Multi Choice question type"; -$string['info_test4_pluginname5'] = "Matching question type"; -$string['info_test4_pluginname6'] = "Essay question type"; -$string['info_test4_pluginname7'] = "Commons question type"; -$string['info_test4_rt1'] = "The following WIRIS question plugins are installed:"; -$string['info_test4_rt2'] = "The following WIRIS question plugins are missing:"; -$string['info_test4_rt3'] = "Install"; -$string['info_test5_name'] = "Database"; -$string['info_test5_rt1'] = "All WIRIS tables are present."; -$string['info_test5_rt2'] = "One or more of WIRIS tables are missing."; -$string['info_test6_name'] = "WIRIS quizzes"; -$string['info_test7_name'] = "Checking WIRIS configuration"; -$string['info_test8_name'] = "Checking if WIRIS server is reachable"; -$string['info_test8_rt1'] = "Connecting to %s at port %s"; -$string['info_test9_name'] = "WIRIS quizzes service"; -$string['info_test10_name'] = "Checking WIRIS quizzes functionality (variable)"; -$string['info_test11_name'] = "Checking WIRIS quizzes functionality (plot)"; -$string['info_test12_name'] = "Max server connections"; -$string['info_test12_rt1'] = "There are currently %s active concurrent connections out of a maximum of %s. Greatest number of concurrent connections is %s."; -$string['info_test12_rt2'] = "Error with the maximum connections security system. See details:
%s
%s
"; +$string['failedtoloadwirisquizzesfromxml'] = 'Failed to load WIRIS quizzes XML definition for question id'; diff --git a/quizzes/lib/integration.ini b/quizzes/lib/integration.ini index c07bb334..404c265e 100644 --- a/quizzes/lib/integration.ini +++ b/quizzes/lib/integration.ini @@ -136,10 +136,10 @@ quizzes.hand.logtraces = "true" ;quizzes.graph.url = "" -; -; Classpath and Class used in Moodle to overwrite service.php and cache folder path -; + ; + ; Classpath and Class used in Moodle to overwrite service.php and cache folder path + ; -quizzes.configuration.classpath = "../classes" -quizzes.configuration.class = "MoodleConfiguration" - \ No newline at end of file + quizzes.configuration.classpath = "../classes" + quizzes.configuration.class = "MoodleConfiguration" + \ No newline at end of file diff --git a/renderer.php b/renderer.php index c68b9b0c..9ee871df 100644 --- a/renderer.php +++ b/renderer.php @@ -63,18 +63,15 @@ protected function question(question_attempt $qa) { } protected function question_instance(question_attempt $qa) { // Add question instance. + $question = $qa->get_question(); $xml = $qa->get_last_qt_var('_sqi'); - if (empty($xml)) { - $question = $qa->get_question(); - $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); - $xml = $sqi->serialize(); - } else { + if (!empty($xml)) { $builder = com_wiris_quizzes_api_QuizzesBuilder::getInstance(); $sqi = $builder->readQuestionInstance($xml); - $question = $qa->get_question(); $question->wirisquestioninstance->updateFromStudentQuestionInstance($sqi); - $xml = $question->wirisquestioninstance->serialize(); } + $sqi = $question->wirisquestioninstance->getStudentQuestionInstance(); + $xml = $sqi->serialize(); $sqiname = $qa->get_qt_field_name('_sqi'); $wirisquestioninstanceattributes = array( diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 453c2435..615e0dae 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.55.0.1025 + 3.56.1.1026 GPL 3.0+ diff --git a/version.php b/version.php index 9d9965ea..4a370b9f 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017100600; +$plugin->version = 2017100700; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 839c0622064b105f7f8658d826805963e2ea6905 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 8 Oct 2017 22:57:55 +0200 Subject: [PATCH 36/38] 2017100800 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 4a370b9f..5b4e9e69 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017100700; +$plugin->version = 2017100800; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 2d6c04f98721ffc0e1f998e0ed93dba42de78a23 Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 10 Oct 2017 23:38:14 +0200 Subject: [PATCH 37/38] 2017101000 development version --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index 5b4e9e69..d63b68f3 100644 --- a/version.php +++ b/version.php @@ -16,7 +16,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017100800; +$plugin->version = 2017101000; $plugin->requires = 2011120500; // Moodle 2.2. $plugin->maturity = MATURITY_BETA; From 5a57f1d2ba80f9937556998481bb2dc1b0f971ce Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 11 Oct 2017 14:36:11 +0200 Subject: [PATCH 38/38] 2017101100 Stable version --- quizzes/lib/com/wiris/util/xml/WCharacterBase.class.php | 1 + quizzes/lib/quizzes.js | 1 + thirdpartylibs.xml | 2 +- version.php | 6 +++--- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/quizzes/lib/com/wiris/util/xml/WCharacterBase.class.php b/quizzes/lib/com/wiris/util/xml/WCharacterBase.class.php index 988e89ec..0ee1e8e7 100644 --- a/quizzes/lib/com/wiris/util/xml/WCharacterBase.class.php +++ b/quizzes/lib/com/wiris/util/xml/WCharacterBase.class.php @@ -9,6 +9,7 @@ public function __construct(){} static $ROOT_NO_TAIL_VERTICAL = 61759; static $ROOT_LEFT_TAIL = 61760; static $ROOT_VERTICAL_LINE = 61761; + static $LINE_FEED = 10; static $ROUND_BRACKET_LEFT = 40; static $ROUND_BRACKET_RIGHT = 41; static $COMMA = 44; diff --git a/quizzes/lib/quizzes.js b/quizzes/lib/quizzes.js index 8922f605..7b8930c7 100644 --- a/quizzes/lib/quizzes.js +++ b/quizzes/lib/quizzes.js @@ -19329,6 +19329,7 @@ com.wiris.util.xml.WCharacterBase.ROOT_NO_TAIL = 61728; com.wiris.util.xml.WCharacterBase.ROOT_NO_TAIL_VERTICAL = 61759; com.wiris.util.xml.WCharacterBase.ROOT_LEFT_TAIL = 61760; com.wiris.util.xml.WCharacterBase.ROOT_VERTICAL_LINE = 61761; +com.wiris.util.xml.WCharacterBase.LINE_FEED = 10; com.wiris.util.xml.WCharacterBase.ROUND_BRACKET_LEFT = 40; com.wiris.util.xml.WCharacterBase.ROUND_BRACKET_RIGHT = 41; com.wiris.util.xml.WCharacterBase.COMMA = 44; diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml index 615e0dae..2b4fc2c0 100644 --- a/thirdpartylibs.xml +++ b/thirdpartylibs.xml @@ -3,7 +3,7 @@ quizzes WIRIS QUIZZES engine - 3.56.1.1026 + 3.57.0.1027 GPL 3.0+ diff --git a/version.php b/version.php index d63b68f3..bf80fc7f 100644 --- a/version.php +++ b/version.php @@ -16,10 +16,10 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2017101000; +$plugin->version = 2017101100; $plugin->requires = 2011120500; // Moodle 2.2. - -$plugin->maturity = MATURITY_BETA; +$plugin->release = '3.57.0.1027'; +$plugin->maturity = MATURITY_STABLE; $plugin->component = 'qtype_wq'; $plugin->dependencies = array ( 'filter_wiris' => ANY_VERSION