Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/neuromat/nes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosribas committed Mar 27, 2019
2 parents 1809701 + 3f99a98 commit 9ab199c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
Binary file added docs/_img/decide_about_participants.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_img/experiment_import.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_img/study_import.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions docs/userguide/studies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You can see more information about an existing study by clicking on its title in

Importing an study
------------------
You can import an study with one experiment in the studies listing page through the `Import Study/Experiment` button. A page will load asking for the .json file with all the necessary data to create a new study and experiment. This .json file can be generated by exporting an experiment in the experiment list of the study (see more details about this list bellow).
You can import an study with one experiment in the studies listing page through the `Import Study/Experiment` button. A page will load asking for the .zip file with all the necessary data to create a new study and experiment. This .zip file can be generated by exporting an experiment in the experiment list of the study (see more details about this list bellow).

.. image:: ../_img/study_import.png

Expand All @@ -50,19 +50,21 @@ Experiments of a study
----------------------
A study may have multiple :ref:`experiments`. Again, only users that have :ref:`permissions` to update a study can add experiments. Non-authorized users can't see the `Insert new` button.

A list with all experiments that belongs to the study will be shown. You may make a copy of an experiment by clicking on the `Copy experiment` icon. A modal will pop up and you have to choose if you want to copy the experiment with or without data. You may also get a PDF version of the experiment by clicking on the `Create PDF` icon and you can export an experiment by clicking the `Export experiment` icon. This will generate a .json file with all the necessary structure of the experiment that can be later imported in other study or NES installation. And finally, if you can import a experiment from a .json file previously exported by NES into the study you are visualizing if you have the right permissions for it.
A list with all experiments that belongs to the study will be shown. You may make a copy of an experiment by clicking on the `Copy experiment` icon. A modal will pop up and you have to choose if you want to copy the experiment with or without data. You may also get a PDF version of the experiment by clicking on the `Create PDF` icon and you can export an experiment by clicking the `Export experiment` icon. This will generate a .zip file with all the necessary structure of the experiment that can be later imported in other study or NES installation along with data collections of the participants of the experiment if there is any. And finally, if you can import a experiment from a .zip file previously exported by NES into the study you are visualizing if you have the right permissions for it.

.. image:: ../_img/experiment_view.png

Exporting/Importing a Experiment of a Study
-------------------------------------------

In the list of experiments of a study (see image above), you can click the `Export experiment` button of an experiment and generate a .json file with all the necessary data to create a copy of this experiment into another study or NES installation.
In the list of experiments of a study (see image above), you can click the `Export experiment` button of an experiment and generate a .zip file with all the necessary data to create a copy of this experiment into another study or NES installation along with participants' personal data and data collections if there is any.

Still on this page, you can import an experiment into this study by clicking the `Import experiment` button. A new page will load where you have to upload the .json file of the experiment exported by NES. Once you upload it and send it, a new study will be created, with new groups and experimental protocols.
Still on this page, you can import an experiment into this study by clicking the `Import experiment` button. A new page will load where you have to upload the .zip file of the experiment exported by NES. Once you upload it and send it, if there'is any conflict between participants in the database, you will be asked to choose either if you want to update the participants in the database or create new ones. After that, a new study will be created, with new groups, experimental protocols and data collections.

.. image:: ../_img/experiment_import.png

.. image:: ../_img/decide_about_participants.png

.. toctree::
:maxdepth: 1
:titlesonly:
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3146,24 +3146,24 @@ msgid "Import Study/Experiment"
msgstr "Importar Estudo/Experimento"

#: experiment/templates/experiment/experiment_import.html:71
msgid "Choose a .json file previously exported by NES"
msgstr "Selecione um arquivo .json previamente exportado pelo NES"
msgid "Choose a .zip file previously exported by NES"
msgstr "Selecione um arquivo .zip previamente exportado pelo NES"

#: experiment/templates/experiment/experiment_import.html:74
msgid ""
"This will create a whole new Experiment. The extension of objects that will "
"be imported depends upon the stuff inside json file."
"be imported depends upon the stuff inside zip file."
msgstr ""
"Isto irá criar um Experimento completo. A extensão dos objetos que serão "
"importados depende das coisas que estão dentro do arquivo json."
"importados depende das coisas que estão dentro do arquivo zip."

#: experiment/templates/experiment/experiment_import.html:76
msgid ""
"This will create a whole new Study/Experiment. The extension of objects that "
"will be imported depends upon the stuff inside json file."
"will be imported depends upon the stuff inside zip file."
msgstr ""
"Isto irá criar um Estudo/Experimento completo. A extensão dos objetos que "
"serão importados depende das coisas que estão dentro do arquivo json."
"serão importados depende das coisas que estão dentro do arquivo zip."

#: experiment/templates/experiment/experiment_info_pdf.html:36
#: experiment/templates/experiment/experiment_register.html:72
Expand Down Expand Up @@ -5045,8 +5045,8 @@ msgid "Please, select at least one researcher."
msgstr "Por favor, selecione pelo menos um pesquisador."

#: experiment/views.py:841
msgid "Please select a json file"
msgstr "Por favor, selecione um arquivo .json"
msgid "Please select a zip file"
msgstr "Por favor, selecione um arquivo .zip"

#: experiment/views.py:893
msgid "Experiment successfully imported."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ <h3>{% trans "Import Experiment" %}</h3>
{% else %}
<h3>{% trans "Import Study/Experiment" %}</h3>
{% endif %}
<h4><em>{% trans "Choose a .json file previously exported by NES" %}</em></h4>
<h4><em>{% trans "Choose a .zip file previously exported by NES" %}</em></h4>
<p>
{% if research_project_id %}
{% trans "This will create a whole new Experiment. The extension of objects that will be imported depends upon the stuff inside json file." %}
{% else %}
{% trans "This will create a whole new Study/Experiment. The extension of objects that will be imported depends upon the stuff inside json file." %}
{% trans "This will create a whole new Study/Experiment. The extension of objects that will be imported depends upon the stuff inside zip file." %}
{% endif %}
</p>
<form method="post" enctype="multipart/form-data">
Expand Down
2 changes: 1 addition & 1 deletion patientregistrationsystem/qdc/experiment/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ def experiment_import(request, template_name='experiment/experiment_import.html'
if not patients_conflicts_resolved:
file = request.FILES.get('file')
if not file:
messages.warning(request, _('Please select a json file'))
messages.warning(request, _('Please select a zip file'))
return HttpResponseRedirect(reverse('experiment_import'))

file_name = handle_uploaded_file(file)
Expand Down

0 comments on commit 9ab199c

Please sign in to comment.