aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Michel Vedrine <vedrine@vedrine.org>2018-01-02 17:01:56 +0100
committerJean-Michel Vedrine <vedrine@vedrine.org>2018-01-02 17:01:56 +0100
commit848785f8d79541835dfee0b0fc634d0a029f13c6 (patch)
tree0ce0b2aa76bb2f9b469ce8e86e218546d7ba5c22
parentf3b9667fd8fccdf100e760cdd196573aa041968c (diff)
Fix style of xmlrpc-utils
-rw-r--r--tests/helper.php7
-rw-r--r--xmlrpc-utils.php6
2 files changed, 7 insertions, 6 deletions
diff --git a/tests/helper.php b/tests/helper.php
index d569db2..ff4cc05 100644
--- a/tests/helper.php
+++ b/tests/helper.php
@@ -81,7 +81,7 @@ class qtype_algebra_test_helper extends question_test_helper {
$qdata->options = new stdClass();
$qdata->options->compareby = 'eval';
- $qdata->options->nchecks = 10;
+ $qdata->options->nchecks = '10';
$qdata->options->tolerance = 0.001;
$qdata->options->disallow = '';
$qdata->options->allowedfuncs = '';
@@ -111,9 +111,9 @@ class qtype_algebra_test_helper extends question_test_helper {
$form->defaultmark = 1.0;
$form->generalfeedback = array('text' => 'Generalfeedback: (P + Q)(x) = 7x.', 'format' => FORMAT_HTML);
$form->compareby = 'eval';
- $form->nchecks = 10;
+ $form->nchecks = '10';
$form->tolerance = 0.001;
- $form->allowedfuncs = '';
+ $form->allowedfuncs = array{'all' => 1};
$form->disallow = '';
$form->answerprefix = '';
$form->answer = array('7*x', '*');
@@ -125,6 +125,7 @@ class qtype_algebra_test_helper extends question_test_helper {
array('text' => 'This is a very good answer.', 'format' => FORMAT_HTML),
array('text' => 'This is completely wrong.', 'format' => FORMAT_HTML),
);
+ $form->penalty = 0.3333333;
return $form;
}
diff --git a/xmlrpc-utils.php b/xmlrpc-utils.php
index 218a95a..7c0ad80 100644
--- a/xmlrpc-utils.php
+++ b/xmlrpc-utils.php
@@ -59,7 +59,7 @@ if (!extension_loaded('xmlrpc')) {
debugging('The php xml-rpc extension is not loaded, SAGE evaluation will fail.', DEBUG_DEVELOPER);
}
-/* generic function to call an http server with post method */
+// Generic function to call an http server with post method.
function xu_query_http_post($request, $host, $uri, $port, $debug,
$timeout, $user, $pass, $secure = false) {
$responsebuf = "";
@@ -206,7 +206,7 @@ function xu_rpc_http_concise($params) {
return $retval;
}
-/* call an xmlrpc method on a remote http server. legacy support. */
+// Call an xmlrpc method on a remote http server. legacy support.
function xu_rpc_http($method, $args, $host, $uri="/", $port=80, $debug=false,
$timeout=0, $user=false, $pass=false, $secure=false) {
return xu_rpc_http_concise(
@@ -231,7 +231,7 @@ function xu_is_fault($arg) {
return is_array($arg) ? xmlrpc_is_fault($arg) : false;
}
-/* Sets some http headers and prints xml */
+// Sets some http headers and prints xml.
function xu_server_send_http_response($xml) {
header("Content-type: text/xml");
header("Content-length: " . strlen($xml) );