Index: openacs-4/packages/assessment/tcl/callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/callback-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/tcl/callback-procs.tcl 9 Jun 2005 20:47:59 -0000 1.1
@@ -0,0 +1,19 @@
+ad_library {
+ Callback definitions
+
+}
+ad_proc -public -callback user::registration -impl url {} {
+
+ Return the properly formed link (URL) that the user will click to go into the registration process.
+
+} {
+ set assessment_id [parameter::get -parameter AsmForRegisterId]
+
+ if { $assessment_id != 0 } {
+
+ set package_id [db_string package_id {}]
+ set url [apm_package_url_from_id $package_id]
+ return "${url}assessment?assessment_id=$assessment_id"
+
+ }
+}
Index: openacs-4/packages/assessment/tcl/callback-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/callback-procs.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/tcl/callback-procs.xql 9 Jun 2005 20:47:59 -0000 1.1
@@ -0,0 +1,9 @@
+
+
+
+
+
+ select package_id from cr_folders where folder_id=(select context_id from acs_objects where object_id=:assessment_id)
+
+
+
\ No newline at end of file
Index: openacs-4/packages/assessment/www/admin/set-reg-assessment.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/set-reg-assessment.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/set-reg-assessment.adp 9 Jun 2005 20:44:08 -0000 1.1
@@ -0,0 +1,15 @@
+
+@page_title;noquote@
+@context;noquote@
+
+ #acs-subsite.no_assessment#
+
+
+#acs-subsite.create_asm#
+
+
+
+
+
+
+
Index: openacs-4/packages/assessment/www/admin/set-reg-assessment.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/set-reg-assessment.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/set-reg-assessment.tcl 9 Jun 2005 20:44:08 -0000 1.1
@@ -0,0 +1,98 @@
+ad_page_contract {
+ This display the anonymous assessments available for registration
+
+ @author Vivian Hernandez (vivian@viaro.net) Viaro Networks (www.viaro.net)
+ @creation-date 2005-01-20
+ @cvs-id $Id:
+} {
+ assessment_id:optional
+}
+
+
+set subsite_id [subsite::main_site_id]
+set asm_instance [ad_conn package_id]
+
+if {![exists_and_not_null assessment_id]} {
+ set value [parameter::get -parameter AsmForRegisterId -package_id $subsite_id]
+ set assessment_id $value
+}
+
+
+
+set page_title "[_ acs-subsite.set_reg_asm]"
+set context [list "[_ acs-subsite.set_reg_asm]"]
+
+
+set assessments [db_list_of_lists get_all_assessments {}]
+lappend assessments [list "[_ acs-subsite.none]" 0]
+
+set asm_p [llength $assessments]
+
+ad_form -name get_assessment -form {
+ {assessment_id:text(select)
+ {label "[_ acs-subsite.choose_assessment]"}
+ {options $assessments}
+ {help_text "[_ acs-subsite.choose_assessment_help]"}
+ {value $assessment_id}}
+ {submit:text(submit)
+ {label " OK "}}
+ {edit:text(submit)
+ {label "[_ acs-subsite.edit_asm]"}}
+} -after_submit {
+ if {![empty_string_p $edit]} {
+ if { $assessment_id != 0} {
+ set package_id [db_string package_id {}]
+ set url [apm_package_url_from_id $package_id]
+ ad_returnredirect "${url}asm-admin/one-a?assessment_id=$assessment_id®_p=1&asm_instance=$asm_instance"
+ }
+ } else {
+ parameter::set_value -package_id [subsite::main_site_id] -parameter AsmForRegisterId -value $assessment_id
+ ad_returnredirect ""
+ }
+}
+
+ad_return_template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/assessment/www/admin/set-reg-assessment.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/set-reg-assessment.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/set-reg-assessment.xql 9 Jun 2005 20:44:08 -0000 1.1
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ select cr.title,ci.item_id as assessment_id
+ from cr_folders cf, cr_items ci, cr_revisions cr, as_assessments a
+ where cr.revision_id = ci.latest_revision
+ and a.assessment_id = cr.revision_id
+ and a.anonymous_p = 't'
+ and ci.parent_id = cf.folder_id
+ and cf.package_id in (select object_id from site_nodes) and -1 in (select grantee_id from acs_permissions where
+ object_id=ci.item_id and privilege='read')
+ order by cr.title
+
+
+
+
+
+
+
+ select package_id from cr_folders where folder_id=(select context_id from acs_objects where object_id=:assessment_id)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+