├── README.txt ├── access └── index.php ├── admin ├── admintools.php ├── plugins.php └── sitepresets.php ├── backup └── moodle2 │ ├── backup_dataform_activity_task.class.php │ ├── backup_dataform_stepslib.php │ ├── restore_dataform_activity_task.class.php │ └── restore_dataform_stepslib.php ├── classes ├── access │ ├── base.php │ ├── entry_add.php │ ├── entry_base.php │ ├── entry_delete.php │ ├── entry_export.php │ ├── entry_update.php │ ├── entry_view.php │ ├── field_update.php │ ├── field_view.php │ ├── view_access.php │ ├── view_capability.php │ └── view_filter_override.php ├── access_manager.php ├── admin │ └── patternvalidator.php ├── capability │ └── manager.php ├── dataform.php ├── entry_manager.php ├── event │ ├── entry_base.php │ ├── entry_created.php │ ├── entry_deleted.php │ ├── entry_updated.php │ ├── field_base.php │ ├── field_content_updated.php │ ├── field_created.php │ ├── field_deleted.php │ ├── field_updated.php │ ├── filter_base.php │ ├── filter_created.php │ ├── filter_deleted.php │ ├── filter_updated.php │ ├── view_base.php │ ├── view_created.php │ ├── view_deleted.php │ ├── view_updated.php │ └── view_viewed.php ├── field_manager.php ├── filter_manager.php ├── grade_manager.php ├── helper │ ├── calendar_event.php │ ├── filterform.php │ ├── notificationform.php │ ├── ruleform.php │ └── testing.php ├── instance_store.php ├── interfaces │ ├── grading.php │ ├── overview.php │ ├── rss.php │ └── usingscale.php ├── notification_manager.php ├── observer │ ├── completion.php │ ├── manager.php │ └── notification.php ├── pattern_manager.php ├── pluginbase │ ├── dataformentry.php │ ├── dataformfield.php │ ├── dataformfield_internal.php │ ├── dataformfield_nocontent.php │ ├── dataformfieldform.php │ ├── dataformfieldrenderer.php │ ├── dataformfilter.php │ ├── dataformfilterform.php │ ├── dataformfilterform_advanced.php │ ├── dataformfilterform_standard.php │ ├── dataformpresetform.php │ ├── dataformrule.php │ ├── dataformview.php │ ├── dataformviewform.php │ ├── dataformviewpatterns.php │ └── entriesform.php ├── plugininfo │ ├── dataformfield.php │ ├── dataformtool.php │ └── dataformview.php ├── preset_manager.php ├── rule_manager.php ├── setting │ ├── managedataformfield.php │ └── managedataformview.php └── view_manager.php ├── css.php ├── db ├── access.php ├── events.php ├── install.php ├── install.xml ├── log.php ├── messages.php ├── subplugins.php └── upgrade.php ├── embed.php ├── field ├── checkbox │ ├── checkbox.js │ ├── classes │ │ ├── checkbox.php │ │ ├── form.php │ │ └── renderer.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_checkbox.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ └── behat │ │ │ ├── default_content.feature │ │ │ └── pattern_require_noedit.feature │ └── version.php ├── commentmdl │ ├── classes │ │ ├── commentmdl.php │ │ ├── event │ │ │ ├── comment_created.php │ │ │ └── comment_deleted.php │ │ ├── form.php │ │ └── renderer.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_commentmdl.php │ ├── pix │ │ └── icon.gif │ └── version.php ├── duration │ ├── classes │ │ ├── duration.php │ │ ├── form.php │ │ └── renderer.php │ ├── db │ │ └── access.php │ ├── duration.js │ ├── lang │ │ └── en │ │ │ └── dataformfield_duration.php │ ├── pix │ │ └── icon.png │ ├── tests │ │ └── behat │ │ │ └── field_duration.feature │ └── version.php ├── edit.php ├── entry │ ├── classes │ │ ├── entry.php │ │ ├── form.php │ │ └── renderer.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_entry.php │ ├── pix │ │ └── icon.gif │ └── version.php ├── entryactions │ ├── classes │ │ ├── entryactions.php │ │ └── renderer.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_entryactions.php │ ├── pix │ │ └── icon.png │ └── version.php ├── entryauthor │ ├── assign.php │ ├── classes │ │ ├── entryauthor.php │ │ └── renderer.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_entryauthor.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ └── behat │ │ │ └── entrychoice.feature │ └── version.php ├── entrygroup │ ├── classes │ │ ├── entrygroup.php │ │ └── renderer.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_entrygroup.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ └── behat │ │ │ └── patterns.feature │ └── version.php ├── entrystate │ ├── ajax.php │ ├── classes │ │ ├── entrystate.php │ │ ├── form.php │ │ ├── helper │ │ │ └── contentperuser.php │ │ └── renderer.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_entrystate.php │ ├── pix │ │ └── icon.gif │ ├── styles.css │ ├── tests │ │ ├── behat │ │ │ ├── behat_dataformfield_entrystate.php │ │ │ ├── completion_requires_specific_grade.feature │ │ │ └── filtering.feature │ │ └── grading_test.php │ ├── version.php │ └── yui │ │ └── stater │ │ └── stater.js ├── entrytime │ ├── classes │ │ ├── entrytime.php │ │ └── renderer.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_entrytime.php │ ├── pix │ │ └── icon.gif │ └── version.php ├── file │ ├── classes │ │ ├── file.php │ │ ├── form.php │ │ └── renderer.php │ ├── db │ │ └── access.php │ ├── download.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_file.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ └── behat │ │ │ └── field_file.feature │ └── version.php ├── index.php ├── number │ ├── classes │ │ ├── form.php │ │ ├── number.php │ │ └── renderer.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_number.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ └── behat │ │ │ └── field_number.feature │ └── version.php ├── picture │ ├── classes │ │ ├── form.php │ │ ├── picture.php │ │ └── renderer.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_picture.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ └── behat │ │ │ └── field_picture.feature │ └── version.php ├── radiobutton │ ├── classes │ │ ├── form.php │ │ ├── helper │ │ │ └── contentperuser.php │ │ ├── radiobutton.php │ │ └── renderer.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_radiobutton.php │ ├── pix │ │ └── icon.gif │ ├── radiobutton.js │ ├── tests │ │ └── behat │ │ │ ├── default_content.feature │ │ │ └── field_radiobutton.feature │ └── version.php ├── ratingmdl │ ├── classes │ │ ├── event │ │ │ ├── rating_created.php │ │ │ └── rating_deleted.php │ │ ├── form.php │ │ ├── helper │ │ │ └── contentperuser.php │ │ ├── ratingmdl.php │ │ └── renderer.php │ ├── db │ │ ├── access.php │ │ └── upgrade.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_ratingmdl.php │ ├── pix │ │ ├── icon.gif │ │ ├── star_black.png │ │ └── star_grey.png │ ├── rate_ajax.php │ ├── ratinglib.php │ ├── tests │ │ └── behat │ │ │ └── rating.feature │ ├── version.php │ └── yui │ │ └── rater │ │ └── rater.js ├── select │ ├── classes │ │ ├── form.php │ │ ├── helper │ │ │ └── contentperuser.php │ │ ├── renderer.php │ │ └── select.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_select.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ └── behat │ │ │ ├── default_content.feature │ │ │ ├── field_select.feature │ │ │ └── search.feature │ └── version.php ├── selectmulti │ ├── classes │ │ ├── form.php │ │ ├── renderer.php │ │ └── selectmulti.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_selectmulti.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ └── behat │ │ │ ├── default_content.feature │ │ │ └── field_selectmulti.feature │ └── version.php ├── text │ ├── classes │ │ ├── form.php │ │ ├── renderer.php │ │ └── text.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_text.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ ├── behat │ │ │ ├── default_content.feature │ │ │ ├── pattern_required_noedit.feature │ │ │ └── various_inputs.feature │ │ └── filter_test.php │ └── version.php ├── textarea │ ├── classes │ │ ├── form.php │ │ ├── renderer.php │ │ └── textarea.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_textarea.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ ├── behat │ │ │ ├── default_content.feature │ │ │ └── field_textarea.feature │ │ └── import_test.php │ └── version.php ├── time │ ├── classes │ │ ├── form.php │ │ ├── renderer.php │ │ └── time.php │ ├── db │ │ └── access.php │ ├── lang │ │ └── en │ │ │ └── dataformfield_time.php │ ├── pix │ │ └── icon.gif │ ├── tests │ │ └── behat │ │ │ ├── adding_entries.feature │ │ │ └── behat_dataformfield_time.php │ └── version.php └── url │ ├── classes │ ├── form.php │ ├── renderer.php │ └── url.php │ ├── db │ └── access.php │ ├── lang │ └── en │ │ └── dataformfield_url.php │ ├── pix │ └── icon.gif │ └── version.php ├── filter ├── edit.php ├── editadvanced.php └── index.php ├── grade ├── items.php └── itemsform.php ├── index.php ├── js.php ├── lang └── en │ └── dataform.php ├── lib.php ├── locallib.php ├── mod_form.php ├── module.js ├── notification └── index.php ├── phpunit.xml ├── pix ├── access.png ├── cleanup.png ├── icon.png ├── noaccess.png ├── nonotification.gif ├── notification.gif ├── patternbroken.png ├── patternsuspect.png └── patternvalid.png ├── preset └── index.php ├── renderer.php ├── rsslib.php ├── settings.php ├── styles.css ├── tests ├── access_test.php ├── backup_restore_test.php ├── behat │ ├── access │ │ ├── access_default.feature │ │ ├── access_early.feature │ │ └── access_late.feature │ ├── add_remove_dataform.feature │ ├── behat_mod_dataform.php │ ├── completion_condition_number_entries.feature │ ├── field │ │ └── management.feature │ ├── filtering.feature │ ├── grade │ │ ├── auto_grading.feature │ │ └── multiple_grade_items.feature │ ├── group_modes.feature │ ├── manage.feature │ ├── max_entries.feature │ ├── max_entries_with_interval.feature │ ├── navigation_tabs.feature │ ├── not_ready.feature │ ├── preset.feature │ ├── separate_participants.feature │ └── view │ │ ├── display_after.feature │ │ ├── image_in_template.feature │ │ ├── management.feature │ │ ├── pattern_addnewentries.feature │ │ ├── pattern_addnewentry.feature │ │ ├── pattern_viewlinknamed.feature │ │ ├── pattern_viewlinkreg.feature │ │ ├── required_field.feature │ │ └── submission_buttons.feature ├── calculations_test.php ├── events_test.php ├── filter_search_test.php ├── filter_test.php ├── fixtures │ ├── Preset-dataform-preset.mbz │ ├── tc_generator.csv │ ├── test_cases_access.csv │ ├── test_dataform_entries.csv │ └── test_image.jpg ├── generator │ └── lib.php ├── generator_test.php └── grading_test.php ├── tool ├── entryperuser │ ├── classes │ │ └── tool.php │ ├── lang │ │ └── en │ │ │ └── dataformtool_entryperuser.php │ └── version.php └── index.php ├── version.php ├── view.php └── view ├── aligned ├── classes │ ├── aligned.php │ └── form.php ├── db │ └── access.php ├── lang │ └── en │ │ └── dataformview_aligned.php ├── lib.php └── version.php ├── csv ├── classes │ ├── csv.php │ ├── form.php │ ├── importform.php │ └── patterns.php ├── db │ └── access.php ├── lang │ └── en │ │ └── dataformview_csv.php ├── lib.php ├── tests │ ├── behat │ │ └── csv_import.feature │ └── csv_import_test.php └── version.php ├── edit.php ├── grid ├── classes │ ├── form.php │ └── grid.php ├── db │ └── access.php ├── lang │ └── en │ │ └── dataformview_grid.php ├── lib.php ├── styles.css └── version.php ├── index.php ├── interval ├── classes │ ├── form.php │ └── interval.php ├── db │ └── access.php ├── lang │ └── en │ │ └── dataformview_interval.php ├── lib.php └── version.php ├── patternsform.php ├── rss ├── classes │ ├── form.php │ └── rss.php ├── db │ └── access.php ├── lang │ └── en │ │ └── dataformview_rss.php ├── lib.php └── version.php └── tabular ├── classes ├── form.php └── tabular.php ├── db └── access.php ├── lang └── en │ └── dataformview_tabular.php ├── lib.php └── version.php /README.txt: -------------------------------------------------------------------------------- 1 | Dataform 2 | ======== 3 | This Moodle module is a major enhancement of Moodle standard Database module activity. 4 | 5 | Release: 6 | -------- 7 | 3.0dev 8 | 9 | Documentation: 10 | -------------- 11 | http://docs.moodle.org/en/Dataform_module 12 | -------------------------------------------------------------------------------- /admin/admintools.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package mod_dataform 19 | * @category admin 20 | * @copyright 2013 Itamar Tzadok 21 | */ 22 | 23 | require_once('../../../config.php'); 24 | require_once("$CFG->libdir/adminlib.php"); 25 | 26 | $tool = required_param('tool', PARAM_ALPHA); 27 | 28 | admin_externalpage_setup("moddataform_$tool"); 29 | 30 | $toolclass = "mod_dataform\admin\\$tool"; 31 | 32 | echo $OUTPUT->header(); 33 | echo $OUTPUT->heading(get_string('pluginname', 'dataform')); 34 | echo html_writer::tag('h3', $toolclass::get_visible_name()); 35 | 36 | echo $toolclass::run(); 37 | 38 | echo $OUTPUT->footer(); 39 | -------------------------------------------------------------------------------- /admin/sitepresets.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package mod_dataform 19 | * @category admin 20 | * @copyright 2013 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | require_once('../../../config.php'); 25 | require_once("$CFG->libdir/adminlib.php"); 26 | 27 | $urlparams = new stdClass; 28 | 29 | // Presets list actions. 30 | // Ids of presets to delete. 31 | $urlparams->delete = optional_param('delete', '', PARAM_SEQUENCE); 32 | // Ids of presets to download in one zip. 33 | $urlparams->download = optional_param('download', '', PARAM_SEQUENCE); 34 | $urlparams->confirmed = optional_param('confirmed', 0, PARAM_INT); 35 | 36 | admin_externalpage_setup('moddataform_sitepresets'); 37 | 38 | $pm = new mod_dataform_preset_manager(0); 39 | 40 | // DATA PROCESSING. 41 | $pm->process_presets($urlparams); 42 | 43 | echo $OUTPUT->header(); 44 | 45 | // Print the preset form. 46 | $pm->print_preset_form(); 47 | 48 | // If there are presets print admin style list of them. 49 | echo html_writer::tag('h4', get_string('presetavailableinsite', 'dataform')); 50 | $presets = $pm->get_user_presets($pm::PRESET_SITEAREA); 51 | echo $pm->get_site_presets_list($presets); 52 | 53 | echo $OUTPUT->footer(); 54 | -------------------------------------------------------------------------------- /classes/access/entry_base.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * mod_dataform access validators. 19 | * 20 | * @package mod_dataform 21 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | namespace mod_dataform\access; 26 | 27 | defined('MOODLE_INTERNAL') || die(); 28 | 29 | /** 30 | * mod_dataform entry view permission class. 31 | * 32 | * @package mod_dataform 33 | * @copyright 2015 Itamar Tzadok {@link http://substantialmethods.com} 34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 35 | */ 36 | abstract class entry_base extends base { 37 | 38 | /** 39 | * @return null|array 40 | */ 41 | public static function get_rules(\mod_dataform_access_manager $man, array $params) { 42 | return array_merge( 43 | $man->get_type_rules('view'), 44 | $man->get_type_rules('entry') 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /classes/access/entry_export.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * mod_dataform access validators. 19 | * 20 | * @package mod_dataform 21 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | namespace mod_dataform\access; 26 | 27 | defined('MOODLE_INTERNAL') || die(); 28 | 29 | /** 30 | * mod_dataform entry export permission class. 31 | * 32 | * @package mod_dataform 33 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 35 | */ 36 | class entry_export extends entry_base { 37 | 38 | /** 39 | * @return array 40 | */ 41 | public static function get_capabilities() { 42 | return array('entry_export'); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /classes/access/view_capability.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * mod_dataform access validators. 19 | * 20 | * @package mod_dataform 21 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | namespace mod_dataform\access; 26 | 27 | defined('MOODLE_INTERNAL') || die(); 28 | 29 | /** 30 | * mod_dataform view capability class. 31 | * 32 | * @package mod_dataform 33 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 35 | */ 36 | class view_capability extends base { 37 | 38 | /** 39 | * @return null|array 40 | */ 41 | public static function get_rules(\mod_dataform_access_manager $man, array $params) { 42 | return $man->get_type_rules('view'); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /classes/access/view_filter_override.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * mod_dataform access validators. 19 | * 20 | * @package mod_dataform 21 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | namespace mod_dataform\access; 26 | 27 | defined('MOODLE_INTERNAL') || die(); 28 | 29 | /** 30 | * mod_dataform view filter override permission class. 31 | * 32 | * @package mod_dataform 33 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 35 | */ 36 | class view_filter_override extends base { 37 | 38 | /** 39 | * @return null|array 40 | */ 41 | public static function get_rules(\mod_dataform_access_manager $man, array $params) { 42 | $viewid = $params['viewid']; 43 | 44 | return $man->get_type_rules('view'); 45 | } 46 | 47 | /** 48 | * @return array 49 | */ 50 | public static function get_capabilities() { 51 | return array('mod/dataform:viewfilteroverride'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /classes/access_manager.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package mod_dataform 19 | * @copyright 2013 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | /** 24 | * Access manager class 25 | */ 26 | class mod_dataform_access_manager extends mod_dataform_rule_manager { 27 | 28 | public static function instance($dataformid) { 29 | if (!$instance = \mod_dataform_instance_store::instance($dataformid, 'access_manager')) { 30 | $instance = new mod_dataform_access_manager($dataformid); 31 | \mod_dataform_instance_store::register($dataformid, 'access_manager', $instance); 32 | } 33 | 34 | return $instance; 35 | } 36 | 37 | /** 38 | * Returns the category of rules the manager refer to. 39 | * @return string Always 'access' 40 | */ 41 | protected function get_category() { 42 | return 'access'; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /classes/event/entry_created.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataforwm entry created event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * int dataid the id of the dataform activity. 24 | * int viewid the id of the view where the event occured. 25 | * int userid the id of the entry owner. 26 | * } 27 | * 28 | * @package mod_dataform 29 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 30 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 31 | */ 32 | 33 | namespace mod_dataform\event; 34 | 35 | defined('MOODLE_INTERNAL') || die(); 36 | 37 | class entry_created extends entry_base { 38 | 39 | /** 40 | * Init method. 41 | * 42 | * @return void 43 | */ 44 | protected function init() { 45 | $this->data['objecttable'] = 'dataform_entries'; 46 | $this->data['crud'] = 'c'; 47 | $this->data['edulevel'] = self::LEVEL_PARTICIPATING; 48 | } 49 | 50 | /** 51 | * Get the legacy event log data. 52 | * 53 | * @return array 54 | */ 55 | public function get_legacy_logdata() { 56 | $d = $this->other['dataid']; 57 | $viewid = $this->other['viewid']; 58 | return array($this->courseid, 'dataform', 'entries add', "view.php?d=$d&view=$viewid&eids=$this->objectid", $this->objectid, $this->contextinstanceid); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /classes/event/field_content_updated.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform field content updated event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string fieldname the name of the field. 24 | * int dataid the id of the dataform activity. 25 | * int entryid the id of the entry. 26 | * } 27 | * 28 | * @package mod_dataform 29 | * @copyright 2014 Itamar Tzadok 30 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 31 | */ 32 | 33 | namespace mod_dataform\event; 34 | 35 | defined('MOODLE_INTERNAL') || die(); 36 | 37 | class field_content_updated extends field_base { 38 | 39 | /** 40 | * Init method. 41 | * 42 | * @return void 43 | */ 44 | protected function init() { 45 | $this->data['objecttable'] = 'dataform_contents'; 46 | $this->data['crud'] = 'u'; 47 | $this->data['edulevel'] = self::LEVEL_PARTICIPATING; 48 | } 49 | 50 | /** 51 | * Returns description of what happened. 52 | * 53 | * @return string 54 | */ 55 | public function get_description() { 56 | return 'The content of field '. $this->objectid. ' belonging to the dataform activity '. $this->other['dataid']. 57 | ' has been updated for entry '. $this->other['entryid']. '.'; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /classes/event/field_created.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform field created event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string fieldname the name of the field. 24 | * int dataid the id of the dataform activity. 25 | * } 26 | * 27 | * @package mod_dataform 28 | * @copyright 2014 Itamar Tzadok 29 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 | */ 31 | 32 | namespace mod_dataform\event; 33 | 34 | defined('MOODLE_INTERNAL') || die(); 35 | 36 | class field_created extends field_base { 37 | 38 | /** 39 | * Init method. 40 | * 41 | * @return void 42 | */ 43 | protected function init() { 44 | $this->data['objecttable'] = 'dataform_fields'; 45 | $this->data['crud'] = 'c'; 46 | $this->data['edulevel'] = self::LEVEL_TEACHING; 47 | } 48 | 49 | /** 50 | * Get the legacy event log data. 51 | * 52 | * @return array 53 | */ 54 | public function get_legacy_logdata() { 55 | return array($this->courseid, 'dataform', 'fields add', 'field/index.php?d=' . $this->other['dataid'] . '&fid=' . 56 | $this->objectid, $this->objectid, $this->contextinstanceid); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /classes/event/field_deleted.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform field deleted event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string fieldname the name of the field. 24 | * int dataid the id of the dataform activity. 25 | * } 26 | * 27 | * @package mod_dataform 28 | * @copyright 2014 Itamar Tzadok 29 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 | */ 31 | 32 | namespace mod_dataform\event; 33 | 34 | defined('MOODLE_INTERNAL') || die(); 35 | 36 | class field_deleted extends field_base { 37 | 38 | /** 39 | * Init method. 40 | * 41 | * @return void 42 | */ 43 | protected function init() { 44 | $this->data['objecttable'] = 'dataform_fields'; 45 | $this->data['crud'] = 'd'; 46 | $this->data['edulevel'] = self::LEVEL_TEACHING; 47 | } 48 | 49 | /** 50 | * Get the legacy event log data. 51 | * 52 | * @return array 53 | */ 54 | public function get_legacy_logdata() { 55 | return array($this->courseid, 'dataform', 'fields delete', 'field/index.php?d=' . $this->other['dataid'] . '&delete=' . 56 | $this->objectid, $this->objectid, $this->contextinstanceid); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /classes/event/field_updated.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform field updated event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string fieldname the name of the field. 24 | * int dataid the id of the dataform activity. 25 | * } 26 | * 27 | * @package mod_dataform 28 | * @copyright 2014 Itamar Tzadok 29 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 | */ 31 | 32 | namespace mod_dataform\event; 33 | 34 | defined('MOODLE_INTERNAL') || die(); 35 | 36 | class field_updated extends field_base { 37 | 38 | /** 39 | * Init method. 40 | * 41 | * @return void 42 | */ 43 | protected function init() { 44 | $this->data['objecttable'] = 'dataform_fields'; 45 | $this->data['crud'] = 'u'; 46 | $this->data['edulevel'] = self::LEVEL_TEACHING; 47 | } 48 | 49 | /** 50 | * Get the legacy event log data. 51 | * 52 | * @return array 53 | */ 54 | public function get_legacy_logdata() { 55 | return array($this->courseid, 'dataform', 'fields update', 'field/index.php?d=' . $this->other['dataid'] . '&fid=' . 56 | $this->objectid, $this->objectid, $this->contextinstanceid); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /classes/event/filter_created.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform filter created event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string filtername the name of the filter. 24 | * int dataid the id of the dataform activity. 25 | * } 26 | * 27 | * @package mod_dataform 28 | * @copyright 2014 Itamar Tzadok 29 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 | */ 31 | 32 | namespace mod_dataform\event; 33 | 34 | defined('MOODLE_INTERNAL') || die(); 35 | 36 | class filter_created extends filter_base { 37 | 38 | /** 39 | * Init method. 40 | * 41 | * @return void 42 | */ 43 | protected function init() { 44 | $this->data['objecttable'] = 'dataform_filters'; 45 | $this->data['crud'] = 'c'; 46 | $this->data['edulevel'] = self::LEVEL_TEACHING; 47 | } 48 | 49 | /** 50 | * Get the legacy event log data. 51 | * 52 | * @return array 53 | */ 54 | public function get_legacy_logdata() { 55 | return array($this->courseid, 'dataform', 'filters add', 'filter/index.php?d=' . $this->other['dataid'] . '&fid=' . 56 | $this->objectid, $this->objectid, $this->contextinstanceid); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /classes/event/filter_deleted.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform filter deleted event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string filtername the name of the filter. 24 | * int dataid the id of the dataform activity. 25 | * } 26 | * 27 | * @package mod_dataform 28 | * @copyright 2014 Itamar Tzadok 29 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 | */ 31 | 32 | namespace mod_dataform\event; 33 | 34 | defined('MOODLE_INTERNAL') || die(); 35 | 36 | class filter_deleted extends filter_base { 37 | 38 | /** 39 | * Init method. 40 | * 41 | * @return void 42 | */ 43 | protected function init() { 44 | $this->data['objecttable'] = 'dataform_filters'; 45 | $this->data['crud'] = 'd'; 46 | $this->data['edulevel'] = self::LEVEL_TEACHING; 47 | } 48 | 49 | /** 50 | * Get the legacy event log data. 51 | * 52 | * @return array 53 | */ 54 | public function get_legacy_logdata() { 55 | return array($this->courseid, 'dataform', 'filters delete', 'filter/index.php?d=' . $this->other['dataid'] . '&delete=' . 56 | $this->objectid, $this->objectid, $this->contextinstanceid); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /classes/event/filter_updated.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform filter updated event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string filtername the name of the filter. 24 | * int dataid the id of the dataform activity. 25 | * } 26 | * 27 | * @package mod_dataform 28 | * @copyright 2014 Itamar Tzadok 29 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 | */ 31 | 32 | namespace mod_dataform\event; 33 | 34 | defined('MOODLE_INTERNAL') || die(); 35 | 36 | class filter_updated extends filter_base { 37 | 38 | /** 39 | * Init method. 40 | * 41 | * @return void 42 | */ 43 | protected function init() { 44 | $this->data['objecttable'] = 'dataform_filters'; 45 | $this->data['crud'] = 'u'; 46 | $this->data['edulevel'] = self::LEVEL_TEACHING; 47 | } 48 | 49 | /** 50 | * Get the legacy event log data. 51 | * 52 | * @return array 53 | */ 54 | public function get_legacy_logdata() { 55 | return array($this->courseid, 'dataform', 'filters update', 'filter/index.php?d=' . $this->other['dataid'] . '&fid=' . 56 | $this->objectid, $this->objectid, $this->contextinstanceid); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /classes/event/view_created.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform view created event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string viewname the name of the view. 24 | * int dataid the id of the dataform activity. 25 | * } 26 | * 27 | * @package mod_dataform 28 | * @copyright 2014 Itamar Tzadok 29 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 | */ 31 | 32 | namespace mod_dataform\event; 33 | 34 | defined('MOODLE_INTERNAL') || die(); 35 | 36 | class view_created extends view_base { 37 | 38 | /** 39 | * Init method. 40 | * 41 | * @return void 42 | */ 43 | protected function init() { 44 | $this->data['objecttable'] = 'dataform_views'; 45 | $this->data['crud'] = 'c'; 46 | $this->data['edulevel'] = self::LEVEL_TEACHING; 47 | } 48 | 49 | /** 50 | * Get the legacy event log data. 51 | * 52 | * @return array 53 | */ 54 | public function get_legacy_logdata() { 55 | return array($this->courseid, 'dataform', 'views add', 'view/index.php?d=' . $this->other['dataid'] . '&vedit=' . 56 | $this->objectid, $this->objectid, $this->contextinstanceid); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /classes/event/view_deleted.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform view deleted event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string viewname the name of the view. 24 | * int dataid the id of the dataform activity. 25 | * } 26 | * 27 | * @package mod_dataform 28 | * @copyright 2014 Itamar Tzadok 29 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 | */ 31 | 32 | namespace mod_dataform\event; 33 | 34 | defined('MOODLE_INTERNAL') || die(); 35 | 36 | class view_deleted extends view_base { 37 | 38 | /** 39 | * Init method. 40 | * 41 | * @return void 42 | */ 43 | protected function init() { 44 | $this->data['objecttable'] = 'dataform_views'; 45 | $this->data['crud'] = 'd'; 46 | $this->data['edulevel'] = self::LEVEL_TEACHING; 47 | } 48 | 49 | /** 50 | * Get the legacy event log data. 51 | * 52 | * @return array 53 | */ 54 | public function get_legacy_logdata() { 55 | return array($this->courseid, 'dataform', 'views delete', 'view/index.php?d=' . $this->other['dataid'] . '&delete=' . 56 | $this->objectid, $this->objectid, $this->contextinstanceid); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /classes/event/view_updated.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform view updated event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string viewname the name of the view. 24 | * int dataid the id of the dataform activity. 25 | * } 26 | * 27 | * @package mod_dataform 28 | * @copyright 2014 Itamar Tzadok 29 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 | */ 31 | 32 | namespace mod_dataform\event; 33 | 34 | defined('MOODLE_INTERNAL') || die(); 35 | 36 | class view_updated extends view_base { 37 | 38 | /** 39 | * Init method. 40 | * 41 | * @return void 42 | */ 43 | protected function init() { 44 | $this->data['objecttable'] = 'dataform_views'; 45 | $this->data['crud'] = 'u'; 46 | $this->data['edulevel'] = self::LEVEL_TEACHING; 47 | } 48 | 49 | /** 50 | * Get the legacy event log data. 51 | * 52 | * @return array 53 | */ 54 | public function get_legacy_logdata() { 55 | return array($this->courseid, 'dataform', 'views update', 'view/index.php?d=' . $this->other['dataid'] . '&vedit=' . 56 | $this->objectid, $this->objectid, $this->contextinstanceid); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /classes/event/view_viewed.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform view accessed event. 19 | * 20 | * @property-read array $other { 21 | * Extra information about event. 22 | * 23 | * string viewname the name of the view. 24 | * int dataid the id of the dataform activity. 25 | * } 26 | * 27 | * @package mod_dataform 28 | * @copyright 2014 Itamar Tzadok 29 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 | */ 31 | 32 | namespace mod_dataform\event; 33 | 34 | defined('MOODLE_INTERNAL') || die(); 35 | 36 | class view_viewed extends view_base { 37 | 38 | /** 39 | * Init method. 40 | * 41 | * @return void 42 | */ 43 | protected function init() { 44 | $this->data['objecttable'] = 'dataform_views'; 45 | $this->data['crud'] = 'r'; 46 | $this->data['edulevel'] = self::LEVEL_PARTICIPATING; 47 | } 48 | 49 | /** 50 | * Get the legacy event log data. 51 | * 52 | * @return array 53 | */ 54 | public function get_legacy_logdata() { 55 | return array($this->courseid, 'dataform', 'views view', 'view.php?d=' . $this->other['dataid'] . '&view=' . 56 | $this->objectid, $this->objectid, $this->contextinstanceid); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /classes/helper/testing.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The mod_dataform testing helper. 19 | * 20 | * @package mod_dataform 21 | * @copyright 2014 Itamar Tzadok 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | namespace mod_dataform\helper; 26 | 27 | defined('MOODLE_INTERNAL') || die(); 28 | 29 | /** 30 | * This class provides helper methods for testing. 31 | */ 32 | class testing { 33 | /** 34 | * Returns role short name override if exists. Overrides can be defined in config.php 35 | * in the following way: 36 | * define('PHPUNIT_ROLENAME_EDITINGTEACHER', 'instructor'); 37 | * 38 | * @param string $shortname 39 | * @return string 40 | */ 41 | public static function get_role_shortname($shortname) { 42 | $constantstr = strtoupper("PHPUNIT_ROLENAME_$shortname"); 43 | if (defined($constantstr) and $newshortname = constant($constantstr)) { 44 | return $newshortname; 45 | } 46 | 47 | return $shortname; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /classes/interfaces/grading.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Interface class. 19 | * 20 | * @package mod_dataform 21 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | namespace mod_dataform\interfaces; 25 | 26 | defined('MOODLE_INTERNAL') || die(); 27 | 28 | /** 29 | * Interface for dataformfield grading support 30 | * 31 | * The interface that is implemented by any dataformfield plugin which supports grading. 32 | * It forces inheriting classes to define methods that are called by the dataform for grading. 33 | * 34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 35 | */ 36 | interface grading { 37 | 38 | /** 39 | * Returns the value replacement of the pattern for each user with content in the field. 40 | * 41 | * @param string $pattern 42 | * @param array $entryids The ids of entries the field values should be fetched from. 43 | * If not provided the method should return values from all applicable entries. 44 | * @param int $userid The id of the users whose field values are requested. 45 | * If not specified, should return values for all applicable users. 46 | * @return null|array Array of userid => value pairs. 47 | */ 48 | public function get_user_values($pattern, array $entryids = null, $userid = 0); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /classes/interfaces/overview.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Interface class. 19 | * 20 | * @package mod_dataform 21 | * @copyright 2016 Itamar Tzadok {@link http://substantialmethods.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | namespace mod_dataform\interfaces; 25 | 26 | defined('MOODLE_INTERNAL') || die(); 27 | 28 | /** 29 | * Interface for dataform overview support 30 | * 31 | * The interface that is implemented by any dataformview plugin which supports course overview. 32 | * 33 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 34 | */ 35 | interface overview { 36 | } 37 | -------------------------------------------------------------------------------- /classes/interfaces/usingscale.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Interface class. 19 | * 20 | * @package mod_dataform 21 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | namespace mod_dataform\interfaces; 25 | 26 | defined('MOODLE_INTERNAL') || die(); 27 | 28 | /** 29 | * Interface for supporting dataformfields which are using a scale 30 | * 31 | * It forces inheriting classes to define methods that are called by the dataform 32 | * for handling scale related operations (e.g. backup). 33 | * 34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 35 | */ 36 | interface usingscale { 37 | 38 | /** 39 | * Returns true if any of the dataformfield instances is using the specified scale 40 | * in the specified dataform or all dataforms. 41 | * 42 | * @return bool 43 | */ 44 | public static function is_using_scale($scaleid, $dataformid = 0); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /classes/notification_manager.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package mod_dataform 19 | * @copyright 2013 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | /** 24 | * Notification manager class 25 | */ 26 | class mod_dataform_notification_manager extends mod_dataform_rule_manager { 27 | 28 | public static function instance($dataformid) { 29 | if (!$instance = \mod_dataform_instance_store::instance($dataformid, 'notification_manager')) { 30 | $instance = new mod_dataform_notification_manager($dataformid); 31 | \mod_dataform_instance_store::register($dataformid, 'notification_manager', $instance); 32 | } 33 | 34 | return $instance; 35 | } 36 | 37 | /** 38 | * Returns the category of rules the manager refer to. 39 | * @return string Always 'notification' 40 | */ 41 | protected function get_category() { 42 | return 'notification'; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /classes/observer/manager.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package mod_dataform 19 | * @copyright 2013 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | namespace mod_dataform\observer; 24 | 25 | /** 26 | * Observers manager class 27 | */ 28 | class manager { 29 | 30 | /** 31 | * Returns list of dataform observers. 32 | * 33 | * @return array 34 | */ 35 | public static function observers() { 36 | global $CFG; 37 | 38 | $observers = array(); 39 | foreach (get_directory_list("$CFG->dirroot/mod/dataform/classes/observer") as $filename) { 40 | $basename = basename($filename, '.php'); 41 | if ($basename == 'manager') { 42 | continue; 43 | } 44 | $observer = '\mod_dataform\observer\\'. $basename; 45 | $observers = array_merge($observers, $observer::observers()); 46 | } 47 | return $observers; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /classes/pluginbase/dataformfield_nocontent.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @copyright 2012 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | namespace mod_dataform\pluginbase; 24 | 25 | /** 26 | * Base class for Dataform field types that require no content 27 | */ 28 | abstract class dataformfield_nocontent extends dataformfield { 29 | /** 30 | * 31 | */ 32 | public function get_content_parts() { 33 | return array(); 34 | } 35 | 36 | public function update_content($entry, array $values = null, $savenew = false) { 37 | return true; 38 | } 39 | 40 | public function delete_content($entryid = 0) { 41 | return true; 42 | } 43 | 44 | public function transfer_content($tofieldid) { 45 | return true; 46 | } 47 | 48 | /** 49 | * Returns an array of distinct content of the field. 50 | * 51 | * @param string $element 52 | * @param int $sortdir Sort direction 0|1 ASC|DESC 53 | * @return array 54 | */ 55 | public function get_distinct_content($element, $sortdir = 0) { 56 | return array(); 57 | } 58 | 59 | public function get_select_sql() { 60 | return ''; 61 | } 62 | 63 | /** 64 | * 65 | */ 66 | public function is_dataform_content() { 67 | return false; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /classes/plugininfo/dataformtool.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Subplugin info class. 19 | * 20 | * @package mod_dataform 21 | * @copyright 2013 Itamar Tzadok {@link http://substantialmethods.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | namespace mod_dataform\plugininfo; 25 | 26 | use core\plugininfo\base; 27 | 28 | defined('MOODLE_INTERNAL') || die(); 29 | 30 | class dataformtool extends base { 31 | 32 | public function is_enabled() { 33 | return true; 34 | } 35 | 36 | public function is_uninstall_allowed() { 37 | return true; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package mod_dataform 19 | * @copyright 2013 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = \mod_dataform\capability\manager::capabilities(); 24 | -------------------------------------------------------------------------------- /db/events.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Event handler definition. 19 | * 20 | * @package mod_dataform 21 | * @category db 22 | * @copyright 2014 Itamar Tzadok 23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 24 | */ 25 | 26 | defined('MOODLE_INTERNAL') or die; 27 | 28 | /* List of observers */ 29 | $observers = mod_dataform\observer\manager::observers(); 30 | -------------------------------------------------------------------------------- /db/install.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Mod dataform installation support. 19 | * 20 | * @package mod_dataform 21 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | defined('MOODLE_INTERNAL') || die(); 26 | 27 | /** 28 | * Install the plugin. 29 | */ 30 | function xmldb_dataform_install() { 31 | // Enable existing field plugins. 32 | $type = 'dataformfield'; 33 | $enabled = array_keys(core_component::get_plugin_list($type)); 34 | set_config("enabled_$type", implode(',', $enabled), 'mod_dataform'); 35 | 36 | // Enable existing view plugins. 37 | $type = 'dataformview'; 38 | $enabled = array_keys(core_component::get_plugin_list($type)); 39 | set_config("enabled_$type", implode(',', $enabled), 'mod_dataform'); 40 | } 41 | -------------------------------------------------------------------------------- /db/log.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package mod_dataform 19 | * @copyright 2011 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | /** 24 | * Definition of log events 25 | */ 26 | 27 | defined('MOODLE_INTERNAL') or die; 28 | 29 | $logs = array( 30 | array('module' => 'dataform', 'action' => 'view', 'mtable' => 'dataform', 'field' => 'name'), 31 | array('module' => 'dataform', 'action' => 'add', 'mtable' => 'dataform', 'field' => 'name'), 32 | array('module' => 'dataform', 'action' => 'update', 'mtable' => 'dataform', 'field' => 'name'), 33 | array('module' => 'dataform', 'action' => 'record delete', 'mtable' => 'dataform', 'field' => 'name'), 34 | array('module' => 'dataform', 'action' => 'fields add', 'mtable' => 'dataform_fields', 'field' => 'name'), 35 | array('module' => 'dataform', 'action' => 'fields update', 'mtable' => 'dataform_fields', 'field' => 'name'), 36 | array('module' => 'dataform', 'action' => 'views add', 'mtable' => 'dataform_views', 'field' => 'name'), 37 | array('module' => 'dataform', 'action' => 'views update', 'mtable' => 'dataform_views', 'field' => 'name'), 38 | array('module' => 'dataform', 'action' => 'filters add', 'mtable' => 'dataform_filters', 'field' => 'name'), 39 | array('module' => 'dataform', 'action' => 'filters update', 'mtable' => 'dataform_filters', 'field' => 'name') 40 | ); 41 | -------------------------------------------------------------------------------- /db/messages.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Defines message providers (types of messages being sent) 19 | * 20 | * @package mod 21 | * @package mod_dataform 22 | * @copyright 2013 Itamar Tzadok 23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 24 | */ 25 | 26 | $messageproviders = array ( 27 | 28 | 'dataform_notification' => array ( 29 | ), 30 | ); 31 | -------------------------------------------------------------------------------- /db/subplugins.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package mod_dataform 19 | * @copyright 2012 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | $subplugins = array( 23 | 'dataformfield' => 'mod/dataform/field', 24 | 'dataformview' => 'mod/dataform/view', 25 | 'dataformtool' => 'mod/dataform/tool', 26 | ); 27 | -------------------------------------------------------------------------------- /field/checkbox/checkbox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @package dataformfield 3 | * @subpackage checkbox 4 | * @copyright 2013 Itamar Tzadok 5 | */ 6 | 7 | /** 8 | * Required alert in entries form 9 | */ 10 | M.dataformfield_checkbox_required = {}; 11 | 12 | M.dataformfield_checkbox_required.init = function(Y, options) { 13 | Y.use('node', function (Y) { 14 | var fieldname = options.fieldname; 15 | var err_message = options.message; 16 | 17 | var required = function (e, element) { 18 | if (e) { 19 | element = this; 20 | } 21 | 22 | if (!element) { 23 | return; 24 | } 25 | 26 | var empty = true; 27 | element.all('.checkboxgroup' + fieldname + '_selected').each(function(check) { 28 | if (check.get('checked')) { 29 | empty = false; 30 | } 31 | }); 32 | element.all('.felement.ftext.error').remove(); 33 | if (empty) { 34 | element.one('.fgrouplabel').insert('
' + err_message + '
', 'after'); 35 | } 36 | } 37 | 38 | var selector = '#fgroup_id_' + fieldname + '.fitem.required'; 39 | 40 | if (!Y.one(selector)) { 41 | return; 42 | } 43 | 44 | Y.one(selector).on('click', required); 45 | required(null, Y.one(selector)); 46 | }); 47 | }; 48 | -------------------------------------------------------------------------------- /field/checkbox/classes/form.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_checkbox 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | class dataformfield_checkbox_form extends dataformfield_selectmulti_form { 24 | } 25 | -------------------------------------------------------------------------------- /field/checkbox/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_checkbox 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/checkbox:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/checkbox/lang/en/dataformfield_checkbox.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_checkbox 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | $string['pluginname'] = 'Checkbox'; 23 | $string['checkbox:addinstance'] = 'Add a new Checkbox dataformfield'; 24 | -------------------------------------------------------------------------------- /field/checkbox/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/checkbox/pix/icon.gif -------------------------------------------------------------------------------- /field/checkbox/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage checkbox 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_checkbox'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/commentmdl/classes/event/comment_created.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | namespace dataformfield_commentmdl\event; 18 | 19 | defined('MOODLE_INTERNAL') || die(); 20 | 21 | /** 22 | * dataformfield_commentmdl comment created event. 23 | * 24 | * @package dataformfield_commentmdl 25 | * @copyright 2014 Itamar Tzadok 26 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 27 | */ 28 | class comment_created extends \core\event\comment_created { 29 | /** 30 | * Get URL related to the action. 31 | * 32 | * @return \moodle_url 33 | */ 34 | public function get_url() { 35 | return new \moodle_url('/mod/dataform/view.php', array('id' => $this->other['itemid'])); 36 | } 37 | 38 | /** 39 | * Returns description of what happened. 40 | * 41 | * @return string 42 | */ 43 | public function get_description() { 44 | return 'User with id ' . $this->userid . ' added comment for dataform activity with id ' . $this->other['itemid']; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /field/commentmdl/classes/event/comment_deleted.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | namespace dataformfield_commentmdl\event; 18 | 19 | defined('MOODLE_INTERNAL') || die(); 20 | 21 | /** 22 | * dataformfield_commentmdl comment deleted event. 23 | * 24 | * @package dataformfield_commentmdl 25 | * @copyright 2014 Itamar Tzadok 26 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 27 | */ 28 | class comment_deleted extends \core\event\comment_deleted { 29 | /** 30 | * Get URL related to the action. 31 | * 32 | * @return \moodle_url 33 | */ 34 | public function get_url() { 35 | return new \moodle_url('/mod/dataform/view.php', array('id' => $this->other['itemid'])); 36 | } 37 | 38 | /** 39 | * Returns description of what happened. 40 | * 41 | * @return string 42 | */ 43 | public function get_description() { 44 | return 'User with id ' . $this->userid . ' deleted comment for dataform activity with id ' . $this->other['itemid']; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /field/commentmdl/classes/form.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_commentmdl 19 | * @copyright 2013 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | class dataformfield_commentmdl_form extends mod_dataform\pluginbase\dataformfieldform { 24 | 25 | /** 26 | * 27 | */ 28 | protected function definition_general() { 29 | parent::definition_general(); 30 | 31 | $mform =& $this->_form; 32 | 33 | // Restrict name to alphanumeric. 34 | $mform->addRule('name', null, 'alphanumeric', null, 'client'); 35 | } 36 | 37 | /** 38 | * The field settings fieldset. Overrides parent to omit. 39 | * 40 | * @return void 41 | */ 42 | protected function definition_settings() { 43 | } 44 | 45 | /** 46 | * The field default content fieldset. Override parent to display no defaults. 47 | * 48 | * @return void 49 | */ 50 | protected function definition_defaults() { 51 | } 52 | 53 | /** 54 | * 55 | */ 56 | public function validation($data, $files) { 57 | $errors = parent::validation($data, $files); 58 | 59 | // Name must be lower case. 60 | if (strtolower($data['name']) != $data['name']) { 61 | $errors['name'] = get_string('err_lowername', 'dataform'); 62 | } 63 | 64 | return $errors; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /field/commentmdl/lang/en/dataformfield_commentmdl.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_commentmdl 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Comment (moodle)'; 24 | // CAPABILITIES. 25 | $string['commentmdl:addinstance'] = 'Add a new Comment (moodle) dataformfield'; 26 | $string['commentmdl:addcomment'] = 'Add Comment'; 27 | $string['commentmdl:deleteowncomment'] = 'Delete Own Comment'; 28 | $string['commentmdl:deleteanycomment'] = 'Delete Any Comment'; 29 | $string['commentmdl:viewcomments'] = 'View Comments'; 30 | -------------------------------------------------------------------------------- /field/commentmdl/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/commentmdl/pix/icon.gif -------------------------------------------------------------------------------- /field/commentmdl/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage commentmdl 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_commentmdl'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/duration/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_duration 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/duration:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/duration/duration.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @package dataformfield 3 | * @subpackage duration 4 | * @copyright 2014 Itamar Tzadok 5 | */ 6 | 7 | /** 8 | * Required alert in entries form 9 | */ 10 | M.dataformfield_duration_required = {}; 11 | 12 | M.dataformfield_duration_required.init = function(Y, options) { 13 | Y.use('node', function (Y) { 14 | var fieldname = options.fieldname; 15 | var err_message = options.message; 16 | 17 | var required = function (e, element) { 18 | if (e) { 19 | element = this; 20 | } 21 | if (!element) { 22 | return; 23 | } 24 | var content = element.one('input').get('value'); 25 | 26 | element.all('.felement.ftext.error').remove(); 27 | if (content == '') { 28 | element.one('.fgrouplabel').insert('
' + err_message + '
', 'after'); 29 | } 30 | } 31 | 32 | var selector = '#fitem_id_' + fieldname + '.fitem.required'; 33 | 34 | if (!Y.one(selector)) { 35 | return; 36 | } 37 | 38 | Y.one(selector).on('change', required); 39 | required(null, Y.one(selector)); 40 | }); 41 | }; 42 | -------------------------------------------------------------------------------- /field/duration/lang/en/dataformfield_duration.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_duration 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | $string['pluginname'] = 'Duration'; 23 | $string['duration:addinstance'] = 'Add a new Duration dataformfield'; 24 | $string['fixedunit'] = 'Fixed unit'; 25 | $string['limitunitsto'] = 'Limit units to'; 26 | -------------------------------------------------------------------------------- /field/duration/pix/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/duration/pix/icon.png -------------------------------------------------------------------------------- /field/duration/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage duration 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_duration'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/entry/lang/en/dataformfield_entry.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_entry 19 | * @copyright 2015 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Entry (Internal)'; 24 | $string['fieldname'] = 'ENT'; 25 | $string['id'] = 'ID'; 26 | $string['type'] = 'Type'; 27 | -------------------------------------------------------------------------------- /field/entry/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/entry/pix/icon.gif -------------------------------------------------------------------------------- /field/entry/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_entry 19 | * @copyright 2015 Itamar Tzadok {@link http://substantialmethods.com} 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $plugin->component = 'dataformfield_entry'; 24 | $plugin->version = 2015051100; 25 | $plugin->requires = 2015051100; 26 | -------------------------------------------------------------------------------- /field/entryactions/classes/entryactions.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage entryactions 20 | * @copyright 2012 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | class dataformfield_entryactions_entryactions extends \mod_dataform\pluginbase\dataformfield_internal { 25 | 26 | const INTERNALID = -1; 27 | 28 | /** 29 | * 30 | */ 31 | public function get_target_view($action) { 32 | return null; 33 | } 34 | 35 | /** 36 | * Returns instance defaults for for the field 37 | * (because internal fields do not have DB record). 38 | * 39 | * @return stdClass 40 | */ 41 | public static function get_default_data($dfid) { 42 | $field = (object) array( 43 | 'id' => self::INTERNALID, 44 | 'dataid' => $dfid, 45 | 'type' => 'entryactions', 46 | 'name' => get_string('fieldname', 'dataformfield_entryactions'), 47 | 'description' => '', 48 | 'visible' => 2, 49 | 'editable' => -1, 50 | ); 51 | return $field; 52 | } 53 | 54 | /** 55 | * Overriding parent to return no sort/search options. 56 | * 57 | * @return array 58 | */ 59 | public function get_sort_options_menu() { 60 | return array(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /field/entryactions/lang/en/dataformfield_entryactions.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage entryactions 20 | * @copyright 2011 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $string['fieldname'] = 'EAC'; 25 | $string['pluginname'] = 'Entry actions (internal)'; 26 | $string['edit'] = 'Edit'; 27 | $string['more'] = 'More'; 28 | $string['targetview'] = 'Target view'; 29 | $string['targetview_help'] = 'Target view'; 30 | 31 | $string['actionparams'] = 'Action params'; 32 | $string['actionparams_help'] = 'Action params'; 33 | 34 | $string['themeicon'] = 'Theme icon'; 35 | $string['themeicon_help'] = 'Theme icon'; 36 | -------------------------------------------------------------------------------- /field/entryactions/pix/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/entryactions/pix/icon.png -------------------------------------------------------------------------------- /field/entryactions/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage entryactions 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_entryactions'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/entryauthor/assign.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * This page receives entry author asign me requests. 19 | * 20 | * @package dataformfield_entryauthor 21 | * @copyright 2014 Itamar Tzadok 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | require_once('../../../../config.php'); 26 | 27 | $d = required_param('d', PARAM_INT); 28 | $viewid = required_param('vid', PARAM_INT); 29 | $entryid = required_param('eid', PARAM_INT); 30 | $action = required_param('action', PARAM_ALPHA); 31 | $ret = required_param('ret', PARAM_RAW); 32 | 33 | // Instantiate the Dataform. 34 | $df = mod_dataform_dataform::instance($d); 35 | require_login($df->course->id, false, $df->cm); 36 | 37 | // Sesskey. 38 | require_sesskey(); 39 | 40 | $PAGE->set_context($df->context); 41 | $PAGE->set_url('/mod/dataform/field/entryauthor/assign.php'); 42 | 43 | $fieldid = dataformfield_entryauthor_entryauthor::INTERNALID; 44 | $field = $df->field_manager->get_field_by_id($fieldid); 45 | 46 | // Assign. 47 | if ($action == 'assign') { 48 | $field->assign_user($USER->id, $entryid, $viewid); 49 | } 50 | 51 | // Unassign. 52 | if ($action == 'unassign') { 53 | $field->assign_user(0, $entryid, $viewid); 54 | } 55 | 56 | redirect(urldecode($ret)); 57 | -------------------------------------------------------------------------------- /field/entryauthor/lang/en/dataformfield_entryauthor.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage entryauthor 20 | * @copyright 2011 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $string['pluginname'] = 'Entry author (Internal)'; 25 | $string['fieldname'] = 'EAU'; 26 | $string['useremail'] = 'User email'; 27 | $string['userfirstname'] = 'User first name'; 28 | $string['userid'] = 'User id'; 29 | $string['useridnumber'] = 'User id number'; 30 | $string['userlastname'] = 'User last name'; 31 | $string['username'] = 'User name'; 32 | $string['userpicture'] = 'User picture'; 33 | $string['userusername'] = 'User username'; 34 | $string['currentuser'] = 'Current user'; 35 | $string['assignme'] = 'Assign me'; 36 | $string['unassignme'] = 'Unassign me'; 37 | -------------------------------------------------------------------------------- /field/entryauthor/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/entryauthor/pix/icon.gif -------------------------------------------------------------------------------- /field/entryauthor/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage entryauthor 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_entryauthor'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/entrygroup/lang/en/dataformfield_entrygroup.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage entrygroup 20 | * @copyright 2012 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $string['group'] = 'Group'; 25 | $string['fieldname'] = 'EGR'; 26 | $string['pluginname'] = 'Entry group (internal)'; 27 | -------------------------------------------------------------------------------- /field/entrygroup/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/entrygroup/pix/icon.gif -------------------------------------------------------------------------------- /field/entrygroup/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage entrygroup 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_entrygroup'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/entrystate/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_entrystate 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/entrystate:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/entrystate/lang/en/dataformfield_entrystate.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_entrystate 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Entry state'; 24 | $string['entrystate:addinstance'] = 'Add a new Entry state dataformfield'; 25 | $string['state'] = 'State'; 26 | $string['states'] = 'States'; 27 | $string['states_help'] = 'State names, one per line. Example:

Draft
Submitted
Approved

The list of states should be saved before transitions can added.'; 28 | $string['transition'] = 'Transition'; 29 | $string['transitions'] = 'Transitions'; 30 | $string['allowedto'] = 'Allowed to'; 31 | $string['allowedto_help'] = 'Allowed to'; 32 | $string['notify'] = 'Notify'; 33 | $string['notify_help'] = 'Notify'; 34 | $string['stateicon'] = 'State Icon'; 35 | $string['stateicon_help'] = 'State Icon'; 36 | $string['transition'] = 'Transition'; 37 | $string['transition_help'] = 'A list of states that can be advanced to from this state. Each state in a new line.'; 38 | $string['incorrectstate'] = 'The requested state {$a} could not be found.'; 39 | $string['alreadyinstate'] = 'The entry ({$a->entryid}) is already in the requested state {$a->newstate}.'; 40 | $string['instatingdenied'] = 'You are not permitted to change the state of this entry.'; 41 | $string['statechanged'] = 'The state of entry id {$a->id} has changed from {$a->old} to {$a->new}.'; 42 | -------------------------------------------------------------------------------- /field/entrystate/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/entrystate/pix/icon.gif -------------------------------------------------------------------------------- /field/entrystate/styles.css: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the Dataform module for Moodle - http://moodle.org/. 3 | * 4 | * The Dataform has been developed as an enhanced counterpart 5 | * of Moodle's Database activity module (1.9.11+ (20110323)). 6 | * To the extent that Dataform code corresponds to Database code, 7 | * certain copyrights on the Database module may obtain. 8 | * 9 | * Moodle is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * Moodle is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with Moodle. If not, see . 21 | */ 22 | 23 | /** 24 | * @package dataformfield 25 | * @subpackage entrystate 26 | * @copyright 2013 Itamar Tzadok 27 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 28 | */ 29 | 30 | .entrystates-wrapper a{ 31 | color: inherit; 32 | } 33 | 34 | .entrystates-wrapper a span.entrystate{ 35 | background-color: #FFDDAA; 36 | } 37 | 38 | .entrystate { 39 | padding: 2px; 40 | min-width: 60px; 41 | border: 1px solid #999; 42 | background-color: #CCC; 43 | text-align: center; 44 | display:inline-block; 45 | } 46 | 47 | .entrystate.currentstate{ 48 | background-color: #DDFFAA; 49 | } 50 | -------------------------------------------------------------------------------- /field/entrystate/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage entrystate 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_entrystate'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/entrytime/lang/en/dataformfield_entrytime.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage entrytime 20 | * @copyright 2011 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $string['fieldname'] = 'ETM'; 25 | $string['pluginname'] = 'Entry time (Internal)'; 26 | $string['timecreated'] = 'Time created'; 27 | $string['timemodified'] = 'Time modified'; 28 | -------------------------------------------------------------------------------- /field/entrytime/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/entrytime/pix/icon.gif -------------------------------------------------------------------------------- /field/entrytime/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage entrytime 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_entrytime'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/file/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_file 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/file:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/file/download.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage file 20 | * @copyright 2012 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | require_once('../../../../config.php'); 25 | 26 | $cid = required_param('cid', PARAM_INT); 27 | $context = required_param('context', PARAM_INT); 28 | $file = required_param('file', PARAM_FILE); 29 | // Check user is logged in. 30 | require_login(); 31 | 32 | $count = $DB->get_field('dataform_contents', 'content2', array('id' => $cid)); 33 | $count++; 34 | $DB->set_field('dataform_contents', 'content2', $count, array('id' => $cid)); 35 | redirect(new moodle_url("/pluginfile.php/$context/mod_dataform/content/$cid/$file")); 36 | -------------------------------------------------------------------------------- /field/file/lang/en/dataformfield_file.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_file 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'File'; 24 | $string['file:addinstance'] = 'Add a new File dataformfield'; 25 | $string['alttext'] = 'Alt text'; 26 | $string['clearcontent'] = 'Clear content'; 27 | $string['newline'] = 'New line'; 28 | $string['filesseparator'] = 'Separator'; 29 | $string['filesseparator_help'] = 'Select New line to display multiple files in separate lines.'; 30 | -------------------------------------------------------------------------------- /field/file/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/file/pix/icon.gif -------------------------------------------------------------------------------- /field/file/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage file 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_file'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/number/classes/number.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage number 20 | * @copyright 2011 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | class dataformfield_number_number extends dataformfield_text_text { 25 | /** 26 | * Returns sql cast to real. 27 | * 28 | * @return string 29 | */ 30 | protected function get_sql_compare_text($column = 'content') { 31 | global $DB; 32 | return $DB->sql_cast_char2real("c{$this->id}.$column", true); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /field/number/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_number 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/number:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/number/lang/en/dataformfield_number.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_number 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Number'; 24 | $string['number:addinstance'] = 'Add a new Number dataformfield'; 25 | $string['decimals'] = 'Decimals'; 26 | -------------------------------------------------------------------------------- /field/number/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/number/pix/icon.gif -------------------------------------------------------------------------------- /field/number/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage number 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_number'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/picture/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_picture 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/picture:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/picture/lang/en/dataformfield_picture.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_picture 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Picture'; 24 | $string['picture:addinstance'] = 'Add a new Picture dataformfield'; 25 | $string['displaydimensions'] = 'Display dimensions'; 26 | $string['displaydimensions_help'] = 'The size of the displayed image. Aspect ratio is preserved if only width or height are specified.'; 27 | $string['maxdimensions'] = 'Max size'; 28 | $string['maxdimensions_help'] = 'The max size (in pixels) of the stored images. If specified, larger images will be cropped.'; 29 | $string['resizingimages'] = 'Resizing image thumbnails...'; 30 | $string['thumbdimensions'] = 'Thumb size'; 31 | $string['thumbdimensions_help'] = 'The thumb size (in pixels of the stored images. If not specified, thumbs are not generated.'; 32 | -------------------------------------------------------------------------------- /field/picture/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/picture/pix/icon.gif -------------------------------------------------------------------------------- /field/picture/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage picture 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_picture'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/radiobutton/classes/form.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage radiobutton 20 | * @copyright 2011 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | class dataformfield_radiobutton_form extends dataformfield_select_form { 25 | 26 | /** 27 | * 28 | */ 29 | protected function field_definition() { 30 | parent::field_definition(); 31 | 32 | $mform = &$this->_form; 33 | 34 | // Options separator. 35 | $mform->addElement( 36 | 'select', 37 | 'param3', 38 | get_string('optionsseparator', 'dataformfield_selectmulti'), 39 | array_map('current', $this->_field->separator_types) 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /field/radiobutton/classes/helper/contentperuser.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The dataformfield_radiobutton user values helper for calculated grading support. 19 | * 20 | * @package dataformfield_radiobutton 21 | * @copyright 2014 Itamar Tzadok 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 | */ 24 | 25 | namespace dataformfield_radiobutton\helper; 26 | 27 | defined('MOODLE_INTERNAL') || die(); 28 | 29 | class contentperuser { 30 | /** 31 | * Returns the value replacement of the pattern for each user with content in the field. 32 | * 33 | * @param string $pattern 34 | * @param array $entryids The ids of entries the field values should be fetched from. 35 | * If not provided the method should return values from all applicable entries. 36 | * @return null|array Array of userid => value pairs. 37 | */ 38 | public static function get_content($field, $pattern, array $userentryids = null) { 39 | return \dataformfield_select\helper\contentperuser::get_content($field, $pattern, $userentryids); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /field/radiobutton/classes/radiobutton.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage radiobutton 20 | * @copyright 2011 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | class dataformfield_radiobutton_radiobutton extends dataformfield_select_select { 25 | 26 | /** 27 | * Returns list of seprators. 28 | * 29 | * @return array Array of arrays (name => string, chr => string) 30 | */ 31 | public function get_separator_types() { 32 | return array( 33 | array('name' => get_string('newline', 'dataformfield_selectmulti'), 'chr' => '
'), 34 | array('name' => get_string('space', 'dataformfield_selectmulti'), 'chr' => ' '), 35 | array('name' => get_string('comma', 'dataformfield_selectmulti'), 'chr' => ','), 36 | array('name' => get_string('commaandspace', 'dataformfield_selectmulti'), 'chr' => ', ') 37 | ); 38 | } 39 | 40 | /** 41 | * Returns the field configured separator. 42 | * 43 | * @return string 44 | */ 45 | public function get_separator() { 46 | $separatortypes = $this->separator_types; 47 | 48 | $selected = (int) $this->param3; 49 | return $separatortypes[$selected]['chr']; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /field/radiobutton/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_radiobutton 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/radiobutton:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/radiobutton/lang/en/dataformfield_radiobutton.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_radiobutton 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Radio button'; 24 | $string['radiobutton:addinstance'] = 'Add a new Radio button dataformfield'; 25 | -------------------------------------------------------------------------------- /field/radiobutton/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/radiobutton/pix/icon.gif -------------------------------------------------------------------------------- /field/radiobutton/radiobutton.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @package dataformfield 3 | * @subpackage radiobutton 4 | * @copyright 2013 Itamar Tzadok 5 | */ 6 | 7 | /** 8 | * Required alert in entries form 9 | */ 10 | M.dataformfield_radiobutton_required = {}; 11 | 12 | M.dataformfield_radiobutton_required.init = function(Y, options) { 13 | Y.use('node', function (Y) { 14 | var fieldname = options.fieldname; 15 | var err_message = options.message; 16 | 17 | var required = function (e, element) { 18 | if (e) { 19 | element = this; 20 | } 21 | 22 | if (!element) { 23 | return; 24 | } 25 | 26 | var empty = true; 27 | element.all('.fgroup input').each(function(check) { 28 | if (check.get('checked')) { 29 | empty = false; 30 | } 31 | }); 32 | element.all('.felement.ftext.error').remove(); 33 | if (empty) { 34 | element.one('.fgrouplabel').insert('
' + err_message + '
', 'after'); 35 | } 36 | } 37 | 38 | var selector = '#fgroup_id_' + fieldname + '.fitem.required'; 39 | 40 | if (!Y.one(selector)) { 41 | return; 42 | } 43 | 44 | Y.one(selector).on('click', required); 45 | required(null, Y.one(selector)); 46 | }); 47 | }; 48 | -------------------------------------------------------------------------------- /field/radiobutton/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage radiobutton 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_radiobutton'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/ratingmdl/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/ratingmdl/pix/icon.gif -------------------------------------------------------------------------------- /field/ratingmdl/pix/star_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/ratingmdl/pix/star_black.png -------------------------------------------------------------------------------- /field/ratingmdl/pix/star_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/ratingmdl/pix/star_grey.png -------------------------------------------------------------------------------- /field/ratingmdl/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage ratingmdl 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_ratingmdl'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/select/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_select 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/select:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/select/lang/en/dataformfield_select.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_select 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Select'; 24 | $string['select:addinstance'] = 'Add a new Select dataformfield'; 25 | $string['allowaddoption'] = 'Allow adding options'; 26 | $string['options'] = 'Options'; 27 | $string['invaliddefaultvalue'] = 'The value must match one of the field options'; 28 | -------------------------------------------------------------------------------- /field/select/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/select/pix/icon.gif -------------------------------------------------------------------------------- /field/select/tests/behat/search.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformfield @dataformfield_select @dataformfilter @dataformfieldselectsearch 2 | Feature: Search by a select field 3 | 4 | @javascript 5 | Scenario: Search equal 6 | Given I start afresh with dataform "Test select field search" 7 | 8 | And the following dataform "fields" exist: 9 | | name | type | dataform | param1 | 10 | | select | select | dataform1 | {OP,TL} | 11 | 12 | And the following dataform "views" exist: 13 | | name | type | dataform | default | 14 | | View 01 | aligned | dataform1 | 1 | 15 | 16 | And the following dataform "filters" exist: 17 | | name | dataform | searchoptions | 18 | | Filter1 | dataform1 | AND,select,Content,,=,OP | 19 | | Filter2 | dataform1 | AND,select,Content,,=,BS | 20 | | Filter3 | dataform1 | AND,select,Content,,=,op | 21 | 22 | And the following dataform "entries" exist: 23 | | dataform | user | select_newvalue | 24 | | dataform1 | teacher1 | OP | 25 | | dataform1 | teacher1 | TL | 26 | 27 | And I log in as "teacher1" 28 | And I follow "Course 1" 29 | And I follow "Test select field search" 30 | 31 | Then I see "OP" 32 | And I see "TL" 33 | 34 | When I set the field "id_filtersmenu" to "Filter1" 35 | Then I see "OP" 36 | And I do not see "TL" 37 | 38 | When I set the field "id_filtersmenu" to "Filter2" 39 | Then I do not see "OP" 40 | And I do not see "TL" 41 | 42 | When I set the field "id_filtersmenu" to "Filter3" 43 | Then I see "OP" 44 | And I do not see "TL" 45 | -------------------------------------------------------------------------------- /field/select/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage select 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_select'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/selectmulti/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_selectmulti 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/selectmulti:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/selectmulti/lang/en/dataformfield_selectmulti.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_selectmulti 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Select (multiple)'; 24 | $string['selectmulti:addinstance'] = 'Add a new Select (multiple) dataformfield'; 25 | $string['newline'] = 'New line'; 26 | $string['space'] = 'Space'; 27 | $string['comma'] = 'Comma'; 28 | $string['commaandspace'] = 'Comma and space'; 29 | $string['allowaddoption'] = 'Allow adding options'; 30 | $string['optionsdefault'] = 'Default values'; 31 | $string['options'] = 'Options'; 32 | $string['optionsseparator'] = 'Options separator'; 33 | -------------------------------------------------------------------------------- /field/selectmulti/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/selectmulti/pix/icon.gif -------------------------------------------------------------------------------- /field/selectmulti/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage selectmulti 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_selectmulti'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/text/classes/text.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage text 20 | * @copyright 2011 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | class dataformfield_text_text extends mod_dataform\pluginbase\dataformfield { 25 | } 26 | -------------------------------------------------------------------------------- /field/text/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_text 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/text:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/text/lang/en/dataformfield_text.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_text 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Text'; 24 | $string['text:addinstance'] = 'Add a new Text dataformfield'; 25 | $string['numcharsallowed'] = 'Number of characters'; 26 | $string['text'] = 'Text'; 27 | -------------------------------------------------------------------------------- /field/text/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/text/pix/icon.gif -------------------------------------------------------------------------------- /field/text/tests/behat/pattern_required_noedit.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformfield @dataformfield_text 2 | Feature: Pattern required noedit 3 | 4 | @javascript 5 | Scenario: Use required or noedit patterns 6 | Given I start afresh with dataform "Test text field" 7 | 8 | ## Field 9 | And the following dataform "fields" exist: 10 | | name | type | dataform | 11 | | Text | text | dataform1 | 12 | 13 | ## View 14 | And the following dataform "views" exist: 15 | | name | type | dataform | default | 16 | | View 01 | aligned | dataform1 | 1 | 17 | 18 | And I log in as "teacher1" 19 | And I follow "Course 1" 20 | And I follow "Test text field" 21 | 22 | # No rules no content 23 | And I follow "Add a new entry" 24 | And I press "Save" 25 | Then "id_editentry1" "link" exists 26 | 27 | # Required * 28 | When I go to manage dataform "views" 29 | And I follow "Edit View 01" 30 | And I expand all fieldsets 31 | And I replace in field "Entry template" "[[Text]]" with "[[*Text]]" 32 | And I press "Save changes" 33 | 34 | And I follow "Browse" 35 | 36 | And I follow "id_editentry1" 37 | And I press "Save" 38 | Then I see "You must supply a value here." 39 | And I set the field "id_field_1_1" to "This world is required" 40 | And I press "Save" 41 | Then I see "This world is required" 42 | 43 | # No edit ! 44 | When I go to manage dataform "views" 45 | And I follow "id_editview1" 46 | And I expand all fieldsets 47 | And I replace in field "Entry template" "[[*Text]]" with "[[!Text]]" 48 | And I press "Save changes" 49 | And I follow "Browse" 50 | And I follow "id_editentry1" 51 | Then "id_field_1_1" "field" should not exist 52 | And I press "Save" 53 | Then I see "This world is required" 54 | -------------------------------------------------------------------------------- /field/text/tests/behat/various_inputs.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformfield @dataformfield_text 2 | Feature: Various inputs 3 | 4 | @javascript 5 | Scenario: Add dataform entry with text field 6 | Given I start afresh with dataform "Test field text" 7 | 8 | ## Field 9 | And the following dataform "fields" exist: 10 | | name | type | dataform | 11 | | Text | text | dataform1 | 12 | 13 | ## View 14 | And the following dataform "views" exist: 15 | | name | type | dataform | default | 16 | | View 01 | aligned | dataform1 | 1 | 17 | 18 | And I log in as "teacher1" 19 | And I follow "Course 1" 20 | And I follow "Test field text" 21 | 22 | ## Some text. 23 | And I follow "Add a new entry" 24 | And I set the field "id_field_1_-1" to "Hello world" 25 | And I press "Save" 26 | Then I see "Hello world" 27 | 28 | ## No content 29 | And I follow "id_editentry1" 30 | And I set the field "id_field_1_1" to "" 31 | And I press "Save" 32 | Then I do not see "Hello world" 33 | 34 | ## Alphanumeric123456 35 | And I follow "id_editentry1" 36 | And I set the field "id_field_1_1" to "Alphanumeric123456" 37 | And I press "Save" 38 | Then I see "Alphanumeric123456" 39 | 40 | ## Lettersonly 41 | And I follow "id_editentry1" 42 | And I set the field "id_field_1_1" to "Lettersonly" 43 | And I press "Save" 44 | Then I see "Lettersonly" 45 | 46 | ## 123456 47 | And I follow "id_editentry1" 48 | And I set the field "id_field_1_1" to "123456" 49 | And I press "Save" 50 | Then I see "123456" 51 | 52 | ## email@email.com 53 | And I follow "id_editentry1" 54 | And I set the field "id_field_1_1" to "email@email.com" 55 | And I press "Save" 56 | Then I see "email@email.com" 57 | 58 | ## No punctuation! 59 | And I follow "id_editentry1" 60 | And I set the field "id_field_1_1" to "No punctuation!" 61 | And I press "Save" 62 | Then I see "No punctuation!" 63 | -------------------------------------------------------------------------------- /field/text/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage text 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_text'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/textarea/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_textarea 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/textarea:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/textarea/lang/en/dataformfield_textarea.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_textarea 19 | * @copyright 2016 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Text area'; 24 | $string['textarea:addinstance'] = 'Add a new Text area dataformfield'; 25 | $string['trusttext'] = 'Trust text'; 26 | $string['newline'] = 'New line'; 27 | -------------------------------------------------------------------------------- /field/textarea/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/textarea/pix/icon.gif -------------------------------------------------------------------------------- /field/textarea/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_textarea 19 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $plugin->component = 'dataformfield_textarea'; 24 | $plugin->version = 2015051100; 25 | $plugin->requires = 2015051100; 26 | -------------------------------------------------------------------------------- /field/time/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_time 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/time:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/time/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/time/pix/icon.gif -------------------------------------------------------------------------------- /field/time/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage time 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_time'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /field/url/classes/form.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_url 19 | * @copyright 2011 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | class dataformfield_url_form extends mod_dataform\pluginbase\dataformfieldform { 24 | 25 | /** 26 | * 27 | */ 28 | protected function field_definition() { 29 | 30 | $mform =& $this->_form; 31 | 32 | // Use url picker. 33 | $mform->addElement('selectyesno', 'param1', get_string('usepicker', 'dataformfield_url')); 34 | 35 | // Force link name. 36 | $mform->addElement('text', 'param2', get_string('forcename', 'dataformfield_url'), array('size' => '32')); 37 | $mform->setType('param2', PARAM_TEXT); 38 | } 39 | 40 | /** 41 | * The field default content fieldset. Override parent to display no defaults. 42 | * 43 | * @return void 44 | */ 45 | protected function definition_defaults() { 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /field/url/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_url 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformfield/url:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /field/url/lang/en/dataformfield_url.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield_url 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Url'; 24 | $string['url:addinstance'] = 'Add a new Url dataformfield'; 25 | $string['applymediafilter'] = 'Apply media filter'; 26 | $string['alttext'] = 'Alt text'; 27 | $string['forcename'] = 'Force name for the link'; 28 | $string['makelink'] = 'Make the url a link'; 29 | $string['makeimage'] = 'Make the url an image'; 30 | $string['usepicker'] = 'Use url picker when editing'; 31 | -------------------------------------------------------------------------------- /field/url/pix/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/field/url/pix/icon.gif -------------------------------------------------------------------------------- /field/url/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformfield 19 | * @subpackage url 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformfield_url'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | . 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /pix/access.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/pix/access.png -------------------------------------------------------------------------------- /pix/cleanup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/pix/cleanup.png -------------------------------------------------------------------------------- /pix/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/pix/icon.png -------------------------------------------------------------------------------- /pix/noaccess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/pix/noaccess.png -------------------------------------------------------------------------------- /pix/nonotification.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/pix/nonotification.gif -------------------------------------------------------------------------------- /pix/notification.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/pix/notification.gif -------------------------------------------------------------------------------- /pix/patternbroken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/pix/patternbroken.png -------------------------------------------------------------------------------- /pix/patternsuspect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/pix/patternsuspect.png -------------------------------------------------------------------------------- /pix/patternvalid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/pix/patternvalid.png -------------------------------------------------------------------------------- /tests/behat/add_remove_dataform.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformactivity 2 | Feature: Add dataform to courses 3 | 4 | @javascript 5 | Scenario: Add a dataform to a course 6 | Given a fresh site for dataform scenario 7 | And I log in as "teacher1" 8 | And I follow "Course 1" 9 | 10 | ## Add a dataform 11 | Then I turn editing mode on 12 | And I add a "Dataform" to section "1" 13 | And I set the field "Name" to "Dataform activity 01" 14 | And I press "Save and return to course" 15 | Then I see "Dataform activity 01" 16 | 17 | ## Delete the dataform 18 | Then I delete "Dataform activity 01" activity 19 | 20 | Then I am on homepage 21 | And I follow "Course 1" 22 | Then I do not see "Dataform activity 01" 23 | -------------------------------------------------------------------------------- /tests/behat/field/management.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformfield 2 | Feature: Field management 3 | 4 | @javascript 5 | Scenario: Field management 6 | Given I run dataform scenario "field management" with: 7 | | fieldtype | 8 | | checkbox | 9 | | commentmdl | 10 | | duration | 11 | | entrystate | 12 | | file | 13 | | number | 14 | | picture | 15 | | radiobutton | 16 | | ratingmdl | 17 | | select | 18 | | selectmulti | 19 | | text | 20 | | textarea | 21 | | time | 22 | | url | 23 | -------------------------------------------------------------------------------- /tests/behat/grade/auto_grading.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformgrading 2 | Feature: Auto grading 3 | 4 | @javascript 5 | Scenario: Auto grading by number of entries. 6 | Given a fresh site for dataform scenario 7 | 8 | #Section: Add activity 9 | And the following dataform exists: 10 | | course | C1 | 11 | | idnumber | dataform1 | 12 | | name | Auto grade by number of entries | 13 | | intro | Auto grade by number of entries | 14 | | grade | 80 | 15 | | gradeitem 0 ca | ##numentries## | 16 | #:Section 17 | 18 | #Section: Add view 19 | And the following dataform "views" exist: 20 | | name | type | dataform | default | 21 | | View 01 | aligned | dataform1 | 1 | 22 | #:Section 23 | 24 | #Section: Add entries 25 | And the following dataform "entries" exist: 26 | | dataform | user | group | timecreated | timemodified | 27 | | dataform1 | student1 | | | | 28 | | dataform1 | student1 | | | | 29 | | dataform1 | student1 | | | | 30 | | dataform1 | student1 | | | | 31 | | dataform1 | student2 | | | | 32 | | dataform1 | student2 | | | | 33 | | dataform1 | student3 | | | | 34 | #:Section 35 | 36 | #Section: Grades 37 | Then I log in as "teacher1" 38 | And I follow "Course 1" 39 | 40 | And I follow "Auto grade by number of entries" 41 | And I navigate to "Edit settings" in current page administration 42 | And I press "Save and display" 43 | 44 | And I follow "Gradebook" 45 | And I should see "4.00" in the "Student 1" "table_row" 46 | And I should see "2.00" in the "Student 2" "table_row" 47 | #:Section 48 | -------------------------------------------------------------------------------- /tests/behat/manage.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformactivity 2 | Feature: Manage Dataform components 3 | In order to provide tools for students learning 4 | As a teacher 5 | I need to add dataforms to a course 6 | 7 | @javascript 8 | Scenario: Add update delete 9 | # N steps 10 | 11 | Given a fresh site with dataform "Basic Dataform Management" 12 | Then I log in as "teacher1" 13 | And I follow "Course 1" 14 | And I follow "Basic Dataform Management" 15 | And I follow "Manage" 16 | 17 | # Views 18 | Then I follow "Views" 19 | And I add a dataform view "aligned" with "View 01" 20 | And I see "View 01" 21 | Then I follow "Delete View 01" 22 | And I press "Continue" 23 | And I do not see "View 01" 24 | #And I set dataform view "View Aligned" options to "SL 01\nSL 02\nSL 03\nSL 04" 25 | 26 | # Fields 27 | Then I follow "Fields" 28 | And I add a dataform field "select" with "Field 01" 29 | And I see "Field 01" 30 | Then I set dataform field "Field 01" options to "SL 01\nSL 02\nSL 03\nSL 04" 31 | And I see "Field 01" 32 | Then I follow "Delete Field 01" 33 | And I press "Continue" 34 | And I do not see "Field 01" 35 | 36 | # Filters 37 | Then I follow "Filters" 38 | And I add a dataform filter with "Filter 01" 39 | And I see "Filter 01" 40 | Then I follow "Delete Filter 01" 41 | And I press "Continue" 42 | And I do not see "Filter 01" 43 | 44 | -------------------------------------------------------------------------------- /tests/behat/not_ready.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformactivity 2 | Feature: Dataform access 3 | 4 | @javascript 5 | Scenario: Access not-ready dataform 6 | Given I start afresh with dataform "Dataform not ready test" 7 | And I log in as "teacher1" 8 | And I follow "Course 1" 9 | And I follow "Dataform not ready test" 10 | Then I see "This dataform appears to be new or with incomplete setup" 11 | And I log out 12 | 13 | When I log in as "student1" 14 | And I follow "Course 1" 15 | And I follow "Dataform not ready test" 16 | Then I see "This activity is not ready for viewing" 17 | -------------------------------------------------------------------------------- /tests/behat/view/image_in_template.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformview @dataformviewimageintemplate @_file_upload 2 | Feature: View image in template 3 | 4 | @javascript 5 | Scenario: View image in template 6 | #Given I run dataform scenario "view image in template" with: 7 | # | viewtype | entrytemplate | 8 | # | aligned | Entry template | 9 | # | csv | Entry template | 10 | # | grid | Entry template | 11 | # | interval | Entry template | 12 | # | rss | Item description | 13 | # | tabular | Table design | 14 | -------------------------------------------------------------------------------- /tests/behat/view/management.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformview @dataformviewmanagement 2 | Feature: View management 3 | 4 | @javascript 5 | Scenario: View management 6 | Given I run dataform scenario "view management" with: 7 | | viewtype | 8 | | aligned | 9 | | csv | 10 | | grid | 11 | | interval | 12 | | rss | 13 | | tabular | 14 | -------------------------------------------------------------------------------- /tests/behat/view/pattern_addnewentry.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformview @dataformviewpattern 2 | Feature: Pattern ##addnewentry##. 3 | 4 | @javascript 5 | Scenario: Open a new entry for editing. 6 | #Section: 7 | Given I start afresh with dataform "Test the addnewentry pattern" 8 | And the following dataform "fields" exist: 9 | | name | type | dataform | 10 | | Field Text | text | dataform1 | 11 | And the following dataform "views" exist: 12 | | name | type | dataform | default | 13 | | View 01 | aligned | dataform1 | 1 | 14 | 15 | When I log in as "teacher1" 16 | And I follow "Course 1" 17 | And I follow "Test the addnewentry pattern" 18 | And I follow "Add a new entry" 19 | 20 | Then "field_1_-1" "field" exists 21 | And "field_1_-2" "field" does not exist 22 | #:Section 23 | -------------------------------------------------------------------------------- /tests/behat/view/pattern_viewlinknamed.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformview @dataformviewpattern 2 | Feature: Pattern ##viewlink:viewname##. 3 | 4 | @javascript 5 | Scenario: Navigate to another view. 6 | #Section: 7 | Given I start afresh with dataform "Test the viewlink:viewname pattern" 8 | And the following dataform "fields" exist: 9 | | name | type | dataform | 10 | | Field Text | text | dataform1 | 11 | And the following dataform "views" exist: 12 | | name | type | dataform | default | 13 | | View 01 | aligned | dataform1 | 1 | 14 | | View 02 | aligned | dataform1 | | 15 | And view "View 01" in dataform "1" has the following view template: 16 | """ 17 | 18 | ##entries## 19 | """ 20 | And view "View 02" in dataform "1" has the following view template: 21 | """ 22 |

I am View 02

23 | ##entries## 24 | """ 25 | 26 | When I log in as "teacher1" 27 | And I follow "Course 1" 28 | And I follow "Test the viewlink:viewname pattern" 29 | And I click on "a" "css_element" in the "div.viewlink" "css_element" 30 | 31 | Then I see "I am View 02" 32 | #:Section 33 | -------------------------------------------------------------------------------- /tests/behat/view/pattern_viewlinkreg.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformview @dataformviewpattern 2 | Feature: Pattern ##viewlink:viewname;some label;some args;##. 3 | 4 | @javascript 5 | Scenario: Use the ##viewlink:viewname;some label;;## pattern. 6 | #Section: 7 | Given I start afresh with dataform "Test the viewlink:viewname;some label pattern" 8 | And the following dataform "fields" exist: 9 | | name | type | dataform | 10 | | Field Text | text | dataform1 | 11 | And the following dataform "views" exist: 12 | | name | type | dataform | default | 13 | | View 01 | aligned | dataform1 | 1 | 14 | | View 02 | aligned | dataform1 | | 15 | And view "View 01" in dataform "1" has the following view template: 16 | """ 17 | 18 | ##entries## 19 | """ 20 | And view "View 02" in dataform "1" has the following view template: 21 | """ 22 |

I am View 02

23 | ##entries## 24 | """ 25 | 26 | When I log in as "teacher1" 27 | And I follow "Course 1" 28 | And I follow "Test the viewlink:viewname;some label pattern" 29 | And I follow "Click me to go to View 02" 30 | 31 | Then I see "I am View 02" 32 | #:Section 33 | -------------------------------------------------------------------------------- /tests/behat/view/required_field.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformview @dataformviewrequiredfield 2 | Feature: View required field 3 | 4 | @javascript 5 | Scenario: View required field 6 | Given I run dataform scenario "view required field" with: 7 | | viewtype | entrytemplate | 8 | | aligned | Entry template | 9 | | csv | Entry template | 10 | | grid | Entry template | 11 | | interval | Entry template | 12 | | rss | Item description | 13 | | tabular | Table design | 14 | -------------------------------------------------------------------------------- /tests/behat/view/submission_buttons.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformview @dataformviewsubmissionbuttons 2 | Feature: View submission buttons 3 | 4 | @javascript 5 | Scenario: View submission buttons 6 | Given I run dataform scenario "view submission buttons" with: 7 | | viewtype | actor | 8 | | aligned | student1 | 9 | | csv | student1 | 10 | | grid | student1 | 11 | | interval | student1 | 12 | | rss | student1 | 13 | | tabular | student1 | 14 | -------------------------------------------------------------------------------- /tests/fixtures/Preset-dataform-preset.mbz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/tests/fixtures/Preset-dataform-preset.mbz -------------------------------------------------------------------------------- /tests/fixtures/tc_generator.csv: -------------------------------------------------------------------------------- 1 | timeavailable,timedue,maxentries 2 | tomorrow,,1 3 | ,yesterday,0 4 | -------------------------------------------------------------------------------- /tests/fixtures/test_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itamart/moodle-mod_dataform/9d86bab2604706f13e13e26ec839ce7964b0581e/tests/fixtures/test_image.jpg -------------------------------------------------------------------------------- /tool/entryperuser/classes/tool.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformtool_entryperuser 19 | * @copyright 2015 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | defined('MOODLE_INTERNAL') or die; 24 | 25 | class dataformtool_entryperuser_tool { 26 | /** 27 | * 28 | */ 29 | public static function execute($df) { 30 | global $DB; 31 | 32 | // Get gradebook users. 33 | if (!$users = $df->grade_manager->get_gradebook_users()) { 34 | return; 35 | } 36 | 37 | // Construct entries data. 38 | $data = (object) array('eids' => array()); 39 | $entryid = -1; 40 | foreach ($users as $userid => $unused) { 41 | $data->eids[$entryid] = $entryid; 42 | $data->{"entry_{$entryid}_userid"} = $userid; 43 | $entryid--; 44 | } 45 | // Add entries. 46 | $em = new mod_dataform_entry_manager($df->id); 47 | $processed = $em->process_entries('update', $data->eids, $data, true); 48 | 49 | if (is_array($processed)) { 50 | list($strnotify, $processedeids) = $processed; 51 | if ($entriesprocessed = ($processedeids ? count($processedeids) : 0)) { 52 | return array('success', $strnotify); 53 | } 54 | } 55 | return array('problem', get_string('entriesupdated', 'dataform', get_string('no'))); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /tool/entryperuser/lang/en/dataformtool_entryperuser.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformtool 19 | * @subpackage entryperuser 20 | * @copyright 2012 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $string['pluginname'] = 'Entry per user'; 25 | $string['pluginname_help'] = 'Adds one blank entry for each gradable user in the course'; 26 | -------------------------------------------------------------------------------- /tool/entryperuser/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformtool_entryperuser 19 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $plugin->component = 'dataformtool_entryperuser'; 24 | $plugin->version = 2015051100; 25 | $plugin->requires = 2015051100; 26 | -------------------------------------------------------------------------------- /version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package mod_dataform 19 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | * 22 | * The Dataform has been developed as an enhanced counterpart 23 | * of Moodle's Database activity module (1.9.11+ (20110323)). 24 | * To the extent that Dataform code corresponds to Database code, 25 | * certain copyrights on the Database module may obtain. 26 | */ 27 | 28 | $plugin->component = 'mod_dataform'; 29 | $plugin->release = '3.0dev'; 30 | $plugin->version = 2015061800; 31 | $plugin->requires = 2015061800; 32 | $plugin->maturity = MATURITY_ALPHA; 33 | -------------------------------------------------------------------------------- /view/aligned/classes/form.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview 19 | * @subpackage aligned 20 | * @copyright 2012 Itamar Tzadok 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | class dataformview_aligned_form extends mod_dataform\pluginbase\dataformviewform { 25 | 26 | /** 27 | * 28 | */ 29 | protected function definition_view_specific() { 30 | // View template. 31 | $this->definition_view_template(); 32 | 33 | // Entry template. 34 | $this->definition_entry_template(); 35 | 36 | // Submission settings. 37 | $this->definition_view_submission(); 38 | } 39 | 40 | /** 41 | * 42 | */ 43 | protected function definition_entry_template() { 44 | $mform = &$this->_form; 45 | 46 | // Header. 47 | $mform->addElement('header', 'entrytemplatehdr', get_string('entrytemplate', 'dataform')); 48 | $mform->addHelpButton('entrytemplatehdr', 'entrytemplate', 'dataform'); 49 | 50 | // Template editor (param2). 51 | $mform->addElement('textarea', 'param2', get_string('entrytemplate', 'dataform'), array('cols' => 40, 'rows' => 12)); 52 | $mform->addHelpButton('param2', 'entrytemplate', 'dataformview_aligned'); 53 | $this->add_patterns_selectors('param2', array('view', 'field')); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /view/aligned/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_aligned 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformview/aligned:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /view/aligned/lang/en/dataformview_aligned.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_aligned 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Aligned'; 24 | $string['aligned:addinstance'] = 'Add a new Aligned dataformview'; 25 | $string['entrytemplate'] = 'Entry template'; 26 | $string['entrytemplate_help'] = 'The entry template of the Aligned view is a simplified definition of a table row. It consists of a list of column definitions, each column definition in a new line. The column definition format: fieldpattern|column header (optional)|cell css class (optional). For example, the following definition will display the entries in a headerless table with 3 columns and the specified field patterns in order: 27 |

28 | [[Name]]
29 | [[Email]]
30 | [[Message]]
31 |

32 | The following definition will display the entries in a table with 5 columns and a header row with header titles in the first 3 columns: 33 |

34 | [[Name]]|Name
35 | [[Email]]|Email
36 | [[Message]]|Message
37 | [[EAC:edit]]]
38 | [[EAC:delete]]
39 |

.'; 40 | -------------------------------------------------------------------------------- /view/aligned/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview 19 | * @subpackage aligned 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformview_aligned'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /view/csv/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_csv 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformview/csv:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /view/csv/lang/en/dataformview_csv.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_csv 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | $string['pluginname'] = 'CSV'; 23 | $string['csv:addinstance'] = 'Add a new Csv dataformview'; 24 | $string['csv'] = 'CSV'; 25 | $string['ods'] = 'Calc (Open Office)'; 26 | $string['xls'] = 'Excel'; 27 | $string['expimpsettings'] = 'Export/Import settings'; 28 | $string['updateexisting'] = 'Update existing entries'; 29 | $string['addperparticipant'] = 'Add entries per participant'; 30 | $string['allowupdateexisting'] = 'Allow update existing entries'; 31 | $string['uploadfile'] = 'CSV File'; 32 | $string['uploadtext'] = 'CSV Text'; 33 | $string['importfields'] = 'Import fields'; 34 | $string['importoptions'] = 'Import options'; 35 | $string['test'] = 'Test'; 36 | $string['csvsettings'] = 'CSV settings'; 37 | $string['csvcontent'] = 'CSV content'; 38 | $string['importresults'] = 'Import results'; 39 | $string['exportall'] = 'Export all'; 40 | $string['exportpage'] = 'Export page'; 41 | $string['nothingimported'] = 'Nothing imported'; 42 | $string['noerrorsfound'] = 'No errors found'; 43 | -------------------------------------------------------------------------------- /view/csv/tests/behat/csv_import.feature: -------------------------------------------------------------------------------- 1 | @mod @mod_dataform @dataformview @dataformview_csv @_file_upload 2 | Feature: Import entries 3 | 4 | @javascript 5 | Scenario: Add dataform entries 6 | Given I start afresh with dataform "Test csv import" 7 | And I log in as "teacher1" 8 | And I follow "Course 1" 9 | And I follow "Test csv import" 10 | 11 | # Add a csv view and put author:username edit and delete patterns 12 | When I go to manage dataform "views" 13 | And I set the field "Add a view" to "csv" 14 | And I expand all fieldsets 15 | And I set the field "Name" to "View 01" 16 | And I set the field "Entry template" to 17 | """ 18 | [[EAU:username]] 19 | [[EGR:name]] 20 | [[EGR:idnumber]] 21 | [[ETM:timecreated]] 22 | [[ETM:timemodified]] 23 | [[EAC:edit]] 24 | [[EAC:delete]] 25 | """ 26 | And I press "Save changes" 27 | 28 | Then I set "View 01" as default view 29 | 30 | Then I follow "Browse" 31 | 32 | Then I follow "Import" 33 | And I expand all fieldsets 34 | ##When I upload "lib/tests/fixtures/upload_users.csv" file to "File" filemanager 35 | And I set the field "CSV Text" to 36 | """ 37 | EAU:username,EGR:idnumber,ETM:timecreated,ETM:timemodified 38 | student1,G1,October 28 2013 16:13,October 27 2013 39 | student2,G2,9 March 2014,9 March 2014 +1 day 40 | student3,,, 41 | """ 42 | And I press "Test" 43 | Then I see "No errors found" 44 | When I press "submitbutton" 45 | Then I see "3 entry(s) added" 46 | 47 | When I follow "View 01" 48 | Then I see "student1" 49 | And I see "student2" 50 | And I see "student3" 51 | And I see "Group 1" 52 | And I see "Group 2" 53 | And I see "28 October 2013, 4:13 PM" 54 | And I do not see "27 October 2013" 55 | And I see "9 March 2014" 56 | And I see "10 March 2014" 57 | 58 | -------------------------------------------------------------------------------- /view/csv/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview 19 | * @subpackage csv 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformview_csv'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /view/grid/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_grid 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformview/grid:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /view/grid/lang/en/dataformview_grid.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_grid 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Grid'; 24 | $string['grid:addinstance'] = 'Add a new Grid dataformview'; 25 | $string['gridsettings'] = 'Grid settings'; 26 | $string['cols'] = 'Number of columns'; 27 | $string['rows'] = 'Aligned rows'; 28 | -------------------------------------------------------------------------------- /view/grid/styles.css: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the Dataform module for Moodle - http://moodle.org/. 3 | * 4 | * The Dataform has been developed as an enhanced counterpart 5 | * of Moodle's Database activity module (1.9.11+ (20110323)). 6 | * To the extent that Dataform code corresponds to Database code, 7 | * certain copyrights on the Database module may obtain. 8 | * 9 | * Moodle is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * Moodle is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with Moodle. If not, see . 21 | */ 22 | 23 | /** 24 | * @package dataformview 25 | * @subpackage grid 26 | * @copyright 2014 Itamar Tzadok 27 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 28 | */ 29 | 30 | .dataformview-grid .entriesview .generaltable td { 31 | background-color: transparent !important; 32 | } 33 | 34 | .dataformview-grid .entriesview .entry { 35 | background-color: #F9F9F9; 36 | } 37 | -------------------------------------------------------------------------------- /view/grid/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview 19 | * @subpackage grid 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformview_grid'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /view/interval/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_interval 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformview/interval:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /view/interval/lang/en/dataformview_interval.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_interval 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Interval'; 24 | $string['interval:addinstance'] = 'Add a new Interval dataformview'; 25 | $string['interval'] = 'Interval'; 26 | $string['custom'] = 'Custom'; 27 | $string['daily'] = 'Daily'; 28 | $string['firstpage'] = 'First page'; 29 | $string['hourly'] = 'Hourly'; 30 | $string['lastpage'] = 'Last page'; 31 | $string['monthly'] = 'Monthly'; 32 | $string['nextpage'] = 'Next page'; 33 | $string['randompage'] = 'Random page'; 34 | $string['randomentries'] = 'Random entries'; 35 | $string['refresh'] = 'Refresh'; 36 | $string['resetnext'] = 'Iterations before reset next count'; 37 | $string['selection'] = 'Which entries to select'; 38 | $string['settings'] = 'Settings'; 39 | $string['weekly'] = 'Weekly'; 40 | -------------------------------------------------------------------------------- /view/interval/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview 19 | * @subpackage interval 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformview_interval'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /view/rss/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_rss 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformview/rss:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /view/rss/lang/en/dataformview_rss.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_rss 19 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'RSS'; 24 | $string['rss:addinstance'] = 'Add a new Rss dataformview'; 25 | $string['feedtemplate'] = 'Feed template'; 26 | $string['feedtemplate_help'] = 'Feed template'; 27 | $string['feedtitle'] = 'Feed title'; 28 | $string['feedtitle_help'] = 'Feed title'; 29 | $string['feedview'] = 'Feed view'; 30 | $string['feedview_help'] = 'Feed view'; 31 | $string['feeddescription'] = 'Feed description'; 32 | $string['feeddescription_help'] = 'Feed description'; 33 | $string['itemtemplate'] = 'Item template'; 34 | $string['itemtemplate_help'] = 'Item template'; 35 | $string['itemtitle'] = 'Item title'; 36 | $string['itemtitle_help'] = 'Item title'; 37 | $string['itemview'] = 'Item view'; 38 | $string['itemview_help'] = 'Item view'; 39 | $string['itemdescription'] = 'Item description'; 40 | $string['itemdescription_help'] = 'Item description'; 41 | -------------------------------------------------------------------------------- /view/rss/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview 19 | * @subpackage rss 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformview_rss'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | -------------------------------------------------------------------------------- /view/tabular/db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_tabular 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $capabilities = array( 24 | // Add Instance. 25 | 'dataformview/tabular:addinstance' => array( 26 | 27 | 'riskbitmask' => RISK_SPAM, 28 | 29 | 'captype' => 'write', 30 | 'contextlevel' => CONTEXT_MODULE, 31 | 'archetypes' => array( 32 | 'editingteacher' => CAP_ALLOW, 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | ); 37 | -------------------------------------------------------------------------------- /view/tabular/lang/en/dataformview_tabular.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview_tabular 19 | * @copyright 2014 Itamar Tzadok 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 21 | */ 22 | 23 | $string['pluginname'] = 'Tabular'; 24 | $string['tabular:addinstance'] = 'Add a new Tabular dataformview'; 25 | $string['headerrow'] = 'Table with header row'; 26 | $string['headerrow_help'] = 'If set to Yes, it is assumed that the first row in the table template is a header row.'; 27 | $string['table'] = 'Table design'; 28 | $string['table_help'] = 'A table template for displaying the entries. If Table with header row is set to Yes, the first row will be the header row of the displayed table. All the other rows (or all rows if Table with header row is set to No) will be repeated for each entry. Typically the table template will consist of 2 rows if header is used or 1 row if there is no header.'; 29 | -------------------------------------------------------------------------------- /view/tabular/version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package dataformview 19 | * @subpackage tabular 20 | * @copyright 2014 Itamar Tzadok {@link http://substantialmethods.com} 21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 | */ 23 | 24 | $plugin->component = 'dataformview_tabular'; 25 | $plugin->version = 2015051100; 26 | $plugin->requires = 2015051100; 27 | --------------------------------------------------------------------------------