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.8 -r1.9 --- openacs-4/packages/assessment/sql/postgresql/assessment-section-create.sql 17 Nov 2004 17:16:07 -0000 1.8 +++ openacs-4/packages/assessment/sql/postgresql/assessment-section-create.sql 22 Nov 2004 11:40:37 -0000 1.9 @@ -126,7 +126,11 @@ -- how shall the navigation happen (default path, randomized, rule-based branching) section_navigation varchar(50) default 'default path' constraint as_assessments_section_navigation_ck - check (section_navigation in ('default path', 'randomized', 'rule-based branching')) + check (section_navigation in ('default path', 'randomized', 'rule-based branching')), + -- differenciate between an assessment and a survey + survey_p char(1) default 'f' + constraint as_assessments_survey_p_ck + check (survey_p in ('t', 'f')) ); -- Style Options 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.3 -r1.4 --- openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 15 Nov 2004 17:17:15 -0000 1.3 +++ openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 22 Nov 2004 11:40:42 -0000 1.4 @@ -28,6 +28,7 @@ {-time_for_response ""} {-show_feedback ""} {-section_navigation ""} + {-survey_p ""} } { @author Eduardo Perez (eperez@it.uc3m.es) @creation-date 2004-07-26 @@ -64,7 +65,8 @@ [list wait_between_tries $wait_between_tries] \ [list time_for_response $time_for_response] \ [list show_feedback $show_feedback] \ - [list section_navigation $section_navigation] ] ] + [list section_navigation $section_navigation] \ + [list survey_p $survey_p]] ] } return $as_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.4 -r1.5 --- openacs-4/packages/assessment/tcl/as-install-procs.tcl 17 Nov 2004 17:16:07 -0000 1.4 +++ openacs-4/packages/assessment/tcl/as-install-procs.tcl 22 Nov 2004 11:40:42 -0000 1.5 @@ -139,6 +139,7 @@ content::type::create_attribute -content_type {as_assessments} -attribute_name {time_for_response} -datatype {number} -pretty_name {Assessment Time for Response} -column_spec {integer} content::type::create_attribute -content_type {as_assessments} -attribute_name {show_feedback} -datatype {string} -pretty_name {Assessment Show comments to the user} -column_spec {varchar(50)} content::type::create_attribute -content_type {as_assessments} -attribute_name {section_navigation} -datatype {string} -pretty_name {Assessment Navigation of sections} -column_spec {varchar(50)} +content::type::create_attribute -content_type {as_assessments} -attribute_name {survey_p} -datatype {string} -pretty_name {Assessment or Survey} -column_spec {char(1)} # Sessions content::type::create_attribute -content_type {as_sessions} -attribute_name {assessment_id} -datatype {number} -pretty_name {Assessment ID} -column_spec {integer} 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.10 -r1.11 --- openacs-4/packages/assessment/tcl/as-qti-procs.tcl 17 Nov 2004 17:16:07 -0000 1.10 +++ openacs-4/packages/assessment/tcl/as-qti-procs.tcl 22 Nov 2004 11:40:42 -0000 1.11 @@ -62,8 +62,13 @@ } } } + set resprocessNodes [$root selectNodes {/questestinterop/assessment/section/item/resprocessing}] + set as_assessments__survey_p {f} + if { [llength $resprocessNodes] == 0 } { + set as_assessments__survey_p {t} + } # Insert assessment in the CR (and as_assessments table) getting the revision_id (assessment_id) - set as_assessments__assessment_id [as::assessment::new -title $as_assessments__title -description $as_assessments__definition -instructions $as_assessments__instructions] + set as_assessments__assessment_id [as::assessment::new -title $as_assessments__title -description $as_assessments__definition -instructions $as_assessments__instructions -survey_p $as_assessments__survey_p] # Section set sectionNodes [$assessment selectNodes {section}] Index: openacs-4/packages/assessment/www/session.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.adp,v diff -u -r1.11 -r1.12 --- openacs-4/packages/assessment/www/session.adp 4 Nov 2004 13:16:19 -0000 1.11 +++ openacs-4/packages/assessment/www/session.adp 22 Nov 2004 11:40:42 -0000 1.12 @@ -7,7 +7,7 @@ #assessment.Review_Asessment# @assessment_name@ #assessment.User_ID#: @session_user_name@ #assessment.Attempt#: @session_attempt@ / Unlimited -#assessment.Out_of#: @assessment_score@ +#assessment.Out_of#: @assessment_score@ #assessment.Started#: @session_start@ #assessment.Finished#: @session_finish@ @@ -26,28 +26,30 @@
- + - + + +
#assessment.Question# @items.rownum@  (@items.maxscore@ #assessment.points#)
#assessment.Question# @items.rownum@   (@items.maxscore@ #assessment.points#)
@items.title@
@items.choice_html;noquote@
#assessment.This_question_will_be_corrected_by_the_teacher#.
#assessment.This_question_will_be_corrected_by_the_teacher#.

#assessment.Score#@items.score@ / @items.maxscore@ (#assessment.Question_not_answered#.)
#assessment.Feedback#: @items.feedback_right@@items.feedback_wrong@


-#assessment.Total_score#: @session_score@ / @assessment_score@ +#assessment.Total_score#: @session_score@ / @assessment_score@ Index: openacs-4/packages/assessment/www/session.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/assessment/www/session.tcl 17 Nov 2004 17:16:08 -0000 1.17 +++ openacs-4/packages/assessment/www/session.tcl 22 Nov 2004 11:40:43 -0000 1.18 @@ -16,6 +16,8 @@ } set context [list "[_ assessment.View_Results]"] +#get survey_p in order to find out whether it's an assessment or a survey +set survey_p [db_string survey_p {SELECT as_assessmentsx.survey_p FROM as_assessmentsx INNER JOIN as_sessionsx ON as_assessmentsx.assessment_id = as_sessionsx.assessment_id WHERE as_sessionsx.session_id=:session_id}] set assessment_name [db_string assessment_name {SELECT as_assessmentsx.title FROM as_assessmentsx INNER JOIN as_sessionsx ON as_assessmentsx.assessment_id = as_sessionsx.assessment_id WHERE as_sessionsx.session_id=:session_id}] #get the user takes a session @@ -101,6 +103,12 @@ #if the user response is wrong, the word "Error" will be displayed in red color set correct_answer {Error} } + + #if it's a survey we show the selected answer with out the word Error + if {$survey_p == {t}} { + set correct_answer {} + } + #for fill in the blank item if {[info exists as_item_display_tbx__item_id]} { if {$choice_correct} {