Office Office Exchange Server. Not an IT pro? Resources for IT Professionals. Sign in. United States English. Ask a question. Quick access. Search related threads. Remove From My Forums. Answered by:. Archived Forums.
Excel IT Pro Discussions. However, the field value must refer to a system role that does exist on the system, otherwise an error will occur.
There are various settings to better control the desired upload behaviour. These settings are found on the "Upload users preview" page. Warning : errors updating existing accounts can affect your users badly.
Be careful when using the options to update. When creating a new user account Moodle can create a new password if one is not provided or require a password in the uploaded file. The Existing user details options are only available when the Upload type allows existing user accounts to be updated.
It specifies how Moodle should process user detail information for existing users. The Existing user password option appears when you you have set the "Existing user details" setting to "Overwrite with file". It specifies how to handle password data for existing user accounts, to change them or leave them as it. This is a bit of insurance to make sure that you really want to mass change user passwords. The Force password change option specifies when to tag a user account so that the next login attempt will require the user to change the user's password.
If the uploaded file contains the special oldusername field, it is possible to rename a user from the oldusername to a new username. The default setting is to not allow renames. Keep in mind that renaming a user will require the user to use the new username when logging in. If the uploaded file contains the deleted special field, it is possible to use the upload file to delete existing user accounts.
The default setting is to not allow deletes. Keep in mind that deleting a user account will prevent that user from logging in. As a protection, site administrator user accounts cannot be deleted with this method. If the uploaded file contains the suspended special field, it is possible to use the upload file to either suspend or make active unsuspend existing user accounts. Keep in mind that suspending an existing user account will prevent that user from logging in.
It is possible, but not recommended to upload users with duplicate email addresses. By default, uploading users with duplicate email addresses is prevented.
You can tick "Allow accounts with same email". Then on the upload users screen you will be allowed to change the "Prevent email address duplicates" setting. However, doing this is not recommended for file uploads. Test thoroughly any user uploads before implementing. For more info, see the Managing authentication docs page.
Standardise usernames is used by default to convert the username to all lower case and to strip out illegal characters. It is possible to not standardise the usernames; however, doing so is not recommended. After the uploaded file has finished being processed all new accounts have been created and existing accounts updated as specified by the previous settings , there is an option to select some of those user accounts to perform additional bulk user actions such as.
By default, no users are selected for bulk user actions. You can provide default user values for some fields not included in the uploaded file. Some fields include:. By clicking the Show more You can set 17 different fields here, including the Authentication method, Country. Language, Timezone, as well as most other standard User profile fields.
After accepting the preview settings by clicking on "Upload users", you should see the Upload users results screen. This screen will show you any exceptions or changes that were made to each user in the upload process.
For example, if you were updating user information, the updated information will be shown. Or if a user was not added that record will be highlighted. The screen will summarize how many users were uploaded or updated, indicate the number of weak passwords and the number of errors.
Note: This section needs checking and updating if necessary for Moodle 2. Please do so and remove this note when finished. For example, if the firstname is John and the lastname is Doe, the following values will be obtained with the specified templates:.
Template processing is done only on default values, and not on the values retrieved from the CSV file. In order to create correct Moodle usernames, the username is always converted to lowercase. Moreover, if the "Allow extended characters in usernames" option in the Site policies page is off, characters different to letters, digits, dash - and dot. The csv module defines the following constants:. Instructs writer objects to quote all fields. Instructs writer objects to only quote those fields which contain special characters such as delimiter , quotechar or any of the characters in lineterminator.
Instructs writer objects to quote all non-numeric fields. Instructs writer objects to never quote fields. When the current delimiter occurs in output data it is preceded by the current escapechar character.
If escapechar is not set, the writer will raise Error if any characters that require escaping are encountered. Instructs reader to perform no special processing of quote characters. The csv module defines the following exception:. To make it easier to specify the format of input and output records, specific formatting parameters are grouped together into dialects.
A dialect is a subclass of the Dialect class having a set of specific methods and a single validate method. When creating reader or writer objects, the programmer can specify a string or a subclass of the Dialect class as the dialect parameter.
In addition to, or instead of, the dialect parameter, the programmer can also specify individual formatting parameters, which have the same names as the attributes defined below for the Dialect class. A one-character string used to separate fields. It defaults to ','. Controls how instances of quotechar appearing inside a field should themselves be quoted. When True , the character is doubled. When False , the escapechar is used as a prefix to the quotechar.
It defaults to True. On output, if doublequote is False and no escapechar is set, Error is raised if a quotechar is found in a field. On reading, the escapechar removes any special meaning from the following character. It defaults to None , which disables escaping. The string used to terminate lines produced by the writer.
This behavior may change in the future. A one-character string used to quote fields containing special characters, such as the delimiter or quotechar , or which contain new-line characters. It defaults to '"'. Controls when quotes should be generated by the writer and recognised by the reader. When True , whitespace immediately following the delimiter is ignored. The default is False. Reader objects DictReader instances and objects returned by the reader function have the following public methods:.
Usually you should call this as next reader. The number of lines read from the source iterator. This is not the same as the number of records returned, as records can span multiple lines. If not passed as a parameter when creating the object, this attribute is initialized upon first access or when the first record is read from the file. Writer objects DictWriter instances and objects returned by the writer function have the following public methods. A row must be an iterable of strings or numbers for Writer objects and a dictionary mapping fieldnames to strings or numbers by passing them through str first for DictWriter objects.
Note that complex numbers are written out surrounded by parens.
0コメント