hltcoe / turkle

Django-based clone of Amazon's Mechanical Turk service running in your local environment.
https://turkle.readthedocs.io
Other
147 stars 47 forks source link

Turkle rejects HTML templates that use JavaScript template literals #80

Open hltcoe-bot opened 4 years ago

hltcoe-bot commented 4 years ago

Discovered by an undergrad working with paulmac.

Turkle currently assumes that the syntax ${foo} is only used for Turkle template variables. When uploading a CSV file, Turkle (currently) requires that the CSV header include a column name for each of the "template variables" it discovers.

When Mechanical Turk was first deployed, ${foo} was not a valid JavaScript construct. But newer versions of JavaScript (apparently starting with the ES2015 standard) introduced support for Template literals (formerly called Template strings). Template literals are backtick-quoted strings that use the same ${foo} syntax for variable substitution, e.g.:

var foo = 'world';
var x = `hello ${foo}`;

Poster: Craig Harman id: 257

hltcoe-bot commented 4 years ago

Here are the HTML template and CSV file that exposed the problem:

audio-translation-json.html

json-file.csv

Poster: Craig Harman

hltcoe-bot commented 4 years ago

mentioned in merge request !216

Poster: Craig Harman