-#assessment.Review_Asessment# @assessment_data.title@ |
-#assessment.User_ID#: @session_user_name@ |
+#assessment.Review_Asessment# @assessment_data.title@ |
+#assessment.User_ID#: @first_names@ @last_name@ |
#assessment.Attempt#: @session_attempt@ / Unlimited |
-#assessment.Out_of#: @assessment_score@ |
+#assessment.Out_of#: @assessment_score@ |
#assessment.Started#: @session_start@ |
#assessment.Finished#: @session_finish@ |
@@ -16,43 +16,25 @@
|
+
-
-
- #assessment.section#: @items.section_title@ |
- @items.section_description@
|
-
+
-
-
-
- #assessment.Question# @items.rownum@ (@items.maxscore@ #assessment.points#) |
-
- @items.title@
- |
-
- @items.choice_html;noquote@ |
-
- | #assessment.This_question_will_be_corrected_by_the_teacher#. |
- | |
-
|
-
-
-
-
- #assessment.Score# | @items.score@ / @items.maxscore@
- (#assessment.Question_not_answered#.) |
- |
- #assessment.Feedback#: @items.feedback_right@
-
- #assessment.Feedback#: @items.feedback_wrong@ | |
-
-
|
-
-
-
-
+
+@sections.rownum@. #assessment.section# @sections.title@
+ (#assessment.max_time# @sections.max_time_to_complete@)
+(0 / @sections.points@ #assessment.points#)
+ |
+
+ @sections.description@
|
+
+
+
+
+
+
+
-#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.26 -r1.27
--- openacs-4/packages/assessment/www/session.tcl 22 Dec 2004 20:52:17 -0000 1.26
+++ openacs-4/packages/assessment/www/session.tcl 24 Dec 2004 15:32:38 -0000 1.27
@@ -1,28 +1,17 @@
ad_page_contract {
- Lists the results that an user obtains after answer an assessment.
- In the results, users can view the started time and finished time
- of assessment, the time spent in take the assessment, as well as
- the number of attempts. The users also can view the obtained total
- score, the obtained score by each item, their incorrect answers and
- a right or wrong feedback. If an item isn't answered users are informed.
+ Show the result of a session.
- @author Eduardo P�rez Ureta (eperez@it.uc3m.es)
- @creation-date 2004-09-13
-} -query {
- session_id:notnull
-} -properties {
- context:onevalue
+ @author timo@timohentschel.de
+ @date 2004-12-24
+ @cvs-id $Id:
+} {
+ session_id:integer
}
set context [list "[_ assessment.View_Results]"]
-db_1row find_assessment {
- select r.item_id as assessment_id
- from as_sessions s, cr_revisions r
- where s.session_id = :session_id
- and r.revision_id = s.assessment_id
-}
+db_1row find_assessment {}
# Get the assessment data
as::assessment::data -assessment_id $assessment_id
@@ -33,171 +22,30 @@
}
set assessment_rev_id $assessment_data(assessment_rev_id)
+set session_user_url [acs_community_member_url -user_id $subject_id]
-if {[empty_string_p $assessment_data(show_feedback)]} {
- set assessment_show_feedback "all"
-}
+# get start and end times
+db_1row session_data {}
-#get the user takes a session
-db_1row session_user_id {
- SELECT p.first_names, p.last_name, ss.assessment_id
- FROM as_sessionsx ss, persons p
- WHERE ss.subject_id = p.person_id
- AND ss.session_id = :session_id
-}
+# get the number of attempts
+set session_attempt [db_string session_attempt {}]
-set assessment_url [export_vars -base "assessment" {assessment_id}]
-set session_user_name "$first_names $last_name"
-
-#get information of assessment as subject that took it, the started time and finished time of assessment
-db_1row session_data {
- SELECT subject_id, creation_datetime AS session_start,
- completed_datetime AS session_finish,
- completed_datetime-creation_datetime AS session_time
- FROM as_sessionsx ss
- WHERE ss.session_id = :session_id
+if {[empty_string_p $assessment_data(show_feedback)]} {
+ set assessment_data(show_feedback) "all"
}
-set session_user_url [acs_community_member_url -user_id $subject_id]
-#get the number of attempts
-set session_attempt [db_string session_attempt {
- SELECT COUNT(*)
- FROM as_sessionsx ss
- WHERE ss.subject_id = :subject_id
- AND ss.assessment_id = :assessment_rev_id
-}]
+# show_feedback: none, all, incorrect, correct
-set assessment_score 100 ;# FIXME
-#get the number of items of an assessment
-set assessment_items [db_string assessment_items {
- SELECT COUNT(*)
- FROM as_sectionsx s, as_assessmentsx a, as_assessment_section_map asm,
- as_itemsx i, as_item_section_map ism
- WHERE a.assessment_id = asm.assessment_id
- AND s.section_id = asm.section_id
- AND i.as_item_id = ism.as_item_id
- AND s.section_id = ism.section_id
- AND a.assessment_id = :assessment_rev_id
-}]
-#set maximum score by each item
-set itemmaxscore [expr $assessment_score/$assessment_items] ;# FIXME total_points/items_number
-
-set session_score 0
-db_multirow -extend [list choice_html score maxscore notanswered item_correct presentation_type] items query_all_items {} {
- #reset variables
- set rb__display_id {}
- unset rb__display_id
- set tb__display_id {}
- unset tb__display_id
- set ta__display_id {}
- unset ta__display_id
- set mc_id [as::item_rels::get_target -item_rev_id $as_item_id -type as_item_type_rel]
- set item_display_id [as::item_rels::get_target -item_rev_id $as_item_id -type as_item_display_rel]
- #set items_as_item_id [db_string items_items_as_item_id "SELECT item_id FROM cr_revisions WHERE revision_id = :as_item_id"]
- set items_as_item_id [db_string items_items_as_item_id "SELECT as_itemsx.as_item_id FROM as_itemsx WHERE as_itemsx.item_id IN (select item_id from cr_revisions where revision_id=:as_item_id)"]
- db_0or1row as_item_display_rbx "SELECT as_item_display_id AS rb__display_id FROM as_item_display_rb WHERE as_item_display_id=:item_display_id"
- db_0or1row as_item_display_tbx "SELECT as_item_display_id AS tb__display_id FROM as_item_display_tb WHERE as_item_display_id=:item_display_id"
- db_0or1row as_item_display_tax "SELECT as_item_display_id AS ta__display_id FROM as_item_display_ta WHERE as_item_display_id=:item_display_id"
- set presentation_type "checkbox" ;# DEFAULT
- #get the presentation type
- if {[info exists rb__display_id]} {set presentation_type "radio"}
- if {[info exists tb__display_id]} {set presentation_type "fitb"}
- if {[info exists ta__display_id]} {set presentation_type "textarea"}
-
- set notanswered 1
- set maxscore $itemmaxscore
- set score 0
- set item_correct 1
- set choice_html "}
- db_dml session_percent_score {}
+ set max_time_to_complete [as::assessment::pretty_time -seconds $max_time_to_complete]
}
+# todo: calculate result
+set session_score 0
+set assessment_score 0
+
ad_return_template
Index: openacs-4/packages/assessment/www/session.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.xql,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/assessment/www/session.xql 20 Dec 2004 13:58:50 -0000 1.14
+++ openacs-4/packages/assessment/www/session.xql 24 Dec 2004 15:32:38 -0000 1.15
@@ -1,50 +1,50 @@
- postgresql7.4
-
-
- SELECT i.as_item_id, i.name, i.title, i.feedback_right, i.feedback_wrong,
- s.section_id, s.title as section_title, s.description as section_description
- FROM as_assessmentsx a, as_sectionsx s, as_assessment_section_map asm, as_itemsx i,
- as_item_section_map ism, as_sessionsx ss
- WHERE a.assessment_id = asm.assessment_id
- AND s.section_id = asm.section_id
- AND i.as_item_id = ism.as_item_id
- AND s.section_id = ism.section_id
- AND a.assessment_id = ss.assessment_id
- AND ss.session_id = :session_id
- ORDER BY s.section_id, ism.sort_order
-
-
+
+
+ select r.item_id as assessment_id, s.subject_id,
+ p.first_names, p.last_name
+ from as_sessions s, cr_revisions r, persons p
+ where s.session_id = :session_id
+ and r.revision_id = s.assessment_id
+ and s.subject_id = p.person_id
+
+
-
-
- SELECT
- as_item_choicesx.choice_id, as_item_choicesx.title AS choice_title, as_item_choicesx.correct_answer_p, as_item_choicesx.percent_score, as_item_choicesx.text_value, as_item_choicesx.content_value
- FROM as_item_choicesx
- WHERE
- as_item_choicesx.mc_id=:mc_id
- ORDER BY
- as_item_choicesx.sort_order
-
-
-
-
-
- SELECT as_item_datax.text_answer
- FROM as_item_datax
- WHERE as_item_datax.session_id = :session_id
- AND as_item_datax.as_item_id = :items_as_item_id
-
-
-
-
-
- UPDATE as_sessions
- SET percent_score = :session_score
- WHERE session_id = :session_id
-
-
+
+
+ SELECT creation_datetime AS session_start,
+ completed_datetime AS session_finish,
+ completed_datetime-creation_datetime AS session_time
+ FROM as_sessions s
+ WHERE s.session_id = :session_id
+
+
+
+
+ SELECT COUNT(*)
+ FROM as_sessions s
+ WHERE s.subject_id = :subject_id
+ AND s.assessment_id = :assessment_rev_id
+
+
+
+
+
+ select s.section_id, cr.title, cr.description, ci.name, s.instructions,
+ s.feedback_text, m.max_time_to_complete, m.points
+ from as_assessment_section_map m, as_session_sections ss,
+ as_sections s, cr_revisions cr, cr_items ci
+ where ci.item_id = cr.item_id
+ and cr.revision_id = s.section_id
+ and s.section_id = m.section_id
+ and m.assessment_id = :assessment_rev_id
+ and m.section_id = ss.section_id
+ and ss.session_id = :session_id
+ order by ss.sort_order
+
+
+