Log Message:
-----------
correct return behavior of wwclient->create_user to conform to its use.
The routine no returns the username that is created. With luck this will
fix a bug in which the first time one attempts to create a webwork assignment one received
a communication error message -- the second time (because the user had already been created)
it would succeed. Now it always appears to succeed the first time.
-- Mike
Modified Files:
--------------
wwmoodle/wwassignment4/moodle/mod/wwassignment:
locallib.php
Revision Data
-------------
Index: locallib.php
===================================================================
RCS file: /webwork/cvs/system/wwmoodle/wwassignment4/moodle/mod/wwassignment/locallib.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -Lwwassignment4/moodle/mod/wwassignment/locallib.php -Lwwassignment4/moodle/mod/wwassignment/locallib.php -u -r1.9 -r1.10
--- wwassignment4/moodle/mod/wwassignment/locallib.php
+++ wwassignment4/moodle/mod/wwassignment/locallib.php
@@ -547,7 +547,8 @@
* @param string $webworkcourse The webwork course name.
* @param array $userdata The user data to use in creation.
* @param string $permission The permissions of the new user, defaults to 0.
- * @return Returns 1 on success.
+ * @return Returns username on success.
+
*/
function create_user($webworkcourse,&$userdata,$permission='0') {
$studentid = $userid;
@@ -574,14 +575,14 @@
$this->handler('add_password',array('courseName' => $webworkcourse,'record' => array(
'user_id' => $userdata->username,
'password' => $userdata->password)));
- return 1;
+ return $userdata->username;
}
/** NOT yet ready!!!!!!!!!
* @desc Updates data for a user in the WeBWorK course.
* @param string $webworkcourse The webwork course name.
* @param array $userdata The user data to use in creation.
* @param string $permission The permissions of the new user, defaults to 0.
- * @return Returns 1 on success.
+ * @return Returns username on success.
*/
function update_user($webworkcourse,&$userdata,$permission='0') {
error_log("update_user called -- not yet ready");
@@ -610,7 +611,7 @@
$this->handler('add_password',array('courseName' => $webworkcourse,'record' => array(
'user_id' => $userdata->username,
'password' => $userdata->password)));
- return 1;
+ return $userdata->username;
}
/**
* @desc Creates a user set in WeBWorK
|