Index: lams_tool_assessment/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r19b542142aa60e2410055b83faecc18681909af4 -ra134c46269a178953fd900aa428cfc77c1a0e008 --- lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 19b542142aa60e2410055b83faecc18681909af4) +++ lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision a134c46269a178953fd900aa428cfc77c1a0e008) @@ -241,6 +241,7 @@ authoring.import.instruction =Please choose questions to import. button.select.importfile =Select file to import msg.import.file.format =The import file must be .xml file exported from assessment tool. +error.import.file.format =The import file is not an .xml file. label.import.file =Import xml file button.import =Import label.authoring.basic.import.questions =Import Index: lams_tool_assessment/web/WEB-INF/tags/AuthoringButton.tag =================================================================== diff -u -rb5ab72c783a98abeb08431bafb067ad4b9edf1df -ra134c46269a178953fd900aa428cfc77c1a0e008 --- lams_tool_assessment/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision b5ab72c783a98abeb08431bafb067ad4b9edf1df) +++ lams_tool_assessment/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision a134c46269a178953fd900aa428cfc77c1a0e008) @@ -123,7 +123,7 @@ }
- + Index: lams_tool_assessment/web/WEB-INF/tags/FileUpload.tag =================================================================== diff -u --- lams_tool_assessment/web/WEB-INF/tags/FileUpload.tag (revision 0) +++ lams_tool_assessment/web/WEB-INF/tags/FileUpload.tag (revision a134c46269a178953fd900aa428cfc77c1a0e008) @@ -0,0 +1,56 @@ +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> + +<%@ attribute name="fileFieldname" required="false" rtexprvalue="true"%> +<%@ attribute name="fileInputNameFieldname" required="false" rtexprvalue="true"%> +<%@ attribute name="fileInputMessageKey" required="false" rtexprvalue="true"%> +<%@ attribute name="uploadInfoMessageKey" required="false" rtexprvalue="true"%> +<%@ attribute name="maxFileSize" required="true" rtexprvalue="true"%> +<%@ attribute name="tabindex" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + + + + + + + + + +
+ <%-- font-size:inherit needed for Share Resources authoring or the button is too small --%> + + + + +
+

${maxFileSize}

+ + + + Index: lams_tool_assessment/web/WEB-INF/tags/WaitingSpinner.tag =================================================================== diff -u --- lams_tool_assessment/web/WEB-INF/tags/WaitingSpinner.tag (revision 0) +++ lams_tool_assessment/web/WEB-INF/tags/WaitingSpinner.tag (revision a134c46269a178953fd900aa428cfc77c1a0e008) @@ -0,0 +1,17 @@ +<%@ taglib uri="tags-core" prefix="c"%> + +<%@ attribute name="id" required="false" rtexprvalue="true"%> +<%@ attribute name="showInline" required="false" rtexprvalue="true"%> + + + id="${id}" + + + + + + + + + + \ No newline at end of file Index: lams_tool_assessment/web/WEB-INF/tlds/lams/lams.tld =================================================================== diff -u -r1f99d03199a3995cfffe0cb1536c08f0220e88b0 -ra134c46269a178953fd900aa428cfc77c1a0e008 --- lams_tool_assessment/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision 1f99d03199a3995cfffe0cb1536c08f0220e88b0) +++ lams_tool_assessment/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision a134c46269a178953fd900aa428cfc77c1a0e008) @@ -529,5 +529,13 @@ CommentsAuthor /WEB-INF/tags/CommentsAuthor.tag + + FileUpload + /WEB-INF/tags/FileUpload.tag + + + WaitingSpinner + /WEB-INF/tags/WaitingSpinner.tag + Index: lams_tool_assessment/web/pages/authoring/importQuestions.jsp =================================================================== diff -u -rfb2d35766faadf7fa8e0247feb943da34f8fba4f -ra134c46269a178953fd900aa428cfc77c1a0e008 --- lams_tool_assessment/web/pages/authoring/importQuestions.jsp (.../importQuestions.jsp) (revision fb2d35766faadf7fa8e0247feb943da34f8fba4f) +++ lams_tool_assessment/web/pages/authoring/importQuestions.jsp (.../importQuestions.jsp) (revision a134c46269a178953fd900aa428cfc77c1a0e008) @@ -14,18 +14,34 @@ } function verifyAndSubmit() { - if (document.getElementById("UPLOAD_FILE").value.length == 0) { + debugger; + var filename = document.getElementById("UPLOAD_FILE").value; + if (filename.length == 0) { var msg = ""; alert(msg); return (false); } else { - var options = { - target: parent.jQuery('#questionListArea'), - success: afterRatingSubmit // post-submit callback - }; - - $('#importForm').ajaxSubmit(options); + if ( filename ) { + var msg = ''; + var extname = filename.substr((~-filename.lastIndexOf(".") >>> 0) + 2); + if ( extname.length == 0) { + alert(msg); + return (false); + } else { + extname = extname.toUpperCase(); + if ( "XML" != extname) { + alert(msg); + return (false); + } + } + } + } + var options = { + target: parent.jQuery('#questionListArea'), + success: afterRatingSubmit // post-submit callback + }; + $('#importForm').ajaxSubmit(options); } // post-submit callback function afterRatingSubmit(responseText, statusText) { @@ -52,16 +68,15 @@

?sessionMapID=${sessionMapID}" method="post" enctype="multipart/form-data" id="importForm"> -
- - -
+ - - - +
+ + +   + +