XML for AMT ExternalQuestion

If you are trying to use Amazon Mechanical Turk for something and you don’t know XML very well, you might run into this error when trying to write an ExternalQuestion with the command line tools.

vanhoudn@gauze:~/workspace/aws-mturk-clt-1.3.0/samples/rate_tests$ ./run.sh
--[Initializing]----------
Input: ../samples/rate_tests/rate_tests.input.csv
Properties: ../samples/rate_tests/rate_tests.properties
Question File: ../samples/rate_tests/rate_tests.question
Preview mode disabled
--[Loading HITs]----------
Start time: Thu Aug 05 16:12:33 EDT 2010
[Fatal Error] :6:111: The reference to entity "student2" must end with the ';' delimiter.
[ERROR] Error creating HIT 1 (3001): [6,111] The reference to entity "student2" must end with the ';' delimiter.
...

The issue is that I’m trying to pass more than one variable via the url and this:

<ExternalURL>
http://www.contrib.andrew.cmu.edu/~nmv/amt/test.php?
student1=${helper.urlencode($student1)}
&student2=${helper.urlencode($student2)}
&student3=${helper.urlencode($student3)}
</ExternalURL> 

Should instead be:

<ExternalURL>
http://www.contrib.andrew.cmu.edu/~nmv/amt/test.php?
student1=${helper.urlencode($student1)}
&amp;student2=${helper.urlencode($student2)}
&amp;student3=${helper.urlencode($student3)}
</ExternalURL> 

The & that separates the variables need to be replaced with &amp;. Then it works just fine.

Advertisements

One response to “XML for AMT ExternalQuestion

  1. Thank you very much I would have never caught this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s