Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix progress for conditional questions in datasets #1107

Merged
merged 7 commits into from
Aug 13, 2024

Conversation

MyPyDavid
Copy link
Member

@MyPyDavid MyPyDavid commented Aug 7, 2024

Description

Related issue: #1103

Motivation and Context

How has this been tested?

Catalog xml for testing this use-case

<?xml version="1.0" encoding="UTF-8"?>
<rdmo xmlns:dc="http://purl.org/dc/elements/1.1/" created="2024-08-06T09:12:56.389719+02:00" version="2.2.0.dev1">
	<catalog dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/test-bug-dataset-conditional-question">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-bug-dataset-conditional-question</uri_path>
		<dc:comment/>
		<order>0</order>
		<title lang="en">test-bug-dataset-conditional-question</title>
		<help lang="en"/>
		<title lang="de">test-bug-dataset-conditional-question</title>
		<help lang="de"/>
		<sections>
			<section dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/test-bug-dataset-conditional-question-section" order="1"/>
		</sections>
	</catalog>
	<section dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/test-bug-dataset-conditional-question-section">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-bug-dataset-conditional-question-section</uri_path>
		<dc:comment/>
		<title lang="en">test-bug-dataset-conditional-question-section</title>
		<short_title lang="en"/>
		<title lang="de">test-bug-dataset-conditional-question-section</title>
		<short_title lang="de"/>
		<pages>
			<page dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/test-bug-dataset-conditional-question-section-page" order="1"/>
		</pages>
	</section>
	<page dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/test-bug-dataset-conditional-question-section-page">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-bug-dataset-conditional-question-section-page</uri_path>
		<dc:comment/>
		<attribute dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset/id"/>
		<is_collection>True</is_collection>
		<title lang="en">test-bug-page</title>
		<short_title lang="en"/>
		<help lang="en"/>
		<verbose_name lang="en"/>
		<title lang="de">test-bug-dataset-conditional-question-section-page</title>
		<short_title lang="de"/>
		<help lang="de"/>
		<verbose_name lang="de"/>
		<questionsets/>
		<questions>
			<question dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/data_description/data_content/ds_newData" order="0"/>
			<question dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/creation_methods_lab_equipment" order="1"/>
			<question dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/data_description/data_content/ds_reuse" order="2"/>
		</questions>
		<conditions/>
	</page>
	<attribute dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset/id">
		<uri_prefix>https://rdmorganiser.github.io/terms</uri_prefix>
		<key>id</key>
		<path>project/dataset/id</path>
		<dc:comment>Short ID for a dataset, used as questionset attribute for dataset related questionsets.</dc:comment>
		<parent dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset"/>
	</attribute>
	<attribute dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset">
		<uri_prefix>https://rdmorganiser.github.io/terms</uri_prefix>
		<key>dataset</key>
		<path>project/dataset</path>
		<dc:comment/>
		<parent dc:uri="https://rdmorganiser.github.io/terms/domain/project"/>
	</attribute>
	<attribute dc:uri="https://rdmorganiser.github.io/terms/domain/project">
		<uri_prefix>https://rdmorganiser.github.io/terms</uri_prefix>
		<key>project</key>
		<path>project</path>
		<dc:comment/>
		<parent/>
	</attribute>
	<question dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/data_description/data_content/ds_newData">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>data_description/data_content/ds_newData</uri_path>
		<dc:comment/>
		<attribute dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset/creation_methods"/>
		<is_collection>True</is_collection>
		<is_optional>False</is_optional>
		<help lang="en">This information is relevant for all types of data in order to be able to understand their genesis.

Please select the methodology used to generate the data.</help>
		<text lang="en">How does your project generate new data?</text>
		<default_text lang="en"/>
		<verbose_name lang="en"/>
		<help lang="de">Diese Informationen sind für alle Arten von Daten relevant, um deren Genese nachvollziehen zu können.

Bitte wählen Sie aus, mit welcher Methodik die Daten generiert werden.</help>
		<text lang="de">Auf welche Weise entstehen neue Daten?</text>
		<default_text lang="de"/>
		<verbose_name lang="de"/>
		<default_option/>
		<default_external_id/>
		<widget_type>checkbox</widget_type>
		<value_type>option</value_type>
		<maximum/>
		<minimum/>
		<step/>
		<unit/>
		<width/>
		<optionsets>
			<optionset dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-bug-optionset"/>
		</optionsets>
		<conditions/>
	</question>
	<attribute dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset/creation_methods">
		<uri_prefix>https://rdmorganiser.github.io/terms</uri_prefix>
		<key>creation_methods</key>
		<path>project/dataset/creation_methods</path>
		<dc:comment/>
		<parent dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset"/>
	</attribute>
	<optionset dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-bug-optionset">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-bug-optionset</uri_path>
		<dc:comment/>
		<provider_key/>
		<options>
			<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-bug-option/1" order="21785"/>
			<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-bug-option/2" order="21786"/>
			<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-bug-option/3" order="21787"/>
		</options>
		<conditions/>
	</optionset>
	<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-bug-option/1">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-bug-option/1</uri_path>
		<dc:comment/>
		<text lang="en">test-bug-option/1</text>
		<help lang="en"/>
		<view_text lang="en"/>
		<text lang="de">test-bug-option/1</text>
		<help lang="de"/>
		<view_text lang="de"/>
		<additional_input/>
	</option>
	<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-bug-option/2">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-bug-option/2</uri_path>
		<dc:comment/>
		<text lang="en">test-bug-option/2 (target option)</text>
		<help lang="en"/>
		<view_text lang="en"/>
		<text lang="de">test-bug-option/2 (target option)</text>
		<help lang="de"/>
		<view_text lang="de"/>
		<additional_input/>
	</option>
	<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-bug-option/3">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-bug-option/3</uri_path>
		<dc:comment/>
		<text lang="en">test-bug-option/3</text>
		<help lang="en"/>
		<view_text lang="en"/>
		<text lang="de">test-bug-option/3</text>
		<help lang="de"/>
		<view_text lang="de"/>
		<additional_input/>
	</option>
	<question dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/creation_methods_lab_equipment">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>creation_methods_lab_equipment</uri_path>
		<dc:comment/>
		<attribute dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/domain/project/dataset/creation_methods/lab_equipment"/>
		<is_collection>True</is_collection>
		<is_optional>False</is_optional>
		<help lang="en"/>
		<text lang="en">Welches Gerät nutzen Sie zur Datenerhebung?</text>
		<default_text lang="en"/>
		<verbose_name lang="en"/>
		<help lang="de">Angeezigt werden öffentliche Einträge aus der TUDa Datenbank für Geräte [TUinfra](https://www.tuinfra.tu-darmstadt.de).

Sie können bei Bedarf auch eigene Geräte eintragen</help>
		<text lang="de">Welches Gerät nutzen Sie zur Datenerhebung?</text>
		<default_text lang="de"/>
		<verbose_name lang="de"/>
		<default_option/>
		<default_external_id/>
		<widget_type>freeautocomplete</widget_type>
		<value_type>option</value_type>
		<maximum/>
		<minimum/>
		<step/>
		<unit/>
		<width/>
		<optionsets>
			<optionset dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-answer-optionset"/>
		</optionsets>
		<conditions>
			<condition dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/conditions/dfg-checklist-data-creation-in-lab"/>
		</conditions>
	</question>
	<attribute dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/domain/project/dataset/creation_methods/lab_equipment">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<key>lab_equipment</key>
		<path>project/dataset/creation_methods/lab_equipment</path>
		<dc:comment>Used lab equipment for data creation</dc:comment>
		<parent dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset/creation_methods"/>
	</attribute>
	<condition dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/conditions/dfg-checklist-data-creation-in-lab">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>dfg-checklist-data-creation-in-lab</uri_path>
		<dc:comment/>
		<source dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset/creation_methods"/>
		<relation>eq</relation>
		<target_text/>
		<target_option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-bug-option/2"/>
	</condition>
	<optionset dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-answer-optionset">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-answer-optionset</uri_path>
		<dc:comment/>
		<provider_key/>
		<options>
			<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-answer-option/1" order="1"/>
			<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-answer-option/2" order="2"/>
			<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-answer-option/3" order="3"/>
		</options>
		<conditions/>
	</optionset>
	<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-answer-option/1">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-answer-option/1</uri_path>
		<dc:comment/>
		<text lang="en">test-answer-option/1</text>
		<help lang="en"/>
		<view_text lang="en"/>
		<text lang="de">test-answer-option/1</text>
		<help lang="de"/>
		<view_text lang="de"/>
		<additional_input/>
	</option>
	<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-answer-option/2">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-answer-option/2</uri_path>
		<dc:comment/>
		<text lang="en">test-answer-option/2</text>
		<help lang="en"/>
		<view_text lang="en"/>
		<text lang="de">test-answer-option/2</text>
		<help lang="de"/>
		<view_text lang="de"/>
		<additional_input/>
	</option>
	<option dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/options/test-answer-option/3">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>test-answer-option/3</uri_path>
		<dc:comment/>
		<text lang="en">test-answer-option/3</text>
		<help lang="en"/>
		<view_text lang="en"/>
		<text lang="de">test-answer-option/3</text>
		<help lang="de"/>
		<view_text lang="de"/>
		<additional_input/>
	</option>
	<question dc:uri="https://rdmo-dev.ulb.tu-darmstadt.de/terms/questions/data_description/data_content/ds_reuse">
		<uri_prefix>https://rdmo-dev.ulb.tu-darmstadt.de/terms</uri_prefix>
		<uri_path>data_description/data_content/ds_reuse</uri_path>
		<dc:comment/>
		<attribute dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset/origin"/>
		<is_collection>False</is_collection>
		<is_optional>False</is_optional>
		<help lang="en">help text</help>
		<text lang="en">Are existing data reused?</text>
		<default_text lang="en"/>
		<verbose_name lang="en"/>
		<help lang="de">help text</help>
		<text lang="de">Werden existierende Daten wiederverwendet?</text>
		<default_text lang="de"/>
		<verbose_name lang="de"/>
		<default_option/>
		<default_external_id/>
		<widget_type>radio</widget_type>
		<value_type>option</value_type>
		<maximum/>
		<minimum/>
		<step/>
		<unit/>
		<width/>
		<optionsets>
			<optionset dc:uri="http://example.com/terms/options/one_two_three"/>
		</optionsets>
		<conditions/>
	</question>
	<attribute dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset/origin">
		<uri_prefix>https://rdmorganiser.github.io/terms</uri_prefix>
		<key>origin</key>
		<path>project/dataset/origin</path>
		<dc:comment/>
		<parent dc:uri="https://rdmorganiser.github.io/terms/domain/project/dataset"/>
	</attribute>
	<optionset dc:uri="http://example.com/terms/options/one_two_three">
		<uri_prefix>http://example.com/terms</uri_prefix>
		<uri_path>one_two_three</uri_path>
		<dc:comment/>
		<provider_key/>
		<options>
			<option dc:uri="http://example.com/terms/options/one_two_three/three" order="1"/>
			<option dc:uri="http://example.com/terms/options/one_two_three/two" order="2"/>
			<option dc:uri="http://example.com/terms/options/one_two_three/one" order="3"/>
		</options>
		<conditions/>
	</optionset>
	<option dc:uri="http://example.com/terms/options/one_two_three/three">
		<uri_prefix>http://example.com/terms</uri_prefix>
		<uri_path>one_two_three/three</uri_path>
		<dc:comment/>
		<text lang="en">Three</text>
		<help lang="en"/>
		<view_text lang="en"/>
		<text lang="de">Drei</text>
		<help lang="de"/>
		<view_text lang="de"/>
		<additional_input/>
	</option>
	<option dc:uri="http://example.com/terms/options/one_two_three/two">
		<uri_prefix>http://example.com/terms</uri_prefix>
		<uri_path>one_two_three/two</uri_path>
		<dc:comment/>
		<text lang="en">Two</text>
		<help lang="en"/>
		<view_text lang="en"/>
		<text lang="de">Zwei</text>
		<help lang="de"/>
		<view_text lang="de"/>
		<additional_input/>
	</option>
	<option dc:uri="http://example.com/terms/options/one_two_three/one">
		<uri_prefix>http://example.com/terms</uri_prefix>
		<uri_path>one_two_three/one</uri_path>
		<dc:comment/>
		<text lang="en">One</text>
		<help lang="en"/>
		<view_text lang="en"/>
		<text lang="de">Eins</text>
		<help lang="de"/>
		<view_text lang="de"/>
		<additional_input/>
	</option>
</rdmo>

Screenshots (if appropriate)

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • revert code to have minimal changes in PR
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@MyPyDavid MyPyDavid changed the base branch from main to dev-2.2.0 August 7, 2024 07:52
@MyPyDavid MyPyDavid force-pushed the progress_conditions_datasets branch from a901f7b to 2ae3fb3 Compare August 7, 2024 07:54
@MyPyDavid MyPyDavid changed the title Progress conditions datasets Fix progress for conditional questions in datasets Aug 7, 2024
rdmo/projects/progress.py Outdated Show resolved Hide resolved
@MyPyDavid MyPyDavid force-pushed the progress_conditions_datasets branch from 962167a to 4e99174 Compare August 7, 2024 13:42
rdmo/projects/progress.py Outdated Show resolved Hide resolved
@jochenklar jochenklar marked this pull request as ready for review August 13, 2024 08:12
@jochenklar
Copy link
Member

We can merge here, right?

@MyPyDavid
Copy link
Member Author

thanks, yes!

@MyPyDavid MyPyDavid merged commit 1806dc6 into dev-2.2.0 Aug 13, 2024
30 checks passed
@MyPyDavid MyPyDavid added this to the RDMO 2.2.0 milestone Aug 14, 2024
@jochenklar jochenklar deleted the progress_conditions_datasets branch August 25, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants