See Release Notes
Long Term Support Release
A form for cohort upload.
Copyright: | 2014 Marina Glancy |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 570 lines (23 kb) |
Included or required: | 0 times |
Referenced: | 1 time |
Includes or requires: | 0 files |
cohort_upload_form:: (13 methods):
definition()
add_cohort_upload_buttons()
definition_after_data()
get_context_options()
validation()
get_cohort_file()
get_cohorts_data()
preview_uploaded_cohorts()
get_previewed_rows()
display()
process_upload_file()
clean_cohort_data()
resolve_context()
Class: cohort_upload_form - X-Ref
Cohort upload form classdefinition() X-Ref |
Form definition |
add_cohort_upload_buttons() X-Ref |
Add buttons to the form ("Upload cohorts", "Preview", "Cancel") |
definition_after_data() X-Ref |
Process the uploaded file and allow the submit button only if it doest not have errors. |
get_context_options() X-Ref |
Returns the list of contexts where current user can create cohorts. return: array |
validation($data, $files) X-Ref |
No description |
get_cohort_file($draftid) X-Ref |
Returns the uploaded file if it is present. param: int $draftid return: stored_file|null |
get_cohorts_data() X-Ref |
Returns the list of prepared objects to be added as cohorts return: array of stdClass objects, each can be passed to {@link cohort_add_cohort()} |
preview_uploaded_cohorts() X-Ref |
Displays the preview of the uploaded file |
get_previewed_rows() X-Ref |
Find up rows to show in preview Number of previewed rows is limited but rows with errors and warnings have priority. return: array |
display() X-Ref |
No description |
process_upload_file($file, $encoding, $delimiter, $defaultcontext) X-Ref |
param: stored_file $file param: string $encoding param: string $delimiter param: context $defaultcontext return: array |
clean_cohort_data(&$hash) X-Ref |
Cleans input data about one cohort. param: array $hash |
resolve_context(&$hash, $defaultcontext) X-Ref |
Determines in which context the particular cohort will be created param: array $hash param: context $defaultcontext return: array array of warning strings |