Combining information from several databases

Re: Combining information from several databases

by Itamar Tzadok -
Number of replies: 5

The field type is available from git at https://github.com/itamart/moodle-mod_dataform/tree/dataform_23/field/dataformview. You can download that Dataform version (https://github.com/itamart/moodle-mod_dataform/archive/dataform_23.zip) and extract the field code from there. I don't know what may be required for making it work with 2012100500. The work around that field type involved also changes to the Dataform filter API. Give it a try, let me know if you need further assistance with this. smile

In reply to Itamar Tzadok

Re: Combining information from several databases

by Noah Freedman -

Two questions about custom search criteria:

Is it possible to nest criteria (e.g. OR{condition one},OR(AND{condition two),AND{condition three})?

We are storing year numbers as text (e.g. "2014", "2015").  Is there any access to type conversion, so that we can perform simple arithmetic (e.g. AND,##Year##,0,=,##Year##+1)?

In reply to Noah Freedman

Re: Combining information from several databases

by Noah Freedman -

As a follow-on, is it possible to use the calculation pattern (e.g. %%F1:=Year-1%%) in the context of custom search criteria?  I realise from testing this kind of formula calculation within a view that numbers in a text entry are treated like numbers and can be used for arithmetic, so the key challenge is either:

passing a calculated result as the ref-pattern; or

calculating within the search criterion.

In reply to Noah Freedman

Re: Combining information from several databases

by Itamar Tzadok -
Is it possible to nest criteria (e.g. OR{condition one},OR(AND{condition two),AND{condition three})?

Not yet, but I've been thinking about adding this option.


Is there any access to type conversion, so that we can perform simple arithmetic (e.g. AND,##Year##,0,=,##Year##+1)?

Assuming you need this function in the dataformview field, the natural way would be to create a specialized field plugin as an extension of the dataformview field and override dataformfield_dataformview_renderer:get_search_options with an implementation which takes the value part of the search option, parses it as a formula and calculates the actual value accordingly.


is it possible to use the calculation pattern (e.g. %%F1:=Year-1%%) in the context of custom search criteria?

Not currently supported by the dataformfilter. But then again, the search value is determined by the field's get_search_value, which you can override in a specialized field type.


hth smile

In reply to Itamar Tzadok

Απάντηση: Re: Combining information from several databases

by Nick Ntalias -

Hello Itamar!


Thanks for this grate module called "Dataform"!

Where could i find field type "dataformview" and how could i add this in my moodle site in order to use it in moodle 2.6 Dataform module? The link you provide doesn' t work any more. I would like to see how i could include data from dataform A to dataform B.

Thanks in advance!

In reply to Nick Ntalias

Re: Απάντηση: Re: Combining information from several databases

by Itamar Tzadok -

The dataformview field has not been released yet for 2.6. I'll try to release it along with some other dataform add-ons in a week or so. smile