Git Product home page Git Product logo

getodk / javarosa Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 105.0 14.33 MB

The core library that many of the ODK tools are built around. It's written in Java, implements the ODK XForms spec, and runs on mobile devices and cloud servers. โœจ๐Ÿ—โœจ

License: Other

HTML 0.14% Java 99.68% Lex 0.18%
data-collection global-development global-health java mhealth mobile-data-collection odk xforms

javarosa's Introduction

opendatakit

The developer wiki (including release notes) and issues tracker are located here.

This site is primarily for developers. If you are not a developer, please visit https://getodk.org/

ODK is a free and open-source set tools which help organizations author, field, and manage mobile data collection solutions. ODK provides an out-of-the-box solution for users to:

  • Build a data collection form or survey;
  • Collect the data on a mobile device and send it to a server; and
  • Aggregate the collected data on a server and extract it in useful formats.

In addition to socio-economic and health surveys with GPS locations and images, ODK is being used to create decision support for clinicians and for building multimedia-rich nature mapping tools. See featured deployments and list of tools for more examples of what the ODK community is doing. We welcome and encourage participation from the user community.

Downloads of the tools are available at Downloads.

javarosa's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javarosa's Issues

fail gracefully when encountering an unknown function

Originally reported by: Yaw Anokwa (Bitbucket: yanokwa, GitHub: yanokwa)


When loading a form with arbitrary function calls, javarosa dies with an unhandled exception.
example where review() is the arbitrary function:

E/AndroidRuntime( 743): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 743): org.javarosa.xpath.XPathUnhandledException: XPath evaluation: cannot handle function 'review'
E/AndroidRuntime( 743): at org.javarosa.xpath.expr.XPathFuncExpr.eval(XPathFuncExpr.java:155)
E/AndroidRuntime( 743): at org.javarosa.xpath.XPathConditional.evalRaw(XPathConditional.java:57)
E/AndroidRuntime( 743): at org.javarosa.xpath.XPathConditional.eval(XPathConditional.java:61)
E/AndroidRuntime( 743): at org.javarosa.core.model.FormDef.evaluateConstraint(FormDef.java:520)

This should be handled gracefully and either logged as a warning/error, or pushed through the UI to the user. Either way, the form should still work.


bind datatype 'long' can't be deserialized

Originally reported by: Anonymous


After storing an unsent form that holds a input field of datatype 'long', i.e.

the form can't be opened again, neither can the 'saved forms' list, due to exception:

//unhandled exception in gui-cl => java.lang.RuntimeException[Error deserializing bytestream for type [fg]; No datatype registration to serialization code [c9 55 48 ff]]//

orignally posted at
https://groups.google.com/forum/#!topic/javarosa-developers/21iPw3gXmV8


trigger control does not save any data in the instance

Originally reported by: Yaw Anokwa (Bitbucket: yanokwa, GitHub: yanokwa)


for the trigger control it seems like jr j2meapp doesn't save anything in the instance.

that is, if i select "ok" after a trigger and i come back to that question, it doesn't remember that i clicked ok. might be good to have that data in the instance

also, if you mark a trigger as required, you can't go past it.


relevancy bug in nested groups with relevancy conditions based off calculated nodes

Originally reported by: Drew Roos (Bitbucket: mrgriscom, GitHub: mrgriscom)


i've discovered what i believe to be a bug in the propogation of chained conditions/relevancy. take the following form:

==========

#!xml

<h:html xmlns:h="http://www.w3.org/1999/xhtml"
        xmlns="http://www.w3.org/2002/xforms"
        xmlns:ev="http://www.w3.org/2001/xml-events"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:jr="http://openrosa.org/javarosa">
<h:head>
  <h:title>group relevancy bug</h:title>
    <model>
      <instance>
        <form xmlns="">

<outer_trigger />
<inner_trigger />

<outer>
  <inner>
    <target_question />
  </inner>
  <inner_condition />
</outer>

<end />

        </form>
      </instance>
    
<bind nodeset="inner_trigger" type="int" />
<bind nodeset="outer/inner_condition" calculate="/form/inner_trigger &lt; 10" />
<bind nodeset="outer" relevant="../outer_trigger and ../outer_trigger != 'A'" />
<bind nodeset="outer/inner" relevant="../inner_condition" />
        
    </model>
</h:head>            
<h:body>

<input ref="inner_trigger"><label>inner trigger (enter 5)</label></input>
<input ref="outer_trigger"><label>outer trigger (enter 'D')</label></input>
<input ref="outer/inner/target_question"><label>target question: i am incorrectly skipped</label></input>
<input ref="end"><label>this is the end of the form</label></input>
   
</h:body>
</h:html>

==========

answer 5 for the first question, and 'D' for the second question. the 'target question' will be skipped, but i believe it should show up, since all the relevancy conditions for its containing groups ('inner' and 'outer') are satisfied.

the problem case above is pretty specific; namely, changing any of the following will cause target_question to show correctly:

  • the relevancy of 'inner' must refer to a calculated node; putting the condition from inner_condition directly in the 'relevant' for 'inner' causes no bug
  • the calculated node 'inner_condition' must be inside 'outer'. putting it at the top level does not trigger the bug
  • inner_trigger must be asked before outer_trigger. switching the order causes no bug
  • the relevancy of outer must start out false by default. changing the relevancy to just '../outer_trigger != 'A'' doesn't trigger the bug, as outer_trigger begins null, and null != 'A', thus making the 'outer' group relevant
  • making inner_condition trivially dependent on outer_trigger doesn't cause the bug. i.e.,

i suspect that the problem comes from inner_condition initially being non-relevant by virtue of the containing group 'outer' being non-relevant. when 'outer' becomes relevant, the relevancy for its child nodes is not re-computed or was not pre-computed properly.


core crashes on select with no items

Originally reported by: Yaw Anokwa (Bitbucket: yanokwa, GitHub: yanokwa)


attached form crashes jr core with nullpointer exception at

java.lang.NullPointerException
       at org.javarosa.core.model.QuestionDef.localizeSelectMap(QuestionDef.java:259)
       at org.javarosa.xform.parse.XFormParser.parseControl(XFormParser.java:468)
       at org.javarosa.xform.parse.XFormParser$6.handle(XFormParser.java:120)
       at org.javarosa.xform.parse.XFormParser.parseElement(XFormParser.java:287)
       at org.javarosa.xform.parse.XFormParser.parseElement(XFormParser.java:296)
       at org.javarosa.xform.parse.XFormParser.parseElement(XFormParser.java:296)
       at org.javarosa.xform.parse.XFormParser.getFormDef(XFormParser.java:264)
       at org.javarosa.xform.parse.XFormParser.getFormDef(XFormParser.java:225)
       at org.javarosa.xform.util.XFormUtils.getFormFromInputStream(XFormUtils.java:50)

the problem is that one of the selects has a label but no items

<select1 ref="in14">
	<label ref="jr:itext('in14')"/>
</select1>

the core should throw a more useful error.


[itext:n] appearing in restored instances

Originally reported by: Yaw Anokwa (Bitbucket: yanokwa, GitHub: yanokwa)


if you fill out a form with itext data for answers and restore it from xml, the answers displayed are "[itext:0]".

we discovered and fixed this in odk (see http://code.google.com/p/open-data-kit/issues/detail?id=45), but it should be fixed in the core.

<> suggests this fix in XFormAnswerDataParser.java:getSelection()

if (q != null) {
    if (q.getSelectItems() == null) {
        q.localizeSelectMap(null);
    }
    int index = q.getSelectedItemIndex(choice);
    s.attachQuestionDef(q);
    return (index != -1 ? s : null);
}
return true;

need ability to load xforms via usb

Originally reported by: apoku (Bitbucket: apoku, GitHub: apoku)


Specifically when dynamically loading any number of forms, it is difficult to have the full JR experience on phones without GPRS service. As of now, once JR has been installed on the phone, the only dynamic option for loading new forms can occur by downloading forms over GPRS.

Proposal is for:

  • A way one can load xforms into the application without
    pulling them down from a remote server.
  • A way for Xforms to be transferred via USB
  • Users should be able to load as many xform(s) as desired after JR has been installed (i.e. Xforms need not be bundled with local build).

See discussion on javaRosa-implementers google group:
http://groups.google.com/group/javarosa-implementers/browse_thread/thread/6d4883d226f645eb


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.