Index: openacs-4/packages/assessment/assessment.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/assessment.info,v
diff -u -r1.22 -r1.23
--- openacs-4/packages/assessment/assessment.info 29 Jan 2005 11:12:57 -0000 1.22
+++ openacs-4/packages/assessment/assessment.info 8 Feb 2005 22:56:15 -0000 1.23
@@ -6,34 +6,30 @@
Assessments
f
f
-
+
-
- oracle
- postgresql
-
Eduardo Perez Ureta
Assessment package that will replace the survey,
quizz, complex survey, poll and other data collection packages
that OpenACS currently supports.
- 2004-03-17
- 0
+ 2005-01-25
E-LANE
Create assessments and evalueate.
+ 0
+
-
-
-
-
-
+
+
+
-
-
+
+
+
+
-
Index: openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-create-p.sql 8 Feb 2005 22:55:58 -0000 1.1
@@ -0,0 +1,141 @@
+
+-- Assessment Package
+-- @author Anny Flores (annyflores@viaro.net) Viaro Networks (www.viaro.net)
+-- @creation-date 2005-01-06
+
+select acs_object_type__create_type (
+ 'as_action',
+ 'as_action',
+ 'as_actions',
+ 'acs_object',
+ 'as_actions',
+ 'action_id',
+ null,
+ 'f',
+ null,
+ 'as_action__name'
+);
+
+
+
+create or replace function as_action__new (integer,varchar,varchar,text,integer,integer)
+returns integer as '
+declare
+ new__action_id alias for $1;
+ new__name alias for $2;
+ new__description alias for $3;
+ new__tcl_code alias for $4;
+ new__context_id alias for $5;
+ new__creation_user alias for $6;
+ v_action_id integer;
+begin
+ v_action_id := acs_object__new (
+ new__action_id,
+ ''as_action'',
+ now(),
+ new__creation_user,
+ null,
+ new__context_id
+ );
+ insert into as_actions
+ (action_id,name,description,tcl_code)
+ values (v_action_id,new__name,new__description,new__tcl_code);
+
+ return v_action_id;
+end;' language 'plpgsql';
+
+
+
+create or replace function as_action__delete (integer)
+returns integer as '
+declare
+ del__action_id alias for $1;
+begin
+
+ delete from as_actions_log where
+ action_id = del__action_id;
+
+ delete from as_inter_item_checks where inter_item_check_id in (select inter_item_check_id from as_action_map where action_id=del__action_id);
+
+ delete from as_action_map where action_id = del__action_id;
+
+ delete from as_action_params where action_id=del__action_id;
+
+ delete from as_param_map where action_id= del__action_id;
+
+ delete from as_actions where action_id = del__action_id;
+ PERFORM acs_object__delete (del__action_id);
+ return del__action_id;
+
+end;' language 'plpgsql';
+
+
+
+create or replace function as_action__default_actions (integer,integer)
+returns integer as '
+declare
+ new__context_id alias for $1;
+ new__creation_user alias for $2;
+ v_action_id integer;
+begin
+
+ v_action_id := as_action__new (
+ null,
+ ''Register User'',
+ ''Register new users'',
+ ''set password [ad_generate_random_string]
+db_transaction {
+array set user_new_info [auth::create_user -username $user_name -email $email -first_names $first_names -last_name $last_name -password $password]
+}
+set admin_user_id [auth::test::get_admin_user_id]
+set administration_name [db_string admin_name "select first_names || \'\' \'\' || last_name from persons where person_id
+ = :admin_user_id"]
+set system_name [ad_system_name]
+set system_url [ad_parameter -package_id [ad_acs_kernel_id] SystemURL ""].
+set admin_email [db_string unused "select email from parties where party_id = :admin_user_id"]
+set message "$first_names $last_name,
+You have been added as a user to $system_name
+at $system_url
+Login information:
+Email: $email
+Password: $password
+(you may change your password after you log in)
+Thank you,
+$administration_name"
+ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_url]" "$message"'',
+ new__context_id,
+ new__creation_user
+ );
+
+insert into as_action_params (parameter_id, action_id,type, varname, description) values (select nextval(''as_action_params_parameter_id''),v_action_id,''n'',''first_names'',''First Names of the User'');
+insert into as_action_params (parameter_id, action_id,type, varname, description) values (select nextval(''as_action_params_parameter_id''),v_action_id,''n'',''last_name'',''Last Name of the User'');
+insert into as_action_params (parameter_id, action_id,type, varname, description) values (select nextval(''as_action_params_parameter_id''),v_action_id,''n'',''email'',''Email of the User'');
+insert into as_action_params (parameter_id, action_id,type, varname, description) values (select nextval(''as_action_params_parameter_id''),v_action_id,''n'',''user_name'',''User name of the User'');
+
+v_action_id:= as_action__new (
+ null,
+ ''Event Registration'',
+ ''Register user to event'',
+ ''set user_id [ad_conn user_id]
+events::registration::new -event_id $event_id -user_id $user_id'',
+ new__context_id,
+ new__creation_user
+ );
+
+insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (select nextval(''as_action_params_parameter_id''),v_action_id,''q'',''event_id'',''Event to add the user'', ''select event_id,event_id from acs_events'');
+
+v_action_id:= as_action__new (
+ null,
+ ''Add to Community'',
+ ''Add user to a community'',
+ ''set user_id [ad_conn user_id]
+dotlrn_privacy::set_user_guest_p -user_id $user_id -value "t"
+dotlrn::user_add -can_browse -user_id $user_id
+dotlrn_community::add_user_to_community -community_id $community_id -user_id $user_id'',
+ new__context_id,
+ new__creation_user
+ );
+
+insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (select nextval(''as_action_params_parameter_id''),v_action_id,''q'',''community_id'',''Community to add the user'', ''select pretty_name,community_id from dotlrn_communities'');
+
+end;' language 'plpgsql';
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.1 -r1.2
--- openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql 24 Jan 2005 21:34:15 -0000 1.1
+++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql 8 Feb 2005 22:55:58 -0000 1.2
@@ -23,12 +23,8 @@
------------------------------------------------
create table as_action_map (
- inter_item_check_id integer
- constraint as_action_map_check_id_fk
- references as_inter_item_checks(inter_item_check_id),
- action_id integer
- constraint as_action_map_action_id_fk
- references as_actions(action_id),
+ inter_item_check_id integer,
+ action_id integer,
order_by integer,
user_message varchar(200),
action_perform varchar(2)
@@ -89,3 +85,4 @@
);
create sequence as_actions_log_action_log_id;
+create sequence as_actions_params_parameter_id;
\ No newline at end of file
Index: openacs-4/packages/assessment/tcl/as-apm-action-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-apm-action-procs-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/tcl/as-apm-action-procs-postgresql.xql 8 Feb 2005 22:55:10 -0000 1.1
@@ -0,0 +1,10 @@
+
+
+
+
+
+ select as_action__default_actions (:instance_id,:user_id)
+
+
+
+
Index: openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl 8 Feb 2005 22:55:10 -0000 1.1
@@ -0,0 +1,21 @@
+ad_library {
+ @author Anny Flores (annyflores@viaro.net) Viaro Networks (www.viaro.net)
+ @creation_date 2004-12-03
+
+}
+
+
+namespace eval as::actions {
+
+ ad_proc -public insert_actions {
+ -package_id:integer,required
+ -node_id:integer,required
+ } {
+ } {
+ set user_id [auth::test::get_admin_user_id]
+ set instance_id $package_id
+
+ db_exec_plsql insert_default {}
+ }
+
+}