Index: openacs-4/packages/assessment/assessment.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/assessment.info,v
diff -u -r1.36.2.1 -r1.36.2.2
--- openacs-4/packages/assessment/assessment.info 7 Jun 2005 23:29:34 -0000 1.36.2.1
+++ openacs-4/packages/assessment/assessment.info 10 Jun 2005 18:53:30 -0000 1.36.2.2
@@ -23,7 +23,6 @@
-
Index: openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml,v
diff -u -r1.68.2.2 -r1.68.2.3
--- openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml 7 Jun 2005 22:09:08 -0000 1.68.2.2
+++ openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml 10 Jun 2005 18:53:30 -0000 1.68.2.3
@@ -499,6 +499,7 @@
Session
Remaining session time: %assessment_data.pretty_remaining_time%
Sessions
+ New Registration Assessment
Show Assessments
Show Feedback
Question name displayed
Index: openacs-4/packages/assessment/lib/section-items.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/section-items.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/assessment/lib/section-items.tcl 13 Apr 2005 18:51:54 -0000 1.9
+++ openacs-4/packages/assessment/lib/section-items.tcl 10 Jun 2005 18:53:30 -0000 1.9.2.1
@@ -27,6 +27,7 @@
set checks [as::section::checks_list -assessment_id $assessment_id -section_id $section_id]
set checks_related 0
+ ns_log notice "[llength $checks]"
foreach check_sql $checks {
set cond_list [split $check_sql "="]
set item_id [lindex [split [lindex $cond_list 2] " "] 0]
Index: openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql,v
diff -u -r1.7 -r1.7.2.1
--- openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql 13 Mar 2005 22:08:45 -0000 1.7
+++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql 10 Jun 2005 18:53:30 -0000 1.7.2.1
@@ -230,7 +230,7 @@
);
v_parameter_id:= nextval(''as_action_params_parameter_id'');
-insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (v_parameter_id,v_action_id,''q'',''community_id'',''Community to add the user'', ''select pretty_name,community_id from dotlrn_communities'');
+insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (v_parameter_id,v_action_id,''q'',''community_id'',''Community to add the user'', ''select pretty_name,community_id from dotlrn_communities where community_id in (select object_id from acs_permissions_all where grantee_id=:user_id)'');
return v_action_id;
end;' language 'plpgsql';
Index: openacs-4/packages/assessment/tcl/apm-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/apm-callback-procs.tcl,v
diff -u -r1.2 -r1.2.2.1
--- openacs-4/packages/assessment/tcl/apm-callback-procs.tcl 1 Feb 2005 22:13:44 -0000 1.2
+++ openacs-4/packages/assessment/tcl/apm-callback-procs.tcl 10 Jun 2005 18:53:30 -0000 1.2.2.1
@@ -97,3 +97,5 @@
}
+
+
Index: openacs-4/packages/assessment/tcl/as-assessment-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-assessment-procs.tcl,v
diff -u -r1.26 -r1.26.2.1
--- openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 2 May 2005 10:11:22 -0000 1.26
+++ openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 10 Jun 2005 18:53:30 -0000 1.26.2.1
@@ -553,3 +553,6 @@
return -1
}
}
+
+
+
Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/assessment/tcl/as-callback-procs.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/assessment/tcl/as-checks-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-checks-procs.tcl,v
diff -u -r1.24 -r1.24.2.1
--- openacs-4/packages/assessment/tcl/as-checks-procs.tcl 3 Mar 2005 22:46:41 -0000 1.24
+++ openacs-4/packages/assessment/tcl/as-checks-procs.tcl 10 Jun 2005 18:53:30 -0000 1.24.2.1
@@ -580,3 +580,34 @@
}
}
}
+
+
+ad_proc -public as::assessment::check::eval_single_check {
+ {-session_id}
+ {-assessment_id}
+ {-inter_item_check_id}
+} {
+
+} {
+ db_1row get_check_info {}
+
+ set perform [db_string check_sql $check_sql -default 0]
+ ns_log notice "$check_sql $perform"
+ if {$perform == 1} {
+ set failed ""
+ as::assessment::check::manual_action_log -check_id $inter_item_check_id -session_id $session_id
+ }
+}
+
+
+ad_proc -public as::assessment::check::add_manual_check {
+ {-assessment_id:required}
+ {-inter_item_check_id:required}
+} {
+
+} {
+ set sessions [db_list_of_lists get_sessions {select session_id from as_sessions where assessment_id=:assessment_id}]
+ foreach session_id $sessions {
+ as::assessment::check::eval_single_check -session_id $session_id -assessment_id $assessment_id -inter_item_check_id $inter_item_check_id
+ }
+}
\ No newline at end of file
Index: openacs-4/packages/assessment/tcl/as-checks-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-checks-procs.xql,v
diff -u -r1.19 -r1.19.2.1
--- openacs-4/packages/assessment/tcl/as-checks-procs.xql 3 Mar 2005 22:46:41 -0000 1.19
+++ openacs-4/packages/assessment/tcl/as-checks-procs.xql 10 Jun 2005 18:53:30 -0000 1.19.2.1
@@ -343,6 +343,11 @@
+
+
+ select * from as_inter_item_checks where inter_item_check_id=:inter_item_check_id
+
+
Index: openacs-4/packages/assessment/tcl/as-install-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-install-procs.tcl,v
diff -u -r1.30.2.1 -r1.30.2.2
--- openacs-4/packages/assessment/tcl/as-install-procs.tcl 31 May 2005 23:13:00 -0000 1.30.2.1
+++ openacs-4/packages/assessment/tcl/as-install-procs.tcl 10 Jun 2005 18:53:30 -0000 1.30.2.2
@@ -18,6 +18,9 @@
} {
inter_item_checks::apm_callback::package_install
+
+apm_parameter_register "AsmForRegisterId" "Assessment used on the registration process." "acs-subsite" "0" "number" "user-login"
+
content::type::new -content_type {as_item_choices} -supertype {content_revision} -pretty_name {Assessment Item Choice} -pretty_plural {Assessment Item Choices} -table_name {as_item_choices} -id_column {choice_id}
content::type::new -content_type {as_item_sa_answers} -supertype {content_revision} -pretty_name {Assessment Item Answer} -pretty_plural {Assessment Item Answer} -table_name {as_item_sa_answers} -id_column {choice_id}
@@ -362,5 +365,10 @@
0.10d11 0.10d12 {
content::type::attribute::new -content_type {as_items} -attribute_name {field_name} -datatype {string} -pretty_name {Item Field Name} -column_spec {varchar(500)}
}
+
}
}
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/assessment/tcl/as-qti-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-qti-procs.tcl,v
diff -u -r1.35.2.1 -r1.35.2.2
--- openacs-4/packages/assessment/tcl/as-qti-procs.tcl 31 May 2005 23:13:01 -0000 1.35.2.1
+++ openacs-4/packages/assessment/tcl/as-qti-procs.tcl 10 Jun 2005 18:53:30 -0000 1.35.2.2
@@ -3,10 +3,53 @@
@author eperez@it.uc3m.es
@creation-date 2004-04-16
@cvs-id $Id$
+
}
namespace eval as::qti {}
+ad_proc -public as::qti::register {
+ {-tmp_dir:required}
+ {-community_id:required}
+} {
+ Relation with assessment
+
+} {
+
+ # 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 ${tmp_dir} -d $tmpdirectory } outMsg
+
+ # Save the current package_id to restore when the assessment is
+ # imported
+ set current_package_id [ad_conn package_id]
+ # Get the assessment package_id associated with the current
+ # community
+ # FIXME this is a hack until I figure out how to get the
+ # package_id of the assessment of the current community
+ ad_conn -set package_id [db_string get_assessment_package_id {select dotlrn_community_applets.package_id from dotlrn_community_applets join apm_packages on (dotlrn_community_applets.package_id=apm_packages.package_id) where community_id = :community_id and package_key='assessment'}]
+
+ # Read the content of the temporary directory
+ foreach file_i [ glob -directory $tmpdirectory *{.xml} ] {
+ set assessment_revision_id [as::qti::parse_qti_xml $file_i]
+ set assessment_id [db_string items_items_as_item_id "SELECT item_id FROM cr_revisions WHERE revision_id = :assessment_revision_id"]
+ }
+
+ # Delete the temporary directory
+ file delete -force $tmpdirectory
+
+ # Restore the package_id
+ ad_conn -set package_id $current_package_id
+
+ set url_assessment "../../assessment/assessment?assessment_id=$assessment_id"
+
+ return $url_assessment
+}
+
ad_proc -private as::qti::mattext_gethtml { mattextNode } { Get the HTML of a mattext } {
set texttype [$mattextNode getAttribute {texttype} {text/plain}]
if { $texttype == "text/html" } {
Index: openacs-4/packages/assessment/tcl/as-section-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-procs.tcl,v
diff -u -r1.23 -r1.23.2.1
--- openacs-4/packages/assessment/tcl/as-section-procs.tcl 13 Apr 2005 10:48:29 -0000 1.23
+++ openacs-4/packages/assessment/tcl/as-section-procs.tcl 10 Jun 2005 18:53:30 -0000 1.23.2.1
@@ -371,7 +371,8 @@
Allow caching of the choice_orientation as it is unlikely to change.
} {
- return [util_memoize [list as::section::checks_list_not_cached -assessment_id $assessment_id -section_id $section_id]]
+
+ return [as::section::checks_list_not_cached -assessment_id $assessment_id -section_id $section_id]
}
ad_proc -private as::section::checks_list_not_cached {
Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/assessment/tcl/callback-procs.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/assessment/tcl/callback-procs.xql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/assessment/www/admin/asm-action-param-admin.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/asm-action-param-admin.tcl,v
diff -u -r1.5.2.1 -r1.5.2.2
--- openacs-4/packages/assessment/www/admin/asm-action-param-admin.tcl 31 May 2005 23:13:01 -0000 1.5.2.1
+++ openacs-4/packages/assessment/www/admin/asm-action-param-admin.tcl 10 Jun 2005 18:53:31 -0000 1.5.2.2
@@ -16,7 +16,8 @@
}
-set context_bar [ad_context_bar [list [export_vars -base asm-action-new {action_id} ] [_ assessment.action_admin] ] $page_title]
+set context [list [list [export_vars -base asm-action-new {action_id} ] [_ assessment.action_admin] ] $page_title]
+set user_id [ad_conn user_id]
set type_options [list [list "[_ assessment.query]" q] [list "[_ assessment.var ]" n]]
@@ -43,11 +44,16 @@
}
{action_id:text(hidden) {value $action_id}}
-} -select_query_name {get_param_info} -new_data {
+} -edit_request {
+ db_1row get_param_info {}
+} -new_data {
if { $type == "q" } {
- set count_query_record [db_1row get_records "" ]
- if { $count_query_record != 0 } {
- db_dml insert_param {}
+
+ set user_id [ad_conn user_id]
+ set count_query_record [db_list_of_lists get_records "$query" ]
+
+ if { [llength $count_query_record] != 0 } {
+ db_dml insert_param {}
} else {
ad_script_abort
}
@@ -57,17 +63,20 @@
} -edit_data {
if { $type == "q" } {
- set count_query_record [db_1row get_records "" ]
- if { $count_query_record != 0 } {
- db_dml edit_param {}
+ set user_id [ad_conn user_id]
+ set count_query_record [db_list_of_lists get_records "$query" ]
+
+ if { [llength $count_query_record] != 0 } {
+ db_dml edit_param {}
} else {
ad_script_abort
}
} else {
db_dml edit_param {}
}
-
-
+
+
} -on_submit {
+
ad_returnredirect "asm-action-param-admin?action_id=$action_id"
}
Index: openacs-4/packages/assessment/www/admin/asm-action-param-admin.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/asm-action-param-admin.xql,v
diff -u -r1.3 -r1.3.2.1
--- openacs-4/packages/assessment/www/admin/asm-action-param-admin.xql 14 Feb 2005 23:36:32 -0000 1.3
+++ openacs-4/packages/assessment/www/admin/asm-action-param-admin.xql 10 Jun 2005 18:53:31 -0000 1.3.2.1
@@ -29,11 +29,5 @@
-
-
- select count(*) from ($query) as query
-
-
-
Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/assessment/www/admin/set-reg-assessment.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/assessment/www/admin/set-reg-assessment.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/assessment/www/admin/set-reg-assessment.xql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/assessment/www/asm-admin/action-params.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/action-params.tcl,v
diff -u -r1.5 -r1.5.2.1
--- openacs-4/packages/assessment/www/asm-admin/action-params.tcl 7 Apr 2005 23:08:12 -0000 1.5
+++ openacs-4/packages/assessment/www/asm-admin/action-params.tcl 10 Jun 2005 18:53:31 -0000 1.5.2.1
@@ -19,6 +19,7 @@
}
set package_id [ad_conn package_id]
+set user_id [ad_conn user_id]
permission::require_permission -object_id $package_id -privilege create
permission::require_permission -object_id $assessment_id -privilege admin
Index: openacs-4/packages/assessment/www/asm-admin/action-select.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/action-select.tcl,v
diff -u -r1.5 -r1.5.2.1
--- openacs-4/packages/assessment/www/asm-admin/action-select.tcl 7 Apr 2005 23:06:01 -0000 1.5
+++ openacs-4/packages/assessment/www/asm-admin/action-select.tcl 10 Jun 2005 18:53:31 -0000 1.5.2.1
@@ -22,6 +22,8 @@
permission::require_permission -object_id $assessment_id -privilege admin
as::assessment::data -assessment_id $assessment_id
+set assessment_rev_id $assessment_data(assessment_rev_id)
+
if {![info exists assessment_data(assessment_id)]} {
ad_return_complaint 1 "[_ assessment.Requested_assess_does]"
ad_script_abort
@@ -64,12 +66,12 @@
{help_text "[_ assessment.action_that_will]"}
{$action_value}
}
- {action_perform:text(select)
- {label "[_ assessment.when_this_will]"}
- {options $options}
- {help_text "[_ assessment.when_this_action]"}
- {$action_perform_value}
- }
+ {action_perform:text(select)
+ {label "[_ assessment.when_this_will]"}
+ {options $options}
+ {help_text "[_ assessment.when_this_action]"}
+ {$action_perform_value}
+ }
{user_message:text(textarea),optional
{label "[_ assessment.message]"}
{html {cols 50} {rows 15}}
@@ -90,9 +92,9 @@
set perform [db_string action_perform {}]
if { $perform==$action_perform} {
db_dml edit_action {}
-
+
} else {
-
+
#re-order the other group
as::assessment::check::re_order_actions -check_id $inter_item_check_id -section_id $section_id -action_perform $perform
set order_value [as::assessment::check::get_max_order -section_id $section_id -action_perform $action_perform]
@@ -101,15 +103,20 @@
} else {
db_dml delete_action_map {}
db_dml delete_param_map {}
-
+
set order_value [as::assessment::check::get_max_order -section_id $section_id -action_perform $action_perform]
db_dml select_action {}
}
}
} -on_submit {
-
set url "action-params?assessment_id=$assessment_id&inter_item_check_id=$inter_item_check_id&action_id=$action_id§ion_id=$section_id"
ad_returnredirect "${url}$return_url"
+
+} -after_submit {
+ if { $action_perform == "m" } {
+ as::assessment::check::add_manual_check -assessment_id $assessment_rev_id -inter_item_check_id $inter_item_check_id
+ }
+
}
\ No newline at end of file
Index: openacs-4/packages/assessment/www/asm-admin/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/index.adp,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/assessment/www/asm-admin/index.adp 9 Feb 2005 10:58:47 -0000 1.4
+++ openacs-4/packages/assessment/www/asm-admin/index.adp 10 Jun 2005 18:53:31 -0000 1.4.2.1
@@ -1,5 +1,4 @@
-@title;noquote@
@context;noquote@
Index: openacs-4/packages/assessment/www/asm-admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/index.tcl,v
diff -u -r1.6 -r1.6.2.1
--- openacs-4/packages/assessment/www/asm-admin/index.tcl 7 Apr 2005 21:22:51 -0000 1.6
+++ openacs-4/packages/assessment/www/asm-admin/index.tcl 10 Jun 2005 18:53:31 -0000 1.6.2.1
@@ -19,6 +19,7 @@
set package_id [ad_conn package_id]
set categories_url [db_string get_category_url {}]
set user_id [ad_conn user_id]
+set sw_admin [acs_user::site_wide_admin_p -user_id $user_id]
set package_admin_p [permission::permission_p -party_id $user_id -object_id $package_id -privilege "admin"]
if { $package_admin_p == 0} {
@@ -32,7 +33,11 @@
{zipfile:file {label "[_ assessment.Import_QTI_ZIP_File]"}}
}
-set actions [list "[_ assessment.New_Assessment]" assessment-form "[_ assessment.New_Assessment2]"]
+if { $sw_admin } {
+ set actions [list "[_ assessment.New_Assessment]" assessment-form "[_ assessment.New_Assessment2]" [_ assessment.set_reg_asm] "../admin/set-reg-assessment" [_ assessment.set_reg_asm]]
+} else {
+ set actions [list "[_ assessment.New_Assessment]" assessment-form "[_ assessment.New_Assessment2]"]
+}
if {[ad_permission_p [acs_magic_object "security_context_root"] "admin"]} {
# lappend actions "[_ assessment.Admin_catalog]" "catalog/" "[_ assessment.Admin_catalog]"
Index: openacs-4/packages/assessment/www/asm-admin/one-a.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/one-a.adp,v
diff -u -r1.11 -r1.11.2.1
--- openacs-4/packages/assessment/www/asm-admin/one-a.adp 15 Apr 2005 18:15:48 -0000 1.11
+++ openacs-4/packages/assessment/www/asm-admin/one-a.adp 10 Jun 2005 18:53:31 -0000 1.11.2.1
@@ -81,7 +81,7 @@
-
#acs-subsite.set_reg_asm#
+
#acs-subsite.set_reg_asm#
Index: openacs-4/packages/assessment/www/asm-admin/one-a.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/one-a.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/assessment/www/asm-admin/one-a.tcl 8 Apr 2005 23:04:23 -0000 1.9
+++ openacs-4/packages/assessment/www/asm-admin/one-a.tcl 10 Jun 2005 18:53:31 -0000 1.9.2.1
@@ -11,6 +11,8 @@
assessment_id:integer
{context ""}
{reg_p ""}
+ {asm_instance ""}
+ {reg_url ""}
}
set is_reg_asm_p ""
set package_id [ad_conn package_id]
@@ -24,12 +26,17 @@
set context [list [list index [_ assessment.admin]] $assessment_data(title)]
set assessment_rev_id $assessment_data(assessment_rev_id)
-set subsite_id [ad_conn subsite_id]
+set subsite_id [subsite::main_site_id]
set url [apm_package_url_from_id $subsite_id]
set anonymous_p [db_string has_privilege {} -default "f"]
set read_p [permission::permission_p -object_id $assessment_id -privilege read -party_id -1]
set value [parameter::get -parameter AsmForRegisterId -package_id $subsite_id]
+if { [exists_and_not_null asm_instance]} {
+ set reg_url "[apm_package_url_from_id $asm_instance]admin"
+} else {
+ set reg_url "../admin"
+}
if { [string eq $assessment_id $value] } {
set is_reg_asm_p "[_ assessment.reg_asm]"
}