xml - 如何在 Amazon Mechanical Turk 命令行工具中将图像添加到资格测试?

标签 xml xslt amazon-web-services command-line mechanicalturk

我正在尝试使用 Amazon Mechanical Turk 命令行工具将外部图像 URL 添加到资格测试。这需要编辑标题为“qualification.question”的 XML 文件以包含图像 URL。

如果我想插入 URL http://upload.wikimedia.org/wikipedia/commons/6/6f/Earth_Eastern_Hemisphere.jpg进入文本“这是什么图片?”下方“qualification.question”中的代码,我该怎么做?

<Question>
    <QuestionIdentifier>question1</QuestionIdentifier>
    <QuestionContent>
        <Text>What is this a picture of?</Text>
    </QuestionContent>
    <AnswerSpecification>
        <SelectionAnswer>
          <StyleSuggestion>radiobutton</StyleSuggestion>
          <Selections>
            <Selection>
              <SelectionIdentifier>1a</SelectionIdentifier>
              <Text>Earth</Text>
            </Selection>
            <Selection>
              <SelectionIdentifier>1b</SelectionIdentifier>
              <Text>Sun</Text>
            </Selection>
          </Selections>
        </SelectionAnswer>
    </AnswerSpecification>
</Question>

最佳答案

想出如何去做。下面是有问题显示图像的更新代码。

#set( $image_url = "http://upload.wikimedia.org/wikipedia/commons/6/6f/Earth_Eastern_Hemisphere.jpg" )
  <Question>
      <QuestionIdentifier>question1</QuestionIdentifier>
      <QuestionContent>
          <Binary>
            <MimeType>
              <Type>image</Type>
              <SubType>jpg</SubType>
            </MimeType>
            <DataURL>${image_url}</DataURL>
            <AltText>Image</AltText>
          </Binary>
          <Text>What is this a picture of?</Text>
      </QuestionContent>
      <AnswerSpecification>
          <SelectionAnswer>
            <StyleSuggestion>radiobutton</StyleSuggestion>
            <Selections>
              <Selection>
                <SelectionIdentifier>1a</SelectionIdentifier>
                <Text>Earth</Text>
              </Selection>
              <Selection>
                <SelectionIdentifier>1b</SelectionIdentifier>
                <Text>Sun</Text>
              </Selection>
            </Selections>
          </SelectionAnswer>
      </AnswerSpecification>
  </Question>

关于xml - 如何在 Amazon Mechanical Turk 命令行工具中将图像添加到资格测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28051800/

相关文章:

c++ - 解决读取xml时的越界错误

java - Android模拟器布局问题

mysql - 用于 Web 应用程序的基于云的 Web 服务

amazon-web-services - 具有假设其自身的 PolicyDocument 的 AWS 角色

java - 如何对 xml 实现简单的取消/编码?

android - TextView:用多行包裹内容

xml - XSL - 复制树,复制一些节点两次并更改第二个副本中的属性

Java:具有输出 HTML 但没有 HTML 实体的 XSLT

xml - 图表有任何 XML 标准吗?

amazon-web-services - 有没有一种方法可以从 CloudFormation 在一个 Amazon RDS 数据库实例中创建多个数据库