Index: openacs-4/packages/assessment/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/index.adp 21 Sep 2004 17:35:40 -0000 1.1 @@ -0,0 +1,6 @@ + +@title;noquote@ +@context;noquote@ + + + Index: openacs-4/packages/assessment/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/index.tcl 21 Sep 2004 17:35:40 -0000 1.1 @@ -0,0 +1,17 @@ +ad_page_contract { + @author eperez@it.uc3m.es + @creation-date 2004-09-21 +} { +} -properties { + zipfile + context:onevalue +} + +set title "[_ assessment.Administration]" +set context {} + +ad_form -name form_upload_file -action {unzip-file} -html {enctype multipart/form-data} -form { + {zipfile:file {label "Import QTI ZIP File:"}} +} + +ad_return_template Index: openacs-4/packages/assessment/www/admin/show-items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/show-items.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/show-items.adp 21 Sep 2004 17:35:40 -0000 1.1 @@ -0,0 +1,35 @@ + +Assessment +@context;noquote@ + + + +
   + Items + + + + + + +
@items.rownum@.- +
@items.title@ + +
+
+ + @formgroup.widget;noquote@ + @formgroup.label;noquote@ +
+
+
+ + + +
+
+
+ +
+Upload files +
Index: openacs-4/packages/assessment/www/admin/show-items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/show-items.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/show-items.tcl 21 Sep 2004 17:35:40 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + @author eperez@it.uc3m.es + @creation-date 2004-09-21 +} { +} -properties { + context:onevalue +} + +set context [list "Show Items"] + +ad_form -name show_item_form -html {enctype multipart/form-data} -form { + { assessment_id:text {value 1} } +} + +#For each item: +db_multirow items query_all_items {} { + #If there is an item + if {![empty_string_p $as_item_id]} { + add_item_to_form show_item_form $as_item_id + } +} + +ad_return_template Index: openacs-4/packages/assessment/www/admin/show-items.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/show-items.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/show-items.xql 21 Sep 2004 17:35:40 -0000 1.1 @@ -0,0 +1,12 @@ + + + postgresql7.4 + + + + SELECT as_itemsx.as_item_id, as_itemsx.name, as_itemsx.title, 'radiobutton' AS presentation_type + FROM as_itemsx + + + + Index: openacs-4/packages/assessment/www/admin/unzip-file.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/unzip-file.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/unzip-file.adp 21 Sep 2004 17:35:40 -0000 1.1 @@ -0,0 +1,8 @@ + +Assessment +@context;noquote@ +# items imported: @qti_items_imported_number@
+
+Show items +Upload files +
Index: openacs-4/packages/assessment/www/admin/unzip-file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/unzip-file.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/unzip-file.tcl 21 Sep 2004 17:35:40 -0000 1.1 @@ -0,0 +1,33 @@ +ad_page_contract { + @author alvaro@it.uc3m.es + @creation-date 2004-04-14 +} { + zipfile + {zipfile.tmpfile} +} -validate { +} -properties { + qti_items_imported_number + context:onevalue +} + +set context [list "Import Results"] + +# Generate a random directory name +set tmpdirectory [ns_tmpnam] +# Create a temporary directory +file mkdir $tmpdirectory + +# UNZIP the zip file in the temporary directory +catch { exec unzip ${zipfile.tmpfile} -d $tmpdirectory } outMsg + +set qti_items_imported_number 0 +# Read the content of the temporary directory +foreach file_i [ glob -directory $tmpdirectory *{.xml} ] { + set items [llength [parse_qti_xml $file_i]] + set qti_items_imported_number [expr [llength items] + $qti_items_imported_number] +} + +# Delete the temporary directory +file delete -force $tmpdirectory + +ad_return_template