project: Moodle
summary: Prepare database module for the Mobile app
description: Move most of the code from view.php to functions Add required web services Implement the check_updates callback Since most of the code of this module is very very old, we will be moving code from view.php to functions in mod/data/lib.php Spec:

1.summary: New Web Service mod_data_get_entries
description: Return a complete list of the database records, including (optionally) it contents and files the current user can see with it currents permissions (supporting groups, etc...) Also for every record the result of data_user_can_manage_entry must be returned (so the ability of editing existing records can be calculated).
2.summary: Return more fields for students in mod_data_get_databases_by_courses
description: Right now only a very limited number of fields is returned for users, we should return more viewable fields like the template.
3.summary: New Web Service mod_data_view_database
description: To mark view completed and launch the mod viewed event for the database.
4.summary: New Web Service mod_data_get_data_access_information
description: To retrieve access information like user permissions and current default group in the database and event the number of entries, read only period, specific permissions calculated via functions like data_user_can_add_entry etc.. In general all kind of information required by an external client to be able to interact properly with the rest of the Web Services
5.summary: New Web Service mod_data_get_entry
description: Get a simple entry (record) of the given database (checking groups permissions, etc..) It should return both the content for each field, files and also the rendered content.
6.summary: New Web Service mod_data_get_fields
description: Return the list of configured fields for the given database. This will require each field type to return the settings available to avoid security issues (maybe there are configuration tokens exposed there)
7.summary: New Web Service mod_data_search_entries
description: Search entries and return the entries found and the list representation for the given search and page.
8.summary: New Web Service mod_data_approve_entry
description: Approves and entry
9.summary: New Web Service mod_data_delete_entry
description: Deletes an entry
10.summary: New Web Service mod_data_add_entry
description: Adds an entry
11.summary: New Web Service mod_data_update_entry
description: Updates an existing entry
12.summary: Implement the check_updates callback in the database module
description: Implement the check_updates_callback to retrieve the list of updates in the module since the given time

Below is an instruction that describes a task, paired with an input that provides an epic with this format: 
"project": "Name of the project" 
"summary": "Summary of the epic user story" 
"description": "Description of the epic user story". Write a response that appropriately completes the request.### Instruction:
Break this epic user story into smaller tasks to help the developers understand the epic better, you can divide this epic into as much as you want depending on the complexity of the epic.
### Input:
project: Moodle
summary: Prepare database module for the Mobile app
description: Move most of the code from view.php to functions Add required web services Implement the check_updates callback Since most of the code of this module is very very old, we will be moving code from view.php to functions in mod/data/lib.php Spec:

### Response:
1.summary: New Web Service mod_data_get_entries
description: Return a complete list of the database records, including (optionally) it contents and files the current user can see with it currents permissions (supporting groups, etc...) Also for every record the result of data_user_can_manage_entry must be returned (so the ability of editing existing records can be calculated).
2.summary: Return more fields for students in mod_data_get_databases_by_courses
description: Right now only a very limited number of fields is returned for users, we should return more viewable fields like the template.
3.summary: New Web Service mod_data_view_database
description: To mark view completed and launch the mod viewed event for the database.
4.summary: New Web Service mod_data_get_data_access_information
description: To retrieve access information like user permissions and current default group in the database and event the number of entries, read only period, specific permissions calculated via functions like data_user_can_add_entry etc.. In general all kind of information required by an external client to be able to interact properly with the rest of the Web Services
5.summary: New Web Service mod_data_get_entry
description: Get a simple entry (record) of the given database (checking groups permissions, etc..) It should return both the content for each field, files and also the rendered content.
6.summary: New Web Service mod_data_get_fields
description: Return the list of configured fields for the given database. This will require each field type to return the settings available to avoid security issues (maybe there are configuration tokens exposed there)
7.summary: New Web Service mod_data_search_entries
description: Search entries and return the entries found and the list representation for the given search and page.
8.summary: New Web Service mod_data_approve_entry
description: Approves and entry
9.summary: New Web Service mod_data_delete_entry
description: Deletes an entry
10.summary: New Web Service mod_data_add_entry
description: Adds an entry
11.summary: New Web Service mod_data_update_entry
description: Updates an existing entry
12.summary: Implement the check_updates callback in the database module
description: Implement the check_updates_callback to retrieve the list of updates in the module since the given time
