Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <script src=""></script>
<script src=""></script>
<link href="" rel="stylesheet" />
<section class="container" id="Other" style="margin-bottom:15px; padding: 10px 10px; font-family: Verdana, Geneva, sans-serif; color:#333333; font-size:0.9em;">
<div class="row col-xs-12 col-md-12">
<!-- Instructions -->
  <label>Read Instruction.</label>
  <div class="panel panel-primary">
    <div class="panel-heading"><strong>Instruction</strong></div>
    <div class="panel-body">
      <b><p>Upload 10 cat pictures. </p></b>
        <!-- We are adding a template variable below which we will replace with an actual link in our code later -->
        <li>Upload .jpg files.</li>
        <li>You cannot submit less than 10 images.</li>
  <!-- End Instructions -->

  <!-- Content Body -->
    <div class="checkbox"><label><input name="Check" type="checkbox" value="check_ok" />Have you checked?</label></div>

<!-- This is new the HTML code to include a file upload -->
  <label>Upload 10 cat pictures.</label>
  <input type="file" id="uploadFiles" multiple />
  <output id="list"></output>
  <button id="upload_file_button" type="button">Upload file</button>
  <span id="status">&nbsp;</span>
  <span id="fin">&nbsp;</span>

<style type="text/css">
  fieldset {
    padding: 10px;
    background: #fbfbfb;
    border-radius: 5px;
    margin-bottom: 5px;
  var ok_file_cnt = 0;
  let config = {
    region: "リージョン",
    pool: "プール名",
    bucket: "バケット名"
  AWS.config.region = config.region;
  // Configure the credentials provider to use your identity pool
  AWS.config.credentials = new AWS.CognitoIdentityCredentials({
    IdentityPoolId: config.pool

  let s3 = new AWS.S3({
    apiVersion: "2006-03-01",
    params: { Bucket: config.bucket }

  function upload_file(file, hitId, assignmentId, workerId, i) {
    let fileKey = hitId + "-" + assignmentId + "-" + workerId + "-" +;
    let failed_flag = false;

        Key: fileKey,
        Body: file,
        ContentType: file.type,
        ACL: "bucket-owner-full-control"
      function(err, data) {
        if (err) {
   + ": Failed to upload. Please check your file."
          failed_flag = true;
          return failed_flag;
        } else {
          $("#status").text( + ": Success.");
          $("#fin").text(ok_file_cnt + " photos are uploaded.");
          return failed_flag;
        $(event.currentTarget).prop("disabled", false);

  do_upload = function(event) {
    // Reset the status indicator and hidden file uploaded flag
    $(event.currentTarget).prop("disabled", false);
    let workerId = turkGetParam("workerId");
    let assignmentId = turkGetParam("assignmentId");
    let hitId = turkGetParam("hitId");
    var $files = $("#uploadFiles").prop("files");
    var len = $files.length;
    var good_file = 0;
    if (len === 10){
        for (var j = 0; j < len; j++) {
            var file = $files[j];
            if ({
            }else if({
        if (good_file === 10){
            for (var i = 0; i < len; i++) {
                var file = $files[i];
                $("#status").text( + " is uploading...");
                failed_flag = upload_file(file, hitId, assignmentId, workerId, i);
                if (failed_flag){
                    $("#status").text( + ": Failed to upload. Please check your file.");
            var miss = 10 - good_file;
            $("#fin").text(miss + " photos are missing. Please check your files.");
        if (i === 10 && good_file === 10){
            $(event.currentTarget).prop("disabled", true);
      miss = 10 - len;
      $("#status").text(miss + " photos are missing. Please check your files.");
  $("#upload_file_button").on("click", do_upload);