diff --git a/app/models/phase.rb b/app/models/phase.rb index df47877..fa5109c 100644 --- a/app/models/phase.rb +++ b/app/models/phase.rb @@ -16,7 +16,7 @@ # Possibly needed for active_admin # -relies on protected_attributes gem as syntax depricated in rails 4.2 attr_accessible :description, :number, :title, :template_id, - :template, :sections, :as => [:default, :admin] + :template, :sections, :modifiable, :as => [:default, :admin] ## # sluggable title diff --git a/app/models/question.rb b/app/models/question.rb index d0fde11..f7db830 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -24,7 +24,8 @@ :suggested_answer, :text, :section_id, :question_format_id, :question_options_attributes, :suggested_answers_attributes, :option_comment_display, :theme_ids, :section, :question_format, - :question_options, :suggested_answers, :answers, :themes, :as => [:default, :admin] + :question_options, :suggested_answers, :answers, :themes, + :modifiable, :as => [:default, :admin] diff --git a/app/models/question_option.rb b/app/models/question_option.rb index b16b0d9..c11151a 100644 --- a/app/models/question_option.rb +++ b/app/models/question_option.rb @@ -7,5 +7,5 @@ ## # Possibly needed for active_admin # -relies on protected_attributes gem as syntax depricated in rails 4.2 - attr_accessible :text, :question_id, :is_default, :number, :as => [:default, :admin] + attr_accessible :text, :question_id, :is_default, :number, :question, :as => [:default, :admin] end diff --git a/app/models/section.rb b/app/models/section.rb index 3577dd9..34acdbe 100644 --- a/app/models/section.rb +++ b/app/models/section.rb @@ -11,7 +11,7 @@ # accepts_nested_attributes_for :version attr_accessible :organisation_id, :description, :number, :title, :published, :questions_attributes, - :organisation, :as => [:default, :admin] + :organisation, :modifiable, :phase, :as => [:default, :admin] ## # return the title of the section diff --git a/app/models/template.rb b/app/models/template.rb index fbee582..510eb9b 100644 --- a/app/models/template.rb +++ b/app/models/template.rb @@ -13,7 +13,7 @@ # Possibly needed for active_admin # -relies on protected_attributes gem as syntax depricated in rails 4.2 attr_accessible :id, :organisation_id, :description, :published, :title, :locale, :is_default, - :guidance_group_ids, :organisation, :plans, :phases, :as => [:default, :admin] + :guidance_group_ids, :organisation, :plans, :phases, :org, :as => [:default, :admin] # defines the export setting for a template object has_settings :export, class_name: 'Settings::Template' do |s| diff --git a/db/seeds.rb b/db/seeds.rb index 49b58d2..4ac811c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -19,7 +19,8 @@ {title: "Radio buttons"}, {title: "Check box"}, {title: "Dropdown"}, - {title: "Multi select box"} + {title: "Multi select box"}, + {title: "Date"} ] question_formats.map{ |qf| QuestionFormat.create!(qf) if QuestionFormat.find_by(title: qf[:title]).nil? } @@ -236,34 +237,34 @@ ● Consider how your data could complement and integrate with existing data, or whether there are any existing data or methods that you could reuse. ● If purchasing or reusing existing data, explain how issues such as copyright and IPR have been addressed. You should aim to m inimise any restrictions on the reuse (and subsequent sharing) of third-party data.", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Data Description')]}, {text: "● Clearly note what format(s) your data will be in, e.g., plain text (.txt), comma-separated values (.csv), geo-referenced TIFF (.tif, .tfw). ● Explain why you have chosen certain formats. Decisions may be based on staff expertise, a preference for open formats, the standards accepted by data centres or widespread usage within a given community. ● Using standardised, interchangeable or open formats ensures the long-term usability of data; these are recommended for sharing and archiving. ● See UK Data Service guidance on recommended formats or DataONE Best Practices for file formats", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Data Format')]}, {text: "● Note what volume of data you will create in MB/GB/TB ● Consider the implications of data volumes in terms of storage, access and preservation. Do you need to include additional costs? ● Consider whether the scale of the data will pose challenges when sharing or transferring data between sites; if so, how will you address these challenges?", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Data Volume')]}, {text: "● Outline how the data will be collected and processed. This should cover relevant standards or methods, quality assurance and data organisation. ● Indicate how the data will be organised during the project, mentioning, e.g., naming conventions, version control and folder structures. Consistent, well-ordered research data will be easier to find, understand and reuse ● Explain how the consistency and quality of data collection will be controlled and documented. This may include processes such as calibration, repeat samples or measurements, standardised data capture, data entry validation, peer review of data or representation with controlled vocabularies. ● See the DataOne Best Practices for data quality", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Data Collection')]}, {text: "● What metadata will be provided to help others identify and discover the data? ● Researchers are strongly encouraged to use community metadata standards where these are in place. The Research Data Alliance offers a Directory of Metadata Standards. ● Consider what other documentation is needed to enable reuse. This may include information on the methodology used to collect the data, analytical and procedural information, definitions of variables, units of measurement, any assumptions made, the format and file type of the data and software used to collect and/or process the data. ● Consider how you will capture this information and where it will be recorded, e.g., in a database with links to each item, in a ‘readme’ text file, in file headers, etc. ", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Metadata & Documentation')]}, {text: "● Investigators carrying out research involving human participants should request consent to preserve and share the data. Do not just ask for permission to use the data in your study or make unnecessary promises to delete it at the end. @@ -271,13 +272,13 @@ ● Ethical issues may affect how you store and transfer data, who can see/use it and how long it is kept. You should demonstrate that you are aware of this and have planned accordingly. ● See UK Data Service guidance on consent for data sharing ● See ICPSR approach to confidentiality and Health Insurance Portability and Accountability Act (HIPAA) regulations for health research", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Ethics & Privacy')]}, {text: "● State who will own the copyright and IPR of any new data that you will generate. For multi-partner projects, IPR ownership should be covered in the consortium agreement. ● Outline any restrictions needed on data sharing, e.g., to protect proprietary or patentable data. ● Explain how the data will be licensed for reuse. See the DCC guide on How to license research data and EUDAT’s data and software licensing wizard.", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Intellectual Property Rights')]}, {text: "● Describe where the data will be stored and backed up during the course of research activities. This may vary if you are doing fieldwork or working across multiple sites so explain each procedure. @@ -285,7 +286,7 @@ ● See UK Data Service Guidance on data storage or DataONE Best Practices for storage ● Also consider data security, particularly if your data is sensitive e.g., detailed personal data, politically sensitive information or trade secrets. Note the main risks and how these will be managed. ● Identify any formal standards that you will comply with, e.g., ISO 27001. See the DCC Briefing Paper on Information Security Management -ISO 27000 and UK Data Service guidance on data security", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Storage & Security')]}, {text: "● How will you share the data e.g. deposit in a data repository, use a secure data service, handle data requests directly or use another mechanism? The methods used will depend on a number of factors such as the type, size, complexity and sensitivity of the data. @@ -293,40 +294,40 @@ ● Who will be able to use your data? If you need to restricted access to certain communities or apply data sharing agreements, explain why. ● Consider strategies to minimise restrictions on sharing. These may include anonymising or aggregating data, gaining participant consent for data sharing, gaining copyright permissions, and agreeing a limited embargo period. ● How might your data be reused in other contexts? Where there is potential for reuse, you should use standards and formats that facilitate this, and ensure that appropriate metadata is available online so your data can be discovered. Persistent identifiers should be applied so people can reliably and efficiently find your data. They also help you to track citations and reuse.", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Data Sharing')]}, {text: "● Where will the data be deposited? If you do not propose to use an established repository, the data management plan should demonstrate that the data can be curated effectively beyond the lifetime of the grant. ● It helps to show that you have consulted with the repository to understand their policies and procedures, including any metadata standards. ● An international list of data repositories is available via Re3data and some universities or publishers provide lists of recommendations e.g. PLOS ONE recommended repositories", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Data Repository')]}, {text: "● Indicate which data are of long-term value and should be shared and/or preserved. ● Outline the plans for data sharing and preservation - how long will the data be retained and where will it be archived? ● Will additional resources be needed to prepare data for deposit or meet any charges from data repositories? See the DCC guide: How to appraise and select research data for curation or DataONE Best Practices: Identifying data with long-term value", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Preservation')]}, {text: "● Outline the roles and responsibilities for all activities, e.g., data capture, metadata production, data quality, storage and backup, data archiving & data sharing. Individuals should be named where possible. ● For collaborative projects you should explain the coordination of data management responsibilities across partners. ● See UK Data Service guidance on data management roles and responsibilities or DataONE Best Practices: Define roles and assign responsibilities for data management", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Roles & Responsibilities')]}, {text: "● Carefully consider and justify any resources needed to deliver the plan. These may include storage costs, hardware, staff time, costs of preparing data for deposit and repository charges. ● Outline any relevant technical expertise, support and training that is likely to be required and how it will be acquired. ● If you are not depositing in a data repository, ensure you have appropriate resources and systems in place to share and preserve the data. See UK Data Service guidance on costing data management", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Budget')]}, {text: "● Consider whether there are any existing procedures that you can base your approach on. If your group/department has local guidelines that you work to, point to them here. ● List any other relevant funder, institutional, departmental or group policies on data management, data sharing and data security. ", - guidance_groups: [GuidanceGroup.first], + guidance_group: GuidanceGroup.first, published: true, themes: [Theme.find_by(title: 'Related Policies')]}, {text: "Please tell us how much data you plan to collect and what format it will be in once its deposited.", - guidance_groups: [GuidanceGroup.last], + guidance_group: GuidanceGroup.last, published: true, themes: [Theme.find_by(title: 'Data Description')]} ] @@ -350,10 +351,11 @@ # Create 2 phases for the funder's template and one for our generic template # ------------------------------------------------------- phases = [ - {title: "Generic Data Management Planning Template", + {title: "Generic DMP", number: 1, template: Template.find_by(title: "My Curation Center's Default Template"), modifiable: false}, + {title: "Preliminary Statement of Work", number: 1, template: Template.find_by(title: "Department of Testing Award"), @@ -365,203 +367,242 @@ ] phases.map{ |p| Phase.create!(p) if Phase.find_by(title: p[:title]).nil? } +generic_template_phase_1 = Phase.find_by(title: "Generic DMP") +funder_template_phase_1 = Phase.find_by(title: "Preliminary Statement of Work") +funder_template_phase_2 = Phase.find_by(title: "Detailed Overview") + # Create sections for the 2 templates and their phases # ------------------------------------------------------- sections = [ - {title: "Overview", + # Sections for the 'Generic DMP' phase of the 'My Curation Center's Default Template' + {title: "Data Collection", number: 1, - phase: Phase.find_by(title: "Regional CurationCenter Data Management Plan"), + phase: generic_template_phase_1, published: true, modifiable: false}, - {title: "Collection", + {title: "Documentation and Metadata", number: 2, - phase: Phase.find_by(title: "Regional CurationCenter Data Management Plan"), + phase: generic_template_phase_1, published: true, modifiable: false}, - {title: "Documentation", + {title: "Ethics and Legal Compliance", number: 3, - phase: Phase.find_by(title: "Regional CurationCenter Data Management Plan"), + phase: generic_template_phase_1, published: true, modifiable: false}, - {title: "Sharing and Usage", + {title: "Storage and Backup", number: 4, - phase: Phase.find_by(title: "Regional CurationCenter Data Management Plan"), + phase: generic_template_phase_1, published: true, modifiable: false}, - {title: "Long Term Preservation", + {title: "Selection and Preservation", number: 5, - phase: Phase.find_by(title: "Regional CurationCenter Data Management Plan"), + phase: generic_template_phase_1, + published: true, + modifiable: false}, + {title: "Data Sharing", + number: 5, + phase: generic_template_phase_1, + published: true, + modifiable: false}, + {title: "Responsibilities and Resources", + number: 5, + phase: generic_template_phase_1, + published: true, + modifiable: false}, + + # Sections for the 'Preliminary Statement of Work' phase of the 'Department of Testing Award' + {title: "Data Description", + number: 1, + phase: funder_template_phase_1, + published: true, + modifiable: false}, + {title: "Collection Methodology", + number: 2, + phase: funder_template_phase_1, published: true, modifiable: false}, - {title: "Data Description", - number: 1, - phase: Phase.find_by(title: "Preliminary Statement of Work"), - published: true, - modifiable: false}, - {title: "Data Description", - number: 1, - phase: Phase.find_by(title: "Preliminary Statement of Work"), - published: true, - modifiable: false}, - + # Sections for the 'Detailed Overview' phase of the 'Department of Testing Award' {title: "Preservation Policy", number: 1, - phase: Phase.find_by(title: "Detailed Overview"), + phase: funder_template_phase_2, published: true, modifiable: false}, {title: "Data Format and Storage", - number: 1, - phase: Phase.find_by(title: "Detailed Overview"), + number: 2, + phase: funder_template_phase_2, published: true, modifiable: false}, {title: "Collection Process", - number: 1, - phase: Phase.find_by(title: "Detailed Overview"), + number: 3, + phase: funder_template_phase_2, published: true, modifiable: false}, {title: "Ethical Standards", - number: 1, - phase: Phase.find_by(title: "Detailed Overview"), + number: 4, + phase: funder_template_phase_2, published: true, modifiable: false}, {title: "Preservation and Reuse Policies", - number: 1, - phase: Phase.find_by(title: "Detailed Overview"), + number: 5, + phase: funder_template_phase_2, published: true, modifiable: false} ] sections.map{ |s| Section.create!(s) if Section.find_by(title: s[:title]).nil? } +text_area_format = QuestionFormat.find_by(title: 'Text area') -=begin - questions = { - "What data will you collect or create?" => { - text: "What data will you collect or create?", - section: "Data Collection", - number: 1, - guidance: "
Questions to consider:
Guidance:
Give a brief description of the data, including any existing data or third-party sources that will be used, in each case noting its content, type and coverage. Outline and justify your choice of format and consider the implications of data format and data volumes in terms of storage, backup and access.
", - themes: ["Theme 2"] - }, - "How will the data be collected or created?" => { - text: "How will the data be collected or created?", - section: "Data Collection", - number: 2, - guidance: "Questions to consider:
Guidance:
Outline how the data will be collected/created and which community data standards (if any) will be used. Consider how the data will be organised during the project, mentioning for example naming conventions, version control and folder structures. Explain how the consistency and quality of data collection will be controlled and documented. This may include processes such as calibration, repeat samples or measurements, standardised data capture or recording, data entry validation, peer review of data or representation with controlled vocabularies.
", - themes: ["Theme 3"] - }, - "What documentation and metadata will accompany the data?" => { - text: "What documentation and metadata will accompany the data?", - section: "Documentation and Metadata", - number: 1, - guidance: "Questions to consider:
Guidance:
Describe the types of documentation that will accompany the data to help secondary users to understand and reuse it. This should at least include basic details that will help people to find the data, including who created or contributed to the data, its title, date of creation and under what conditions it can be accessed.
Documentation may also include details on the methodology used, analytical and procedural information, definitions of variables, vocabularies, units of measurement, any assumptions made, and the format and file type of the data. Consider how you will capture this information and where it will be recorded. Wherever possible you should identify and use existing community standards.
", - themes: ["Theme 1"] - }, - "Data Overview" => { - text: "Overview of the Data", - section: "Data Overview", - number: 1, - guidance: "Things to consider:
Things to consider:
Questions to consider:
Guidance:
Ethical issues affect how you store data, who can see/use it and how long it is kept. Managing ethical concerns may include: anonymisation of data; referral to departmental or institutional ethics committees; and formal consent agreements. You should show that you are aware of any issues and have planned accordingly. If you are carrying out research involving human participants, you must also ensure that consent is requested to allow data to be shared and reused.
", - themes: ["Theme 4"] - }, - "How will you manage copyright and Intellectual Property Rights (IPR) issues?" => { - text: "How will you manage copyright and Intellectual Property Rights (IPR) issues?", - section: "Ethics and Legal Compliance", - number: 2, - guidance: "Questions to consider:
Guidance:
State who will own the copyright and IPR of any data that you will collect or create, along with the licence(s) for its use and reuse. For multi-partner projects, IPR ownership may be worth covering in a consortium agreement. Consider any relevant funder, institutional, departmental or group policies on copyright or IPR. Also consider permissions to reuse third-party data and any restrictions needed on data sharing.
", - themes: ["Theme 1"] - }, - "How will the data be stored and backed up during the research?" => { - text: "How will the data be stored and backed up during the research?", - section: "Storage and Backup", - number: 1, - guidance: "Questions to consider:
Guidance:
State how often the data will be backed up and to which locations. How many copies are being made? Storing data on laptops, computer hard drives or external storage devices alone is very risky. The use of robust, managed storage provided by university IT teams is preferable. Similarly, it is normally better to use automatic backup services provided by IT Services than rely on manual processes. If you choose to use a third-party service, you should ensure that this does not conflict with any funder, institutional, departmental or group policies, for example in terms of the legal jurisdiction in which data are held or the protection of sensitive data.
", - themes: ["Theme 2"] - }, - "4a: Preserving Your Data" => { - text: "4a: Preserving Your Data", - section: "Preservation, Sustainability and Use", - number: 1, - guidance: "Preservation of digital outputs is necessary in order for them to endure changes in the technological environment and remain potentially re-usable in the future. In this section you must state what, if any, digital outputs of your project you intend to preserve beyond the period of funding.
The length and cost of preservation should be proportionate to the value and significance of the digital outputs. If you believe that none of these should be preserved this must be justified, and if the case is a good one the application will not be prejudiced.
You must consider preservation in four ways: what, where, how and for how long. You must also consider any institutional support needed in order to carry out these plans, whether from an individual, facility, organisation or service.
You should think about the possibilities for re-use of your data in other contexts and by other users, and connect this as appropriate with your plans for dissemination and Pathways to Impact.Where there is potential for re-usability, you should use standards and formats that facilitate this.
The Technical Reviewer will be looking for evidence that you understand the reasons for the choice of technical standards and formats described in Section 2.a Technical Methodology: Standards and Formats.
You should describe the types of documentation which will accompany the data. Documentation in this sense means technical documentation as well as user documentation. It includes, for instance, technical description, code commenting, project-build guidelines, the documentation of technical decisions and resource metadata which is additional to the standards which you have described in Section 2.a. Not all types of documentation will be relevant to a project and the quantity of documentation proposed should be proportionate to the envisaged value of the data.
", - themes: ["Theme 2", "Theme 3", "Theme 4"] - }, - "4b: Ensuring Continued Accessibility and Use of Your Digital Outputs" => { - text: "4b: Ensuring Continued Accessibility and Use of Your Digital Outputs", - section: "Preservation, Sustainability and Use", - number: 2, - guidance: "In this section you must provide information about any plans for ensuring that digital outputs remain sustainable in the sense of immediately accessible and usable beyond the period of funding. There are costs to ensuring sustainability in this sense over and above the costs of preservation. The project's sustainability plan should therefore be proportionate to the envisaged longer-term value of the data for the research community and should be closely related to your plans for dissemination and Pathways to Impact.
If you believe that digital outputs should not be sustained beyond the period of funding then this should be justified. It is not mandatory to sustain all digital outputs. While you should consider the long-term value of the digital outputs to the research community, where they are purely ancillary to a project’s research outputs there may not be a case for sustaining them (though there would usually be a case for preservation).
You must consider the sustainability of your digital outputs in five ways: what, where, how, for how long, and how the cost will be covered. You must make appropriate provision for user consultation and user testing in this connection, and plan the development of suitable user documentation.
You should provide justification if you do not envisage open, public access. A case can be made for charging for or otherwise limiting access, but the default expectation is that access will be open. The Technical Reviewer will be looking for realistic commitments to sustaining public access in line with affordability and the longer-term value of the digital output.
You must consider any institutional support needed in order to carry out these plans, if not covered under Section 3, as well as the cost of keeping the digital output publicly available in the future, including issues relating to maintenance, infrastructure and upgrade (such as the need to modify aspects of a web interface or software application in order to account for changes in the technological environment). In order to minimise sustainability costs, it is generally useful that the expertise involved in the development of your project is supported by expertise in your own or a partner institution.
A sustainability plan does not necessarily mean a requirement to generate income or prevent resources from being freely available. Rather it is a requirement to consider the direct costs and expertise of maintaining digital outputs for continued access. Some applicants might be able to demonstrate that there will be no significant sustainability problems with their digital output; in some cases the university’s computing services or library might provide a firm commitment to sustaining the resource for a specified period; others might see the benefit of Open Source community development models. You should provide reassurances of sustainability which are proportionate to the envisaged longer-term value of the digital outputs for the research community.
When completing this section, you should consider the potential impact of the data on research in your field (if research in the discipline will be improved through the creation of the digital output, how will it be affected if the resource then disappears?), and make the necessary connections with your Impact Plan. You must factor in the effects of any IP, copyright and ethical issues during the period in which the digital output will be publicly accessible, connecting what you say with the relevant part of your Case for Support.
You must identify whether or not you envisage the academic content (as distinct from the technology) of the digital output being extended or updated beyond the period of funding, addressing the following issues: how this will be done, by who and at what cost. You will need to show how the cost of this will be sustained after the period of funding ends.
", - themes: ["Theme 2"] - } - } +# Create questions for the 2 templates and their phases/sections +# ------------------------------------------------------- +questions = [ + # Questions for the 'Generic DMP' phase of the 'My Curation Center's Default Template' + {number: 1, + text: "What data will you collect or create?", + section: generic_template_phase_1.sections.find_by(number: 1), + question_format: text_area_format, + modifiable: false}, + {number: 2, + text: "How will the data be collected or created?", + section: generic_template_phase_1.sections.find_by(number: 1), + question_format: text_area_format, + modifiable: false}, + {number: 1, + text: "What documentation and metadata will accompany the data?", + section: generic_template_phase_1.sections.find_by(number: 2), + question_format: text_area_format, + modifiable: false}, + {number: 1, + text: "How will you manage ethical issues?", + section: generic_template_phase_1.sections.find_by(number: 3), + question_format: text_area_format, + modifiable: false}, + {number: 2, + text: "How will you manage copyright and Intellectual Property Rights (IPR) issues?", + section: generic_template_phase_1.sections.find_by(number: 3), + question_format: text_area_format, + modifiable: false}, + {number: 1, + text: "How will the data be stored and backed up during the research?", + section: generic_template_phase_1.sections.find_by(number: 4), + question_format: text_area_format, + modifiable: false}, + {number: 2, + text: "How will you manage access and security?", + section: generic_template_phase_1.sections.find_by(number: 4), + question_format: text_area_format, + modifiable: false}, + {number: 1, + text: "Which data are of long-term value and should be retained, shared, and/or preserved?", + section: generic_template_phase_1.sections.find_by(number: 5), + question_format: text_area_format, + modifiable: false}, + {number: 2, + text: "What is the long-term preservation plan for the dataset?", + section: generic_template_phase_1.sections.find_by(number: 5), + question_format: text_area_format, + modifiable: false}, + {number: 1, + text: "How will you share the data?", + section: generic_template_phase_1.sections.find_by(number: 6), + question_format: text_area_format, + modifiable: false}, + {number: 2, + text: "Are any restrictions on data sharing required?", + section: generic_template_phase_1.sections.find_by(number: 6), + question_format: text_area_format, + modifiable: false}, + {number: 1, + text: "Who will be responsible for data management?", + section: generic_template_phase_1.sections.find_by(number: 7), + question_format: text_area_format, + modifiable: false}, + {number: 2, + text: "What resources will you require to deliver your plan?", + section: generic_template_phase_1.sections.find_by(number: 7), + question_format: text_area_format, + modifiable: false}, + + # Questions for the 'Preliminary Statement of Work' phase of the 'Department of Testing Award' + {number: 1, + text: "Please provide a description of the type(s) of data you plan to collect.", + default_value: "Statistical data stored in csv files, images in the RAW format, etc.", + section: funder_template_phase_1.sections.find_by(number: 1), + question_format: text_area_format, + modifiable: false}, + {number: 1, + text: "Please describe your methods for gathering and storing the data.", + section: funder_template_phase_1.sections.find_by(number: 2), + question_format: text_area_format, + modifiable: false}, + + # Questions for the 'Detailed Overview' phase of the 'Department of Testing Award' + {number: 1, + text: "Please describe your departmental and institutional policies about preserving research data.", + section: funder_template_phase_2.sections.find_by(number: 1), + question_format: text_area_format, + modifiable: false}, + + {number: 1, + text: "Please list all data formats you intend to collect and provide a description of the storage facilities you intend to use.", + section: funder_template_phase_2.sections.find_by(number: 2), + question_format: text_area_format, + modifiable: false}, + {number: 2, + text: "Will require store your data in your institution's repository?", + section: funder_template_phase_2.sections.find_by(number: 2), + question_format: QuestionFormat.find_by(title: 'Check box'), + modifiable: false}, + + {number: 1, + text: "How will you go about collecting your data?", + section: funder_template_phase_2.sections.find_by(number: 3), + question_format: text_area_format, + modifiable: false}, + + {number: 1, + text: "How will you ensure that your data does not contain sensitive information like personal email addresses, social security number, names, etc.", + section: funder_template_phase_2.sections.find_by(number: 4), + question_format: text_area_format, + modifiable: false}, + + {number: 1, + text: "Please describe your overall plan for preservation and reuse.", + default_value: "Enter your policy guidelines here ...", + section: funder_template_phase_2.sections.find_by(number: 5), + question_format: text_area_format, + modifiable: false}, + {number: 2, + text: "What type of license will you use?", + section: funder_template_phase_2.sections.find_by(number: 5), + question_format: QuestionFormat.find_by(title: 'Dropdown'), + modifiable: false}, + {number: 3, + text: "When will the data be made available to the public?", + guidance: "The date can be approximate.", + section: funder_template_phase_2.sections.find_by(number: 5), + question_format: QuestionFormat.find_by(title: 'Date'), + modifiable: false} +] +questions.map{ |s| Question.create!(s) if Question.find_by(text: s[:text]).nil? } - questions.each do |q, details| - if Question.where(text: details[:text]).empty? - question = Question.new - question.text = details[:text] - question.number = details[:number] - question.guidance = details[:guidance] - question.section = Section.find_by_title(details[:section]) - details[:themes].each do |theme| - question.themes << Theme.find_by_title(theme) - end - question.save! - end - end -formatting = { - 'Funder' => { - font_face: "Arial, Helvetica, Sans-Serif", - font_size: 11, - margin: { top: 20, bottom: 20, left: 20, right: 20 } - }, - 'DCC' => { - font_face: "Arial, Helvetica, Sans-Serif", - font_size: 12, - margin: { top: 20, bottom: 20, left: 20, right: 20 } - } -} - -formatting.each do |org, settings| - #template = Dmptemplate.find_by_title("#{org} Template") # this is bugged, there is no Funder Template nor DCC template - #template.settings(:export).formatting = settings - #template.save! -end - -token_permission_types = { - 'guidances' => { - description: "allows a user access to the guidances api endpoint" - }, - 'plans' => { - description: "allows a user access to the plans api endpoint" - }, - 'templates' => { - description: "allows a user access to the templates api endpoint" - }, - 'statistics' => { - description: "allows a user access to the statistics api endpoint" - } -} - -token_permission_types.each do |title,settings| - if TokenPermissionType.where(token_type: title).empty? - token_permission_type = TokenPermissionType.new - token_permission_type.token_type = title - token_permission_type.text_description = settings[:description] - token_permission_type.save! - end -end -=end \ No newline at end of file +# Create some options for our dropdown question +# ------------------------------------------------------- +license_question = Question.find_by(text: "What type of license will you use?") +license_question_options = [ + {question: license_question, + text: "BSD", + number: 1, + is_default: false}, + {question: license_question, + text: "GNU", + number: 2, + is_default: false}, + {question: license_question, + text: "MIT", + number: 3, + is_default: true} +] +license_question_options.map{ |q| QuestionOption.create!(q) if QuestionOption.find_by(text: q[:text]).nil? } \ No newline at end of file