anchor.diff:        console.log("uploading files");
         $.ajaxJSONPreparedFiles.call(this, {
           handle_files: function(attachments, data) {
  -          var ids = (data['submission[attachment_ids]'] || "").split(",")
  +          var ids = (data['submission[attachment_ids]'] || "").split(",");
             for(var idx in attachments) {
               ids.push(attachments[idx].attachment.id);
             }
  
positive.code:   });
    $(".add_another_file_link").click(function(event) {
      event.preventDefault();
      var $file = $(this).parents("td").find(".submission_attachment:last").clone(true).hide();
      $file.val("").find("input").attr('name', 'attachments[' + (++submissionAttachmentIndex) + '][uploaded_data]');
      $(this).before($file.slideDown());
      if($(this).parents("td").find(".submission_attachment").length >= 3) {
        $(this).parents("td").find(".remove_attachment_link").show();
      }
    });
    $(".remove_attachment_link").click(function(event) {  
      event.preventDefault();
      $(this).parents(".submission_attachment").slideUp(function() {
        $(this).remove();
        checkAllowUploadSubmit();
      });
      if($(this).parents("td").find(".submission_attachment").length <= 3) {
        $(this).parents("td").find(".remove_attachment_link").hide();
      }
    });
    var checkAllowUploadSubmit = function() {
      // disable the submit button if any extensions are bad
      var $submit_button = $("#submit_online_upload_form").find('button[type=submit]');
      if ($(".bad_ext_msg:visible").length > 0) {
        $submit_button.attr('disabled', true);
      } else {
        $submit_button.attr('disabled', false);
      }
    }
    $(".submission_attachment input[type=file]").live('change', function() {
      if (allowed_extensions.length < 1 || $(this).val() == "")
  
negative.code:         context_code: $("#submit_assignment").data('context_code'),
          asset_string: $("#submit_assignment").data('asset_string'),
          intent: "submit",
          file_elements: $(this).find("input[type='file']:visible").filter(function(){ 
            // only include file inputs where user has selected a file, no blank ones.
            return $(this).val() !== ''; 
          }),
          data: $(this).getFormData(),
          url: $(this).attr('action'),
          success: function(data) {
  