Index: openacs-4/packages/assessment/assessment.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/assessment.info,v diff -u -r1.18 -r1.19 --- openacs-4/packages/assessment/assessment.info 19 Jan 2005 16:49:22 -0000 1.18 +++ openacs-4/packages/assessment/assessment.info 23 Jan 2005 18:10:56 -0000 1.19 @@ -7,7 +7,7 @@ f f - + oracle postgresql @@ -20,7 +20,7 @@ 0 E-LANE Create assessments and evalueate. - + 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.24 -r1.25 --- openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml 20 Jan 2005 18:47:23 -0000 1.24 +++ openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml 23 Jan 2005 18:10:48 -0000 1.25 @@ -52,19 +52,23 @@ How many minutes have to pass between each retry. is this a standalone assessment or does it provide an integrated assessment. Needs refinement, ignore for now How shall the navigation between sections happen in the assessment. - How often can a subject retake the test. 0 for infinite. + How often can a subject retake the test. empty for infinite. URL to go to after the assessment has been finished by a subject If yes, the system will look for previous responses to the the questions and prefill the last answer the respondee has given in the assessment form of the respondee Is https:// method required to access this assessment? If yes, the respondee will see the name of the question<br> in addition to the question itself when taking the survey. Start Time of the assessment - Once started, how many seconds does the user have to finish the assessment. 0 for indefinite. + Once started, how many minutes does the user have to finish the assessment. empty for indefinite. Helptext for Assessment Title Assessment Assessment Administration Assessment Imported Correctly + Assessment is not public. + Access restricted, wrong IP. Title + Only %number_tries% tries allowed. + You have to wait %pretty_wait_time% before your next try. Attempt Author Back button allowed @@ -156,7 +160,7 @@ Feedback wrong Feedback given to the user if his answer was wrong Field Code - A short label used when exporting question (e.g. for column or row names in a spreadsheet) + A short label used when exporting question (e.g. for column or row names in a spreadsheet) Your file is too large. Files are limited to %pretty_max_size% bytes.\n Your file is zero-length. Either you attempted to upload a zero length file, a file which does not exists, or something went wrong during the transfer.\n @@ -175,7 +179,9 @@ Increasing (true) will give (number of correct matches / number of total matches) *100% points.<br> Increasing (false) will either give 100%, if all correct answers are given, or 0% else. Instructions + IP Mask Upload File + Questions %section.cur_first_item% - %section.cur_last_item% out of %section.num_items% REDUNDANT, Description should be enough Delete File Additional searchable description for the question catalog @@ -297,6 +303,7 @@ SECTION Branched section Is this a branched section? + Section %section.cur_section% out of %section.num_sections% No clue what this is => No help Description for this section Display Type to use for this section. @@ -313,13 +320,15 @@ Section Template Template for the section, made up of ADP commands. Seconds allowed to finish this section. + Remaining section time: %section.pretty_remaining_time% Title of the section, will be used in Display and HTML Title Sections Secure Access Required Secure access required Selected Sections Send bulk mail Session + Remaining session time: %assessment_data.pretty_remaining_time% Sessions Show Assessments Show Feedback @@ -339,6 +348,7 @@ Summary This question will be corrected by the teacher Seconds allowed for completion + Minutes allowed for completion %assessment_data.time_for_response% seconds maximum response time Time spent Retry allowed after %assessment_data.wait_between_tries% minutes Index: openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql 19 Jan 2005 16:49:14 -0000 1.7 +++ openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql 23 Jan 2005 18:10:48 -0000 1.8 @@ -42,6 +42,9 @@ check (percent_score <= 100) ); +create index as_sessions_assessment_id_idx on as_sessions (assessment_id); +create index as_sessions_subject_id_idx on as_sessions (subject_id); + --Assessment Section Data: tracks the state of each Section in the Assessment. create table as_section_data ( section_data_id integer @@ -62,9 +65,17 @@ staff_id integer constraint as_section_data_staff_id_fk references users(user_id), - points integer + points integer, + -- when the subject initiated the section + creation_datetime timestamptz, + -- when the final submission produced a complete section + completed_datetime timestamptz ); +create unique index as_section_data_pk2 on as_section_data (session_id, section_id); +create unique index as_section_data_pk3 on as_section_data (section_id, session_id); +create index as_section_data_subject_id_idx on as_section_data (subject_id); + -- Assessment Item Data: is the "long skinny table" where all the primary data go create table as_item_data ( item_data_id integer @@ -109,6 +120,9 @@ -- to do: figure out how attachment answers should be supported; the Attachment package is still in need of considerable help. Can we rely on it here? ); +create index as_item_data_pk2 on as_item_data (session_id, section_id, as_item_id); +create index as_item_data_pk3 on as_item_data (as_item_id, section_id, session_id); +create index as_item_data_subject_id_idx on as_item_data (subject_id); -- here the selected choices are stored create table as_item_data_choices ( @@ -123,6 +137,7 @@ primary key (item_data_id, choice_id) ); +create unique index as_item_data_choices_pk2 on as_item_data_choices (choice_id, item_data_id); -- here the order of the displayed sections is stored per session create table as_session_sections ( @@ -137,6 +152,8 @@ primary key (session_id, section_id) ); +create unique index as_session_sections_pk2 on as_session_sections (section_id, session_id); + -- here the order of the displayed items is stored per session create table as_session_items ( session_id integer @@ -153,6 +170,8 @@ primary key (session_id, section_id, as_item_id) ); +create unique index as_session_items_pk2 on as_session_items (as_item_id, section_id, session_id); + -- here the order of the displayed item choices is stored per session create table as_session_choices ( session_id integer @@ -172,6 +191,8 @@ primary key (session_id, section_id, as_item_id, choice_id) ); +create unique index as_session_choices_pk2 on as_session_choices (choice_id, as_item_id, section_id, session_id); + -- here all references to answers of a session are stored create table as_session_item_map ( session_id integer @@ -183,3 +204,5 @@ constraint as_session_item_map_pk primary key (session_id, item_data_id) ); + +create unique index as_session_item_map_pk2 on as_session_item_map (item_data_id, session_id); Index: openacs-4/packages/assessment/sql/postgresql/assessment-item-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-item-create.sql,v diff -u -r1.14 -r1.15 --- openacs-4/packages/assessment/sql/postgresql/assessment-item-create.sql 5 Jan 2005 12:39:28 -0000 1.14 +++ openacs-4/packages/assessment/sql/postgresql/assessment-item-create.sql 23 Jan 2005 18:10:48 -0000 1.15 @@ -72,6 +72,8 @@ check (percent_score <= 100) ); +create index as_item_choices_sort_order_idx on as_item_choices (mc_id, sort_order); + -- Short Answer Answers create table as_item_sa_answers ( choice_id integer Index: openacs-4/packages/assessment/sql/postgresql/assessment-section-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-section-create.sql,v diff -u -r1.14 -r1.15 --- openacs-4/packages/assessment/sql/postgresql/assessment-section-create.sql 5 Jan 2005 12:39:05 -0000 1.14 +++ openacs-4/packages/assessment/sql/postgresql/assessment-section-create.sql 23 Jan 2005 18:10:48 -0000 1.15 @@ -103,6 +103,8 @@ wait_between_tries integer, -- how many minutes has the respondee to finish the assessment time_for_response integer, + -- ip mask for restricted access + ip_mask varchar(100), -- the feedback type which will be displayed to the respondee (all, none, correct, incorrect) show_feedback varchar(50) default 'all' constraint as_assessments_show_feedback_ck @@ -149,9 +151,13 @@ -- order in which a section will be displayed sort_order integer, -- this is the relative weight of a section in an assessment - points integer + points integer, + constraint as_assessment_section_map_pk primary key (assessment_id, section_id) ); +create unique index as_assessment_section_map_pk2 on as_assessment_section_map (section_id, assessment_id); +create index as_assessment_section_map_sort_order_idx on as_assessment_section_map (assessment_id, sort_order); + -- Item Section Map: defines the items of a section create table as_item_section_map ( as_item_id integer @@ -171,5 +177,9 @@ -- fixed position in display. 0 for default, negative values relative to section end fixed_position integer, -- this is the relative weight of an item in a section - points integer + points integer, + constraint as_item_section_map_pk primary key (section_id, as_item_id) ); + +create unique index as_item_section_map_pk2 on as_item_section_map (as_item_id, section_id); +create index as_item_section_map_sort_order_idx on as_item_section_map (section_id, sort_order); Index: openacs-4/packages/assessment/sql/postgresql/assessment-types-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-types-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/sql/postgresql/assessment-types-create.sql 8 Dec 2004 15:30:33 -0000 1.2 +++ openacs-4/packages/assessment/sql/postgresql/assessment-types-create.sql 23 Jan 2005 18:10:48 -0000 1.3 @@ -9,7 +9,8 @@ create table as_item_types_map ( item_type varchar(50), - display_type varchar(50) + display_type varchar(50), + constraint as_item_types_map_pk primary key (item_type, display_type) ); insert into as_item_types_map (item_type, display_type) Index: openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.10d2-0.10d3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.10d2-0.10d3.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.10d2-0.10d3.sql 23 Jan 2005 18:10:48 -0000 1.1 @@ -0,0 +1,37 @@ +alter table as_section_data add column creation_datetime timestamptz; +alter table as_section_data add column completed_datetime timestamptz; + +alter table as_assessments add column ip_mask varchar(100); + +alter table as_assessment_section_map add constraint as_assessment_section_map_pk primary key (assessment_id, section_id); +create unique index as_assessment_section_map_pk2 on as_assessment_section_map (section_id, assessment_id); +create index as_assessment_section_map_sort_order_idx on as_assessment_section_map (assessment_id, sort_order); + +alter table as_item_section_map add constraint as_item_section_map_pk primary key (section_id, as_item_id); +create unique index as_item_section_map_pk2 on as_item_section_map (as_item_id, section_id); +create index as_item_section_map_sort_order_idx on as_item_section_map (section_id, sort_order); + +create index as_item_choices_sort_order_idx on as_item_choices (mc_id, sort_order); + +alter table as_item_types_map add constraint as_item_types_map_pk primary key (item_type, display_type); + +create index as_sessions_assessment_id_idx on as_sessions (assessment_id); +create index as_sessions_subject_id_idx on as_sessions (subject_id); + +create unique index as_section_data_pk2 on as_section_data (session_id, section_id); +create unique index as_section_data_pk3 on as_section_data (section_id, session_id); +create index as_section_data_subject_id_idx on as_section_data (subject_id); + +create index as_item_data_pk2 on as_item_data (session_id, section_id, as_item_id); +create index as_item_data_pk3 on as_item_data (as_item_id, section_id, session_id); +create index as_item_data_subject_id_idx on as_item_data (subject_id); + +create unique index as_item_data_choices_pk2 on as_item_data_choices (choice_id, item_data_id); + +create unique index as_session_sections_pk2 on as_session_sections (section_id, session_id); + +create unique index as_session_items_pk2 on as_session_items (as_item_id, section_id, session_id); + +create unique index as_session_choices_pk2 on as_session_choices (choice_id, as_item_id, section_id, session_id); + +create unique index as_session_item_map_pk2 on as_session_item_map (item_data_id, session_id); Index: openacs-4/packages/assessment/tcl/as-assessment-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-assessment-procs-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/tcl/as-assessment-procs-oracle.xql 18 Jan 2005 12:42:36 -0000 1.4 +++ openacs-4/packages/assessment/tcl/as-assessment-procs-oracle.xql 23 Jan 2005 18:10:48 -0000 1.5 @@ -7,7 +7,7 @@ select a.assessment_id as assessment_rev_id, cr.item_id as assessment_id, cr.title, ci.name, cr.description, o.creation_user, o.creation_date, a.instructions, a.run_mode, - a.anonymous_p, a.secure_access_p, a.reuse_responses_p, + a.anonymous_p, a.secure_access_p, a.reuse_responses_p, a.ip_mask, a.show_item_name_p, a.entry_page, a.exit_page, a.consent_page, a.return_url, a.start_time, a.end_time, a.number_tries, a.wait_between_tries, a.time_for_response, a.show_feedback, a.section_navigation, a.creator_id, a.survey_p @@ -35,4 +35,27 @@ + + + + select a.number_tries, a.wait_between_tries, a.ip_mask, + to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time, + to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time, + to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') as cur_time + from as_assessments a + where a.assessment_id = :assessment_id + + + + + + + + select round(86400 * (sysdate - completed_datetime)) as cur_wait_time + from as_sessions + where session_id = :last_session_id + + + + Index: openacs-4/packages/assessment/tcl/as-assessment-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-assessment-procs-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/tcl/as-assessment-procs-postgresql.xql 18 Jan 2005 12:42:36 -0000 1.4 +++ openacs-4/packages/assessment/tcl/as-assessment-procs-postgresql.xql 23 Jan 2005 18:10:48 -0000 1.5 @@ -7,7 +7,7 @@ select a.assessment_id as assessment_rev_id, cr.item_id as assessment_id, cr.title, ci.name, cr.description, o.creation_user, o.creation_date, a.instructions, a.run_mode, - a.anonymous_p, a.secure_access_p, a.reuse_responses_p, + a.anonymous_p, a.secure_access_p, a.reuse_responses_p, a.ip_mask, a.show_item_name_p, a.entry_page, a.exit_page, a.consent_page, a.return_url, a.start_time, a.end_time, a.number_tries, a.wait_between_tries, a.time_for_response, a.show_feedback, a.section_navigation, a.creator_id, a.survey_p @@ -35,4 +35,27 @@ + + + + select a.number_tries, a.wait_between_tries, a.ip_mask, + to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time, + to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time, + to_char(now(), 'YYYY-MM-DD HH24:MI:SS') as cur_time + from as_assessments a + where a.assessment_id = :assessment_id + + + + + + + + select round(date_part('epoch', now() - completed_datetime)) as cur_wait_time + from as_sessions + where session_id = :last_session_id + + + + 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.15 -r1.16 --- openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 19 Jan 2005 16:49:14 -0000 1.15 +++ openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 23 Jan 2005 18:10:48 -0000 1.16 @@ -26,6 +26,7 @@ {-number_tries ""} {-wait_between_tries ""} {-time_for_response ""} + {-ip_mask ""} {-show_feedback ""} {-section_navigation ""} {-survey_p ""} @@ -67,6 +68,7 @@ [list number_tries $number_tries] \ [list wait_between_tries $wait_between_tries] \ [list time_for_response $time_for_response] \ + [list ip_mask $ip_mask] \ [list show_feedback $show_feedback] \ [list section_navigation $section_navigation] \ [list survey_p $survey_p]] ] @@ -95,6 +97,7 @@ {-number_tries ""} {-wait_between_tries ""} {-time_for_response ""} + {-ip_mask ""} {-show_feedback ""} {-section_navigation ""} } { @@ -128,6 +131,7 @@ [list number_tries $number_tries] \ [list wait_between_tries $wait_between_tries] \ [list time_for_response $time_for_response] \ + [list ip_mask $ip_mask] \ [list show_feedback $show_feedback] \ [list section_navigation $section_navigation] ] ] @@ -198,6 +202,7 @@ [list number_tries $a(number_tries)] \ [list wait_between_tries $a(wait_between_tries)] \ [list time_for_response $a(time_for_response)] \ + [list ip_mask $a(ip_mask)] \ [list show_feedback $a(show_feedback)] \ [list section_navigation $a(section_navigation)] ] ] @@ -295,6 +300,48 @@ db_dml update_assessment_percent {} } +ad_proc -public as::assessment::check_session_conditions { + -assessment_id:required + -subject_id:required +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2004-12-22 + + Checks if subject is allowed to take the assessment +} { + db_1row assessment_data {} + db_1row total_tries {} + if {![empty_string_p $wait_between_tries]} { + set wait_between_tries [expr 60 * $wait_between_tries] + } + if {$total_tries > 0} { + db_1row cur_wait_time {} + } else { + set cur_wait_time $wait_between_tries + } + + set error_list "" + if {(![empty_string_p $start_time] && $start_time > $cur_time) || (![empty_string_p $end_time] && $end_time < $cur_time)} { + append error_list "
  • [_ assessment.assessment_not_public]
  • " + } + if {![empty_string_p $number_tries] && $number_tries < $total_tries} { + append error_list "
  • [_ assessment.assessment_too_many_tries]
  • " + } + if {![empty_string_p $wait_between_tries] && $wait_between_tries > $cur_wait_time} { + set pretty_wait_time [pretty_time -seconds [expr $wait_between_tries - $cur_wait_time]] + append error_list "
  • [_ assessment.assessment_wait_retry]
  • " + } + if {![empty_string_p $ip_mask]} { + regsub -all {\.} "^$ip_mask" {\\.} ip_mask + regsub -all {\*} $ip_mask {.*} ip_mask + if {![regexp $ip_mask [ad_conn peeraddr]]} { + append error_list "
  • [_ assessment.assessment_restricted_ips]
  • " + } + } + + return $error_list +} + ad_proc as::assessment::pretty_time { {-seconds} } { @@ -307,7 +354,8 @@ if {![empty_string_p $seconds]} { set time_min [expr $seconds / 60] set time_sec [expr $seconds - ($time_min * 60)] - set time "$time_min\:$time_sec min" + set pad "00" + set time "[string range $pad [string length $time_min] end]$time_min\:[string range $pad [string length $time_sec] end]$time_sec min" } return $time } Index: openacs-4/packages/assessment/tcl/as-assessment-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-assessment-procs.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/tcl/as-assessment-procs.xql 18 Jan 2005 12:42:36 -0000 1.8 +++ openacs-4/packages/assessment/tcl/as-assessment-procs.xql 23 Jan 2005 18:10:48 -0000 1.9 @@ -99,6 +99,20 @@ + + + + select count(*) as total_tries, max(session_id) as last_session_id + from as_sessions s, cr_revisions r, cr_revisions r2 + where s.subject_id = :subject_id + and s.completed_datetime is not null + and s.assessment_id = r.revision_id + and r.item_id = r2.item_id + and r2.revision_id = :assessment_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.19 -r1.20 --- openacs-4/packages/assessment/tcl/as-install-procs.tcl 19 Jan 2005 16:49:14 -0000 1.19 +++ openacs-4/packages/assessment/tcl/as-install-procs.tcl 23 Jan 2005 18:10:48 -0000 1.20 @@ -153,6 +153,7 @@ content::type::attribute::new -content_type {as_assessments} -attribute_name {number_tries} -datatype {number} -pretty_name {Assessment Number Tries} -column_spec {integer} content::type::attribute::new -content_type {as_assessments} -attribute_name {wait_between_tries} -datatype {number} -pretty_name {Assessment Wait Between Tries} -column_spec {integer} content::type::attribute::new -content_type {as_assessments} -attribute_name {time_for_response} -datatype {number} -pretty_name {Assessment Time for Response} -column_spec {integer} +content::type::attribute::new -content_type {as_assessments} -attribute_name {ip_mask} -datatype {string} -pretty_name {IP Mask} -column_spec {varchar(100)} content::type::attribute::new -content_type {as_assessments} -attribute_name {show_feedback} -datatype {string} -pretty_name {Assessment Show comments to the user} -column_spec {varchar(50)} content::type::attribute::new -content_type {as_assessments} -attribute_name {section_navigation} -datatype {string} -pretty_name {Assessment Navigation of sections} -column_spec {varchar(50)} content::type::attribute::new -content_type {as_assessments} -attribute_name {survey_p} -datatype {string} -pretty_name {Survey} -column_spec {char(1)} @@ -176,6 +177,8 @@ content::type::attribute::new -content_type {as_section_data} -attribute_name {subject_id} -datatype {number} -pretty_name {Subject ID} -column_spec {integer} content::type::attribute::new -content_type {as_section_data} -attribute_name {staff_id} -datatype {number} -pretty_name {Staff ID} -column_spec {integer} content::type::attribute::new -content_type {as_section_data} -attribute_name {points} -datatype {number} -pretty_name {Points Awarded} -column_spec {integer} +content::type::attribute::new -content_type {as_section_data} -attribute_name {creation_datetime} -datatype {number} -pretty_name {Creation Date Time} -column_spec {timestamptz} +content::type::attribute::new -content_type {as_section_data} -attribute_name {completed_datetime} -datatype {number} -pretty_name {Final Submission} -column_spec {timestamptz} # Item data content::type::attribute::new -content_type {as_item_data} -attribute_name {session_id} -datatype {number} -pretty_name {Session ID} -column_spec {integer} @@ -253,5 +256,10 @@ 0.10d1 0.10d2 { content::type::attribute::new -content_type {as_item_data} -attribute_name {section_id} -datatype {number} -pretty_name {Section ID} -column_spec {integer} } + 0.10d2 0.10d3 { + content::type::attribute::new -content_type {as_section_data} -attribute_name {creation_datetime} -datatype {number} -pretty_name {Creation Date Time} -column_spec {timestamptz} + content::type::attribute::new -content_type {as_section_data} -attribute_name {completed_datetime} -datatype {number} -pretty_name {Final Submission} -column_spec {timestamptz} + content::type::attribute::new -content_type {as_assessments} -attribute_name {ip_mask} -datatype {string} -pretty_name {IP Mask} -column_spec {varchar(100)} + } } } Index: openacs-4/packages/assessment/tcl/as-section-data-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/Attic/as-section-data-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/tcl/as-section-data-procs-oracle.xql 23 Jan 2005 18:10:48 -0000 1.1 @@ -0,0 +1,16 @@ + + +oracle8.1.6 + + + + + update as_section_data + set creation_datetime = sysdate + where session_id = :session_id + and section_id = :section_id + + + + + Index: openacs-4/packages/assessment/tcl/as-section-data-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/Attic/as-section-data-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/tcl/as-section-data-procs-postgresql.xql 23 Jan 2005 18:10:48 -0000 1.1 @@ -0,0 +1,16 @@ + + +postgresql7.1 + + + + + update as_section_data + set creation_datetime = now() + where session_id = :session_id + and section_id = :section_id + + + + + Index: openacs-4/packages/assessment/tcl/as-section-data-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-data-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/tcl/as-section-data-procs.tcl 19 Jan 2005 16:49:14 -0000 1.2 +++ openacs-4/packages/assessment/tcl/as-section-data-procs.tcl 23 Jan 2005 18:10:48 -0000 1.3 @@ -37,6 +37,8 @@ [list subject_id $subject_id] \ [list staff_id $staff_id] \ [list points $points] ] ] + + db_dml update_creation_time {} } return $as_section_data_id Index: openacs-4/packages/assessment/tcl/as-section-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/tcl/as-section-procs-oracle.xql 19 Jan 2005 16:49:14 -0000 1.3 +++ openacs-4/packages/assessment/tcl/as-section-procs-oracle.xql 23 Jan 2005 18:10:48 -0000 1.4 @@ -68,4 +68,29 @@ + + + + update as_section_data + set points = :section_points, + completed_datetime = sysdate + where session_id = :session_id + and section_id = :section_id + + + + + + + + update as_section_data + set creation_datetime= sysdate, + completed_datetime = sysdate, + points = 0 + where session_id = :session_id + and section_id = :section_id + + + + Index: openacs-4/packages/assessment/tcl/as-section-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-procs-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/tcl/as-section-procs-postgresql.xql 19 Jan 2005 16:49:14 -0000 1.3 +++ openacs-4/packages/assessment/tcl/as-section-procs-postgresql.xql 23 Jan 2005 18:10:48 -0000 1.4 @@ -65,4 +65,29 @@ + + + + update as_section_data + set points = :section_points, + completed_datetime = now() + where session_id = :session_id + and section_id = :section_id + + + + + + + + update as_section_data + set creation_datetime= now(), + completed_datetime = now(), + points = 0 + where session_id = :session_id + and section_id = :section_id + + + + 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.14 -r1.15 --- openacs-4/packages/assessment/tcl/as-section-procs.tcl 19 Jan 2005 16:49:14 -0000 1.14 +++ openacs-4/packages/assessment/tcl/as-section-procs.tcl 23 Jan 2005 18:10:48 -0000 1.15 @@ -299,3 +299,43 @@ set section_points [expr round($section_max_points * $item_points / $item_max_points)] db_dml update_section_points {} } + +ad_proc -public as::section::skip { + -section_id:required + -session_id:required + -subject_id:required + {-staff_id ""} +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2005-01-22 + + Skip section in a session and award 0 points +} { + db_transaction { + as::section_data::new -section_id $section_id -session_id $session_id -subject_id $subject_id -staff_id $staff_id + db_dml set_zero_points {} + } +} + +ad_proc -public as::section::close { + -section_id:required + -assessment_id:required + -session_id:required + -subject_id:required + {-staff_id ""} +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2005-01-22 + + Close started section in a session and award 0 points with empty answers + to all remaining items +} { + db_transaction { + set item_list [db_list remaining_items {}] + foreach as_item_id $item_list { + as::item_data::new -session_id $session_id -subject_id $subject_id -staff_id $staff_id -as_item_id $as_item_id -section_id $section_id -points 0 -allow_overwrite_p f + } + + calculate -section_id $section_id -assessment_id $assessment_id -session_id $session_id + } +} Index: openacs-4/packages/assessment/tcl/as-section-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-procs.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/assessment/tcl/as-section-procs.xql 19 Jan 2005 16:49:14 -0000 1.9 +++ openacs-4/packages/assessment/tcl/as-section-procs.xql 23 Jan 2005 18:10:48 -0000 1.10 @@ -86,13 +86,17 @@ - + - update as_section_data - set points = :section_points - where session_id = :session_id - and section_id = :section_id + select i.as_item_id + from as_session_items i + where i.session_id = :session_id + and i.section_id = :section_id + and i.as_item_id not in (select d.as_item_id + from as_item_data d + where d.session_id = :session_id + and d.section_id = :section_id) Index: openacs-4/packages/assessment/www/assessment-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/assessment-oracle.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/assessment-oracle.xql 18 Jan 2005 12:42:37 -0000 1.5 +++ openacs-4/packages/assessment/www/assessment-oracle.xql 23 Jan 2005 18:10:48 -0000 1.6 @@ -2,6 +2,34 @@ oracle8.1.6 + + + + select round(86400 * (sysdate - creation_datetime)) as elapsed_time + from as_sessions + where session_id = :session_id + + + + + + + + select s.section_id, cr.title, cr.description, s.instructions, + m.max_time_to_complete, s.display_type_id, s.num_items, + round(86400 * (sysdate - d.creation_datetime)) as elapsed_time + from cr_revisions cr, as_sections s, as_assessment_section_map m, + as_section_data d + where cr.revision_id = s.section_id + and s.section_id = :section_id + and m.section_id = s.section_id + and m.assessment_id = :assessment_rev_id + and d.session_id = :session_id + and d.section_id = m.section_id + + + + UPDATE as_sessions Index: openacs-4/packages/assessment/www/assessment-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/assessment-postgresql.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/assessment/www/assessment-postgresql.xql 18 Jan 2005 12:42:37 -0000 1.9 +++ openacs-4/packages/assessment/www/assessment-postgresql.xql 23 Jan 2005 18:10:48 -0000 1.10 @@ -2,6 +2,34 @@ postgresql7.4 + + + + select round(date_part('epoch', now() - creation_datetime)) as elapsed_time + from as_sessions + where session_id = :session_id + + + + + + + + select s.section_id, cr.title, cr.description, s.instructions, + m.max_time_to_complete, s.display_type_id, s.num_items, + round(date_part('epoch', now() - d.creation_datetime)) as elapsed_time + from cr_revisions cr, as_sections s, as_assessment_section_map m, + as_section_data d + where cr.revision_id = s.section_id + and s.section_id = :section_id + and m.section_id = s.section_id + and m.assessment_id = :assessment_rev_id + and d.session_id = :session_id + and d.section_id = m.section_id + + + + UPDATE as_sessions Index: openacs-4/packages/assessment/www/assessment-section-submit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/assessment-section-submit.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/assessment-section-submit.adp 20 Jan 2005 18:47:23 -0000 1.1 +++ openacs-4/packages/assessment/www/assessment-section-submit.adp 23 Jan 2005 18:10:48 -0000 1.2 @@ -5,6 +5,12 @@ + Index: openacs-4/packages/assessment/www/assessment-single-submit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/assessment-single-submit.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/assessment-single-submit.adp 20 Jan 2005 18:47:23 -0000 1.1 +++ openacs-4/packages/assessment/www/assessment-single-submit.adp 23 Jan 2005 18:10:48 -0000 1.2 @@ -5,6 +5,12 @@
    @assessment_data.title@
    @assessment_data.instructions@
    +#assessment.section_counter# +
    #assessment.item_counter# +
    #assessment.session_time_remaining#
    +
    #assessment.section_time_remaining#
    +

    + Index: openacs-4/packages/assessment/www/assessment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/assessment.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/assessment/www/assessment.tcl 20 Jan 2005 22:39:41 -0000 1.24 +++ openacs-4/packages/assessment/www/assessment.tcl 23 Jan 2005 18:10:48 -0000 1.25 @@ -28,6 +28,11 @@ } set assessment_rev_id $assessment_data(assessment_rev_id) +set errors [as::assessment::check_session_conditions -assessment_id $assessment_rev_id -subject_id $user_id] +if {![empty_string_p $errors]} { + ad_return_complaint 1 $errors + ad_script_abort +} db_transaction { if {[empty_string_p $session_id]} { @@ -48,6 +53,14 @@ } } + db_1row session_time {} + set assessment_data(elapsed_time) $elapsed_time + if {![empty_string_p $assessment_data(time_for_response)]} { + set assessment_data(time_for_response) [expr 60 * $assessment_data(time_for_response)] + set assessment_data(pretty_remaining_time) [as::assessment::pretty_time -seconds [expr $assessment_data(time_for_response) - $assessment_data(elapsed_time)]] + } + + # get all sections of assessment in correct order set section_list [as::assessment::sections -assessment_id $assessment_rev_id -session_id $session_id -sort_order_type $assessment_data(section_navigation)] @@ -61,6 +74,7 @@ } + as::section_data::new -section_id $section_id -session_id $session_id -subject_id $user_id db_1row section_data {} -column_array section set display_type_id $section(display_type_id) if {![empty_string_p $display_type_id]} { @@ -69,10 +83,13 @@ array set display [list num_items "" adp_chunk "" branched_p f back_button_p t submit_answer_p f sort_order_type order_of_entry] } - # get all items of section in correct order set item_list [as::section::items -section_id $section_id -session_id $session_id -sort_order_type $display(sort_order_type) -num_items $section(num_items)] - as::section_data::new -section_id $section_id -session_id $session_id -subject_id $user_id + set section(num_sections) [llength $section_list] + set section(num_items) [llength $item_list] + if {![empty_string_p $section(max_time_to_complete)]} { + set section(pretty_remaining_time) [as::assessment::pretty_time -seconds [expr $section(max_time_to_complete) - $section(elapsed_time)]] + } if {![empty_string_p $item_order]} { # show next items on section page @@ -116,7 +133,60 @@ } } +set section(cur_section) [expr $section_order + 1] +set section(cur_first_item) [expr $item_order + 1] +set section(cur_last_item) [expr $item_order + [llength $item_list]] +# check if section or session time ran out +if {(![empty_string_p $assessment_data(time_for_response)] && $assessment_data(time_for_response) < $assessment_data(elapsed_time)) || (![empty_string_p $section(max_time_to_complete)] && $section(max_time_to_complete) < $section(elapsed_time))} { + if {[empty_string_p $assessment_data(time_for_response)] || $assessment_data(time_for_response) >= $assessment_data(elapsed_time)} { + # skip to next section + set new_section_order [expr $section_order + 1] + set new_item_order "" + if {$new_section_order == [llength $section_list]} { + # last section + set new_section_order "" + } + + # answer all remaining section items with empty string + as::section::close -section_id $section_id -assessment_id $assessment_rev_id -session_id $session_id -subject_id $user_id + } else { + # skip entire session + set new_section_order "" + set new_item_order "" + + db_transaction { + # answer all remaining section items with empty string + as::section::close -section_id $section_id -assessment_id $assessment_rev_id -session_id $session_id -subject_id $user_id + + set section_list [lreplace $section_list 0 [expr $section_order]] + foreach section_id $section_list { + # skip remaining sections + as::section::skip -section_id $section_id -session_id $session_id -subject_id $user_id + } + } + } + + if {![empty_string_p $new_section_order]} { + # go to next section + set section_order $new_section_order + set item_order $new_item_order + ad_returnredirect [export_vars -base assessment {assessment_id session_id section_order item_order}] + ad_script_abort + } else { + # calculate session points at end of session + as::assessment::calculate -session_id $session_id -assessment_id $assessment_rev_id + db_dml session_finished {} + if {[empty_string_p $assessment_data(return_url)]} { + ad_returnredirect [export_vars -base finish {session_id assessment_id}] + } else { + ad_returnredirect $assessment_data(return_url) + } + ad_script_abort + } +} + + # form for display an assessment with sections and items ad_form -name show_item_form -action assessment -html {enctype multipart/form-data} -export {assessment_id section_id section_order item_order} -form { {session_id:text(hidden) {value $session_id}} @@ -246,7 +316,11 @@ # calculate session points at end of session as::assessment::calculate -session_id \$session_id -assessment_id \$assessment_rev_id db_dml session_finished {} - ad_returnredirect \[export_vars -base finish {session_id assessment_id}\] + if {\[empty_string_p \$assessment_data(return_url)\]} { + ad_returnredirect \[export_vars -base finish {session_id assessment_id}\] + } else { + ad_returnredirect \$assessment_data(return_url) + } ad_script_abort } }" @@ -284,7 +358,11 @@ # calculate session points at end of session as::assessment::calculate -session_id $session_id -assessment_id $assessment_rev_id db_dml session_finished {} - ad_returnredirect [export_vars -base finish {session_id assessment_id}] + if {[empty_string_p $assessment_data(return_url)]} { + ad_returnredirect [export_vars -base finish {session_id assessment_id}] + } else { + ad_returnredirect $assessment_data(return_url) + } ad_script_abort } } Index: openacs-4/packages/assessment/www/assessment.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/assessment.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/www/assessment.xql 20 Jan 2005 22:39:41 -0000 1.8 +++ openacs-4/packages/assessment/www/assessment.xql 23 Jan 2005 18:10:48 -0000 1.9 @@ -1,20 +1,6 @@ - - - - select s.section_id, cr.title, cr.description, s.instructions, - m.max_time_to_complete, s.display_type_id, s.num_items - from cr_revisions cr, as_sections s, as_assessment_section_map m - where cr.revision_id = s.section_id - and s.section_id = :section_id - and m.section_id = s.section_id - and m.assessment_id = :assessment_rev_id - - - - Index: openacs-4/packages/assessment/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/index-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/index-oracle.xql 23 Jan 2005 18:10:49 -0000 1.1 @@ -0,0 +1,22 @@ + + + oracle8.1.6 + + + + select cr.item_id as assessment_id, cr.title, cr.description, + to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time, + to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time, + to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') as cur_time + from as_assessments a, cr_revisions cr, cr_items ci + where a.assessment_id = cr.revision_id + and cr.revision_id = ci.latest_revision + and ci.parent_id = :folder_id + and exists (select 1 + from as_assessment_section_map asm, as_item_section_map ism + where asm.assessment_id = a.assessment_id + and ism.section_id = asm.section_id) + + + + Index: openacs-4/packages/assessment/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/index-postgresql.xql 23 Jan 2005 18:10:49 -0000 1.1 @@ -0,0 +1,22 @@ + + + postgresql7.4 + + + + select cr.item_id as assessment_id, cr.title, cr.description, + to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time, + to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time, + to_char(now(), 'YYYY-MM-DD HH24:MI:SS') as cur_time + from as_assessments a, cr_revisions cr, cr_items ci + where a.assessment_id = cr.revision_id + and cr.revision_id = ci.latest_revision + and ci.parent_id = :folder_id + and exists (select 1 + from as_assessment_section_map asm, as_item_section_map ism + where asm.assessment_id = a.assessment_id + and ism.section_id = asm.section_id) + + + + Index: openacs-4/packages/assessment/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/index.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/www/index.tcl 14 Jan 2005 13:13:37 -0000 1.8 +++ openacs-4/packages/assessment/www/index.tcl 23 Jan 2005 18:10:49 -0000 1.9 @@ -23,22 +23,24 @@ -elements { title { label {Assessment} - link_url_eval {[export_vars -base "assessment" {assessment_id}]} - link_html { title {@assessments.description@} } - + display_template {@assessments.title@@assessments.title@} } session { label {[_ assessment.Sessions]} link_url_eval {[export_vars -base "sessions" {assessment_id}]} } - } \ - -main_class { + } -main_class { narrow } # get the information of all assessments store in the database -db_multirow -extend { session } assessments asssessment_id_name_definition {} { +db_multirow -extend { session assessment_url } assessments asssessment_id_name_definition {} { set session {Sessions} + if {([empty_string_p $start_time] || $start_time <= $cur_time) && ([empty_string_p $end_time] || $end_time >= $cur_time)} { + set assessment_url [export_vars -base "assessment" {assessment_id}] + } else { + set assessment_url "" + } } set admin_p [ad_permission_p $package_id admin] Fisheye: Tag 1.7 refers to a dead (removed) revision in file `openacs-4/packages/assessment/www/index.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/assessment/www/sessions-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/sessions-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/sessions-oracle.xql 18 Jan 2005 12:42:37 -0000 1.4 +++ openacs-4/packages/assessment/www/sessions-oracle.xql 23 Jan 2005 18:10:49 -0000 1.5 @@ -8,13 +8,17 @@ SELECT r.item_id as assessment_id, s.session_id, s.percent_score, to_char(s.completed_datetime, :format) as completed_datetime, p.first_names || ' ' || p.last_name AS subject_name, - r.title AS assessment_name, s.subject_id - FROM as_sessions s, cr_revisions r, persons p + r.title AS assessment_name, s.subject_id, + to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time, + to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time, + to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') as cur_time + FROM as_sessions s, cr_revisions r, persons p, as_assessments a WHERE s.assessment_id = r.revision_id AND s.subject_id = p.person_id AND s.subject_id = :subject_id AND r.item_id = :assessment_id - ORDER BY s.completed_datetime desc, s.creation_datetime desc + and a.assessment_id = :assessment_rev_id + ORDER BY s.session_id desc @@ -23,12 +27,16 @@ SELECT r.item_id as assessment_id, s.session_id, s.percent_score, to_char(s.completed_datetime, :format) as completed_datetime, p.first_names || ' ' || p.last_name AS subject_name, - r.title AS assessment_name, s.subject_id - FROM as_sessions s, cr_revisions r, persons p + r.title AS assessment_name, s.subject_id, + to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time, + to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time, + to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') as cur_time + FROM as_sessions s, cr_revisions r, persons p, as_assessments a WHERE s.assessment_id = r.revision_id AND s.subject_id = p.person_id AND r.item_id = :assessment_id - ORDER BY s.completed_datetime desc, s.creation_datetime desc + and a.assessment_id = :assessment_rev_id + ORDER BY s.session_id desc Index: openacs-4/packages/assessment/www/sessions-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/sessions-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/sessions-postgresql.xql 18 Jan 2005 12:42:37 -0000 1.7 +++ openacs-4/packages/assessment/www/sessions-postgresql.xql 23 Jan 2005 18:10:49 -0000 1.8 @@ -8,13 +8,17 @@ SELECT r.item_id as assessment_id, s.session_id, s.percent_score, to_char(s.completed_datetime, :format) as completed_datetime, p.first_names || ' ' || p.last_name AS subject_name, - r.title AS assessment_name, s.subject_id - FROM as_sessions s, cr_revisions r, persons p + r.title AS assessment_name, s.subject_id, + to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time, + to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time, + to_char(now(), 'YYYY-MM-DD HH24:MI:SS') as cur_time + FROM as_sessions s, cr_revisions r, persons p, as_assessments a WHERE s.assessment_id = r.revision_id AND s.subject_id = p.person_id AND s.subject_id = :subject_id AND r.item_id = :assessment_id - ORDER BY s.completed_datetime desc, s.creation_datetime desc + and a.assessment_id = :assessment_rev_id + ORDER BY s.session_id desc @@ -23,12 +27,16 @@ SELECT r.item_id as assessment_id, s.session_id, s.percent_score, to_char(s.completed_datetime, :format) as completed_datetime, p.first_names || ' ' || p.last_name AS subject_name, - r.title AS assessment_name, s.subject_id - FROM as_sessions s, cr_revisions r, persons p + r.title AS assessment_name, s.subject_id, + to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time, + to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time, + to_char(now(), 'YYYY-MM-DD HH24:MI:SS') as cur_time + FROM as_sessions s, cr_revisions r, persons p, as_assessments a WHERE s.assessment_id = r.revision_id AND s.subject_id = p.person_id AND r.item_id = :assessment_id - ORDER BY s.completed_datetime desc, s.creation_datetime desc + and a.assessment_id = :assessment_rev_id + ORDER BY s.session_id desc Index: openacs-4/packages/assessment/www/sessions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/sessions.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/assessment/www/sessions.tcl 18 Jan 2005 12:42:37 -0000 1.13 +++ openacs-4/packages/assessment/www/sessions.tcl 23 Jan 2005 18:10:49 -0000 1.14 @@ -53,7 +53,7 @@ } assessment_name { label {Assessment} - link_url_eval {[export_vars -base "assessment" {assessment_id}]} + display_template {@sessions.assessment_name@@sessions.assessment_name@} } completed_datetime { label {[_ assessment.Finish_Time]} @@ -79,7 +79,7 @@ } assessment_name { label {Assessment} - link_url_eval {[export_vars -base "assessment" {assessment_id}]} + display_template {@sessions.assessment_name@@sessions.assessment_name@} } completed_datetime { label {[_ assessment.Finish_Time]} @@ -103,9 +103,14 @@ set query "sessions_of_assessment" } -db_multirow -extend { item_url } sessions $query { +db_multirow -extend { item_url assessment_url } sessions $query { } { set item_url [export_vars -base "session" {session_id}] + if {([empty_string_p $start_time] || $start_time <= $cur_time) && ([empty_string_p $end_time] || $end_time >= $cur_time)} { + set assessment_url [export_vars -base "assessment" {assessment_id}] + } else { + set assessment_url "" + } } Index: openacs-4/packages/assessment/www/admin/assessment-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/assessment-form.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/www/admin/assessment-form.tcl 18 Jan 2005 12:42:37 -0000 1.8 +++ openacs-4/packages/assessment/www/admin/assessment-form.tcl 23 Jan 2005 18:10:49 -0000 1.9 @@ -31,6 +31,10 @@ set navigation_options [list [list "[_ assessment.Default_Path]" "default path"] [list "[_ assessment.Randomized]" randomized] [list "[_ assessment.Rulebased_branching]" "rule-based branching"]] +## {entry_page:text,optional,nospell {label "[_ assessment.Entry_Page]"} {html {size 50 maxlength 50}} {help_text "[_ assessment.as_Entry_Page_help]"}} +## {exit_page:text,optional,nospell {label "[_ assessment.Exit_Page]"} {html {size 50 maxlength 50}} {help_text "[_ assessment.as_Exit_Page_help]"}} + + ad_form -name assessment_form -action assessment-form -form { {assessment_id:key} } @@ -61,15 +65,14 @@ {secure_access_p:text(select) {label "[_ assessment.Secure_Access_1]"} {options $boolean_options} {help_text "[_ assessment.as_Secure_Access_help]"}} {reuse_responses_p:text(select) {label "[_ assessment.Reuse_Responses_1]"} {options $boolean_options} {help_text "[_ assessment.as_Reuse_Responses_help]"}} {show_item_name_p:text(select) {label "[_ assessment.Show_Item_Name_1]"} {options $boolean_options} {help_text "[_ assessment.as_Show_Item_Name_help]"}} - {entry_page:text,optional,nospell {label "[_ assessment.Entry_Page]"} {html {size 50 maxlength 50}} {help_text "[_ assessment.as_Entry_Page_help]"}} - {exit_page:text,optional,nospell {label "[_ assessment.Exit_Page]"} {html {size 50 maxlength 50}} {help_text "[_ assessment.as_Exit_Page_help]"}} {consent_page:text(textarea),optional,nospell {label "[_ assessment.Consent_Page]"} {html {rows 5 cols 80}} {help_text "[_ assessment.as_Consent_Page_help]"}} {return_url:text,optional,nospell {label "[_ assessment.Return_Url]"} {html {size 50 maxlength 50}} {help_text "[_ assessment.as_Return_Url_help]"}} {start_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.Start_Time]"} {format $form_format} {help} {help_text "[_ assessment.as_Start_Time_help]"}} {end_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.End_Time]"} {format $form_format} {help} {help_text "[_ assessment.as_End_Time_help]"}} {number_tries:integer,optional,nospell {label "[_ assessment.Number_of_Tries]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_Number_Tries_help]"}} {wait_between_tries:integer,optional,nospell {label "[_ assessment.Minutes_for_Retry]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_Minutes_Retry_help]"}} - {time_for_response:integer,optional,nospell {label "[_ assessment.time_for_completion]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_time_help]"}} + {time_for_response:integer,optional,nospell {label "[_ assessment.time_for_response]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_time_help]"}} + {ip_mask:text,optional,nospell {label "[_ assessment.ip_mask]"} {html {size 20 maxlength 100}} {help_text "[_ assessment.as_ip_mask_help]"}} {show_feedback:text(select),optional {label "[_ assessment.Show_Feedback]"} {options $feedback_options} {help_text "[_ assessment.as_Feedback_help]"}} {section_navigation:text(select),optional {label "[_ assessment.Section_Navigation]"} {options $navigation_options} {help_text "[_ assessment.as_Navigation_help]"}} } -new_request { @@ -91,6 +94,7 @@ set number_tries "" set wait_between_tries "" set time_for_response "" + set ip_mask "" set show_feedback "none" set section_navigation "default path" } -edit_request { @@ -129,15 +133,16 @@ -secure_access_p $secure_access_p \ -reuse_responses_p $reuse_responses_p \ -show_item_name_p $show_item_name_p \ - -entry_page $entry_page \ - -exit_page $exit_page \ + -entry_page "" \ + -exit_page "" \ -consent_page $consent_page \ -return_url $return_url \ -start_time "" \ -end_time "" \ -number_tries $number_tries \ -wait_between_tries $wait_between_tries \ -time_for_response $time_for_response \ + -ip_mask $ip_mask \ -show_feedback $show_feedback \ -section_navigation $section_navigation] @@ -166,15 +171,16 @@ -secure_access_p $secure_access_p \ -reuse_responses_p $reuse_responses_p \ -show_item_name_p $show_item_name_p \ - -entry_page $entry_page \ - -exit_page $exit_page \ + -entry_page "" \ + -exit_page "" \ -consent_page $consent_page \ -return_url $return_url \ -start_time "" \ -end_time "" \ -number_tries $number_tries \ -wait_between_tries $wait_between_tries \ -time_for_response $time_for_response \ + -ip_mask $ip_mask \ -show_feedback $show_feedback \ -section_navigation $section_navigation] Index: openacs-4/packages/assessment/www/admin/assessment-form.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/assessment-form.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/admin/assessment-form.xql 18 Jan 2005 12:42:37 -0000 1.7 +++ openacs-4/packages/assessment/www/admin/assessment-form.xql 23 Jan 2005 18:10:49 -0000 1.8 @@ -4,7 +4,7 @@ - select ci.name, cr.title, cr.description, a.instructions, a.run_mode, + select ci.name, cr.title, cr.description, a.instructions, a.run_mode, a.ip_mask, a.anonymous_p, a.secure_access_p, a.reuse_responses_p, a.show_item_name_p, a.entry_page, a.exit_page, a.consent_page, a.return_url, a.number_tries, a.wait_between_tries, a.time_for_response, a.show_feedback, a.section_navigation,
    @assessment_data.title@
    @assessment_data.instructions@
    +#assessment.section_counter# +
    #assessment.item_counter# +
    #assessment.session_time_remaining#
    +
    #assessment.section_time_remaining#
    +