From c0cb213f77a4b614b352391cad068f9491470ddd Mon Sep 17 00:00:00 2001 From: Kordan Date: Tue, 15 Mar 2016 10:03:17 +0100 Subject: [PATCH] CONTRIB-6190 mod_surveypro: Changed advanced to reserved --- README.md | 2 +- adminlib.php | 6 +- backup/moodle2/backup_surveypro_stepslib.php | 2 +- backup/moodle2/restore_surveypro_stepslib.php | 4 + classes/formbase.class.php | 10 +- classes/itembase.class.php | 70 +++++----- classes/itemlist.class.php | 91 ++++++------- classes/layout_preview.class.php | 2 +- classes/mtemplate.class.php | 4 +- classes/tabs.class.php | 4 +- classes/templatebase.class.php | 2 +- classes/utemplate.class.php | 7 +- classes/utils.class.php | 10 +- classes/view_cover.class.php | 6 +- classes/view_export.class.php | 14 +- classes/view_form.class.php | 21 +-- classes/view_import.class.php | 3 +- classes/view_submissions.class.php | 16 +-- db/access.php | 8 +- db/install.xml | 2 +- db/uninstall.php | 16 --- db/upgrade.php | 13 ++ field/age/form/plugin_form.php | 3 +- .../tests/behat/use_advanced_elements.feature | 10 +- field/autofill/classes/plugin.class.php | 3 - field/autofill/form/plugin_form.php | 1 - field/boolean/classes/plugin.class.php | 2 +- field/character/db/upgradelib.php | 14 -- field/checkbox/classes/plugin.class.php | 8 +- field/checkbox/form/plugin_form.php | 2 +- .../lang/en/surveyprofield_checkbox.php | 4 +- .../fileupload/classes/mform_filemanager.php | 8 +- field/fileupload/classes/plugin.class.php | 1 - field/fileupload/form/plugin_form.php | 1 - field/integer/classes/plugin.class.php | 1 - field/multiselect/classes/plugin.class.php | 2 +- field/multiselect/form/plugin_form.php | 2 +- .../lang/en/surveyprofield_multiselect.php | 4 +- field/numeric/classes/plugin.class.php | 1 - .../lang/en/surveyprofield_radiobutton.php | 2 +- field/rate/classes/plugin.class.php | 10 +- field/rate/form/plugin_form.php | 2 +- field/rate/lang/en/surveyprofield_rate.php | 2 +- field/recurrence/classes/plugin.class.php | 1 - field/recurrence/form/plugin_form.php | 1 - field/select/classes/plugin.class.php | 2 +- field/select/form/plugin_form.php | 2 +- .../select/lang/en/surveyprofield_select.php | 2 +- field/shortdate/form/plugin_form.php | 2 - form/data/export_form.php | 6 +- form/items/itembase_form.php | 10 +- form/mtemplates/apply_form.php | 2 +- form/outform/fill_form.php | 24 ++-- form/outform/search_form.php | 12 +- form/utemplates/apply_form.php | 8 +- form/utemplates/create_form.php | 4 - form/utemplates/import_form.php | 4 - format/fieldset/form/plugin_form.php | 2 +- format/pagebreak/classes/plugin.class.php | 2 +- lang/en/surveypro.php | 16 +-- layout_preview.php | 2 +- lib.php | 11 +- .../classes/uploadsform.class.php | 2 +- .../attachments_overview/form/filter_form.php | 7 +- report/attachments_overview/uploads.php | 3 +- report/colles/classes/report.class.php | 1 - report/frequency/classes/report.class.php | 4 +- report/frequency/form/item_form.php | 2 +- .../lang/en/surveyproreport_frequency.php | 2 +- template/attls/template.xml | 44 +++--- template/collesactual/template.xml | 78 +++++------ template/collesactualpreferred/template.xml | 126 ++++++++--------- template/collespreferred/template.xml | 78 +++++------ template/criticalincidents/template.xml | 12 +- .../lang/en/surveyprotemplate_pluginname.php | 6 +- templatemaster/template.class.php | 4 +- templatemaster/template.xml | 4 +- templatemaster/version.php | 6 +- tests/behat/behat_mod_surveypro.php | 1 - .../fixtures/usertemplate/MMM_2015123000.xml | 128 +++++++++--------- .../usertemplate/age_only_2015123000.xml | 42 +++--- .../attachment_only_2015123000.xml | 6 +- .../usertemplate/autofill_only_2015123000.xml | 10 +- .../usertemplate/boolean_only_2015123000.xml | 62 ++++----- .../usertemplate/checkbox_only_2015123000.xml | 82 +++++------ .../usertemplate/date_only_2015123000.xml | 38 +++--- .../dateshort_only_2015123000.xml | 38 +++--- .../usertemplate/datetime_only_2015123000.xml | 38 +++--- .../usertemplate/integer_only_2015123000.xml | 18 +-- .../multiselect_only_2015123000.xml | 34 ++--- .../usertemplate/numeric_only_2015123000.xml | 18 +-- .../usertemplate/parent-child_2015123000.xml | 52 +++---- .../radiobutton_only_2015123000.xml | 54 ++++---- .../usertemplate/rate_only_2015123000.xml | 42 +++--- .../recurrence_only_2015123000.xml | 38 +++--- .../usertemplate/select_only_2015123000.xml | 54 ++++---- .../usertemplate/textarea_only_2015123000.xml | 18 +-- .../textshort_only_2015123000.xml | 34 ++--- .../usertemplate/time_only_2015123000.xml | 38 +++--- utemplates_create.php | 2 - utemplates_import.php | 2 - version.php | 2 +- view_form.php | 2 +- view_search.php | 2 +- 104 files changed, 837 insertions(+), 906 deletions(-) diff --git a/README.md b/README.md index 73d8a2b23ec..2d6ff79183d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The meaning of the less common properties is: - Availability defines who will see the field in the form. It can be: -- all: each user will see the field in the survey form; -- hidden: not any user will see the field in the survey form; --- advanced: only students with specific permissions (accessadvanceditems) will see the field in the survey form; +-- reserved: only students with specific permissions (accessreserveditems) will see the field in the survey form; -- search: the field will be available in the search form too (if not hidden). - Validation options define the range of allowed responses for the students. - Default is what the blank form will display as predefined value of an element. diff --git a/adminlib.php b/adminlib.php index 312b43dd733..a0ff435cdd1 100644 --- a/adminlib.php +++ b/adminlib.php @@ -64,7 +64,7 @@ public function search($query) { $found = false; - foreach (core_component::get_plugin_list($this->subtype) as $name => $notused) { + foreach (core_component::get_plugin_list($this->subtype) as $name => $unused) { if (strpos(core_text::strtolower(get_string('pluginname', $this->subtype.'_'.$name)), $query) !== false) { $found = true; @@ -119,7 +119,7 @@ public function get_sorted_plugins_list() { $result = array(); - foreach ($names as $name => $notused) { + foreach ($names as $name => $unused) { $idx = get_config($this->subtype.'_'.$name, 'sortorder'); if (!$idx) { $idx = 0; @@ -458,7 +458,7 @@ public static function add_admin_surveypro_plugin_settings($subtype, $plugins = core_component::get_plugin_list_with_file($subtype, 'settings.php', false); // $plugins = get_plugin_list_with_file($subtype, 'settings.php', false); $pluginsbyname = array(); - foreach ($plugins as $plugin => $notused) { + foreach ($plugins as $plugin => $unused) { $pluginname = get_string('pluginname', $subtype.'_'.$plugin); $pluginsbyname[$pluginname] = $plugin; } diff --git a/backup/moodle2/backup_surveypro_stepslib.php b/backup/moodle2/backup_surveypro_stepslib.php index d676e630ba9..530bc2feb1a 100644 --- a/backup/moodle2/backup_surveypro_stepslib.php +++ b/backup/moodle2/backup_surveypro_stepslib.php @@ -51,7 +51,7 @@ protected function define_structure() { $items = new backup_nested_element('items'); $item = new backup_nested_element('item', array('id', 'type', 'plugin'), array( - 'hidden', 'insearchform', 'advanced', 'sortindex', 'formpage', + 'hidden', 'insearchform', 'reserved', 'sortindex', 'formpage', 'parentid', 'parentvalue', 'timecreated', 'timemodified')); $submissions = new backup_nested_element('submissions'); diff --git a/backup/moodle2/restore_surveypro_stepslib.php b/backup/moodle2/restore_surveypro_stepslib.php index 617d41ff964..4c089eb08c7 100644 --- a/backup/moodle2/restore_surveypro_stepslib.php +++ b/backup/moodle2/restore_surveypro_stepslib.php @@ -69,6 +69,10 @@ protected function process_surveypro($data) { $oldid = $data->id; $data->course = $this->get_courseid(); + // Old backups using advanced field map to new reserved field. + if (isset($data->advanced)) { + $data->reserved = $data->advanced; + } $data->timeopen = $this->apply_date_offset($data->timeopen); $data->timeclose = $this->apply_date_offset($data->timeclose); $data->timemodified = $this->apply_date_offset($data->timemodified); diff --git a/classes/formbase.class.php b/classes/formbase.class.php index fa116557547..fea2f0051db 100644 --- a/classes/formbase.class.php +++ b/classes/formbase.class.php @@ -65,10 +65,10 @@ public function __construct($cm, $context, $surveypro) { public function noitem_stopexecution() { global $COURSE, $OUTPUT; - $canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $this->context, null, true); + $canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $this->context, null, true); $utilityman = new mod_surveypro_utility($this->cm, $this->surveypro); - if (!$utilityman->has_input_items(0, false, false, $canaccessadvanceditems)) { + if (!$utilityman->has_input_items(0, false, false, $canaccessreserveditems)) { $canmanageitems = has_capability('mod/surveypro:manageitems', $this->context, null, true); if ($canmanageitems) { @@ -98,12 +98,12 @@ public function noitem_stopexecution() { public function get_prefill_data() { global $DB; - $canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $this->context, null, true); + $canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $this->context, null, true); $prefill = array(); if (!empty($this->submissionid)) { - // $canaccessadvanceditems, $searchform=false, $type=SURVEYPRO_TYPEFIELD, $formpage=$this->formpage - list($sql, $whereparams) = surveypro_fetch_items_seeds($this->surveypro->id, $canaccessadvanceditems, false, SURVEYPRO_TYPEFIELD, $this->formpage); + // $canaccessreserveditems, $searchform=false, $type=SURVEYPRO_TYPEFIELD, $formpage=$this->formpage + list($sql, $whereparams) = surveypro_fetch_items_seeds($this->surveypro->id, $canaccessreserveditems, false, SURVEYPRO_TYPEFIELD, $this->formpage); if ($itemseeds = $DB->get_recordset_sql($sql, $whereparams)) { foreach ($itemseeds as $itemseed) { $item = surveypro_get_item($this->cm, $this->surveypro, $itemseed->id, $itemseed->type, $itemseed->plugin); diff --git a/classes/itembase.class.php b/classes/itembase.class.php index 03667233b24..142775c8a82 100644 --- a/classes/itembase.class.php +++ b/classes/itembase.class.php @@ -66,9 +66,9 @@ class mod_surveypro_itembase { protected $insearchform; /** - * $advanced = is this field going to be available only to users with accessadvanceditems capability? + * $reserved = is this field going to be available only to users with accessreserveditems capability? */ - protected $advanced; + protected $reserved; /** * $sortindex = the order of this item in the surveypro form @@ -121,7 +121,7 @@ class mod_surveypro_itembase { 'variable' => true, 'indent' => true, 'hidden' => true, - 'advanced' => true, + 'reserved' => true, 'insearchform' => true, 'parentid' => true ); @@ -192,7 +192,7 @@ public function item_force_coherence($record) { * √ plugin * √ hidden * √ insearchform - * √ advanced + * √ reserved * sortindex * formpage * √ parentid @@ -229,7 +229,7 @@ protected function item_get_common_settings($record) { // Plugin and type are already onboard. // Checkboxes content. - $checkboxessettings = array('hidden', 'insearchform', 'advanced', 'hideinstructions', 'required'); + $checkboxessettings = array('hidden', 'insearchform', 'reserved', 'hideinstructions', 'required'); foreach ($checkboxessettings as $checkboxessetting) { if ($this->insetupform[$checkboxessetting]) { $record->{$checkboxessetting} = isset($record->{$checkboxessetting}) ? 1 : 0; @@ -389,7 +389,7 @@ public function item_save($record) { // End of: hide/unhide 1. // Begin of: Limit/unlimit access part 1. - $oldadvanced = $this->get_advanced(); // Used later. + $oldreserved = $this->get_reserved(); // Used later. // End of: limit/unlimit access part 1. // Sortindex. @@ -419,7 +419,7 @@ public function item_save($record) { $transaction->allow_commit(); - $this->item_manage_chains($record->itemid, $oldhidden, $record->hidden, $oldadvanced, $record->advanced); + $this->item_manage_chains($record->itemid, $oldhidden, $record->hidden, $oldreserved, $record->reserved); // Event: item_modified. $eventdata = array('context' => $context, 'objectid' => $record->itemid); @@ -526,13 +526,11 @@ public function item_validate_variablename($record, $itemid) { * @param integer $itemid * @param boolean 0/1 $oldhidden * @param boolean 0/1 $newhidden - * @param boolean 0/1 $oldadvanced - * @param boolean 0/1 $newadvanced + * @param boolean 0/1 $oldreserved + * @param boolean 0/1 $newreserved * @return void */ - private function item_manage_chains($itemid, $oldhidden, $newhidden, $oldadvanced, $newadvanced) { - global $DB; - + private function item_manage_chains($itemid, $oldhidden, $newhidden, $oldreserved, $newreserved) { $context = context_module::instance($this->cm->id); // Now hide or unhide (whether needed) chain of ancestors or descendents. @@ -565,9 +563,9 @@ private function item_manage_chains($itemid, $oldhidden, $newhidden, $oldadvance } - // Manage ($oldadvanced != $newadvanced). - if ($oldadvanced != $newadvanced) { - $action = ($oldadvanced) ? SURVEYPRO_MAKESTANDARD : SURVEYPRO_MAKEADVANCED; + // Manage ($oldreserved != $newreserved). + if ($oldreserved != $newreserved) { + $action = ($oldreserved) ? SURVEYPRO_MAKESTANDARD : SURVEYPRO_MAKEADVANCED; $itemlistman = new mod_surveypro_itemlist($this->cm, $context, $this->surveypro); $itemlistman->set_type($this->type); @@ -578,14 +576,14 @@ private function item_manage_chains($itemid, $oldhidden, $newhidden, $oldadvance $itemlistman->set_confirm(SURVEYPRO_CONFIRMED_YES); // Begin of: Limit/unlimit access part 2. - if ( ($oldadvanced == 1) && ($newadvanced == 0) ) { + if ( ($oldreserved == 1) && ($newreserved == 0) ) { if ($itemlistman->item_makestandard_execute()) { // A chain of parent items has been made available for all. $this->itemeditingfeedback += 16; // 1*2^4. } } - if ( ($oldadvanced == 0) && ($newadvanced == 1) ) { - if ($itemlistman->item_makeadvanced_execute()) { + if ( ($oldreserved == 0) && ($newreserved == 1) ) { + if ($itemlistman->item_makereserved_execute()) { // A chain of child items got a limited access. $this->itemeditingfeedback += 32; // 1*2^5 } @@ -650,7 +648,7 @@ protected function item_builtin_string_load_support() { } if ($multilangfields = $this->item_get_multilang_fields()) { - foreach ($multilangfields as $plugin => $fieldnames) { + foreach ($multilangfields as $fieldnames) { foreach ($fieldnames as $fieldname) { $stringkey = $this->{$fieldname}; $this->{$fieldname} = get_string($stringkey, 'surveyprotemplate_'.$template); @@ -758,7 +756,7 @@ public function item_get_content_array($content, $field) { $options = surveypro_textarea_to_array($this->{$field}); $values = array(); - foreach ($options as $k => $option) { + foreach ($options as $option) { if (preg_match('~^(.*)'.SURVEYPRO_VALUELABELSEPARATOR.'(.*)$~', $option, $match)) { $values[] = $match[$index]; } else { @@ -838,7 +836,7 @@ public function item_mandatory_is_allowed() { public function item_add_mandatory_base_fields(&$record) { $record->hidden = 0; $record->insearchform = 0; - $record->advanced = 0; + $record->reserved = 0; $record->formpage = 0; $record->timecreated = time(); } @@ -864,26 +862,24 @@ public function item_get_multilang_fields() { * @return string $schema */ public static function item_get_item_schema() { + + // Fields: surveyproid, formpage, timecreated and timemodified are not supposed to be part of the file! $schema = ''."\n"; $schema .= ''."\n"; $schema .= ' '."\n"; $schema .= ' '."\n"; $schema .= ' '."\n"; - // $schema .= ' '."\n"; - $schema .= ' '."\n"; $schema .= ' '."\n"; - $schema .= ' '."\n"; - - // sortindex has been dropped on December 30, 2015. Next line only for backword compatibility. + // "advanced" has been replaced by "reserved" on March 21, 2016. Next lines guarantee backword compatibility. + $schema .= ' '."\n"; + $schema .= ' '."\n"; + $schema .= ' '."\n"; + $schema .= ' '."\n"; + // "sortindex" has been dropped on December 30, 2015. Next line only for backword compatibility. $schema .= ' '."\n"; - // $schema .= ' '."\n"; - $schema .= ' '."\n"; $schema .= ' '."\n"; - - // $schema .= ' '."\n"; - // $schema .= ' '."\n"; $schema .= ' '."\n"; $schema .= ' '."\n"; $schema .= ' '."\n"; @@ -1143,13 +1139,13 @@ public function get_insearchform() { } /** - * get_advanced + * get_reserved * * @param none - * @return the content of the $advanced property + * @return the content of the $reserved property */ - public function get_advanced() { - return $this->advanced; + public function get_reserved() { + return $this->reserved; } /** @@ -1468,10 +1464,10 @@ public function userform_child_item_allowed_static($submissionid, $childitemreco * In the frame of this method the parent item is calculated and is requested to provide the disabledif conditions to disable its child item * * @param $mform - * @param $canaccessadvanceditems + * @param $canaccessreserveditems * @return void */ - public function userform_add_disabledif($mform, $canaccessadvanceditems) { + public function userform_add_disabledif($mform, $canaccessreserveditems) { global $DB; if (!$this->parentid || ($this->type == SURVEYPRO_TYPEFORMAT)) { diff --git a/classes/itemlist.class.php b/classes/itemlist.class.php index 758060d0796..575c0ea71bd 100644 --- a/classes/itemlist.class.php +++ b/classes/itemlist.class.php @@ -127,8 +127,6 @@ public function __construct($cm, $context, $surveypro) { $this->cm = $cm; $this->context = $context; $this->surveypro = $surveypro; - - $utilityman = new mod_surveypro_utility($cm, $surveypro); } /** @@ -335,10 +333,10 @@ public function display_items_table() { // Availability. $currenthide = $item->get_hidden(); if (empty($currenthide)) { - // First icon: advanced vs standard (generally available). - if (!$item->get_advanced()) { + // First icon: reserved vs standard (generally available). + if (!$item->get_reserved()) { $message = get_string('available', 'mod_surveypro'); - if ($item->get_insetupform('advanced')) { + if ($item->get_insetupform('reserved')) { $paramurl = $paramurlbase; $paramurl['act'] = SURVEYPRO_MAKEADVANCED; $paramurl['sortindex'] = $sortindex; @@ -442,8 +440,8 @@ public function display_items_table() { } $icons .= $OUTPUT->action_icon(new moodle_url('/mod/surveypro/layout_manage.php#sortindex_'.($sortindex - 1), $paramurl), - new pix_icon('t/move', $edittitle, 'moodle', array('title' => $edittitle)), - null, array('id' => 'move_item_'.$item->get_sortindex(), 'title' => $edittitle)); + new pix_icon('t/move', $edittitle, 'moodle', array('title' => $changetitle)), + null, array('id' => 'move_item_'.$item->get_sortindex(), 'title' => $changetitle)); } // SURVEYPRO_DELETEITEM. @@ -907,7 +905,7 @@ public function display_item_editing_feedback() { break; case 5: // A chain of items was removed from the user entry form. if ($bit) { - $message .= '
'.get_string('itemeditmakeadvanced', 'mod_surveypro'); + $message .= '
'.get_string('itemeditmakereserved', 'mod_surveypro'); } break; } @@ -995,7 +993,7 @@ public function actions_execution() { $DB->set_field('surveypro_item', 'insearchform', 0, array('id' => $this->itemid)); break; case SURVEYPRO_MAKEADVANCED: - $this->item_makeadvanced_execute(); + $this->item_makereserved_execute(); break; case SURVEYPRO_MAKESTANDARD: $this->item_makestandard_execute(); @@ -1045,7 +1043,7 @@ public function actions_feedback() { $this->item_delete_feedback(); break; case SURVEYPRO_MAKEADVANCED: - $this->item_makeadvanced_feedback(); + $this->item_makereserved_feedback(); break; case SURVEYPRO_MAKESTANDARD: $this->item_makestandard_feedback(); @@ -1105,7 +1103,7 @@ public function bulk_action_ask($message) { * @return void */ public function item_hide_execute() { - global $DB, $OUTPUT; + global $DB; // Build tohidelist. // Here I must select the whole tree down. @@ -1131,7 +1129,7 @@ public function item_hide_execute() { * @return void */ public function item_hide_feedback() { - global $DB, $OUTPUT; + global $OUTPUT; // Build tohidelist. // Here I must select the whole tree down. @@ -1184,8 +1182,6 @@ public function item_hide_feedback() { * @return void */ public function item_show_execute() { - global $DB, $OUTPUT; - // Build toshowlist. list($toshowlist, $sortindextoshowlist) = $this->add_parent_node(array('hidden' => 1)); @@ -1207,7 +1203,7 @@ public function item_show_execute() { * @return void */ public function item_show_feedback() { - global $DB, $OUTPUT; + global $OUTPUT; // Build toshowlist. list($toshowlist, $sortindextoshowlist) = $this->add_parent_node(array('hidden' => 1)); @@ -1432,7 +1428,7 @@ public function drop_multilang_execute() { * @return void */ public function drop_multilang_feedback() { - global $DB, $OUTPUT; + global $OUTPUT; if ($this->confirm == SURVEYPRO_UNCONFIRMED) { // Ask for confirmation. @@ -1478,32 +1474,32 @@ public function item_setrequired_execute($value) { $DB->set_field('surveypro'.$this->type.'_'.$this->plugin, 'required', $value, array('itemid' => $this->itemid)); } - // MARK item make advanced + // MARK item make reserved /** - * item_makeadvanced_execute + * item_makereserved_execute * - * the idea is: in a chain of parent-child items, - * -> items available to each user (standard items) can be parent of item available to each user such as item with limited access (advanced) - * -> item with limited access (advanced) can ONLY BE parent of items with limited access (advanced) + * the idea is this: in a chain of parent-child items, + * -> items available to each user (public items) can be parent of item available to each user such as item with reserved access + * -> item with reserved access can ONLY BE parent of items with reserved access * * @param none * @return void */ - public function item_makeadvanced_execute() { + public function item_makereserved_execute() { global $DB; - // Build toadvancedlist. + // Build toreservedlist. // Here I must select the whole tree down. - $toadvancedlist = array($this->itemid); - $sortindextoadvancedlist = array(); - $this->add_child_node($toadvancedlist, $sortindextoadvancedlist, array('advanced' => 0)); + $toreservedlist = array($this->itemid); + $sortindextoreservedlist = array(); + $this->add_child_node($toreservedlist, $sortindextoreservedlist, array('reserved' => 0)); - $itemstoprocess = count($toadvancedlist); + $itemstoprocess = count($toreservedlist); if ( ($this->confirm == SURVEYPRO_CONFIRMED_YES) || ($itemstoprocess == 1) ) { - // Make items advanced. - foreach ($toadvancedlist as $tohideitemid) { - $DB->set_field('surveypro_item', 'advanced', 1, array('id' => $tohideitemid)); + // Make items reserved. + foreach ($toreservedlist as $tohideitemid) { + $DB->set_field('surveypro_item', 'reserved', 1, array('id' => $tohideitemid)); } $utilityman = new mod_surveypro_utility($this->cm, $this->surveypro); $utilityman->reset_items_pages(); @@ -1511,33 +1507,32 @@ public function item_makeadvanced_execute() { } /** - * item_makeadvanced_feedback + * item_makereserved_feedback * - * the idea is: in a chain of parent-child items, - * -> items available to each user (standard items) can be parent of item available to each user such as item with limited access (advanced) - * -> item with limited access (advanced) can ONLY BE parent of items with limited access (advanced) + * the idea is this: in a chain of parent-child items, + * -> items available to each user (public items) can be parent of item available to each user such as item with reserved access + * -> item with reserved access can ONLY BE parent of items with reserved access * * @param none * @return void */ - public function item_makeadvanced_feedback() { - global $DB, $OUTPUT; + public function item_makereserved_feedback() { + global $OUTPUT; - // Build toadvancedlist. + // Build toreservedlist. // Here I must select the whole tree down. - $toadvancedlist = array($this->itemid); - $sortindextoadvancedlist = array(); - $this->add_child_node($toadvancedlist, $sortindextoadvancedlist, array('advanced' => 0)); + $toreservedlist = array($this->itemid); + $sortindextoreservedlist = array(); + $this->add_child_node($toreservedlist, $sortindextoreservedlist, array('reserved' => 0)); - $itemstoprocess = count($toadvancedlist); if ($this->confirm == SURVEYPRO_UNCONFIRMED) { - if (count($toadvancedlist) > 1) { // Ask for confirmation. + if (count($toreservedlist) > 1) { // Ask for confirmation. $item = surveypro_get_item($this->cm, $this->surveypro, $this->itemid, $this->type, $this->plugin); $a = new stdClass(); $a->parentid = $item->get_content(); - $a->dependencies = implode(', ', $sortindextoadvancedlist); - $message = get_string('askitemstoadvanced', 'mod_surveypro', $a); + $a->dependencies = implode(', ', $sortindextoreservedlist); + $message = get_string('askitemstoreserved', 'mod_surveypro', $a); $optionbase = array('id' => $this->cm->id, 'act' => SURVEYPRO_MAKEADVANCED, 'sesskey' => sesskey()); @@ -1577,13 +1572,13 @@ public function item_makestandard_execute() { global $DB; // Build tostandardlist. - list($tostandardlist, $sortindextostandardlist) = $this->add_parent_node(array('advanced' => 1)); + list($tostandardlist, $sortindextostandardlist) = $this->add_parent_node(array('reserved' => 1)); $itemstoprocess = count($tostandardlist); // This is the list of ancestors. if ( ($this->confirm == SURVEYPRO_CONFIRMED_YES) || ($itemstoprocess == 1) ) { // Make items standard. foreach ($tostandardlist as $toshowitemid) { - $DB->set_field('surveypro_item', 'advanced', 0, array('id' => $toshowitemid)); + $DB->set_field('surveypro_item', 'reserved', 0, array('id' => $toshowitemid)); } $utilityman = new mod_surveypro_utility($this->cm, $this->surveypro); $utilityman->reset_items_pages(); @@ -1597,10 +1592,10 @@ public function item_makestandard_execute() { * @return void */ public function item_makestandard_feedback() { - global $DB, $OUTPUT; + global $OUTPUT; // Build tostandardlist. - list($tostandardlist, $sortindextostandardlist) = $this->add_parent_node(array('advanced' => 1)); + list($tostandardlist, $sortindextostandardlist) = $this->add_parent_node(array('reserved' => 1)); $itemstoprocess = count($tostandardlist); // This is the list of ancestors. if ($this->confirm == SURVEYPRO_UNCONFIRMED) { diff --git a/classes/layout_preview.class.php b/classes/layout_preview.class.php index 47137f09739..b59eda92aef 100644 --- a/classes/layout_preview.class.php +++ b/classes/layout_preview.class.php @@ -63,7 +63,7 @@ public function surveypro_add_custom_css() { global $PAGE; $fs = get_file_storage(); - if ($files = $fs->get_area_files($this->context->id, 'mod_surveypro', SURVEYPRO_STYLEFILEAREA, 0, 'sortorder', false)) { + if ($fs->get_area_files($this->context->id, 'mod_surveypro', SURVEYPRO_STYLEFILEAREA, 0, 'sortorder', false)) { $PAGE->requires->css('/mod/surveypro/userstyle.php?id='.$this->surveypro->id.'&cmid='.$this->cm->id); // Not overridable via themes! } } diff --git a/classes/mtemplate.class.php b/classes/mtemplate.class.php index bf55776c3e7..c1a7b649e98 100644 --- a/classes/mtemplate.class.php +++ b/classes/mtemplate.class.php @@ -22,7 +22,7 @@ defined('MOODLE_INTERNAL') || die(); -define('SURVEYPROTEMPLATE_NAMEPLACEHOLDER', '@@templateNamePlaceholder@@'); +define('SURVEYPROTEMPLATE_NAMEPLACEHOLDER', '00templateNamePlaceholder00'); require_once($CFG->dirroot.'/mod/surveypro/classes/templatebase.class.php'); @@ -676,7 +676,7 @@ public function get_translated_strings($userlang) { $a = new stdClass(); $a->userlang = $userlang; foreach ($this->langtree as $langbranch) { - foreach ($langbranch as $k => $stringcontent) { + foreach ($langbranch as $k => $unused) { $a->stringkey = $k; $stringsastext[] = get_string('translatedstring', 'mod_surveypro', $a); } diff --git a/classes/tabs.class.php b/classes/tabs.class.php index dc8c3d8efb0..3ff9a1dff94 100644 --- a/classes/tabs.class.php +++ b/classes/tabs.class.php @@ -122,7 +122,7 @@ private function get_tabs_structure() { // TAB USER TEMPLATES. $this->tabutemplatename = get_string('tabutemplatename', 'mod_surveypro'); if ($this->moduletab == SURVEYPRO_TABUTEMPLATES) { - if (empty($surveypro->template)) { + if (empty($this->surveypro->template)) { $canmanageusertemplates = has_capability('mod/surveypro:manageusertemplates', $this->context, null, true); if ($canmanageusertemplates) { $elementurl = new moodle_url('/mod/surveypro/utemplates_create.php', $paramurl); @@ -189,7 +189,7 @@ private function get_pages_structure() { $strlabel = get_string('tabitemspage2', 'mod_surveypro'); $row[] = new tabobject('idpage2', $elementurl->out(), $strlabel); - if (empty($surveypro->template)) { + if (empty($this->surveypro->template)) { // Setup. if ($this->modulepage == SURVEYPRO_ITEMS_SETUP) { $elementurl = new moodle_url('/mod/surveypro/layout_itemsetup.php', $paramurl); diff --git a/classes/templatebase.class.php b/classes/templatebase.class.php index 18f21c08b40..4dcb0880991 100644 --- a/classes/templatebase.class.php +++ b/classes/templatebase.class.php @@ -248,7 +248,7 @@ public function get_plugin_versiondisk() { $pluginman = core_plugin_manager::instance(); $subplugins = $pluginman->get_subplugins_of_plugin('surveypro'); $versions = array(); - foreach ($subplugins as $component => $plugin) { + foreach ($subplugins as $plugin) { if (($plugin->type != 'surveypro'.SURVEYPRO_TYPEFIELD) && ($plugin->type != 'surveypro'.SURVEYPRO_TYPEFORMAT)) { continue; diff --git a/classes/utemplate.class.php b/classes/utemplate.class.php index 98e065e81bf..bc5212f7687 100644 --- a/classes/utemplate.class.php +++ b/classes/utemplate.class.php @@ -400,8 +400,6 @@ public function write_template_content($visiblesonly=true) { * @return null */ public function apply_template() { - global $CFG, $DB; - $action = $this->formdata->action; $parts = explode('_', $this->formdata->usertemplateinfo); $this->utemplateid = $parts[1]; @@ -835,14 +833,13 @@ public function manage_utemplates() { // $table->set_attribute('width', '90%'); $table->setup(); - $applytitle = get_string('applytemplate', 'mod_surveypro'); $deletetitle = get_string('delete'); $exporttitle = get_string('exporttemplate', 'mod_surveypro'); $options = $this->get_sharinglevel_options(); $templates = new stdClass(); - foreach ($options as $sharinglevel => $v) { + foreach ($options as $sharinglevel => $unused) { $parts = explode('_', $sharinglevel); $contextlevel = $parts[0]; @@ -930,7 +927,7 @@ private function create_fictitious_table($templates, $usersort) { // Original table per rows: originaltableperrows. $originaltableperrows = array(); - foreach ($templatenamecol as $k => $value) { + foreach ($templatenamecol as $k => $unused) { $tablerow = array(); $tablerow['templatename'] = $templatenamecol[$k]; $tablerow['sharinglevel'] = $sharinglevelcol[$k]; diff --git a/classes/utils.class.php b/classes/utils.class.php index f8bd0393773..327314ff712 100644 --- a/classes/utils.class.php +++ b/classes/utils.class.php @@ -96,10 +96,10 @@ public function assign_pages() { * @param $surveyproid * @param $formpage * @param $includehidden - * @param $includeadvanced + * @param $includereserved * @return bool|int as required by $returncount */ - public function has_input_items($formpage=0, $returncount=false, $includehidden=false, $includeadvanced=false) { + public function has_input_items($formpage=0, $returncount=false, $includehidden=false, $includereserved=false) { global $DB; $whereparams = array('surveyproid' => $this->surveypro->id, 'type' => SURVEYPRO_TYPEFIELD); @@ -109,8 +109,8 @@ public function has_input_items($formpage=0, $returncount=false, $includehidden= if (!$includehidden) { $whereclause['hidden'] = 0; } - if (!$includeadvanced) { - $whereclause['advanced'] = 0; + if (!$includereserved) { + $whereclause['reserved'] = 0; } if ($returncount) { @@ -387,7 +387,7 @@ public function delete_submissions($whereparams=null, $updatecompletion=true) { * @return void */ public function delete_answer($whereparams=null) { - global $DB, $COURSE; + global $DB; if (empty($whereparams)) { $whereparams = array(); diff --git a/classes/view_cover.class.php b/classes/view_cover.class.php index 55b0c6be9c3..0a2be0d052d 100644 --- a/classes/view_cover.class.php +++ b/classes/view_cover.class.php @@ -67,11 +67,11 @@ public function display_cover() { $cansavemastertemplates = has_capability('mod/surveypro:savemastertemplates', $this->context, null, true); $canapplymastertemplates = has_capability('mod/surveypro:applymastertemplates', $this->context, null, true); $canignoremaxentries = has_capability('mod/surveypro:ignoremaxentries', $this->context, null, true); - $canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $this->context, null, true); + $canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $this->context, null, true); $riskyediting = ($this->surveypro->riskyeditdeadline > time()); $hassubmissions = $utilityman->has_submissions(); - $itemcount = $utilityman->has_input_items(0, true, $canmanageitems, $canaccessadvanceditems); + $itemcount = $utilityman->has_input_items(0, true, $canmanageitems, $canaccessreserveditems); $messages = array(); $timenow = time(); @@ -121,7 +121,7 @@ public function display_cover() { if ($canmanageitems) { // If I $canmanageitems in $itemcount items counted were: visible + hidden. $message .= ' '; - $visibleonly = $utilityman->has_input_items(0, true, false, $canaccessadvanceditems); + $visibleonly = $utilityman->has_input_items(0, true, false, $canaccessreserveditems); $a = $itemcount - $visibleonly; $message .= get_string('count_hiddenitems', 'mod_surveypro', $a); } diff --git a/classes/view_export.class.php b/classes/view_export.class.php index 75de2d5b17b..d0876dee74d 100644 --- a/classes/view_export.class.php +++ b/classes/view_export.class.php @@ -105,8 +105,8 @@ public function export_get_sql($forceuserid=false) { if (!isset($this->formdata->includehidden)) { $sql .= ' AND (si.hidden = 0 OR ISNULL(si.hidden))'; } - if (!isset($this->formdata->includeadvanced)) { - $sql .= ' AND (si.advanced = 0 OR ISNULL(si.advanced))'; + if (!isset($this->formdata->includereserved)) { + $sql .= ' AND (si.reserved = 0 OR ISNULL(si.reserved))'; } if ($this->formdata->status != SURVEYPRO_STATUSALL) { $sql .= ' AND s.status = :status'; @@ -152,7 +152,7 @@ public function surveypro_export() { global $DB; // Do I need to filter groups? - $filtergroups = surveypro_need_group_filtering($this->cm, $this->context); + // $filtergroups = surveypro_need_group_filtering($this->cm, $this->context); if ($this->formdata->downloadtype == SURVEYPRO_FILESBYUSER) { if ($errorreturned = $this->attachments_downloadbyuser()) { @@ -247,8 +247,6 @@ public function export_to_csv($richsubmissions) { // $mygroups = groups_get_all_groups($course->id, $USER->id, $this->cm->groupingid); $oldsubmissionid = 0; - $strnever = get_string('never'); - foreach ($richsubmissions as $richsubmission) { if ($oldsubmissionid != $richsubmission->submissionid) { if (!empty($oldsubmissionid)) { // New richsubmissionid, stop managing old record. @@ -343,8 +341,6 @@ public function export_to_xls($richsubmissions) { // $mygroups = groups_get_all_groups($course->id, $USER->id, $this->cm->groupingid); $oldsubmissionid = 0; - $strnever = get_string('never'); - foreach ($richsubmissions as $richsubmission) { if ($oldsubmissionid != $richsubmission->submissionid) { if (!empty($oldsubmissionid)) { // New richsubmissionid, stop managing old record. @@ -389,8 +385,8 @@ public function export_get_field_list() { $where = array(); $where['surveyproid'] = $this->surveypro->id; $where['type'] = SURVEYPRO_TYPEFIELD; - if (!isset($this->formdata->includeadvanced)) { - $where['advanced'] = 0; + if (!isset($this->formdata->includereserved)) { + $where['reserved'] = 0; } if (!isset($this->formdata->includehide)) { $where['hidden'] = 0; diff --git a/classes/view_form.class.php b/classes/view_form.class.php index 46c959e4309..f554f64fa4d 100644 --- a/classes/view_form.class.php +++ b/classes/view_form.class.php @@ -113,9 +113,9 @@ public function set_formpage($formpage) { debugging('Error at line '.__LINE__.' of '.__FILE__.'. '.$message , DEBUG_DEVELOPER); } - $canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $this->context, null, true); + $canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $this->context, null, true); - if ($canaccessadvanceditems) { + if ($canaccessreserveditems) { $this->firstpageright = 1; } else { $this->next_not_empty_page(true, 0); // This sets $this->firstformpage. @@ -287,9 +287,9 @@ public function next_not_empty_page($rightdirection, $startingpage=null) { private function page_has_items($formpage) { global $CFG, $DB; - $canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $this->context, null, true); + $canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $this->context, null, true); - list($sql, $whereparams) = surveypro_fetch_items_seeds($this->surveypro->id, $canaccessadvanceditems, false, false, $formpage); + list($sql, $whereparams) = surveypro_fetch_items_seeds($this->surveypro->id, $canaccessreserveditems, false, false, $formpage); $itemseeds = $DB->get_records_sql($sql, $whereparams); // Start looking ONLY at empty($itemseed->parentid) because it doesn't involve extra queries. @@ -362,7 +362,7 @@ public function surveypro_add_custom_css() { global $PAGE; $fs = get_file_storage(); - if ($files = $fs->get_area_files($this->context->id, 'mod_surveypro', SURVEYPRO_STYLEFILEAREA, 0, 'sortorder', false)) { + if ($fs->get_area_files($this->context->id, 'mod_surveypro', SURVEYPRO_STYLEFILEAREA, 0, 'sortorder', false)) { $PAGE->requires->css('/mod/surveypro/userstyle.php?id='.$this->surveypro->id.'&cmid='.$this->cm->id); // Not overridable via themes! } } @@ -714,7 +714,7 @@ public function save_user_data() { private function check_mandatories_are_in() { global $CFG, $DB; - $canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $this->context, null, true); + $canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $this->context, null, true); // Begin of: get the list of all mandatory fields. $sql = 'SELECT MIN(id), plugin @@ -733,7 +733,7 @@ private function check_mandatories_are_in() { $itemcanbemandatory = $itemclass::item_get_can_be_mandatory(); if ($itemcanbemandatory) { - $sql = 'SELECT i.id, i.parentid, i.parentvalue, i.advanced, p.required + $sql = 'SELECT i.id, i.parentid, i.parentvalue, i.reserved, p.required FROM {surveypro_item} i JOIN {surveypro'.SURVEYPRO_TYPEFIELD.'_'.$plugin.'} p ON i.id = p.itemid WHERE i.surveyproid = :surveyproid @@ -744,10 +744,10 @@ private function check_mandatories_are_in() { foreach ($pluginitems as $pluginitem) { if ($pluginitem->required > 0) { - if ( (!$pluginitem->advanced) || $canaccessadvanceditems ) { + if ( (!$pluginitem->reserved) || $canaccessreserveditems ) { // Just to save few bits of RAM. unset ($pluginitem->required); - unset ($pluginitem->advanced); + unset ($pluginitem->reserved); $requireditems[$pluginitem->id] = $pluginitem; } @@ -1175,7 +1175,8 @@ private function drop_unexpected_values() { $childitem = surveypro_get_item($this->cm, $this->surveypro, $itemid, $type, $plugin); - if (empty($childitem->get_parentid())) { + $parentid = $childitem->get_parentid(); + if (empty($parentid)) { continue; } diff --git a/classes/view_import.class.php b/classes/view_import.class.php index 312f128677d..b627fc57ef6 100644 --- a/classes/view_import.class.php +++ b/classes/view_import.class.php @@ -382,7 +382,7 @@ public function import_csv() { $csvusesolddata = true; } - $recordcount = $cir->load_csv_content($csvcontent, $this->formdata->encoding, $this->formdata->csvdelimiter); + // $recordcount = $cir->load_csv_content($csvcontent, $this->formdata->encoding, $this->formdata->csvdelimiter); unset($csvcontent); // Start here 3 tests against general file configuration. @@ -582,7 +582,6 @@ public function import_csv() { // This means that the content reported in the csv for this column is supposed to be ALREADY a position. // Verify the content is REALLY a VALID position. $positions = explode(SURVEYPRO_DBMULTICONTENTSEPARATOR, $value); - $positionscount = count($positions); if ($debug) { echo 'I am at the line '.__LINE__.' of the file '.__FILE__.'
'; diff --git a/classes/view_submissions.class.php b/classes/view_submissions.class.php index 220690d88fb..5bff075cc53 100644 --- a/classes/view_submissions.class.php +++ b/classes/view_submissions.class.php @@ -74,10 +74,10 @@ public function __construct($cm, $context, $surveypro) { $this->surveypro = $surveypro; $canmanageitems = has_capability('mod/surveypro:manageitems', $this->context, null, true); - $canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $this->context, null, true); + $canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $this->context, null, true); $utilityman = new mod_surveypro_utility($cm, $surveypro); - $this->hasitems = $utilityman->has_input_items(0, false, $canmanageitems, $canaccessadvanceditems); + $this->hasitems = $utilityman->has_input_items(0, false, $canmanageitems, $canaccessreserveditems); } /** @@ -251,7 +251,7 @@ public function get_submissions_sql($table) { // Manage user selection. if ($this->searchquery) { // This will be re-send to URL for next page reload, whether requested with a sort, for instance. - $paramurl['searchquery'] = $this->searchquery; + $whereparams['searchquery'] = $this->searchquery; $searchrestrictions = unserialize($this->searchquery); @@ -472,7 +472,7 @@ public function one_submission_deletion_feedback() { * @return void */ public function all_submission_deletion_feedback() { - global $OUTPUT, $DB; + global $OUTPUT; switch ($this->confirm) { case SURVEYPRO_UNCONFIRMED: @@ -1120,7 +1120,7 @@ private function prevent_direct_user_input($confirm) { $groupmode = groups_get_activity_groupmode($this->cm, $COURSE); if ($groupmode == SEPARATEGROUPS) { $mygroupmates = surveypro_groupmates($this->cm); - $groupuser = in_array($submission->userid, $mygroupmates); + $groupuser = in_array($ownerid, $mygroupmates); } } } @@ -1216,14 +1216,12 @@ private function submission_to_pdf() { require_once($CFG->libdir.'/tcpdf/tcpdf.php'); require_once($CFG->libdir.'/tcpdf/config/tcpdf_config.php'); - $emptyanswer = get_string('notanswereditem', 'mod_surveypro'); - $submission = $DB->get_record('surveypro_submission', array('id' => $this->submissionid)); $user = $DB->get_record('user', array('id' => $submission->userid)); $userdatarecord = $DB->get_records('surveypro_answer', array('submissionid' => $this->submissionid), '', 'itemid, id, content'); - $canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $this->context, $user->id, true); - list($sql, $whereparams) = surveypro_fetch_items_seeds($this->surveypro->id, $canaccessadvanceditems, false); + $canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $this->context, $user->id, true); + list($sql, $whereparams) = surveypro_fetch_items_seeds($this->surveypro->id, $canaccessreserveditems, false); // I am not allowed to get ONLY answers from surveypro_answer // because I also need to gather info about fieldset and label so: diff --git a/db/access.php b/db/access.php index 0436543cc8a..2a2586c7532 100644 --- a/db/access.php +++ b/db/access.php @@ -81,7 +81,7 @@ * SUB-TAB == SURVEYPRO_SUBMISSION_INSERT * $elementurl = new moodle_url('/mod/surveypro/view_form.php', $paramurl); * mod/surveypro:view - * mod/surveypro:accessadvanceditems + * mod/surveypro:accessreserveditems * mod/surveypro:submit * mod/surveypro:ignoremaxentries * @@ -194,7 +194,7 @@ ) ), - 'mod/surveypro:accessadvanceditems' => array( + 'mod/surveypro:accessreserveditems' => array( 'captype' => 'read', 'contextlevel' => CONTEXT_MODULE, @@ -202,7 +202,9 @@ 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, 'manager' => CAP_ALLOW - ) + ), + + 'clonepermissionsfrom' => 'mod/surveypro:accessadvanceditems' ), 'mod/surveypro:submit' => array( diff --git a/db/install.xml b/db/install.xml index ce5933af911..7a9fd124ab2 100644 --- a/db/install.xml +++ b/db/install.xml @@ -44,7 +44,7 @@ - + diff --git a/db/uninstall.php b/db/uninstall.php index 4f155e274fd..82025a25fd5 100644 --- a/db/uninstall.php +++ b/db/uninstall.php @@ -23,19 +23,3 @@ * copyright 2011 kordan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - -defined('MOODLE_INTERNAL') || die(); - -/** - * This is called at the beginning of the uninstallation process to give the module - * a chance to clean-up its hacks, bits etc. where possible. - * - * @return bool true if success - */ -function mod_surveypro_uninstall() { - global $DB; - - $dbman = $DB->get_manager(); - - return true; -} diff --git a/db/upgrade.php b/db/upgrade.php index 62e90dcc95c..a2848b69f59 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -124,5 +124,18 @@ function xmldb_surveypro_upgrade($oldversion) { upgrade_mod_savepoint(true, 2015112301, 'surveypro'); } + if ($oldversion < 2016031501) { + + // Rename field advanced on table surveypro_item to reserved. + $table = new xmldb_table('surveypro_item'); + $field = new xmldb_field('advanced', XMLDB_TYPE_INTEGER, '4', null, null, null, null, 'insearchform'); + + // Launch rename field advanced. + $dbman->rename_field($table, $field, 'reserved'); + + // Surveypro savepoint reached. + upgrade_mod_savepoint(true, 2016031501, 'surveypro'); + } + return true; } diff --git a/field/age/form/plugin_form.php b/field/age/form/plugin_form.php index 712efb1e6a9..e3de7671357 100644 --- a/field/age/form/plugin_form.php +++ b/field/age/form/plugin_form.php @@ -41,11 +41,10 @@ public function definition() { $mform = $this->_form; // Get _customdata. - $item = $this->_customdata->item; + // $item = $this->_customdata->item; // $surveypro = $this->_customdata->surveypro; $maximumage = get_config('surveyprofield_age', 'maximumage'); - $format = get_string('strftimemonthyear', 'langconfig'); $years = array_combine(range(0, $maximumage), range(0, $maximumage)); $months = array_combine(range(0, 11), range(0, 11)); diff --git a/field/age/tests/behat/use_advanced_elements.feature b/field/age/tests/behat/use_advanced_elements.feature index 39ec3febc50..23cfe62cba2 100644 --- a/field/age/tests/behat/use_advanced_elements.feature +++ b/field/age/tests/behat/use_advanced_elements.feature @@ -1,11 +1,11 @@ @mod @mod_surveypro @surveyprofield @surveyprofield_age -Feature: test the use of advanced elements - In order to test advanced elements are only seen by teacher and not students +Feature: test the use of reserved elements + In order to test reserved elements are only seen by teacher and not students As a teacher and student I add two items with different availability and go to fill the corresponding survey and edit it @javascript - Scenario: use advanced elements + Scenario: use reserved elements Given the following "courses" exist: | fullname | shortname | category | groupmode | | Advanced elements | Advanced elements | 0 | 0 | @@ -19,7 +19,7 @@ Feature: test the use of advanced elements | student1 | Advanced elements | student | And the following "activities" exist: | activity | name | intro | course | idnumber | - | surveypro | Advanced element test | To test advanced element | Advanced elements | surveypro1 | + | surveypro | Advanced element test | To test reserved element | Advanced elements | surveypro1 | And I log in as "teacher1" And I follow "Advanced elements" And I follow "Advanced element test" @@ -41,7 +41,7 @@ Feature: test the use of advanced elements | id_defaultvalue_month | 4 | And I press "Add" - # add the second age item (as advanced element) + # add the second age item (as reserved element) And I set the field "typeplugin" to "Age [yy/mm]" And I press "Add" diff --git a/field/autofill/classes/plugin.class.php b/field/autofill/classes/plugin.class.php index 038c4f520ef..f3a19f3b9bb 100644 --- a/field/autofill/classes/plugin.class.php +++ b/field/autofill/classes/plugin.class.php @@ -224,7 +224,6 @@ public function item_custom_fields_to_form() { $referencearray[] = constant('SURVEYPROFIELD_AUTOFILL_CONTENTELEMENT'.sprintf('%02d', $i)); } - $items = array(); for ($i = 1; $i < 6; $i++) { $index = sprintf('%02d', $i); $fieldname = 'element'.$index.'_select'; @@ -410,8 +409,6 @@ public function userform_mform_validation($data, &$errors, $surveypro, $searchfo * @return void */ public function userform_save_preprocessing($answer, $olduseranswer, $searchform) { - global $DB; - if ($searchform) { if (isset($answer['ignoreme'])) { $olduseranswer->content = null; diff --git a/field/autofill/form/plugin_form.php b/field/autofill/form/plugin_form.php index 888848fbef0..55b84ab035a 100644 --- a/field/autofill/form/plugin_form.php +++ b/field/autofill/form/plugin_form.php @@ -86,7 +86,6 @@ public function validation($data, $files) { $errors = parent::validation($data, $files); - $uniontext = ''; $constantname = 'SURVEYPROFIELD_AUTOFILL_CONTENTELEMENT'.SURVEYPROFIELD_AUTOFILL_CONTENTELEMENT_COUNT; for ($i = 1; $i < 6; $i++) { $index = sprintf('%02d', $i); diff --git a/field/boolean/classes/plugin.class.php b/field/boolean/classes/plugin.class.php index 3888a1eec11..a3225e2a9c4 100644 --- a/field/boolean/classes/plugin.class.php +++ b/field/boolean/classes/plugin.class.php @@ -639,7 +639,7 @@ public function userform_get_parent_disabilitation_info($childparentvalue) { // Only garbage but user wrote it. if ($labelsubset) { - foreach ($labelsubset as $k => $label) { + foreach ($labelsubset as $label) { $mformelementinfo = new stdClass(); $mformelementinfo->parentname = $this->itemname; $mformelementinfo->operator = 'neq'; diff --git a/field/character/db/upgradelib.php b/field/character/db/upgradelib.php index 51a0570e30d..8a08a950bec 100644 --- a/field/character/db/upgradelib.php +++ b/field/character/db/upgradelib.php @@ -22,17 +22,3 @@ * @copyright 2013 onwards kordan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - -/** - * Performs upgrade of the database structure and data - * - * @param int $oldversion the version we are upgrading from - * @return bool true - */ -function xmldb_surveyprofield_character_upgrade($oldversion) { - global $DB; - - $dbman = $DB->get_manager(); - - return true; -} \ No newline at end of file diff --git a/field/checkbox/classes/plugin.class.php b/field/checkbox/classes/plugin.class.php index 80ab08d782e..935183115e6 100644 --- a/field/checkbox/classes/plugin.class.php +++ b/field/checkbox/classes/plugin.class.php @@ -488,7 +488,7 @@ public function userform_mform_element($mform, $searchform, $readonly=false, $su $elementgroup = array(); $i = 0; - foreach ($labels as $value => $label) { + foreach ($labels as $label) { $uniqueid = $this->itemname.'_'.$i; $attributes['id'] = $idprefix.'_'.$i; $elementgroup[] = $mform->createElement('mod_surveypro_advcheckbox', $uniqueid, '', $label, $attributes, array('0', '1')); @@ -607,7 +607,7 @@ public function userform_mform_validation($data, &$errors, $surveypro, $searchfo $labels = $this->item_get_content_array(SURVEYPRO_LABELS, 'options'); $answercount = 0; - foreach ($labels as $k => $label) { + foreach ($labels as $k => $unused) { $uniqueid = $this->itemname.'_'.$k; if ($data[$uniqueid]) { // They are advanced checkbox so I am sure the answer always exist. $answercount++; @@ -654,7 +654,7 @@ public function userform_get_parent_disabilitation_info($childparentvalue) { } if ($indexsubset) { - foreach ($indexsubset as $k => $index) { + foreach ($indexsubset as $k => $unused) { $mformelementinfo = new stdClass(); $mformelementinfo->parentname = $this->itemname.'_'.$k; if ($indexsubset[$k] == 1) { @@ -715,7 +715,7 @@ public function userform_child_item_allowed_dynamic($childparentvalue, $data) { $parentvalues = explode(SURVEYPRO_DBMULTICONTENTSEPARATOR, $childparentvalue); // 2;3;shark. $status = true; - foreach ($labels as $k => $label) { + foreach ($labels as $k => $unused) { $key = array_search($k, $parentvalues); if ($key !== false) { $status = $status && (isset($data[$this->itemname.'_'.$k])); diff --git a/field/checkbox/form/plugin_form.php b/field/checkbox/form/plugin_form.php index 4ff36df7955..8556c9eeef4 100644 --- a/field/checkbox/form/plugin_form.php +++ b/field/checkbox/form/plugin_form.php @@ -174,7 +174,7 @@ public function validation($data, $files) { } $arrayunique = array_unique($cleandefaultvalue); if (count($cleandefaultvalue) != count($arrayunique)) { - $errors['defaultvalue'] = get_string('ierr_optionduplicated', 'surveyprofield_checkbox', $default); + $errors['defaultvalue'] = get_string('ierr_defaultsduplicated', 'surveyprofield_checkbox'); } // Fourth check. diff --git a/field/checkbox/lang/en/surveyprofield_checkbox.php b/field/checkbox/lang/en/surveyprofield_checkbox.php index f2dffaf1644..98c633e6736 100644 --- a/field/checkbox/lang/en/surveyprofield_checkbox.php +++ b/field/checkbox/lang/en/surveyprofield_checkbox.php @@ -35,8 +35,8 @@ $string['horizontal'] = 'horizontal'; $string['ierr_foreigndefaultvalue'] = 'The default item "{$a}" was not found among options'; $string['ierr_minimumrequired'] = 'The minimum number of checkboxes to select must be lower than {$a}'; -$string['ierr_optionduplicated'] = 'At least one option is duplicated'; -$string['ierr_optionsduplicated'] = 'At least one option is duplicated'; +$string['ierr_optionduplicated'] = 'Defaults must be unique'; +$string['ierr_optionsduplicated'] = 'Options must be unique'; $string['ierr_optionswithseparator'] = 'Options can not contain "{$a}"'; $string['labelother_help'] = 'If this question is equipped with the option "other" followed by a text field, enter here the label for that option. You can choose to write this option with the format: label'.SURVEYPRO_OTHERSEPARATOR.'value. The label will be displayed on the screen, the value will be used as default for the text field. If you only specify one word, the field default will be neglected.'; $string['labelother'] = 'Option "other"'; diff --git a/field/fileupload/classes/mform_filemanager.php b/field/fileupload/classes/mform_filemanager.php index 9c5610e3528..f95b9e41e0e 100644 --- a/field/fileupload/classes/mform_filemanager.php +++ b/field/fileupload/classes/mform_filemanager.php @@ -81,9 +81,9 @@ public function getFrozenHtml() { require_once("$CFG->dirroot/repository/lib.php"); $id = $this->_attributes['id']; - $elname = $this->_attributes['name']; - $subdirs = $this->_options['subdirs']; - $maxbytes = $this->_options['maxbytes']; + // $elname = $this->_attributes['name']; + // $subdirs = $this->_options['subdirs']; + // $maxbytes = $this->_options['maxbytes']; $draftitemid = $this->getValue(); $accepted_types = $this->_options['accepted_types']; @@ -117,7 +117,7 @@ public function getFrozenHtml() { $return = ''; $attachmentcount = count($fm->options->list); $attachmentcount -= 1; - foreach ($fm->options->list as $k => $list) { + foreach ($fm->options->list as $list) { $return .= html_writer::start_tag('div', array('class' => $class)); // $return .= ''; diff --git a/field/fileupload/classes/plugin.class.php b/field/fileupload/classes/plugin.class.php index b9b2178413d..281dca8d90f 100644 --- a/field/fileupload/classes/plugin.class.php +++ b/field/fileupload/classes/plugin.class.php @@ -360,7 +360,6 @@ public function userform_get_filling_instructions() { public function userform_save_preprocessing($answer, $olduseranswer, $searchform) { if (!empty($answer)) { $context = context_module::instance($this->cm->id); - $fieldname = $this->itemname.'_filemanager'; $attributes = array(); $attributes['maxbytes'] = $this->maxbytes; diff --git a/field/fileupload/form/plugin_form.php b/field/fileupload/form/plugin_form.php index 5cb5f9225c1..5a6f8d63284 100644 --- a/field/fileupload/form/plugin_form.php +++ b/field/fileupload/form/plugin_form.php @@ -96,7 +96,6 @@ public function validation($data, $files) { $errors['filetypes'] = get_string('ierr_extensionmissingdot', 'surveyprofield_fileupload'); break; } - $testtype = str_replace('.', '', $filetype, $count); if ($count > 1) { $errors['filetypes'] = get_string('ierr_extensiononlyonedot', 'surveyprofield_fileupload'); break; diff --git a/field/integer/classes/plugin.class.php b/field/integer/classes/plugin.class.php index ff531cfe1b1..7f684e1b3c6 100644 --- a/field/integer/classes/plugin.class.php +++ b/field/integer/classes/plugin.class.php @@ -541,7 +541,6 @@ public function userform_get_filling_instructions() { $haslowerbound = ($this->lowerbound != 0); $hasupperbound = ($this->upperbound != get_config('surveyprofield_integer', 'maximuminteger')); - $format = get_string('strftimedate', 'langconfig'); if ($haslowerbound && $hasupperbound) { $a = new stdClass(); $a->lowerbound = $this->lowerbound; diff --git a/field/multiselect/classes/plugin.class.php b/field/multiselect/classes/plugin.class.php index 70653902aea..ffbc1566835 100644 --- a/field/multiselect/classes/plugin.class.php +++ b/field/multiselect/classes/plugin.class.php @@ -636,7 +636,7 @@ public function userform_child_item_allowed_dynamic($childparentvalue, $data) { $parentvalues = explode(SURVEYPRO_DBMULTICONTENTSEPARATOR, $childparentvalue); // 2;3 $status = true; - foreach ($labels as $k => $label) { + foreach ($labels as $k => $unused) { $key = array_search($k, $parentvalues); if ($key !== false) { $status = $status && (isset($data[$this->itemname.'_'.$k])); diff --git a/field/multiselect/form/plugin_form.php b/field/multiselect/form/plugin_form.php index 6a58d6d5409..425ba7524e5 100644 --- a/field/multiselect/form/plugin_form.php +++ b/field/multiselect/form/plugin_form.php @@ -144,7 +144,7 @@ public function validation($data, $files) { } $arrayunique = array_unique($cleandefaultvalue); if (count($cleandefaultvalue) != count($arrayunique)) { - $errors['defaultvalue'] = get_string('ierr_optionduplicated', 'surveyprofield_multiselect', $default); + $errors['defaultvalue'] = get_string('ierr_defaultsduplicated', 'surveyprofield_multiselect'); } // Third check. diff --git a/field/multiselect/lang/en/surveyprofield_multiselect.php b/field/multiselect/lang/en/surveyprofield_multiselect.php index f8027d08d0e..02f280fb068 100644 --- a/field/multiselect/lang/en/surveyprofield_multiselect.php +++ b/field/multiselect/lang/en/surveyprofield_multiselect.php @@ -34,8 +34,8 @@ $string['heightinrows'] = 'Height in rows'; $string['ierr_foreigndefaultvalue'] = 'The default item "{$a}" was not found among options'; $string['ierr_minimumrequired'] = 'The minimum number of items to select must be lower than {$a}'; -$string['ierr_optionduplicated'] = 'At least one option is duplicated'; -$string['ierr_optionsduplicated'] = 'At least one option is duplicated'; +$string['ierr_defaultsduplicated'] = 'Defaults must be unique'; +$string['ierr_optionsduplicated'] = 'Options must be unique'; $string['ierr_optionswithseparator'] = 'Options can not contain "{$a}"'; $string['minimumrequired_help'] = 'The minimum number of items the user is forced to choose in his/her answer'; $string['minimumrequired'] = 'Minimum required items'; diff --git a/field/numeric/classes/plugin.class.php b/field/numeric/classes/plugin.class.php index f5eb7254e4e..a215c62de58 100644 --- a/field/numeric/classes/plugin.class.php +++ b/field/numeric/classes/plugin.class.php @@ -464,7 +464,6 @@ public function userform_mform_validation($data, &$errors, $surveypro, $searchfo if ($this->lowerbound > $this->upperbound) { // External range. if (($userinput > $this->lowerbound) && ($userinput < $this->upperbound)) { - $format = get_string($this->item_get_friendlyformat(), 'surveyprofield_numeric'); $a = new stdClass(); $a->lowerbound = $this->lowerbound; $a->upperbound = $this->upperbound; diff --git a/field/radiobutton/lang/en/surveyprofield_radiobutton.php b/field/radiobutton/lang/en/surveyprofield_radiobutton.php index 54ef10c69b5..e6bd1521e96 100644 --- a/field/radiobutton/lang/en/surveyprofield_radiobutton.php +++ b/field/radiobutton/lang/en/surveyprofield_radiobutton.php @@ -36,7 +36,7 @@ $string['horizontal'] = 'horizontal'; $string['ierr_foreigndefaultvalue'] = 'The default item "{$a}" was not found among options'; $string['ierr_missingdefault'] = 'Custom default is missing. You may like to choose the "{$a}" one.'; -$string['ierr_optionsduplicated'] = 'Options can not be repeated'; +$string['ierr_optionsduplicated'] = 'Options must be unique'; $string['labelother_help'] = 'If this question is equipped with the option "other" followed by a text field, enter here the label for that option. You can choose to write this option with the format: label'.SURVEYPRO_OTHERSEPARATOR.'value. The label will be displayed on the screen, the value will be used as default for the text field. If you only specify one word, the field default will be neglected.'; $string['labelother'] = 'Option "other"'; $string['option'] = 'Option'; diff --git a/field/rate/classes/plugin.class.php b/field/rate/classes/plugin.class.php index c9b98e7f96d..c74036b562f 100644 --- a/field/rate/classes/plugin.class.php +++ b/field/rate/classes/plugin.class.php @@ -286,7 +286,7 @@ public function item_generate_standard_default($options=null, $rates=null, $diff $ratesarray = surveypro_textarea_to_array($rates); if ($differentrates) { $default = array(); - foreach ($ratesarray as $k => $singlerate) { + foreach ($ratesarray as $singlerate) { if (strpos($singlerate, SURVEYPRO_VALUELABELSEPARATOR) === false) { $defaultrate = $singlerate; } else { @@ -517,9 +517,8 @@ public function userform_mform_validation($data, &$errors, $surveypro, $searchfo return; // Nothing to validate. } - $optionindex = 0; $return = false; - foreach ($options as $option) { + foreach ($options as $optionindex => $unused) { $uniquename = $this->itemname.'_'.$optionindex; if ($data[$uniquename] == SURVEYPRO_INVITEVALUE) { if ($this->style == SURVEYPROFIELD_RATE_USERADIO) { @@ -530,7 +529,6 @@ public function userform_mform_validation($data, &$errors, $surveypro, $searchfo $errors[$elementname] = get_string('uerr_optionnotset', 'surveyprofield_rate'); $return = true; } - $optionindex++; } if ($return) { return; @@ -546,7 +544,7 @@ public function userform_mform_validation($data, &$errors, $surveypro, $searchfo $uniquerates = array_unique($rates); $duplicaterates = array_diff_assoc($rates, $uniquerates); - foreach ($duplicaterates as $k => $v) { + foreach ($duplicaterates as $k => $unused) { if ($this->style == SURVEYPROFIELD_RATE_USERADIO) { $elementname = $this->itemname.'_'.$k.'_group'; } else { @@ -623,7 +621,7 @@ public function userform_set_prefill($fromdb) { } else { $answers = explode(SURVEYPRO_DBMULTICONTENTSEPARATOR, $fromdb->content); - foreach ($answers as $optionindex => $value) { + foreach ($answers as $optionindex => $unused) { $uniquename = $this->itemname.'_'.$optionindex; $prefill[$uniquename] = $answers[$optionindex]; } diff --git a/field/rate/form/plugin_form.php b/field/rate/form/plugin_form.php index a8bbcde7ec1..6764760a669 100644 --- a/field/rate/form/plugin_form.php +++ b/field/rate/form/plugin_form.php @@ -173,7 +173,7 @@ public function validation($data, $files) { if ($data['defaultoption'] == SURVEYPRO_CUSTOMDEFAULT) { // If I claim for different rates, I have to respect the constraint in the default. if (count($cleandefaultvalue) > count(array_unique($cleandefaultvalue))) { - $errors['defaultvalue_group'] = get_string('ierr_optionduplicated', 'surveyprofield_rate'); + $errors['defaultvalue_group'] = get_string('ierr_defaultsduplicated', 'surveyprofield_rate'); } } } diff --git a/field/rate/lang/en/surveyprofield_rate.php b/field/rate/lang/en/surveyprofield_rate.php index b7faab5ae0f..c5294867fcf 100644 --- a/field/rate/lang/en/surveyprofield_rate.php +++ b/field/rate/lang/en/surveyprofield_rate.php @@ -36,7 +36,7 @@ $string['ierr_foreigndefaultvalue'] = 'The default item "{$a}" was not found among rates'; $string['ierr_invaliddefaultscount'] = 'Number of defaults has to be equal to the number of options'; $string['ierr_notenoughrates'] = 'Number of rates is not enough to force different rates'; -$string['ierr_optionduplicated'] = 'Defaults have to be different when different rates is required'; +$string['ierr_defaultsduplicated'] = 'Defaults have to be different when different rates is required'; $string['options_help'] = 'The list of the options for this item.'; $string['options'] = 'Options'; $string['pluginname'] = 'Rate'; diff --git a/field/recurrence/classes/plugin.class.php b/field/recurrence/classes/plugin.class.php index ded199f617d..e943eb28526 100644 --- a/field/recurrence/classes/plugin.class.php +++ b/field/recurrence/classes/plugin.class.php @@ -569,7 +569,6 @@ public function userform_mform_validation($data, &$errors, $surveypro, $searchfo $userinput = $this->item_recurrence_to_unix_time($data[$this->itemname.'_month'], $data[$this->itemname.'_day']); - $format = get_string('strftimedateshort', 'langconfig'); if ($haslowerbound && $hasupperbound) { // Internal range. if ( ($userinput < $this->lowerbound) || ($userinput > $this->upperbound) ) { diff --git a/field/recurrence/form/plugin_form.php b/field/recurrence/form/plugin_form.php index 817cca4c67c..b91ce997f26 100644 --- a/field/recurrence/form/plugin_form.php +++ b/field/recurrence/form/plugin_form.php @@ -54,7 +54,6 @@ public function definition() { for ($i = 1; $i <= 12; $i++) { $months[$i] = userdate(gmmktime(12, 0, 0, $i, 1, 2000), "%B", 0); // January, February, March... } - $years = array_combine(range($startyear, $stopyear), range($startyear, $stopyear)); $elementgroup = array(); $elementgroup[] = $mform->createElement('radio', 'defaultoption', '', get_string('customdefault', 'surveyprofield_recurrence'), SURVEYPRO_CUSTOMDEFAULT); diff --git a/field/select/classes/plugin.class.php b/field/select/classes/plugin.class.php index d5cc0b56f64..7e47f983220 100644 --- a/field/select/classes/plugin.class.php +++ b/field/select/classes/plugin.class.php @@ -615,7 +615,7 @@ public function userform_get_parent_disabilitation_info($childparentvalue) { } if ($labelsubset) { - foreach ($labelsubset as $k => $label) { + foreach ($labelsubset as $k => $unused) { // Only garbage after the first label, but user wrote it. if (!empty($this->labelother)) { $mformelementinfo = new stdClass(); diff --git a/field/select/form/plugin_form.php b/field/select/form/plugin_form.php index 1bec3990946..841094d83c1 100644 --- a/field/select/form/plugin_form.php +++ b/field/select/form/plugin_form.php @@ -154,7 +154,7 @@ public function validation($data, $files) { // Each single option item has to be unique. $arrayunique = array_unique($cleanoptions); if (count($cleanoptions) != count($arrayunique)) { - $errors['options'] = get_string('ierr_optionsduplicated', 'mod_surveypro', $default); + $errors['options'] = get_string('ierr_optionsduplicated', 'surveyprofield_select'); } } } diff --git a/field/select/lang/en/surveyprofield_select.php b/field/select/lang/en/surveyprofield_select.php index c61c8649fb2..a4daf48d613 100644 --- a/field/select/lang/en/surveyprofield_select.php +++ b/field/select/lang/en/surveyprofield_select.php @@ -33,7 +33,7 @@ $string['downloadformat'] = 'Download format'; $string['ierr_foreigndefaultvalue'] = 'The default item "{$a}" was not found among options'; $string['ierr_missingdefault'] = 'Custom default is missing. You may like to choose the "{$a}" one.'; -$string['ierr_optionsduplicated'] = 'Options can not be repeated'; +$string['ierr_optionsduplicated'] = 'Options must be unique'; $string['labelother_help'] = 'If this question is equipped with the option "other" followed by a text field, enter here the label for that option. You can choose to write this option with the format: label'.SURVEYPRO_OTHERSEPARATOR.'value. The label will be displayed on the screen, the value will be used as default for the text field. If you only specify one word, the field default will be neglected.'; $string['labelother'] = 'Option "other"'; $string['option'] = 'Option'; diff --git a/field/shortdate/form/plugin_form.php b/field/shortdate/form/plugin_form.php index 1896e8d4a9c..1e063aacaf9 100644 --- a/field/shortdate/form/plugin_form.php +++ b/field/shortdate/form/plugin_form.php @@ -47,8 +47,6 @@ public function definition() { $startyear = $this->_customdata->surveypro->startyear; $stopyear = $this->_customdata->surveypro->stopyear; - $format = get_string('strftimemonthyear', 'langconfig'); - // Item: defaultoption. $fieldname = 'defaultoption'; $months = array(); diff --git a/form/data/export_form.php b/form/data/export_form.php index 691d7e8ac49..024b4838506 100644 --- a/form/data/export_form.php +++ b/form/data/export_form.php @@ -89,9 +89,9 @@ public function definition() { $mform->addElement('checkbox', $fieldname, get_string($fieldname, 'mod_surveypro')); $mform->setType($fieldname, PARAM_INT); - // Submissionexport: includeadvanced. - $fieldname = 'includeadvanced'; - if (has_capability('mod/surveypro:accessadvanceditems', $context)) { + // Submissionexport: includereserved. + $fieldname = 'includereserved'; + if (has_capability('mod/surveypro:accessreserveditems', $context)) { $mform->addElement('checkbox', $fieldname, get_string($fieldname, 'mod_surveypro')); } else { $mform->addElement('hidden', $fieldname, 0); diff --git a/form/items/itembase_form.php b/form/items/itembase_form.php index 84f8c78d19f..5eef8ac5374 100644 --- a/form/items/itembase_form.php +++ b/form/items/itembase_form.php @@ -107,7 +107,7 @@ public function definition() { // Itembase: position. $fieldname = 'position'; - if ($position = $item->get_insetupform($fieldname)) { + if ($item->get_insetupform($fieldname)) { $options = array(); $default = SURVEYPRO_POSITIONTOP; if ($item->item_left_position_allowed()) { // Position can even be SURVEYPRO_POSITIONLEFT. @@ -177,8 +177,8 @@ public function definition() { $mform->setType($fieldname, PARAM_INT); } - // Itembase: advanced. - $fieldname = 'advanced'; + // Itembase: reserved. + $fieldname = 'reserved'; if ($item->get_insetupform($fieldname)) { $mform->addElement('checkbox', $fieldname, get_string($fieldname, 'mod_surveypro')); $mform->addHelpButton($fieldname, $fieldname, 'surveypro'); @@ -195,7 +195,7 @@ public function definition() { // Create the list of each item with: // sortindex lower than mine (whether already exists); // $classname::item_get_canbeparent() == true; - // advanced == my one <-- I omit this verification because the surveypro creator can, at every time, change the availability of the current item + // reserved == my one <-- I omit this verification because the surveypro creator can, at every time, change the availability of the current item // So I move the verification of the holding form at the form verification time. // Build the list only for searchable plugins. @@ -225,7 +225,7 @@ public function definition() { $select->addOption(get_string('choosedots'), 0); foreach ($parentsseeds as $parentsseed) { $parentitem = surveypro_get_item($cm, $surveypro, $parentsseed->id, $parentsseed->type, $parentsseed->plugin); - $star = ($parentitem->get_advanced()) ? '(*) ' : ''; + $star = ($parentitem->get_reserved()) ? '(*) ' : ''; // I do not need to take care of contents of items of master templates because if I am here, $parent is a standard item and not a multilang one $content = $star; diff --git a/form/mtemplates/apply_form.php b/form/mtemplates/apply_form.php index 268fc3d842c..62bcf17df6e 100644 --- a/form/mtemplates/apply_form.php +++ b/form/mtemplates/apply_form.php @@ -87,7 +87,7 @@ public function validation($data, $files) { // Get _customdata. $mtemplateman = $this->_customdata->mtemplateman; - $inline = $this->_customdata->inline; + // $inline = $this->_customdata->inline; $errors = parent::validation($data, $files); diff --git a/form/outform/fill_form.php b/form/outform/fill_form.php index ac16f3ee3d5..a48b67be90f 100644 --- a/form/outform/fill_form.php +++ b/form/outform/fill_form.php @@ -42,7 +42,7 @@ public function definition() { $surveypro = $this->_customdata->surveypro; $submissionid = $this->_customdata->submissionid; $maxassignedpage = $this->_customdata->maxassignedpage; - $canaccessadvanceditems = $this->_customdata->canaccessadvanceditems; + $canaccessreserveditems = $this->_customdata->canaccessreserveditems; $formpage = $this->_customdata->formpage; $modulepage = $this->_customdata->modulepage; $readonly = $this->_customdata->readonly; // I see a form (record) that is not mine. @@ -65,7 +65,7 @@ public function definition() { $mform->setType('formpage', PARAM_INT); if ($formpage == SURVEYPRO_LEFT_OVERFLOW) { - $mform->addElement('static', 'nomoreitems', get_string('note', 'mod_surveypro'), get_string('onlyadvanceditemhere', 'mod_surveypro')); + $mform->addElement('static', 'nomoreitems', get_string('note', 'mod_surveypro'), get_string('onlyreserveditemhere', 'mod_surveypro')); // $mform->addElement('static', 'nomoreitems', get_string('note', 'mod_surveypro'), 'SURVEYPRO_LEFT_OVERFLOW'); } @@ -76,8 +76,8 @@ public function definition() { } if ($formpage >= 0) { - // $canaccessadvanceditems, $searchform=false, $type=false, $formpage - list($sql, $whereparams) = surveypro_fetch_items_seeds($surveypro->id, $canaccessadvanceditems, false, false, $formpage); + // $canaccessreserveditems, $searchform=false, $type=false, $formpage + list($sql, $whereparams) = surveypro_fetch_items_seeds($surveypro->id, $canaccessreserveditems, false, false, $formpage); $itemseeds = $DB->get_recordset_sql($sql, $whereparams); if (!$itemseeds->valid()) { @@ -86,8 +86,6 @@ public function definition() { $mform->addElement('static', 'noitemshere', get_string('note', 'mod_surveypro'), 'ERROR: How can I be here if ($formpage > 0) ?'); } - $context = context_module::instance($cm->id); - // This dummy item is needed for the colours alternation. // Because 'label' or ($position == SURVEYPRO_POSITIONFULLWIDTH) // as first item are out from the a fieldset @@ -173,7 +171,7 @@ public function definition() { } if (!$surveypro->newpageforchild) { - $item->userform_add_disabledif($mform, $canaccessadvanceditems); + $item->userform_add_disabledif($mform, $canaccessreserveditems); } } } @@ -253,12 +251,12 @@ public function validation($data, $files) { // Get _customdata. $cm = $this->_customdata->cm; - $modulepage = $this->_customdata->modulepage; + // $modulepage = $this->_customdata->modulepage; $surveypro = $this->_customdata->surveypro; - $submissionid = $this->_customdata->submissionid; - $formpage = $this->_customdata->formpage; - $maxassignedpage = $this->_customdata->maxassignedpage; - $canaccessadvanceditems = $this->_customdata->canaccessadvanceditems; + // $submissionid = $this->_customdata->submissionid; + // $formpage = $this->_customdata->formpage; + // $maxassignedpage = $this->_customdata->maxassignedpage; + // $canaccessreserveditems = $this->_customdata->canaccessreserveditems; // $readonly = $this->_customdata->readonly; // I see a form (record) that is not mine $preview = $this->_customdata->preview; // Are we in preview mode? @@ -272,7 +270,7 @@ public function validation($data, $files) { // Validate an item only if is enabled, alias: only if it matches the parent value $regexp = '~('.SURVEYPRO_ITEMPREFIX.'|'.SURVEYPRO_DONTSAVEMEPREFIX.')_('.SURVEYPRO_TYPEFIELD.'|'.SURVEYPRO_TYPEFORMAT.')_([a-z]+)_([0-9]+)_?([a-z0-9]+)?~'; $olditemid = 0; - foreach ($data as $itemname => $v) { + foreach ($data as $itemname => $unused) { if (preg_match($regexp, $itemname, $matches)) { $type = $matches[2]; // Item type. $plugin = $matches[3]; // Item plugin. diff --git a/form/outform/search_form.php b/form/outform/search_form.php index e0364c0a78f..2f7a432e812 100644 --- a/form/outform/search_form.php +++ b/form/outform/search_form.php @@ -40,14 +40,12 @@ public function definition() { // Get _customdata. $cm = $this->_customdata->cm; $surveypro = $this->_customdata->surveypro; - $canaccessadvanceditems = $this->_customdata->canaccessadvanceditems; + $canaccessreserveditems = $this->_customdata->canaccessreserveditems; - // $canaccessadvanceditems, $searchform=true, $type=false, $formpage=false - list($sql, $whereparams) = surveypro_fetch_items_seeds($surveypro->id, $canaccessadvanceditems, true); + // $canaccessreserveditems, $searchform=true, $type=false, $formpage=false + list($sql, $whereparams) = surveypro_fetch_items_seeds($surveypro->id, $canaccessreserveditems, true); $itemseeds = $DB->get_recordset_sql($sql, $whereparams); - $context = context_module::instance($cm->id); - // This dummy item is needed for the colours alternation. // Because 'label' or ($position == SURVEYPRO_POSITIONFULLWIDTH). // as first item are out from the a fieldset @@ -127,14 +125,14 @@ public function validation($data, $files) { // Get _customdata. $cm = $this->_customdata->cm; $surveypro = $this->_customdata->surveypro; - // $canaccessadvanceditems = $this->_customdata->canaccessadvanceditems; + // $canaccessreserveditems = $this->_customdata->canaccessreserveditems; $errors = array(); // TODO: verify item per item whether they provide a coherent requests $regexp = '~('.SURVEYPRO_ITEMPREFIX.'|'.SURVEYPRO_DONTSAVEMEPREFIX.')_('.SURVEYPRO_TYPEFIELD.'|'.SURVEYPRO_TYPEFORMAT.')_([a-z]+)_([0-9]+)_?([a-z0-9]+)?~'; $olditemid = 0; - foreach ($data as $itemname => $v) { + foreach ($data as $itemname => $unused) { if (preg_match($regexp, $itemname, $matches)) { $type = $matches[2]; // Item type. $plugin = $matches[3]; // Item plugin. diff --git a/form/utemplates/apply_form.php b/form/utemplates/apply_form.php index d2596aebd9f..4592b6f714b 100644 --- a/form/utemplates/apply_form.php +++ b/form/utemplates/apply_form.php @@ -36,14 +36,14 @@ public function definition() { $mform = $this->_form; // Get _customdata. - $cmid = $this->_customdata->cmid; - $surveypro = $this->_customdata->surveypro; + // $cmid = $this->_customdata->cmid; + // $surveypro = $this->_customdata->surveypro; $utemplateman = $this->_customdata->utemplateman; $options = $utemplateman->get_sharinglevel_options(); $templatesfiles = array(); - foreach ($options as $sharinglevel => $v) { + foreach ($options as $sharinglevel => $unused) { $parts = explode('_', $sharinglevel); $contextlevel = $parts[0]; $contextid = $utemplateman->get_contextid_from_sharinglevel($sharinglevel); @@ -92,7 +92,7 @@ public function definition() { * @return $errors */ public function validation($data, $files) { - $mform = $this->_form; + // $mform = $this->_form; // Get _customdata. // $cmid = $this->_customdata->cmid; diff --git a/form/utemplates/create_form.php b/form/utemplates/create_form.php index 46306cb90eb..c5c81e4df60 100644 --- a/form/utemplates/create_form.php +++ b/form/utemplates/create_form.php @@ -36,8 +36,6 @@ public function definition() { $mform = $this->_form; // Get _customdata. - $cmid = $this->_customdata->cmid; - $surveypro = $this->_customdata->surveypro; $utemplateman = $this->_customdata->utemplateman; // Utemplatecreate: surveyproid. @@ -108,8 +106,6 @@ public function validation($data, $files) { // $mform = $this->_form; // Get _customdata. - $cmid = $this->_customdata->cmid; - $surveypro = $this->_customdata->surveypro; $utemplateman = $this->_customdata->utemplateman; $errors = parent::validation($data, $files); diff --git a/form/utemplates/import_form.php b/form/utemplates/import_form.php index 76821fb7374..d72437660a2 100644 --- a/form/utemplates/import_form.php +++ b/form/utemplates/import_form.php @@ -36,8 +36,6 @@ public function definition() { $mform = $this->_form; // Get _customdata. - $cmid = $this->_customdata->cmid; - $surveypro = $this->_customdata->surveypro; $utemplateman = $this->_customdata->utemplateman; $filemanageroptions = $this->_customdata->filemanageroptions; @@ -78,8 +76,6 @@ public function validation($data, $files) { // $mform = $this->_form; // Get _customdata. - $cmid = $this->_customdata->cmid; - $surveypro = $this->_customdata->surveypro; $utemplateman = $this->_customdata->utemplateman; // $filemanageroptions = $this->_customdata->filemanager_options; diff --git a/format/fieldset/form/plugin_form.php b/format/fieldset/form/plugin_form.php index c45606e58ac..bfae4d8c31d 100644 --- a/format/fieldset/form/plugin_form.php +++ b/format/fieldset/form/plugin_form.php @@ -41,7 +41,7 @@ public function definition() { // $mform = $this->_form; // Get _customdata. - $item = $this->_customdata->item; + // $item = $this->_customdata->item; // $surveypro = $this->_customdata->surveypro; $this->add_item_buttons(); diff --git a/format/pagebreak/classes/plugin.class.php b/format/pagebreak/classes/plugin.class.php index b48c27c5a58..62933ac42eb 100644 --- a/format/pagebreak/classes/plugin.class.php +++ b/format/pagebreak/classes/plugin.class.php @@ -65,7 +65,7 @@ public function __construct($cm, $surveypro, $itemid=0, $evaluateparentcontent) $this->insetupform['required'] = false; $this->insetupform['variable'] = false; $this->insetupform['insearchform'] = false; - $this->insetupform['advanced'] = false; + $this->insetupform['reserved'] = false; $this->insetupform['indent'] = false; $this->insetupform['hideinstructions'] = false; $this->insetupform['parentid'] = false; diff --git a/lang/en/surveypro.php b/lang/en/surveypro.php index ce9837e0416..de03fa72c44 100644 --- a/lang/en/surveypro.php +++ b/lang/en/surveypro.php @@ -61,8 +61,8 @@ $string['action_help'] = 'Operate on elements already present in the survey with the following action.'; $string['action'] = 'Preexisting elements'; $string['addnewsubmission'] = 'New response'; -$string['advanced_help'] = 'Is this element going to be available only to users equipped with a special permission or generally available to each user?'; -$string['advanced'] = 'Advanced element'; +$string['reserved_help'] = 'Is this element going to be available only to users equipped with a special permission or generally available to each user?'; +$string['reserved'] = 'Reserved element'; $string['af_allitems_deleted'] = 'All the elements were successfully deleted'; $string['af_allitems_hided'] = 'All the elements were successfully hided'; $string['af_allitems_visible'] = 'All the elements were successfully made visible'; @@ -95,7 +95,7 @@ $string['askdeleteonesurveypro'] = 'Are you sure you want delete the selected response owned by {$a->fullname}, created on {$a->timecreated} and modified on {$a->timemodified}?'; $string['askdeleteonesurveypronevermodified'] = 'Are you sure you want delete the selected responses owned by {$a->fullname}, created on {$a->timecreated} and never modified?'; $string['askdeleteonetemplate'] = 'Are you sure you want delete the user template "{$a}"'; -$string['askitemstoadvanced'] = 'Switching to "Advanced" the element {$a->parentid} all its dependencies will be switched to "Advanced" too.
Dependency(ies) is (are) the element(s) in position: {$a->dependencies}.
Do you confirm this action?'; +$string['askitemstoreserved'] = 'Switching to "Advanced" the element {$a->parentid} all its dependencies will be switched to "Advanced" too.
Dependency(ies) is (are) the element(s) in position: {$a->dependencies}.
Do you confirm this action?'; $string['askitemstohide'] = 'Hiding the element {$a->parentid} all its dependencies will be hided too.
Dependency(ies) is (are) the element(s) in position: {$a->dependencies}.
Do you confirm this action?'; $string['askitemstoshow'] = 'Showing the element {$a->lastitem} you are going to show all its ancestors.
Ancestor(s) is (are) the element(s) in position: {$a->ancestors}.
Do you confirm this action?'; $string['askitemstostandard'] = 'Switching to "Standard" the element {$a->lastitem} you are going to switch to "Standard" all its ancestors.
Ancestor(s) is (are) the element(s) in position: {$a->ancestors}.
Do you confirm this action?'; @@ -248,7 +248,7 @@ $string['import_positionoutofbound'] = 'The position {$a->position} found in "{$a->csvvalue}" for the column {$a->csvcol} is out of bound. Allowed bounds are: "{$a->bounds}"'; $string['importfile'] = 'Choose files to import'; $string['importusertemplates'] = 'Import user templates'; -$string['includeadvanced'] = 'Include advanced element'; +$string['includereserved'] = 'Include reserved element'; $string['includedates'] = 'Include creation and modification dates'; $string['includehidden'] = 'Include hidden elements'; $string['includenames'] = 'Include owner name'; @@ -268,7 +268,7 @@ $string['itemdrivensemantic'] = 'as in the "{$a}" of each item'; $string['itemeditfail'] = 'An error occurred saving the element'; $string['itemedithidehide'] = 'Hiding this element, some depending elements were hided too.'; -$string['itemeditmakeadvanced'] = 'Marking this element as "Advanced", some depending elements were forced to "Advanced" too.'; +$string['itemeditmakereserved'] = 'Marking this element as "Advanced", some depending elements were forced to "Advanced" too.'; $string['itemeditok'] = 'Element has been successfully modified'; $string['itemeditshow'] = 'Showing this element, some parent elements were showed too.'; $string['itemeditshowinbasicform'] = 'Removing the "Advanced" attribute from this element, some parent elements were forced to "Standard" element too.'; @@ -338,7 +338,7 @@ $string['notifyrole'] = 'Notify role'; $string['notinsearchform'] = 'Element not available in the search form'; $string['numinstances'] = 'Instances'; -$string['onlyadvanceditemhere'] = 'The current page holds only advanced elements you are not supposed to access'; +$string['onlyreserveditemhere'] = 'The current page holds only reserved elements you are not supposed to access'; $string['onlyoptional'] = 'Optional is forced by the value of default.'; $string['onlyreview'] = ' or review'; $string['opened'] = 'Opening time'; @@ -352,7 +352,7 @@ $string['parentformat'] = 'Define the "{$a->fieldname}" format as shown here: {$a->examples}'; $string['parentid_alt'] = 'Parent element'; $string['parentid_header'] = 'Relation'; -$string['parentid_help'] = 'Parent elements allow you to create conditional branching. Dimmed elements in the list identify hidden parent elments. Show them to have them available in this list.
Elements preceded by an asterisk are supposed to belong ONLY to advanced form.'; +$string['parentid_help'] = 'Parent elements allow you to create conditional branching. Dimmed elements in the list identify hidden parent elments. Show them to have them available in this list.
Elements preceded by an asterisk are supposed to belong ONLY to reserved form.'; $string['parentid'] = 'Parent element'; $string['pause'] = 'Pause'; $string['plugin'] = 'Element'; @@ -415,7 +415,7 @@ $string['submissions_welcome'] = 'Responses overview'; $string['submissions'] = 'Attempts'; $string['submissionslist'] = 'Attempts list'; -$string['surveypro:accessadvanceditems'] = 'Access advanced items'; +$string['surveypro:accessreserveditems'] = 'Access reserved items'; $string['surveypro:accessownreports'] = 'Access own reports'; $string['surveypro:accessreports'] = 'Access reports'; $string['surveypro:addinstance'] = 'Add a new survey activity'; diff --git a/layout_preview.php b/layout_preview.php index f61b38e3e82..61f4d8a08f5 100644 --- a/layout_preview.php +++ b/layout_preview.php @@ -64,7 +64,7 @@ $formparams->surveypro = $surveypro; $formparams->submissionid = $submissionid; $formparams->maxassignedpage = $previewman->get_maxassignedpage(); -$formparams->canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $context, null, true); +$formparams->canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $context, null, true); $formparams->formpage = $previewman->get_formpage(); // The page of the form to select subset of fields $formparams->modulepage = SURVEYPRO_ITEMS_PREVIEW; // This is the page of the TAB-PAGE structure. $formparams->readonly = false; diff --git a/lib.php b/lib.php index 183a2e929fa..0e0e4c0e3c1 100644 --- a/lib.php +++ b/lib.php @@ -412,7 +412,6 @@ function surveypro_delete_instance($id) { return false; } - $dbman = $DB->get_manager(); $whereparams = array('surveyproid' => $surveypro->id); // Delete any dependent records here. @@ -1029,8 +1028,6 @@ function surveypro_extend_navigation(navigation_node $navref, stdClass $course, $context = context_module::instance($cm->id); $cansearch = has_capability('mod/surveypro:searchsubmissions', $context, null, true); - $canimportdata = has_capability('mod/surveypro:importdata', $context, null, true); - $canexportdata = has_capability('mod/surveypro:exportdata', $context, null, true); // $currentgroup = groups_get_activity_group($cm); // $groupmode = groups_get_activity_groupmode($cm, $COURSE); @@ -1139,13 +1136,13 @@ function surveypro_get_plugin_list($plugintype=null, $includetype=false, $count= * surveypro_fetch_items_seeds * * @param $surveyproid - * @param $canaccessadvanceditems + * @param $canaccessreserveditems * @param $searchform * @param $type * @param $formpage * @return void */ -function surveypro_fetch_items_seeds($surveyproid, $canaccessadvanceditems, $searchform, $type=false, $formpage=false) { +function surveypro_fetch_items_seeds($surveyproid, $canaccessreserveditems, $searchform, $type=false, $formpage=false) { $sql = 'SELECT si.* FROM {surveypro_item} si WHERE si.surveyproid = :surveyproid @@ -1153,8 +1150,8 @@ function surveypro_fetch_items_seeds($surveyproid, $canaccessadvanceditems, $sea $params = array(); $params['surveyproid'] = $surveyproid; - if (!$canaccessadvanceditems) { - // $sql .= ' AND si.advanced = 0'; + if (!$canaccessreserveditems) { + $sql .= ' AND si.reserved = 0'; } if ($searchform) { // Advanced search. $sql .= ' AND si.insearchform = 1'; diff --git a/report/attachments_overview/classes/uploadsform.class.php b/report/attachments_overview/classes/uploadsform.class.php index fe49d118ba3..f1abcf1b9bf 100644 --- a/report/attachments_overview/classes/uploadsform.class.php +++ b/report/attachments_overview/classes/uploadsform.class.php @@ -180,7 +180,7 @@ public function display_attachment($submissionid, $itemid) { if ($files = $fs->get_area_files($this->context->id, 'surveyprofield_fileupload', SURVEYPROFIELD_FILEUPLOAD_FILEAREA, $item->answerid, "timemodified", false)) { foreach ($files as $file) { $filename = $file->get_filename(); - $mimetype = $file->get_mimetype(); + // $mimetype = $file->get_mimetype(); $iconimage = $OUTPUT->pix_icon(file_file_icon($file, 80), get_mimetype_description($file)); $path = '/'.$this->context->id.'/surveyprofield_fileupload/'.SURVEYPROFIELD_FILEUPLOAD_FILEAREA.'/'.$item->answerid.'/'.$filename; diff --git a/report/attachments_overview/form/filter_form.php b/report/attachments_overview/form/filter_form.php index e7e82da3a5f..fa6a6f62225 100644 --- a/report/attachments_overview/form/filter_form.php +++ b/report/attachments_overview/form/filter_form.php @@ -38,15 +38,14 @@ public function definition() { $mform = $this->_form; // Get _customdata. - $cmid = $this->_customdata->cmid; $surveypro = $this->_customdata->surveypro; $userid = $this->_customdata->userid; $submissionid = $this->_customdata->submissionid; - $canaccessadvanceditems = $this->_customdata->canaccessadvanceditems; + $canaccessreserveditems = $this->_customdata->canaccessreserveditems; $submissionidstring = get_string('submission', 'surveyproreport_attachments_overview'); - list($sql, $whereparams) = surveypro_fetch_items_seeds($surveypro->id, $canaccessadvanceditems, false); + list($sql, $whereparams) = surveypro_fetch_items_seeds($surveypro->id, $canaccessreserveditems, false); $itemseeds = $DB->get_recordset_sql($sql, $whereparams); if (!$itemseeds->valid()) { @@ -60,7 +59,6 @@ public function definition() { // Itemid. $options = array('0' => get_string('eachitem', 'surveyproreport_attachments_overview')); - $tablename = 'surveyprofield_fileupload'; foreach ($itemseeds as $itemseed) { if ($itemseed->plugin != 'fileupload') { continue; @@ -97,7 +95,6 @@ public function definition() { $users = $DB->get_recordset_sql($sql, $whereparams); $options = array(); - $submissionoptions = array(); foreach ($users as $user) { if ($user->userid == $userid) { $i = 0; diff --git a/report/attachments_overview/uploads.php b/report/attachments_overview/uploads.php index 623388a2c74..3ebd3e0124c 100644 --- a/report/attachments_overview/uploads.php +++ b/report/attachments_overview/uploads.php @@ -72,12 +72,11 @@ // Begin of: prepare params for the form. $formparams = new stdClass(); -$formparams->cmid = $cm->id; $formparams->surveypro = $surveypro; $formparams->itemid = $itemid; $formparams->userid = $userid; $formparams->submissionid = $submissionid; -$formparams->canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $context, null, true); +$formparams->canaccessreserveditems = $uploadsformman->canaccessreserveditems; // End of: prepare params for the form. $filterform = new mod_surveypro_report_filterform($formurl, $formparams, 'post', '', array('id' => 'userentry')); diff --git a/report/colles/classes/report.class.php b/report/colles/classes/report.class.php index dea675a81a9..58fdeced268 100644 --- a/report/colles/classes/report.class.php +++ b/report/colles/classes/report.class.php @@ -468,7 +468,6 @@ public function fetch_scalesdata($area=false) { // Begin of: names of areas of investigation. // Short names of questions. - $name = array(); for ($i = 1; $i < 5; $i++) { $index = sprintf('%02d', 4 * $area + $i); $key = 'question'.$index.'short'; diff --git a/report/frequency/classes/report.class.php b/report/frequency/classes/report.class.php index d35d04f2fc0..327229535f1 100644 --- a/report/frequency/classes/report.class.php +++ b/report/frequency/classes/report.class.php @@ -87,12 +87,12 @@ public function setup_outputtable() { public function stop_if_textareas_only() { global $DB, $OUTPUT; - $where = 'surveyproid = :surveyproid AND type = :type AND advanced = :advanced AND hidden = :hidden AND plugin <> :plugin'; + $where = 'surveyproid = :surveyproid AND type = :type AND reserved = :reserved AND hidden = :hidden AND plugin <> :plugin'; $params = array(); $params['surveyproid'] = $this->surveypro->id; $params['type'] = SURVEYPRO_TYPEFIELD; - $params['advanced'] = 0; + $params['reserved'] = 0; $params['hidden'] = 0; $params['plugin'] = 'textarea'; diff --git a/report/frequency/form/item_form.php b/report/frequency/form/item_form.php index 86e5e252616..2cad961a5b9 100644 --- a/report/frequency/form/item_form.php +++ b/report/frequency/form/item_form.php @@ -48,7 +48,7 @@ public function definition() { $where = array(); $where['surveyproid'] = $surveypro->id; $where['type'] = SURVEYPRO_TYPEFIELD; - $where['advanced'] = 0; + $where['reserved'] = 0; $where['hidden'] = 0; $itemseeds = $DB->get_recordset('surveypro_item', $where, 'sortindex'); diff --git a/report/frequency/lang/en/surveyproreport_frequency.php b/report/frequency/lang/en/surveyproreport_frequency.php index c61007b41b7..f6739734858 100644 --- a/report/frequency/lang/en/surveyproreport_frequency.php +++ b/report/frequency/lang/en/surveyproreport_frequency.php @@ -31,4 +31,4 @@ $string['percentage'] = 'percentage'; $string['pleasechooseavalue'] = 'Please choose an item for the distribution'; $string['pluginname'] = 'Frequency distribution'; -$string['textareasarenotallowed'] = 'This survey has no fields or uses only fields, among visible and not advanced, that are not suitable for this report.'; +$string['textareasarenotallowed'] = 'This survey has no fields or uses only fields, among visible and not reserved, that are not suitable for this report.'; diff --git a/template/attls/template.xml b/template/attls/template.xml index a16f88ed6e5..6c26d0a7392 100644 --- a/template/attls/template.xml +++ b/template/attls/template.xml @@ -4,7 +4,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -19,7 +19,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -30,7 +30,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -52,7 +52,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -74,7 +74,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -96,7 +96,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -118,7 +118,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -140,7 +140,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -162,7 +162,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -184,7 +184,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -206,7 +206,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -228,7 +228,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -250,7 +250,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -272,7 +272,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -294,7 +294,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -316,7 +316,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -338,7 +338,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -360,7 +360,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -382,7 +382,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -404,7 +404,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -426,7 +426,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -448,7 +448,7 @@ 0 1 - 0 + 0 item_parentvalue_01 diff --git a/template/collesactual/template.xml b/template/collesactual/template.xml index 9cb7d4df69f..e8615591df7 100644 --- a/template/collesactual/template.xml +++ b/template/collesactual/template.xml @@ -4,7 +4,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -19,7 +19,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -30,7 +30,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -45,7 +45,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -67,7 +67,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -89,7 +89,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -111,7 +111,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -133,7 +133,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -144,7 +144,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -159,7 +159,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -181,7 +181,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -203,7 +203,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -225,7 +225,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -247,7 +247,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -258,7 +258,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -273,7 +273,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -295,7 +295,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -317,7 +317,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -339,7 +339,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -361,7 +361,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -372,7 +372,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -387,7 +387,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -409,7 +409,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -431,7 +431,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -453,7 +453,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -475,7 +475,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -486,7 +486,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -501,7 +501,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -523,7 +523,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -545,7 +545,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -567,7 +567,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -589,7 +589,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -600,7 +600,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -615,7 +615,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -637,7 +637,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -659,7 +659,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -681,7 +681,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -703,7 +703,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -724,7 +724,7 @@ 0 1 - 0 + 0 item_parentvalue_01 diff --git a/template/collesactualpreferred/template.xml b/template/collesactualpreferred/template.xml index 77ac35b25cd..d74579861f5 100644 --- a/template/collesactualpreferred/template.xml +++ b/template/collesactualpreferred/template.xml @@ -4,7 +4,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -19,7 +19,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -30,7 +30,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -45,7 +45,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -67,7 +67,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -89,7 +89,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -111,7 +111,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -133,7 +133,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -155,7 +155,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -177,7 +177,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -199,7 +199,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -221,7 +221,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -232,7 +232,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -247,7 +247,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -269,7 +269,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -291,7 +291,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -313,7 +313,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -335,7 +335,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -357,7 +357,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -379,7 +379,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -401,7 +401,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -423,7 +423,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -434,7 +434,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -449,7 +449,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -471,7 +471,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -493,7 +493,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -515,7 +515,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -537,7 +537,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -559,7 +559,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -581,7 +581,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -603,7 +603,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -625,7 +625,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -636,7 +636,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -651,7 +651,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -673,7 +673,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -695,7 +695,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -717,7 +717,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -739,7 +739,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -761,7 +761,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -783,7 +783,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -805,7 +805,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -827,7 +827,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -838,7 +838,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -853,7 +853,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -875,7 +875,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -897,7 +897,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -919,7 +919,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -941,7 +941,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -963,7 +963,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -985,7 +985,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1007,7 +1007,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1029,7 +1029,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1040,7 +1040,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1055,7 +1055,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1077,7 +1077,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1099,7 +1099,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1121,7 +1121,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1143,7 +1143,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1165,7 +1165,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1187,7 +1187,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1209,7 +1209,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1231,7 +1231,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -1252,7 +1252,7 @@ 0 1 - 0 + 0 item_parentvalue_01 diff --git a/template/collespreferred/template.xml b/template/collespreferred/template.xml index 31f9581fa6b..c0f7866b895 100644 --- a/template/collespreferred/template.xml +++ b/template/collespreferred/template.xml @@ -4,7 +4,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -19,7 +19,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -30,7 +30,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -45,7 +45,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -67,7 +67,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -89,7 +89,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -111,7 +111,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -133,7 +133,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -144,7 +144,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -159,7 +159,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -181,7 +181,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -203,7 +203,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -225,7 +225,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -247,7 +247,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -258,7 +258,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -273,7 +273,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -295,7 +295,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -317,7 +317,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -339,7 +339,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -361,7 +361,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -372,7 +372,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -387,7 +387,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -409,7 +409,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -431,7 +431,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -453,7 +453,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -475,7 +475,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -486,7 +486,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -501,7 +501,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -523,7 +523,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -545,7 +545,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -567,7 +567,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -589,7 +589,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -600,7 +600,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -615,7 +615,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -637,7 +637,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -659,7 +659,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -681,7 +681,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -703,7 +703,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -724,7 +724,7 @@ 0 1 - 0 + 0 item_parentvalue_01 diff --git a/template/criticalincidents/template.xml b/template/criticalincidents/template.xml index 1a0afbc4dc9..b139ff9bd3c 100644 --- a/template/criticalincidents/template.xml +++ b/template/criticalincidents/template.xml @@ -4,7 +4,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -19,7 +19,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -41,7 +41,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -63,7 +63,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -85,7 +85,7 @@ 0 1 - 0 + 0 item_parentvalue_01 @@ -107,7 +107,7 @@ 0 1 - 0 + 0 item_parentvalue_01 diff --git a/templatemaster/lang/en/surveyprotemplate_pluginname.php b/templatemaster/lang/en/surveyprotemplate_pluginname.php index 65abbedd3a7..3df3590bf84 100644 --- a/templatemaster/lang/en/surveyprotemplate_pluginname.php +++ b/templatemaster/lang/en/surveyprotemplate_pluginname.php @@ -15,12 +15,12 @@ // along with Moodle. If not, see . /** - * Strings for component 'surveyprotemplate_@@templateNamePlaceholder@@', language 'en', branch 'MOODLE_26_STABLE' + * Strings for component 'surveyprotemplate_00templateNamePlaceholder00', language 'en', branch 'MOODLE_26_STABLE' * * @package surveyprotemplate - * @subpackage surveyproTemplate_@@templateNamePlaceholder@@ + * @subpackage surveyproTemplate_00templateNamePlaceholder00 * @copyright 2013 onwards kordan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['pluginname'] = '@@templateNamePlaceholder@@'; \ No newline at end of file +$string['pluginname'] = '00templateNamePlaceholder00'; \ No newline at end of file diff --git a/templatemaster/template.class.php b/templatemaster/template.class.php index 6a94fe4b518..c1871fab284 100644 --- a/templatemaster/template.class.php +++ b/templatemaster/template.class.php @@ -16,14 +16,14 @@ /** * @package surveyprotemplate - * @subpackage surveyproTemplate_@@templateNamePlaceholder@@ + * @subpackage surveyproTemplate_00templateNamePlaceholder00 * @copyright 2013 onwards kordan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); -class mod_surveypro_template_@@templateNamePlaceholder@@ { +class mod_surveypro_template_00templateNamePlaceholder00 { /** * apply_template_settings * diff --git a/templatemaster/template.xml b/templatemaster/template.xml index 48b374e832d..16fb25a7989 100644 --- a/templatemaster/template.xml +++ b/templatemaster/template.xml @@ -15,13 +15,13 @@ // along with Moodle. If not, see . /** - * Defines the version of surveypro surveyproTemplate_@@templateNamePlaceholder@@ subplugin + * Defines the version of surveypro surveyproTemplate_00templateNamePlaceholder00 subplugin * * This code fragment is called by moodle_needs_upgrading() and * /admin/index.php * * @package surveyprotemplate - * @subpackage surveyproTemplate_@@templateNamePlaceholder@@ + * @subpackage surveyproTemplate_00templateNamePlaceholder00 * @copyright 2013 onwards kordan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/templatemaster/version.php b/templatemaster/version.php index ec6d0678dba..884d5fee78e 100644 --- a/templatemaster/version.php +++ b/templatemaster/version.php @@ -15,13 +15,13 @@ // along with Moodle. If not, see . /** - * Defines the version of surveypro surveyproTemplate_@@templateNamePlaceholder@@ subplugin + * Defines the version of surveypro surveyproTemplate_00templateNamePlaceholder00 subplugin * * This code fragment is called by moodle_needs_upgrading() and * /admin/index.php * * @package surveyprotemplate - * @subpackage @@templateNamePlaceholder@@ + * @subpackage 00templateNamePlaceholder00 * @copyright 2013 onwards kordan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -31,4 +31,4 @@ $plugin->version = 2014111000; $plugin->release = '1.0'; $plugin->requires = 2013111800; // Requires this Moodle version -$plugin->component = 'surveyprotemplate_@@templateNamePlaceholder@@'; // Full name of the plugin (used for diagnostics) +$plugin->component = 'surveyprotemplate_00templateNamePlaceholder00'; // Full name of the plugin (used for diagnostics) diff --git a/tests/behat/behat_mod_surveypro.php b/tests/behat/behat_mod_surveypro.php index 8a3552923ce..b5ed83ec28a 100644 --- a/tests/behat/behat_mod_surveypro.php +++ b/tests/behat/behat_mod_surveypro.php @@ -87,7 +87,6 @@ public function surveypro_has_the_following_items($surveyproname, TableNode $dat $cm = get_coursemodule_from_instance('surveypro', $surveypro->id, $surveypro->course, false, MUST_EXIST); // Add the questions. - $lastpage = 0; foreach ($data->getHash() as $surveyprodata) { if (!array_key_exists('type', $surveyprodata)) { throw new ExpectationException('When adding an item to a surveypro, ' . diff --git a/tests/fixtures/usertemplate/MMM_2015123000.xml b/tests/fixtures/usertemplate/MMM_2015123000.xml index cd0f73eff7b..1643e7c43ac 100644 --- a/tests/fixtures/usertemplate/MMM_2015123000.xml +++ b/tests/fixtures/usertemplate/MMM_2015123000.xml @@ -4,7 +4,7 @@ 0 1 - 1 + 1 <p><img src="@@PLUGINFILE@@/MMM_logo.png" alt="MMM" width="313" height="70" /></p> @@ -21,7 +21,7 @@ 0 1 - 0 + 0 <p>This is a demo survey to quickly see some features of the items. This not a real survey, question are silly or non complete or meaningless (and, for sure, written in a bad English), but they are examples of what you can get playing with this module.</p> @@ -37,7 +37,7 @@ 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -47,7 +47,7 @@ 0 0 - 0 + 0 <p><img style="float:left;" src="@@PLUGINFILE@@/anziano.jpg" alt="old man" width="120" height="120" />How old is the person shown in the picture, in your personal opinion?</p> @@ -73,7 +73,7 @@ 0 0 - 0 + 0 <p><img style="float:left;" src="@@PLUGINFILE@@/anziano.jpg" alt="old man" width="120" height="120" />How old is the person shown in the picture, in your personal opinion?</p> @@ -99,7 +99,7 @@ 0 0 - 0 + 0 <p><img style="float:left;" src="@@PLUGINFILE@@/anziano.jpg" alt="old man" width="120" height="120" />How old is the person shown in the picture, in your personal opinion?</p> @@ -125,7 +125,7 @@ 0 0 - 0 + 0 <p><img style="float:left;" src="@@PLUGINFILE@@/anziano.jpg" alt="old man" width="120" height="120" />How old is the person shown in the picture, in your personal opinion?</p> @@ -150,7 +150,7 @@ 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -160,7 +160,7 @@ 0 0 - 0 + 0 <p>user ID</p> @@ -178,7 +178,7 @@ 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -188,7 +188,7 @@ 0 0 - 0 + 0 <p>Do you live in NY?</p> @@ -209,7 +209,7 @@ 0 0 - 0 + 0 <p>Do you live in NY?</p> @@ -230,7 +230,7 @@ 0 0 - 0 + 0 <p>Do you live in NY?</p> @@ -250,7 +250,7 @@ 0 0 - 0 + 0 <p>Do you live in NY?</p> @@ -271,7 +271,7 @@ 0 0 - 0 + 0 <p>Do you live in NY?</p> @@ -292,7 +292,7 @@ 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -302,7 +302,7 @@ 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -329,7 +329,7 @@ milk 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -358,7 +358,7 @@ Apple juice 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -368,7 +368,7 @@ Apple juice 0 1 - 0 + 0 <p>When did you get your last car?</p> @@ -388,7 +388,7 @@ Apple juice 0 0 - 0 + 0 <p>When did you get your last car?</p> @@ -408,7 +408,7 @@ Apple juice 0 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -418,7 +418,7 @@ Apple juice 0 0 - 0 + 0 <p>Date of birth</p> @@ -438,7 +438,7 @@ Apple juice 0 0 - 0 + 0 <p>Date of birth</p> @@ -458,7 +458,7 @@ Apple juice 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -468,7 +468,7 @@ Apple juice 0 0 - 0 + 0 <p>In which day and at what time do you remember the event?</p> @@ -489,7 +489,7 @@ Apple juice 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -499,7 +499,7 @@ Apple juice 0 0 - 0 + 0 <p>Please, attach your Curriculum Vitae.</p> @@ -519,7 +519,7 @@ Apple juice 0 0 - 0 + 0 <p>Please, attach your Curriculum Vitae.</p> @@ -539,7 +539,7 @@ Apple juice 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -549,7 +549,7 @@ Apple juice 0 0 - 0 + 0 <p>How many days do you foreseen for your Easter holidays?</p> @@ -567,7 +567,7 @@ Apple juice 0 0 - 0 + 0 <p>How many days do you foreseen for your Easter holidays?</p> @@ -586,7 +586,7 @@ Apple juice 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -596,7 +596,7 @@ Apple juice 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -621,7 +621,7 @@ chocolate 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -631,7 +631,7 @@ chocolate 1 1 - 0 + 0 <p>Which is the mean room temperature you prefer?</p> @@ -652,7 +652,7 @@ chocolate 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -662,7 +662,7 @@ chocolate 0 1 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -685,7 +685,7 @@ Lake 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -709,7 +709,7 @@ Lake 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -733,7 +733,7 @@ Lake 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -743,7 +743,7 @@ Lake 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -774,7 +774,7 @@ Optimum 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -810,7 +810,7 @@ Good 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -841,7 +841,7 @@ Optimum 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -851,7 +851,7 @@ Optimum 0 1 - 0 + 0 <p>When do you usually celebrate your name-day?</p> @@ -871,7 +871,7 @@ Optimum 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -881,7 +881,7 @@ Optimum 1 1 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -903,7 +903,7 @@ hill 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -913,7 +913,7 @@ hill 0 0 - 0 + 0 <p>Write a short description of yourself.</p> @@ -934,7 +934,7 @@ hill 0 0 - 0 + 0 <p>Write a short description of yourself.</p> @@ -955,7 +955,7 @@ hill 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -965,7 +965,7 @@ hill 0 1 - 0 + 0 <p>At what time do you usually get up in the morning in the working days?</p> @@ -987,7 +987,7 @@ hill 0 0 - 0 + 0 <p>At what time do you usually get up in the morning in the working days?</p> @@ -1009,7 +1009,7 @@ hill 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -1019,7 +1019,7 @@ hill 0 0 - 0 + 0 <p>Enter your VISA card number.</p> @@ -1038,7 +1038,7 @@ hill 0 0 - 0 + 0 <p>Enter your email address.</p> @@ -1056,7 +1056,7 @@ hill 0 0 - 0 + 0 <p>Enter the URL of your favourite site.</p> @@ -1074,7 +1074,7 @@ hill 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -1084,7 +1084,7 @@ hill 0 0 - 0 + 0 <p>Do you have the driving licence?</p> @@ -1103,7 +1103,7 @@ hill 0 0 - 0 + 0 60 1 @@ -1115,7 +1115,7 @@ hill 0 0 - 0 + 0 60 1 @@ -1137,7 +1137,7 @@ C::for tracks 0 0 - 0 + 0 60 0 @@ -1149,7 +1149,7 @@ C::for tracks 0 0 - 0 + 0 60 0 diff --git a/tests/fixtures/usertemplate/age_only_2015123000.xml b/tests/fixtures/usertemplate/age_only_2015123000.xml index cc33ca0f97f..21c1b0dfe95 100644 --- a/tests/fixtures/usertemplate/age_only_2015123000.xml +++ b/tests/fixtures/usertemplate/age_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>AGE</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only one <b>age specific setting</b>:</p><ol><li>default.</li></ol><p>and with two more <b>validation options</b></p><ol><li>Lower bound</li><li>Upper bound</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>an age has been defined as default</li><li>user answer is limited only by module level age limit</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox.</p> @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>How old are you?</p> @@ -52,7 +52,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li><li>user answer is limited only by module level age limit</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option.</p> @@ -66,7 +66,7 @@ 0 0 - 0 + 0 <p>How old are you?</p> @@ -87,7 +87,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"Yes" is the default</li><li>user answer is limited only by module level age limit</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -101,7 +101,7 @@ 0 0 - 0 + 0 <p>How old are you?</p> @@ -122,7 +122,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"Choose..." is the default</li><li>user answer is limited only by module level age limit</li></ul><p>Behaviour: The item is not mandatory but the default is set to an invalid value so the user will be forced to select an age corresponding to his/her answer. Being the item not required, the user can choose as answer: "No answer".</p> @@ -136,7 +136,7 @@ 0 0 - 0 + 0 <p>How old are you?</p> @@ -157,7 +157,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"No answer" is the default</li><li>user answer is limited only by module level age limit</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -171,7 +171,7 @@ 0 0 - 0 + 0 <p>How old are you?</p> @@ -191,7 +191,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to a valid value</li><li>user answer is limited between 20 and 40</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -205,7 +205,7 @@ 0 0 - 0 + 0 <p>How old are you?</p> @@ -226,7 +226,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li><li>user answer is limited between 12 years and half and 18</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option.</p> @@ -240,7 +240,7 @@ 0 0 - 0 + 0 <p>How old are you?</p> @@ -261,7 +261,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"Yes" is the default</li><li>user answer is limited over 18</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -275,7 +275,7 @@ 0 0 - 0 + 0 <p>How old are you?</p> @@ -296,7 +296,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"Choose..." is the default</li><li>user answer is limited between 0 and 3 months</li></ul><p>Behaviour: The item is not mandatory but the default is set to an invalid value so the user will be forced to select an age corresponding to his/her answer. Being the item not required, the user can choose as answer: "No answer".</p> @@ -310,7 +310,7 @@ 0 0 - 0 + 0 <p>How old are you?</p> @@ -331,7 +331,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"No answer" is the default</li><li>user answer is limited between 18 and 65</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -345,7 +345,7 @@ 0 0 - 0 + 0 <p>How old are you?</p> diff --git a/tests/fixtures/usertemplate/attachment_only_2015123000.xml b/tests/fixtures/usertemplate/attachment_only_2015123000.xml index b2fb3bf0f06..35073690baf 100644 --- a/tests/fixtures/usertemplate/attachment_only_2015123000.xml +++ b/tests/fixtures/usertemplate/attachment_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>ATTACHMENT</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with three <b>file upload specific setting</b>:</p><ol><li>Maximum files</li><li>Maximum file size</li><li>Allowed file types</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <p>Upload your CV, please.</p> @@ -35,7 +35,7 @@ 0 0 - 0 + 0 <p>Please, upload the menu of the next week using a specific file per each working day.</p> diff --git a/tests/fixtures/usertemplate/autofill_only_2015123000.xml b/tests/fixtures/usertemplate/autofill_only_2015123000.xml index 9c03623ea4f..3371ec0bcbe 100644 --- a/tests/fixtures/usertemplate/autofill_only_2015123000.xml +++ b/tests/fixtures/usertemplate/autofill_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>AUTOFILL</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Indent</li><li>Question position</li><li>Element number</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only one <b>autofill specific setting</b>:</p><ol><li>First content element</li><li>Second content element</li><li>Third content element</li><li>Fourth content element</li><li>Fifth content element</li><li>Make hidden</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>the User ID (probably for future relationship between exported tables)</li><li>field is visible</li></ul><p>Behaviour: The element is supposed to display the ID of the owner of the record and that ID is going to be visible in the surveypro page.</p> @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>Your user ID</p> @@ -47,7 +47,7 @@ 0 0 - 0 + 0 <ul><li>the User ID (probably for future relationship between exported tables)</li><li>field is not visible</li></ul><p>Behaviour: The element is supposed to display the ID of the owner of the record and that ID is not going to be visible in the surveypro page. This is the reason why you can not see that element in the surveypro preview page.</p> @@ -61,7 +61,7 @@ 0 0 - 0 + 0 <p>Your user ID</p> diff --git a/tests/fixtures/usertemplate/boolean_only_2015123000.xml b/tests/fixtures/usertemplate/boolean_only_2015123000.xml index a396d741d23..19f3457cb8f 100644 --- a/tests/fixtures/usertemplate/boolean_only_2015123000.xml +++ b/tests/fixtures/usertemplate/boolean_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>BOOLEAN</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only one <b>boolean specific setting</b>:</p><ol><li>Element style</li><li>Default</li><li>Download format</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>drop down</li><li>mandatory (so: "No answer" is not expected)</li><li>"yes" is the default (so: "Choose..." is not expected)</li></ul><p>Behaviour: The item is mandatory so the user is theoretically forced to choose a value. In spite of this, the default is set to a valid value so the user will be allowed to "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -51,7 +51,7 @@ 0 0 - 0 + 0 <ul><li>drop down</li><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option.</p> @@ -65,7 +65,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -85,7 +85,7 @@ 0 0 - 0 + 0 <ul><li>drop down</li><li>not mandatory (so: "No answer" is expected)</li><li>"Yes" is the default</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -99,7 +99,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -119,7 +119,7 @@ 0 0 - 0 + 0 <ul><li>drop down</li><li>not mandatory (so: "No answer" is expected)</li><li>"Choose..." is the default</li></ul><p>Behaviour: The item is not mandatory but the default is set to an invalid value so the user will be forced to select the item corresponding to his/her answer. Being the item not required, the user can choose as answer the item: "No answer".</p> @@ -133,7 +133,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -153,7 +153,7 @@ 0 0 - 0 + 0 <ul><li>drop down</li><li>not mandatory (so: "No answer" is expected)</li><li>"No answer" is the default</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -167,7 +167,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -186,7 +186,7 @@ 0 0 - 0 + 0 <ul><li>horizontal radio buttons</li><li>mandatory (so: "No answer" is not expected)</li><li>"yes" is the default (so: "Choose..." is not expected)</li></ul><p>Behaviour: The item is mandatory so the user is theoretically forced to choose a value. In spite of this, the default is set to a valid value so the user will be allowed to "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -200,7 +200,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -220,7 +220,7 @@ 0 0 - 0 + 0 <ul><li>horizontal radio buttons</li><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option.</p> @@ -234,7 +234,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -254,7 +254,7 @@ 0 0 - 0 + 0 <ul><li>horizontal radio buttons</li><li>not mandatory (so: "No answer" is expected)</li><li>"Yes" is the default</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -268,7 +268,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -288,7 +288,7 @@ 0 0 - 0 + 0 <ul><li>horizontal radio buttons</li><li>not mandatory (so: "No answer" is expected)</li><li>"Choose..." is the default</li></ul><p>Behaviour: The item is not mandatory but the default is set to an invalid value so the user will be forced to select the item corresponding to his/her answer. Being the item not required, the user can choose as answer the item: "No answer".</p> @@ -302,7 +302,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -322,7 +322,7 @@ 0 0 - 0 + 0 <ul><li>horizontal radio buttons</li><li>not mandatory (so: "No answer" is expected)</li><li>"No answer" is the default</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -336,7 +336,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -355,7 +355,7 @@ 0 0 - 0 + 0 <ul><li>vertical radio buttons</li><li>mandatory (so: "No answer" is not expected)</li><li>"yes" is the default (so: "Choose..." is not expected)</li></ul><p>Behaviour: The item is mandatory so the user is theoretically forced to choose a value. In spite of this, the default is set to a valid value so the user will be allowed to "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -369,7 +369,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -389,7 +389,7 @@ 0 0 - 0 + 0 <ul><li>vertical radio buttons</li><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option.</p> @@ -403,7 +403,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -423,7 +423,7 @@ 0 0 - 0 + 0 <ul><li>vertical radio buttons</li><li>not mandatory (so: "No answer" is expected)</li><li>"Yes" is the default</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -437,7 +437,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -457,7 +457,7 @@ 0 0 - 0 + 0 <ul><li>vertical radio buttons</li><li>not mandatory (so: "No answer" is expected)</li><li>"Choose..." is the default</li></ul><p>Behaviour: The item is not mandatory but the default is set to an invalid value so the user will be forced to select the item corresponding to his/her answer. Being the item not required, the user can choose as answer the item: "No answer".</p> @@ -471,7 +471,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> @@ -491,7 +491,7 @@ 0 0 - 0 + 0 <ul><li>vertical radio buttons</li><li>not mandatory (so: "No answer" is expected)</li><li>"No answer" is the default</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -505,7 +505,7 @@ 0 0 - 0 + 0 <p>Is this true?</p> diff --git a/tests/fixtures/usertemplate/checkbox_only_2015123000.xml b/tests/fixtures/usertemplate/checkbox_only_2015123000.xml index ea7ec56b106..842b3d962d1 100644 --- a/tests/fixtures/usertemplate/checkbox_only_2015123000.xml +++ b/tests/fixtures/usertemplate/checkbox_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>CHECKBOX</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only one <b>checkbox specific setting</b>:</p><ol><li>Options</li><li>"Option other"</li><li>Default</li><li>"No answer" as defaults</li><li>Adjustment</li><li>Minimum required options</li><li>Download format</li></ol><p>and with one <b>validation options</b></p><ol><li>Minimum required options</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>"butter" is the default</li><li>minimum required options set to 1<br /></li><li>checkboxes are horizzontally displayed</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user is forced to tick at least one checkbox.</p> @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -57,7 +57,7 @@ bread 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>"butter" is the default</li><li>minimum required options set to 1<br /></li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user is forced to tick at least one checkbox.</p> @@ -71,7 +71,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -97,7 +97,7 @@ bread 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>"butter" is the default</li><li>minimum required options set to 2<br /></li><li>checkboxes are horizzontally displayed</li></ul>Behaviour: The item is mandatory and the default is set to a valid value but the user can not "fly" over this element because the minimum required options is set to 2. So he/she is forced to or select al least two checkboxes.<br /> @@ -111,7 +111,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -137,7 +137,7 @@ bread 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>"butter" is the default</li><li>minimum required options set to 2<br /></li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value but the user can not "fly" over this element because the minimum @@ -152,7 +152,7 @@ required options is set to 2. So he/she is forced to or select al least two chec 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -178,7 +178,7 @@ bread 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>default is not set<br /></li><li>minimum required options set to 1<br /></li><li>checkboxes are horizzontally displayed</li></ul><p>Behaviour: The item is mandatory and the default is not set so the user is forced to tick at least one checkbox.</p> @@ -192,7 +192,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -217,7 +217,7 @@ bread 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>default is not set<br /></li><li>minimum required options set to 1<br /></li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is not set so the user is forced to tick at least one checkbox.</p> @@ -231,7 +231,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -256,7 +256,7 @@ bread 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>default is not set<br /></li><li>minimum required options set to 2<br /></li><li>checkboxes are horizzontally displayed</li></ul><p>Behaviour: The item is mandatory and the default is not set so the user is forced to tick at least two checkboxes.</p> @@ -270,7 +270,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -295,7 +295,7 @@ bread 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>default is not set<br /></li><li>minimum required options set to 2<br /></li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is not set so the user is forced to tick at least two checkboxes.</p> @@ -309,7 +309,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -334,7 +334,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"butter" is the default</li><li>minimum required options set to 1<br /></li><li>checkboxes are horizzontally displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer".</p> @@ -348,7 +348,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -374,7 +374,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)<br /></li><li>"butter" is the default</li><li>minimum required options set to 1<br /></li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer".</p> @@ -388,7 +388,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -414,7 +414,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"butter" is the default</li><li>minimum required options set to 2<br /></li><li>checkboxes are horizzontally displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid @@ -431,7 +431,7 @@ options or to tick the "No answer" checkbox.</p> 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -457,7 +457,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"butter" is the default</li><li>minimum required options set to 2<br /></li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value but the user can not "fly" over this element because the minimum required options is set to 2. So he/she is forced to or select two options or to tick the "No answer" checkbox.</p> @@ -471,7 +471,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -497,7 +497,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"No answer" is the default</li><li>minimum required options set to 1<br /></li><li>checkboxes are horizzontally displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to tick at least one checkbox.</p> @@ -511,7 +511,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -537,7 +537,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"No answer" is the default</li><li>minimum required options set to 1<br /></li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to an invalid value so the user is forced to tick at least one checkbox.</p> @@ -551,7 +551,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -577,7 +577,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"No answer" is the default</li><li>minimum required options set to 2<br /></li><li>checkboxes are horizzontally displayed</li></ul>Behaviour: The item is not mandatory and the default is set to a valid value <span class="rangySelectionBoundary" style="line-height:0;"></span>so the user can "fly" over this element leaving the proposed default untouched (and the question not read).<br /> @@ -591,7 +591,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -617,7 +617,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>"No answer" is the default</li><li>minimum required options set to 2<br /></li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value but the user can not "fly" over this element because the minimum required options is set to 2. So he/she is forced to or select two @@ -632,7 +632,7 @@ options or to tick the "No answer" checkbox.</p> 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -658,7 +658,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>default is not set<br /></li><li>minimum required options set to 1<br /></li><li>checkboxes are horizzontally displayed</li></ul><p>Behaviour: The item is not mandatory and the default is not set so the user is forced to tick at least one checkbox or to select the "No answer" checkbox.</p> @@ -672,7 +672,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -697,7 +697,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>default is not set<br /></li><li>minimum required options set to 1<br /></li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is not set so the user is forced to tick at least one checkbox or to select the "No answer" checkbox.</p> @@ -711,7 +711,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -736,7 +736,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>default is not set<br /></li><li>minimum required options set to 2<br /></li><li>checkboxes are horizzontally displayed</li></ul><p>Behaviour: The item is not mandatory and the default is not set so the user is forced to tick at least two checkboxes or to select the "No answer" chackbox.</p> @@ -750,7 +750,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -775,7 +775,7 @@ bread 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>default is not set<br /></li><li>minimum required options set to 2<br /></li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is not set so the user is forced to tick at least two checkboxes or to select the "No answer" checkbox.</p> @@ -789,7 +789,7 @@ bread 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> diff --git a/tests/fixtures/usertemplate/date_only_2015123000.xml b/tests/fixtures/usertemplate/date_only_2015123000.xml index 0a47603fb5f..3a726b904fc 100644 --- a/tests/fixtures/usertemplate/date_only_2015123000.xml +++ b/tests/fixtures/usertemplate/date_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>DATE</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only two <b>date specific setting</b>:</p><ol><li>Default</li><li>Download format</li></ol><p>and with two more <b>validation options</b>:</p><ol><li>Lower bound</li><li>Upper bound</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited to academic year 2014/2015, i.e. November 1st, 2014 - October 31, 2015</li><li>the default invites the user to choose a value</li></ul>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a different date or tick the "No answer" checkbox. @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>When did you get your degree?</p> @@ -52,7 +52,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited to academic year 2014/2015, i.e. November 1st, 2014 - October 31, 2015</li><li>the default is set to a valid value</li></ul>Behaviour: the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox. @@ -66,7 +66,7 @@ 0 0 - 0 + 0 <p>When did you get your degree?</p> @@ -88,7 +88,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited to academic year 2014/2015, i.e. November 1st, 2014 - October 31, 2015</li><li>the default is set to the last input</li></ul>Behaviour: The item is not mandatory and the default is probably set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox or tick the "No answer" checkbox. @@ -102,7 +102,7 @@ 0 0 - 0 + 0 <p>When did you get your degree?</p> @@ -123,7 +123,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited to academic year 2014/2015, i.e. November 1st, 2014 - October 31, 2015</li><li>the default is set to the current date</li></ul>Behaviour: If the default is valid the user can "fly" over this element leaving the proposed default untouched (and the question not read) otherwise he/she is forced to choose a different date or to tick the "No answer" checkbox. @@ -137,7 +137,7 @@ 0 0 - 0 + 0 <p>When did you get your degree?</p> @@ -158,7 +158,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited to academic year 2014/2015, i.e. November 1st, 2014 - October 31, 2015</li><li>the default is set to "No answer"</li></ul>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox or tick the "No answer" checkbox and setting a different date. @@ -172,7 +172,7 @@ 0 0 - 0 + 0 <p>When did you get your degree?</p> @@ -193,7 +193,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited to academic year 2014/2015, i.e. November 1st, 2014 - October 31, 2015</li><li>the default invites the user to choose a value</li></ul>Behaviour: The item is mandatory and the default is set to a not valid value so the user is forced to choose a different date. @@ -207,7 +207,7 @@ 0 0 - 0 + 0 <p>When did you get your degree?</p> @@ -228,7 +228,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited to academic year 2014/2015, i.e. November 1st, 2014 - October 31, 2015</li><li>the default is set to a valid value</li></ul>Behaviour: the user can "fly" over this element leaving the proposed default untouched (and the question not read). @@ -242,7 +242,7 @@ 0 0 - 0 + 0 <p>When did you get your degree?</p> @@ -264,7 +264,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited to academic year 2014/2015, i.e. November 1st, 2014 - October 31, 2015</li><li>the default is set to the last input</li></ul>Behaviour: The item is mandatory and the default is probably set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) @@ -278,7 +278,7 @@ 0 0 - 0 + 0 <p>When did you get your degree?</p> @@ -299,7 +299,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited to academic year 2014/2015, i.e. November 1st, 2014 - October 31, 2015</li><li>the default is set to the current date</li></ul>Behaviour: If the default is valid the user can "fly" over this element leaving the proposed default untouched (and the question not read) otherwise he/she is forced to choose a different date. @@ -313,7 +313,7 @@ 0 0 - 0 + 0 <p>When did you get your degree?</p> diff --git a/tests/fixtures/usertemplate/dateshort_only_2015123000.xml b/tests/fixtures/usertemplate/dateshort_only_2015123000.xml index 09e70052424..197577aa817 100644 --- a/tests/fixtures/usertemplate/dateshort_only_2015123000.xml +++ b/tests/fixtures/usertemplate/dateshort_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>SHORT DATE</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only two <b>shortdate specific setting</b>:</p><ol><li>Default</li><li>Download format</li></ol><p>and with two more <b>validation options</b>:</p><ol><li>Lower bound</li><li>Upper bound</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited to last 15 years</li><li>the default invites the user to choose a value</li></ul>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a different date or tick the "No answer" checkbox. @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>When did you buy your current car?</p> @@ -52,7 +52,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited to last 15 years</li><li>the default is set to a valid value</li></ul>Behaviour: the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox. @@ -66,7 +66,7 @@ 0 0 - 0 + 0 <p>When did you buy your current car?</p> @@ -88,7 +88,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited to last 15 years</li><li>the default is set to the last input</li></ul>Behaviour: The item is not mandatory and the default is probably set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox. @@ -102,7 +102,7 @@ 0 0 - 0 + 0 <p>When did you buy your current car?</p> @@ -123,7 +123,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited to last 15 years</li><li>the default is set to the current date</li></ul>Behaviour: If the default is valid the user can "fly" over this element leaving the proposed default untouched (and the question not read) otherwise he/she is forced to choose a different date or to tick the "No answer" checkbox. @@ -137,7 +137,7 @@ 0 0 - 0 + 0 <p>When did you buy your current car?</p> @@ -158,7 +158,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited to last 15 years</li><li>the default is set to "No answer"</li></ul>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox and setting a different date. @@ -172,7 +172,7 @@ 0 0 - 0 + 0 <p>When did you buy your current car?</p> @@ -193,7 +193,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited to last 15 years</li><li>the default invites the user to choose a value</li></ul>Behaviour: The item is mandatory and the default is set to a not valid value so the user is forced to choose a different date. @@ -207,7 +207,7 @@ 0 0 - 0 + 0 <p>When did you buy your current car?</p> @@ -228,7 +228,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited to last 15 years</li><li>the default is set to a valid value</li></ul>Behaviour: the user can "fly" over this element leaving the proposed default untouched (and the question not read). @@ -242,7 +242,7 @@ 0 0 - 0 + 0 <p>When did you buy your current car?</p> @@ -264,7 +264,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited to last 15 years</li><li>the default is set to the last input</li></ul>Behaviour: The item is mandatory and the default is probably set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) @@ -278,7 +278,7 @@ 0 0 - 0 + 0 <p>When did you buy your current car?</p> @@ -299,7 +299,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited to last 15 years</li><li>the default is set to the current date</li></ul>Behaviour: If the default is valid the user can "fly" over this element leaving the proposed default untouched (and the question not read) otherwise he/she is forced to choose a different date. @@ -313,7 +313,7 @@ 0 0 - 0 + 0 <p>When did you buy your current car?</p> diff --git a/tests/fixtures/usertemplate/datetime_only_2015123000.xml b/tests/fixtures/usertemplate/datetime_only_2015123000.xml index 61867181834..cbac463da33 100644 --- a/tests/fixtures/usertemplate/datetime_only_2015123000.xml +++ b/tests/fixtures/usertemplate/datetime_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>DATETIME</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only two <b>datetime specific setting</b>:</p><ol><li>Default</li><li>Download format</li></ol><p>and with two more <b>validation options</b>:</p><ol><li>Lower bound</li><li>Upper bound</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited between 15 to 22 September</li><li>the default invites the user to choose a value</li></ul>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a different date and time or tick the "No answer" checkbox. @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>Please, write down date and time of your last flight to Los Angeles.</p> @@ -53,7 +53,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited between 15 to 22 September</li><li>the default is set to a valid value</li></ul>Behaviour: the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox. @@ -67,7 +67,7 @@ 0 0 - 0 + 0 <p>Please, write down date and time of your last flight to Los Angeles.</p> @@ -90,7 +90,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited between 15 to 22 September</li><li>the default is set to the last input</li></ul>Behaviour: The item is not mandatory and the default is probably set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox. @@ -104,7 +104,7 @@ 0 0 - 0 + 0 <p>Please, write down date and time of your last flight to Los Angeles.</p> @@ -126,7 +126,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited between 15 to 22 September</li><li>the default is set to the current date and time</li></ul>Behaviour: If the default is valid the user can "fly" over this element leaving the proposed default untouched (and the question not read) or to tick the "No answer" checkbox. @@ -140,7 +140,7 @@ 0 0 - 0 + 0 <p>Please, write down date and time of your last flight to Los Angeles.</p> @@ -162,7 +162,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is limited between 15 to 22 September</li><li>the default is set to "No answer"</li></ul>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox and setting a different date and time. @@ -176,7 +176,7 @@ 0 0 - 0 + 0 <p>Please, write down date and time of your last flight to Los Angeles.</p> @@ -198,7 +198,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited between 15 to 22 September</li><li>the default invites the user to choose a value</li></ul>Behaviour: The item is mandatory and the default is set to a not valid value so the user is forced to choose a different date. @@ -212,7 +212,7 @@ 0 0 - 0 + 0 <p>Please, write down date and time of your last flight to Los Angeles.</p> @@ -234,7 +234,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited between 15 to 22 September</li><li>the default is set to a valid value</li></ul><p>Behaviour: The item is mandatory and the default is set to an valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -248,7 +248,7 @@ 0 0 - 0 + 0 <p>Please, write down date and time of your last flight to Los Angeles.</p> @@ -271,7 +271,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited between 15 to 22 September</li><li>the default is set to the last input</li></ul>Behaviour: The item is mandatory and the default is probably set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) @@ -285,7 +285,7 @@ 0 0 - 0 + 0 <p>Please, write down date and time of your last flight to Los Angeles.</p> @@ -307,7 +307,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>input is limited between 15 to 22 September</li><li>the default is set to the current date</li></ul><p>Behaviour: The item is mandatory and the default is set to an valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -321,7 +321,7 @@ 0 0 - 0 + 0 <p>Please, write down date and time of your last flight to Los Angeles.</p> diff --git a/tests/fixtures/usertemplate/integer_only_2015123000.xml b/tests/fixtures/usertemplate/integer_only_2015123000.xml index d748c352ff3..ae7d8b8bb16 100644 --- a/tests/fixtures/usertemplate/integer_only_2015123000.xml +++ b/tests/fixtures/usertemplate/integer_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>INTEGER</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only one <b>integer specific setting</b>:</p><ol><li>Default</li></ol><p>and with two more <b>validation options</b>:</p><ol><li>Lower bound</li><li>Upper bound</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>mandatory</li><li>input is lower limited to 1</li><li>input is upper limited to at least 19</li><li>the default invites the user to choose a value.</li></ul>Behaviour: The item is mandatory and the default is set to a not valid value so the user is forced to choose a different value or select the "No answer" item. @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>How many children do your parents have?</p> @@ -51,7 +51,7 @@ 0 0 - 0 + 0 <ul><li>mandatory</li><li>input is lower limited to 1</li><li>input is upper limited to at least 19</li><li>the default is set to 1 (to count the person filling the survey)</li></ul>Behaviour: The item is mandatory and the default is set to a not valid value so the user is forced to choose a different value or select the "No answer" item. @@ -65,7 +65,7 @@ 0 0 - 0 + 0 <p>How many children do your parents have?</p> @@ -85,7 +85,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is lower limited to 1</li><li>input is upper limited to 19</li><li>the default is set to 1 (to count the person filling the survey)</li></ul>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this item leaving the proposed default untouched (and the question not read) or select the "No answer" item. @@ -99,7 +99,7 @@ 0 0 - 0 + 0 <p>How many children do your parents have?</p> @@ -120,7 +120,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>input is lower limited to 1</li><li>input is limited to at least 19</li><li>the default invites the user to choose a value.</li></ul>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a different date or tick the "No answer" checkbox. @@ -134,7 +134,7 @@ 0 0 - 0 + 0 <p>How many children do your parents have?</p> diff --git a/tests/fixtures/usertemplate/multiselect_only_2015123000.xml b/tests/fixtures/usertemplate/multiselect_only_2015123000.xml index 0036fa4c80e..6027e0c2436 100644 --- a/tests/fixtures/usertemplate/multiselect_only_2015123000.xml +++ b/tests/fixtures/usertemplate/multiselect_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>MULTISELECT</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with some<b>multiple selection specific setting</b>:</p><ol><li>Options</li><li>Default</li><li>Height in rows</li><li>Minimum required items</li><li>Download format</li></ol><p>and with one <b>validation options</b></p><ol><li>Minimum required options</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>a default is not set</li><li>minimum required is (automatically) set to 1<br /></li></ul>Behaviour: The item is mandatory and the default is not set so the user is forced to select at least one item. @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -55,7 +55,7 @@ chocolate 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>a default is set</li><li>minimum required is (automatically) set to 1<br /></li></ul>Behaviour: The item is mandatory and the default is set so to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read). @@ -69,7 +69,7 @@ chocolate 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -95,7 +95,7 @@ jam 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>a default is not set</li><li>minimum required is set to 1<br /></li></ul>Behaviour: The item is not mandatory and the default is not set so the user is forced to select at least one item or to select the "No answer" checkbox. @@ -109,7 +109,7 @@ jam 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -133,7 +133,7 @@ chocolate 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>a default is set</li><li>minimum required is (automatically) set to 1<br /></li></ul>Behaviour: The item is not mandatory and the default is set but so the user is forced to select at least one item. @@ -147,7 +147,7 @@ chocolate 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -172,7 +172,7 @@ chocolate 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>a default is not set</li><li>minimum required is set to 2<br /></li></ul>Behaviour: The item is mandatory and the default is not set so the user is forced to select at least two items. @@ -186,7 +186,7 @@ chocolate 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -210,7 +210,7 @@ chocolate 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>a default is set</li><li>minimum required is set to 2<br /></li></ul>Behaviour: The item is mandatory and the default is set so to a valid value but the user can not "fly" over this element because the minimum @@ -225,7 +225,7 @@ required options is set to 2.<br /> 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -251,7 +251,7 @@ jam 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>a default is not set</li><li>minimum required is set to 2<br /></li></ul>Behaviour: The item is not mandatory and the default is not set so the user is forced to select at least two items or to select the "No answer" checkbox. @@ -265,7 +265,7 @@ jam 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> @@ -289,7 +289,7 @@ chocolate 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>a default is set</li><li>minimum required is (automatically) set to 1<br /></li></ul>Behaviour: The item is not mandatory and the default is set but so the user is forced to select at least one item. @@ -303,7 +303,7 @@ chocolate 0 0 - 0 + 0 <p>What do you usually get for breakfast?</p> diff --git a/tests/fixtures/usertemplate/numeric_only_2015123000.xml b/tests/fixtures/usertemplate/numeric_only_2015123000.xml index d23da89317d..9a72c7b940f 100644 --- a/tests/fixtures/usertemplate/numeric_only_2015123000.xml +++ b/tests/fixtures/usertemplate/numeric_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>NUMERIC</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only one<b> </b><b>numeric specific setting</b>:</p><ol><li>Default</li></ol><p>and with some more <b>validation options</b></p><ol><li>Signed value</li><li>Decimal positions</li><li>Minimum value</li><li>Maximum value</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>mandatory</li><li>default is set to 3.1</li><li>decimal positions set to 4</li><li>minimum value set to 3.1</li><li>maximum value set to 3.2</li></ul>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read). @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>Write the best approximation of π you can remember.</p> @@ -53,7 +53,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory</li><li>default is set to 3.1</li><li>decimal positions set to 4</li><li>minimum value set to 3.1</li><li>maximum value set to 3.2</li></ul>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or blank the field. @@ -67,7 +67,7 @@ 0 0 - 0 + 0 <p>Write the best approximation of π you can remember.</p> @@ -89,7 +89,7 @@ 0 0 - 0 + 0 <ul><li>mandatory</li><li>default is not set</li><li>decimal positions set to 4</li><li>minimum value set to 3.1</li><li>maximum value set to 3.2</li></ul>Behaviour: The item is mandatory but the default is unset. The user will be forced to choose a value. @@ -103,7 +103,7 @@ 0 0 - 0 + 0 <p>Write the best approximation of π you can remember.</p> @@ -124,7 +124,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory</li><li>default is not set</li><li>decimal positions set to 4</li><li>minimum value set to 3.1</li><li>maximum value set to 3.2</li></ul>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read). @@ -138,7 +138,7 @@ 0 0 - 0 + 0 <p>Write the best approximation of π you can remember.</p> diff --git a/tests/fixtures/usertemplate/parent-child_2015123000.xml b/tests/fixtures/usertemplate/parent-child_2015123000.xml index 99cd975bf29..7667b603aaf 100644 --- a/tests/fixtures/usertemplate/parent-child_2015123000.xml +++ b/tests/fixtures/usertemplate/parent-child_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <p>Before starting I need to let you know few details at general level.</p> @@ -34,7 +34,7 @@ 0 0 - 0 + 0 <p>Example with boolean item: Is this true or false?</p> @@ -54,7 +54,7 @@ 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -64,7 +64,7 @@ 0 0 - 0 + 0 2 1 @@ -87,7 +87,7 @@ 0 0 - 0 + 0 2 0 @@ -110,7 +110,7 @@ 0 0 - 0 + 0 <p>As you can see, by answering "No answer" to the parent item you get disabled the first such as the second child too.</p> @@ -123,7 +123,7 @@ 0 0 - 0 + 0 <p>Example with checkbox item: What do you always want to find on your desk in the office?</p> @@ -148,7 +148,7 @@ A4 paper 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -158,7 +158,7 @@ A4 paper 0 0 - 0 + 0 7 1;1;1;0 @@ -180,7 +180,7 @@ A4 paper 0 0 - 0 + 0 7 0;1;0;0 @@ -204,7 +204,7 @@ A4 paper 0 0 - 0 + 0 <p>Example with numeric (small integer) item: Enter an integer value.</p> @@ -224,7 +224,7 @@ A4 paper 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -234,7 +234,7 @@ A4 paper 0 0 - 0 + 0 11 11 @@ -256,7 +256,7 @@ A4 paper 0 0 - 0 + 0 11 22 @@ -279,7 +279,7 @@ A4 paper 0 0 - 0 + 0 <p>Example with multiselect item: What do you eat for breakfast? (click or shift-click to change the selection).</p> @@ -306,7 +306,7 @@ ham 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -316,7 +316,7 @@ ham 0 0 - 0 + 0 15 3;0 @@ -339,7 +339,7 @@ ham 0 0 - 0 + 0 15 2;3;4 @@ -363,7 +363,7 @@ ham 0 0 - 0 + 0 <p>Example with radio button item: which countryside do you like more for your summer holidays?</p> @@ -388,7 +388,7 @@ City 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -398,7 +398,7 @@ City 0 0 - 0 + 0 19 3 @@ -422,7 +422,7 @@ City 0 0 - 0 + 0 19 0 @@ -460,7 +460,7 @@ bad 0 0 - 0 + 0 <p>Example with select item: Indicate your preferred direction.</p> @@ -482,7 +482,7 @@ left 1 0 - 0 + 0 <hr class="pagebreakcontent" /> @@ -492,7 +492,7 @@ left 0 0 - 0 + 0 23 1 @@ -516,7 +516,7 @@ left 0 0 - 0 + 0 23 0 diff --git a/tests/fixtures/usertemplate/radiobutton_only_2015123000.xml b/tests/fixtures/usertemplate/radiobutton_only_2015123000.xml index 636c4d9d430..58e10dfb0ed 100644 --- a/tests/fixtures/usertemplate/radiobutton_only_2015123000.xml +++ b/tests/fixtures/usertemplate/radiobutton_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>RADIO BUTTON</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro plugins.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with some <b>radio button specific setting</b>:</p><ol><li>Options</li><li>Option "other"</li><li>Default</li><li>Download format</li><li>Adjustment</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default invites the user to choose a value</li><li>"option other" is not set</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a valid option or to select the "No answer" value.</p> @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -55,7 +55,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li><li>"option other" is not set</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is set to a not valid value so the user is forced to choose a valid option.</p> @@ -69,7 +69,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -93,7 +93,7 @@ desert 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to "No answer"</li><li>"option other" is not set</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -107,7 +107,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -131,7 +131,7 @@ desert 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to a valid value</li><li>"option other" is not set</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -145,7 +145,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -170,7 +170,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to a valid value</li><li>"option other" is not set</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -184,7 +184,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -209,7 +209,7 @@ desert 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default invites the user to choose a value</li><li>"option other" is set to "other, please specify"</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a valid option or to select the "No answer" value.</p> @@ -223,7 +223,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -248,7 +248,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li><li>"option other" is set to "other, please specify"</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is set to a not valid value so the user is forced to choose a valid option.</p> @@ -262,7 +262,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -287,7 +287,7 @@ desert 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to "No answer"</li><li>"option other" is set to "other, please specify"</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -301,7 +301,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -326,7 +326,7 @@ desert 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to a valid value</li><li>"option other" is set to "other, please specify"</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -340,7 +340,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -366,7 +366,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to a valid value</li><li>"option other" is set to "other, please specify"</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -380,7 +380,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -406,7 +406,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the defaultis set to a valid value</li><li>"option other" is set to "other, please specify" and has a default</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -420,7 +420,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -446,7 +446,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to the label of the "option other"</li><li>"option other" is set to "other, please specify"</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -460,7 +460,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -486,7 +486,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to the label of "option other"</li><li>custom value is not set</li><li>checkboxes are vertically displayed</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option or to write a custom value.</p> @@ -500,7 +500,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> diff --git a/tests/fixtures/usertemplate/rate_only_2015123000.xml b/tests/fixtures/usertemplate/rate_only_2015123000.xml index 4e90e637252..d2208b79773 100644 --- a/tests/fixtures/usertemplate/rate_only_2015123000.xml +++ b/tests/fixtures/usertemplate/rate_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>RATE</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro plugins.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with some <b>rate</b><b> specific setting</b>:</p><ol><li>Element style</li><li>Options</li><li>Rates</li><li>Default</li><li>Download format</li></ol><p>and one <b>validaion option</b></p><ol><li>Force different rate</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li><li>element style is set to "radio buttons"</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option.</p> @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -60,7 +60,7 @@ unknown 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default invites the user to choose a value</li><li>element style is set to "radio buttons"</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option or to tick the "No answer" checkbox.</p> @@ -74,7 +74,7 @@ unknown 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -103,7 +103,7 @@ unknown 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to a valid value</li><li>element style is set to "radio buttons"</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -117,7 +117,7 @@ unknown 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -150,7 +150,7 @@ mother tongue 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to a valid value</li><li>element style is set to "radio buttons"</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox.</p> @@ -164,7 +164,7 @@ mother tongue 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -197,7 +197,7 @@ mother tongue 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to "No answer"</li><li>element style is set to "radio buttons"</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -211,7 +211,7 @@ mother tongue 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -240,7 +240,7 @@ unknown 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li><li>element style is set to "drop down menu"</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option.</p> @@ -254,7 +254,7 @@ unknown 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -283,7 +283,7 @@ unknown 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default invites the user to choose a value</li><li>element style is set to "drop down menu"</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option or to tick the "No answer" checkbox.</p> @@ -297,7 +297,7 @@ unknown 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -326,7 +326,7 @@ unknown 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to a valid value</li><li>element style is set to "drop down menu"</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -340,7 +340,7 @@ unknown 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -373,7 +373,7 @@ mother tongue 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to a valid value</li><li>element style is set to "drop down menu"</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox.</p> @@ -387,7 +387,7 @@ mother tongue 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> @@ -420,7 +420,7 @@ mother tongue 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to "No answer"</li><li>element style is set to "drop down menu"</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -434,7 +434,7 @@ mother tongue 0 0 - 0 + 0 <p>How confident are you with the following languages?</p> diff --git a/tests/fixtures/usertemplate/recurrence_only_2015123000.xml b/tests/fixtures/usertemplate/recurrence_only_2015123000.xml index 3b4eb54597e..ee304eb5f17 100644 --- a/tests/fixtures/usertemplate/recurrence_only_2015123000.xml +++ b/tests/fixtures/usertemplate/recurrence_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>RECURRENCE</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only two <b>date specific setting</b>:</p><ol><li>Default</li><li>Download format</li></ol><p>and with two more <b>validation options</b>:</p><ol><li>Lower bound</li><li>Upper bound</li></ol><p>and two <b>validaion option</b></p><ol><li>Lower bound</li><li>Upper bound</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default invites the user to choose a value</li></ul>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a different drecurrenceate or tick the "No answer" checkbox. @@ -31,7 +31,7 @@ 0 0 - 0 + 0 When do you usually celebrate your name-day? @@ -52,7 +52,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to a valid value</li></ul>Behaviour: the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox. @@ -66,7 +66,7 @@ 0 0 - 0 + 0 When do you usually celebrate your name-day? @@ -88,7 +88,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to the last input</li></ul>Behaviour: The item is not mandatory and the default is probably set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox or tick the "No answer" checkbox. @@ -102,7 +102,7 @@ 0 0 - 0 + 0 When do you usually celebrate your name-day? @@ -123,7 +123,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to the current date</li></ul>Behaviour: If the default is valid the user can "fly" over this element leaving the proposed default untouched (and the question not read) otherwise he/she is forced to choose a different date or to tick the "No answer" checkbox. @@ -137,7 +137,7 @@ 0 0 - 0 + 0 When do you usually celebrate your name-day? @@ -158,7 +158,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to "No answer"</li></ul>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox or tick the "No answer" checkbox and setting a different date. @@ -172,7 +172,7 @@ 0 0 - 0 + 0 When do you usually celebrate your name-day? @@ -193,7 +193,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li></ul>Behaviour: The item is mandatory and the default is set to a not valid value so the user is forced to choose a different date. @@ -207,7 +207,7 @@ 0 0 - 0 + 0 When do you usually celebrate your name-day? @@ -228,7 +228,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to a valid value</li></ul>Behaviour: the user can "fly" over this element leaving the proposed default untouched (and the question not read). @@ -242,7 +242,7 @@ 0 0 - 0 + 0 When do you usually celebrate your name-day? @@ -264,7 +264,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to the last input</li></ul>Behaviour: The item is mandatory and the default is probably set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) @@ -278,7 +278,7 @@ 0 0 - 0 + 0 When do you usually celebrate your name-day? @@ -299,7 +299,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to the current date</li></ul>Behaviour: If the default is valid the user can "fly" over this element leaving the proposed default untouched (and the question not read) otherwise he/she is forced to choose a different date. @@ -313,7 +313,7 @@ 0 0 - 0 + 0 When do you usually celebrate your name-day? diff --git a/tests/fixtures/usertemplate/select_only_2015123000.xml b/tests/fixtures/usertemplate/select_only_2015123000.xml index 7bda16a004b..e3e70da271a 100644 --- a/tests/fixtures/usertemplate/select_only_2015123000.xml +++ b/tests/fixtures/usertemplate/select_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>SELECT</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro plugins.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with some <b>select specific setting</b>:</p><ol><li>Options</li><li>Option "other"</li><li>Default</li><li>Download format</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default invites the user to choose a value</li><li>"option other" is not set</li></ul><p>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a valid option or to select the "No answer" value.</p> @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -54,7 +54,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li><li>"option other" is not set</li></ul><p>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a valid option or to select the "No answer" value.</p> @@ -68,7 +68,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -91,7 +91,7 @@ desert 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to "No answer"</li><li>"option other" is not set</li></ul><p>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a valid option or to select the "No answer" value.</p> @@ -105,7 +105,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -128,7 +128,7 @@ desert 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to a valid value</li><li>"option other" is not set</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -142,7 +142,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -166,7 +166,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to a valid value</li><li>"option other" is not set</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -180,7 +180,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -204,7 +204,7 @@ desert 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default invites the user to choose a value</li><li>"option other" is set to "other, please specify"</li></ul><p>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a valid option or to select the "No answer" value.</p> @@ -218,7 +218,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -242,7 +242,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default invites the user to choose a value</li><li>"option other" is set to "other, please specify"</li></ul><p>Behaviour: The item is mandatory and the default is set to a not valid value so the user is forced to choose a valid option.</p> @@ -256,7 +256,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -280,7 +280,7 @@ desert 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to "No answer"</li><li>"option other" is set to "other, please specify"</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -294,7 +294,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -318,7 +318,7 @@ desert 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>the default is set to a valid value</li><li>"option other" is set to "other, please specify"</li></ul><p>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -332,7 +332,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -357,7 +357,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to a valid value</li><li>"option other" is set to "other, please specify"</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -371,7 +371,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -396,7 +396,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to a valid value</li><li>"option other" is set to "other, please specify" and has a default</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -410,7 +410,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -435,7 +435,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to the label of the "option other"</li><li>"option other" is set to "other, please specify"</li></ul><p>Behaviour: The item is mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -449,7 +449,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> @@ -474,7 +474,7 @@ desert 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>the default is set to the label of "option other"</li><li>custom value is not set</li></ul><p>Behaviour: The item is mandatory and the default is set to an invalid value so the user is forced to choose a valid option or to write a custom value.</p> @@ -488,7 +488,7 @@ desert 0 0 - 0 + 0 <p>Where do you usually spend your summer holidays?</p> diff --git a/tests/fixtures/usertemplate/textarea_only_2015123000.xml b/tests/fixtures/usertemplate/textarea_only_2015123000.xml index 34cec7dd5e5..baca30624d4 100644 --- a/tests/fixtures/usertemplate/textarea_only_2015123000.xml +++ b/tests/fixtures/usertemplate/textarea_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>TEXTAREA<br /></h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only two <b>date specific setting</b>:</p><ol><li>Use html editor</li><li>Area heigh in rows</li><li>Area width in columns<br /></li></ol><p>and with two more <b>validation options</b>:</p><ol><li>Minimum length (in characters)</li><li>Maximum length (in characters)<br /></li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>mandatory<br /></li><li>use html editor<br /></li></ul><p>Behaviour: The item is mandatory and the user is supposed to enter a text.</p> @@ -31,7 +31,7 @@ 0 0 - 0 + 0 Write a short description of yourself @@ -52,7 +52,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory<br /></li><li>use html editor<br /></li></ul><p>Behaviour: The item is not mandatory and the user is supposed to enter a text or to leave the textarea blank.</p> @@ -66,7 +66,7 @@ 0 0 - 0 + 0 Write a short description of yourself @@ -87,7 +87,7 @@ 0 0 - 0 + 0 <ul><li>mandatory<br /></li><li>use simple text area<br /></li></ul><p>Behaviour: The item is mandatory and the user is supposed to enter a text.</p> @@ -101,7 +101,7 @@ 0 0 - 0 + 0 Write a short description of yourself @@ -122,7 +122,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory<br /></li><li>use simple text area<br /></li></ul><p>Behaviour: The item is not mandatory and the user is supposed to enter a text or to leave the textarea blank.</p> @@ -136,7 +136,7 @@ 0 0 - 0 + 0 Write a short description of yourself diff --git a/tests/fixtures/usertemplate/textshort_only_2015123000.xml b/tests/fixtures/usertemplate/textshort_only_2015123000.xml index d82716cf6ac..48304865dd5 100644 --- a/tests/fixtures/usertemplate/textshort_only_2015123000.xml +++ b/tests/fixtures/usertemplate/textshort_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>SHORT TEXT<br /></h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only one <b>short text specifi</b><b>c setting</b>:</p><ol><li>Default</li></ol><p>and with two more <b>validation options</b>:</p><ol><li>Text pattern<br /></li><li>Minimum length (in characters)</li><li>Maximum length (in characters)<br /></li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory<br /></li><li>free pattern</li><li>default not set<br /></li></ul><p>Behaviour: The item is not mandatory and the default is not set so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -31,7 +31,7 @@ 0 0 - 0 + 0 <p>Name</p> @@ -50,7 +50,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory<br /></li><li>custom pattern set to 16 digits (Minimum and maximum length are automatically set to 16)<br /></li><li>default not set<br /></li></ul><p>Behaviour: The item is not mandatory and the default is not set so the user can "fly" over this element leaving the proposed default untouched (and the question not read). If an input is provided, it will be required to match the pattern.</p> @@ -64,7 +64,7 @@ 0 0 - 0 + 0 <p>Enter your VISA card number</p> @@ -84,7 +84,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory<br /></li><li>pattern set to email address<br /></li><li>default not set<br /></li></ul><p>Behaviour: The item is not mandatory and the default is not set so the user can "fly" over this element leaving the proposed default untouched (and the question not read). If an input is provided, it will be required to be an email address.</p> @@ -98,7 +98,7 @@ 0 0 - 0 + 0 <p>Enter your email address</p> @@ -117,7 +117,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory<br /></li><li>pattern set to web page URL<br /></li><li>default not set<br /></li></ul><p>Behaviour: The item is not mandatory and the default is not set so the user can "fly" over this element leaving the proposed default untouched (and the question not read). If an input is provided, it will be required to be a web page URL.</p> @@ -131,7 +131,7 @@ 0 0 - 0 + 0 <p>Enter the URL of your favourite site</p> @@ -150,7 +150,7 @@ 0 0 - 0 + 0 <ul><li>mandatory<br /></li><li>free pattern</li><li>default not set<br /></li></ul><p>Behaviour: The item is mandatory and the default is not set so the user will be forced to enter a text.</p> @@ -164,7 +164,7 @@ 0 0 - 0 + 0 <p>Name</p> @@ -183,7 +183,7 @@ 0 0 - 0 + 0 <ul><li>mandatory<br /></li><li>custom pattern set to 16 digits (Minimum and maximum length are automatically set to 16)<br /></li><li>default not set<br /></li></ul><p>Behaviour: The item is mandatory and the default is not set so the user will be forced to enter a text matching the defined pattern.</p> @@ -197,7 +197,7 @@ 0 0 - 0 + 0 <p>Enter your VISA card number</p> @@ -217,7 +217,7 @@ 0 0 - 0 + 0 <ul><li>mandatory<br /></li><li>pattern set to email address<br /></li><li>default not set<br /></li></ul><p>Behaviour: The item is mandatory and the default is not set so the user will be forced to enter a an email address.</p> @@ -231,7 +231,7 @@ 0 0 - 0 + 0 <p>Enter your email address</p> @@ -250,7 +250,7 @@ 0 0 - 0 + 0 <ul><li>mandatory<br /></li><li>pattern set to web page URL<br /></li><li>default not set<br /></li></ul><p>Behaviour: The item is mandatory and the default is not set so the user will be forced to enter a web page URL.</p> @@ -264,7 +264,7 @@ 0 0 - 0 + 0 <p>Enter the URL of your favourite site</p> diff --git a/tests/fixtures/usertemplate/time_only_2015123000.xml b/tests/fixtures/usertemplate/time_only_2015123000.xml index efe60bf34de..fd016541e5d 100644 --- a/tests/fixtures/usertemplate/time_only_2015123000.xml +++ b/tests/fixtures/usertemplate/time_only_2015123000.xml @@ -4,7 +4,7 @@ 0 0 - 0 + 0 <h5>TIME</h5><p>This plugin, like all the others provided by surveypro core, is equipped with a set of common settings shared with all the other surveypro elements.</p><p>The <b>common settings</b> set is done by:</p><ol><li>Required</li><li>Indent</li><li>Question position</li><li>Element number</li><li>Hide filling instruction</li><li>Variable</li><li>Additional note</li></ol><p>This plugin is equipped with only two <b>time specific setting</b>:</p><ol><li>Step</li><li>Default<br /></li><li>Download format</li></ol><p>and with two more <b>validation options</b>:</p><ol><li>Lower bound</li><li>Upper bound</li></ol><p>The cartesian product of all these settings makes a very long list of possible implementations of this element. In this usertemplate few use cases are described.</p> @@ -17,7 +17,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>step is set to 15 minutes<br /></li><li>input is limited between 4 am to 8:59 am</li><li>the default invites the user to choose a value</li></ul>Behaviour: The item is not mandatory and the default is set to a not valid value so the user is forced to choose a different date and time or tick the "No answer" checkbox. @@ -31,7 +31,7 @@ 0 0 - 0 + 0 At what time do you usually get up in the morning in the working days? @@ -54,7 +54,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>step is set to 15 minutes<br /></li><li>input is limited between 4 am to 8:59 am</li><li>the default is set to a valid static value</li></ul>Behaviour: the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox. @@ -68,7 +68,7 @@ 0 0 - 0 + 0 At what time do you usually get up in the morning in the working days? @@ -91,7 +91,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>step is set to 15 minutes<br /></li><li>input is limited between 4 am to 8:59 am</li><li>the default is set to the last input</li></ul>Behaviour: The item is not mandatory and the default is probably set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox. @@ -105,7 +105,7 @@ 0 0 - 0 + 0 At what time do you usually get up in the morning in the working days? @@ -128,7 +128,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)</li><li>step is set to 15 minutes<br /></li><li>input is limited between 4 am to 8:59 am</li><li>the default is set to the current time</li></ul>Behaviour: If the default is valid the user can "fly" over this element leaving the proposed default untouched (and the question not read) or to tick the "No answer" checkbox. @@ -142,7 +142,7 @@ 0 0 - 0 + 0 At what time do you usually get up in the morning in the working days? @@ -165,7 +165,7 @@ 0 0 - 0 + 0 <ul><li>not mandatory (so: "No answer" is expected)<br /></li><li>step is set to 15 minutes<br /></li><li>input is limited between 4 am to 8:59 am</li><li>the default is set to "No answer"</li></ul>Behaviour: The item is not mandatory and the default is set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) or tick the "No answer" checkbox and setting a different date and time. @@ -179,7 +179,7 @@ 0 0 - 0 + 0 At what time do you usually get up in the morning in the working days? @@ -202,7 +202,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>step is set to 15 minutes<br /></li><li>input is limited between 4 am to 8:59 am</li><li>the default invites the user to choose a value</li></ul>Behaviour: The item is mandatory and the default is set to a not valid value so the user is forced to choose a different date. @@ -216,7 +216,7 @@ 0 0 - 0 + 0 At what time do you usually get up in the morning in the working days? @@ -239,7 +239,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)<br /></li><li>step is set to 15 minutes<br /></li><li>input is limited between 4 am to 8:59 am</li><li>the default is set to a valid value</li></ul><p>Behaviour: The item is mandatory and the default is set to an valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -253,7 +253,7 @@ 0 0 - 0 + 0 At what time do you usually get up in the morning in the working days? @@ -276,7 +276,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)</li><li>step is set to 15 minutes<br /></li><li>input is limited between 4 am to 8:59 am</li><li>the default is set to the last input</li></ul>Behaviour: The item is mandatory and the default is probably set to a valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read) @@ -290,7 +290,7 @@ 0 0 - 0 + 0 At what time do you usually get up in the morning in the working days? @@ -313,7 +313,7 @@ 0 0 - 0 + 0 <ul><li>mandatory (so: "No answer" is not expected)<br /></li><li>step is set to 15 minutes<br /></li><li>input is limited between 4 am to 8:59 am</li><li>the default is set to the current time<br /></li></ul><p>Behaviour: The item is mandatory and the default is set to an valid value so the user can "fly" over this element leaving the proposed default untouched (and the question not read).</p> @@ -327,7 +327,7 @@ 0 0 - 0 + 0 At what time do you usually get up in the morning in the working days? diff --git a/utemplates_create.php b/utemplates_create.php index cb453c69c15..1cbc8cf61c8 100644 --- a/utemplates_create.php +++ b/utemplates_create.php @@ -66,8 +66,6 @@ // Begin of: prepare params for the form. $formparams = new stdClass(); -$formparams->cmid = $cm->id; -$formparams->surveypro = $surveypro; $formparams->utemplateman = $utemplateman; $createutemplate = new mod_surveypro_utemplatecreateform($formurl, $formparams); // End of: prepare params for the form. diff --git a/utemplates_import.php b/utemplates_import.php index 1f8eb54b6a4..c45ef61ed4e 100644 --- a/utemplates_import.php +++ b/utemplates_import.php @@ -66,8 +66,6 @@ // Begin of: prepare params for the form. $formparams = new stdClass(); -$formparams->cmid = $cm->id; -$formparams->surveypro = $surveypro; $formparams->utemplateman = $utemplateman; $formparams->filemanageroptions = $utemplateman->get_filemanager_options(); $importutemplate = new mod_surveypro_importutemplateform($formurl, $formparams); diff --git a/version.php b/version.php index 44e7a2c554b..353d9591dde 100644 --- a/version.php +++ b/version.php @@ -26,7 +26,7 @@ $plugin->component = 'mod_surveypro'; // Full name of the plugin (used for diagnostics) $plugin->maturity = MATURITY_ALPHA; // MATURITY_RC -$plugin->version = 2015123000; // The current module version (Date: YYYYMMDDXX) +$plugin->version = 2016031501; // The current module version (Date: YYYYMMDDXX) $plugin->release = '1.0'; // The current release $plugin->requires = 2015111600; // Requires this Moodle version $plugin->cron = 3600; // Period for cron to check this module (secs) diff --git a/view_form.php b/view_form.php index 6fd4bfb1ada..e4fb6bea016 100644 --- a/view_form.php +++ b/view_form.php @@ -65,7 +65,7 @@ $formparams->surveypro = $surveypro; $formparams->submissionid = $submissionid; $formparams->maxassignedpage = $userformman->get_maxassignedpage(); -$formparams->canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $context, null, true); +$formparams->canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $context, null, true); $formparams->formpage = $userformman->get_formpage(); // The page of the form to select subset of fields $formparams->modulepage = $userformman->get_modulepage(); // The page of the TAB-PAGE structure. $formparams->readonly = ($userformman->get_modulepage() == SURVEYPRO_SUBMISSION_READONLY); diff --git a/view_search.php b/view_search.php index e23b2f40188..b1c9aa16ff0 100644 --- a/view_search.php +++ b/view_search.php @@ -60,7 +60,7 @@ $formparams = new stdClass(); $formparams->cm = $cm; $formparams->surveypro = $surveypro; -$formparams->canaccessadvanceditems = has_capability('mod/surveypro:accessadvanceditems', $context, null, true); +$formparams->canaccessreserveditems = has_capability('mod/surveypro:accessreserveditems', $context, null, true); $searchform = new mod_surveypro_searchform($formurl, $formparams, 'post', '', array('id' => 'usersearch')); // End of: prepare params for the form.