Index: openacs-4/packages/evaluation/www/task-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/task-view.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/evaluation/www/task-view.tcl 10 Jun 2004 21:08:53 -0000 1.4
+++ openacs-4/packages/evaluation/www/task-view.tcl 15 Jun 2004 23:20:29 -0000 1.5
@@ -8,8 +8,7 @@
@cvs-id $Id$
} {
grade_id:integer,notnull
- task_id:integer,notnull,optional
- item_id:integer,notnull,optional
+ task_id:integer,notnull
{return_url ""}
}
@@ -22,39 +21,108 @@
db_1row get_task_info { *SQL* }
-set weight [format %.2f [lc_numeric $weight]]
+ad_form -name task -has_submit 1 -has_edit 1 -export { return_url item_id storage_type grade_id attached_p } -mode display -form {
-if { [string eq $online_p "1"] || [string eq $online_p "t"] } {
- set online_p "[_ evaluation.Yes_]"
-} else {
- set online_p "[_ evaluation.No_]"
-}
+ task_id:key
-if { [string eq $late_submit_p "1"] || [string eq $late_submit_p "t"]} {
- set late_submit_p "[_ evaluation.Yes_]"
-} else {
- set late_submit_p "[_ evaluation.No_]"
+ {task_name:text
+ {label "[_ evaluation.Task_Name_]"}
+ {html {size 30}}
+ }
+
}
+db_1row get_task_info { *SQL* }
-#set description [template::util::richtext::get_property contents $description]
-# working with task stuff (if it has a file/url attached)
-if { [empty_string_p $task_data] } {
- set task_url "[_ evaluation.lt_No_fileurl_associated]"
-} elseif { [regexp "http://" $task_data] } {
- set task_url "$task_data"
-} else {
+if { ![empty_string_p $task_data] } {
+
+ if { [regexp "http://" $task_data] } {
+ set task_url "$task_data"
+ } else {
# we assume it's a file
- set task_url "$task_title"
+ set task_url "$task_title"
+ }
+
+ ad_form -extend -name task -form {
+ {task_file:text,optional
+ {label "[_ evaluation.lt_Assignment_Attachment]"}
+ {html "size 30"}
+ {after_html "$task_url"}
+ }
+ }
}
-# working with task soluiton stuff (if it has a file/url attached)
-if { [empty_string_p $solution_data] } {
- set solution_url "[_ evaluation.lt_No_fileurl_associated_1]"
-} elseif { [regexp "http://" $solution_data] } {
- set solution_url "$solution_data"
-} else {
+if { ![empty_string_p $solution_data] } {
+
+ if { [regexp "http://" $solution_data] } {
+ set solution_url "$solution_data"
+ } else {
# we assume it's a file
- set solution_url "$solution_title"
+ set solution_url "$solution_title"
+ }
+
+ ad_form -extend -name task -form {
+ {solution_file:text,optional
+ {label "[_ evaluation.Solution_Attachment_]"}
+ {html "size 30"}
+ {after_html "$solution_url"}
+ }
+ }
}
+ad_form -extend -name task -form {
+
+ {description:richtext,optional
+ {label "[_ evaluation.lt_Assignments_Descripti]"}
+ {html {rows 4 cols 40 wrap soft}}
+ }
+
+ {due_date:date,to_sql(linear_date),from_sql(sql_date)
+ {label "[_ evaluation.Due_Date_]"}
+ {format "MONTH DD YYYY"}
+ {today}
+ {help}
+ {value {[evaluation::now_plus_days -ndays 15]}}
+ }
+
+ {number_of_members:naturalnum
+ {label "[_ evaluation.Number_of_Members_]"}
+ {value "1"}
+ {html {size 5 onChange TaskInGroups()}}
+ {help_text "[_ evaluation.1__Individual_]"}
+ }
+
+ {weight:float
+ {label "[_ evaluation.Weight_]"}
+ {html {size 5}}
+ {help_text "[_ evaluation.lt_over_grade_weight_of_]"}
+ }
+
+ {online_p:text(radio)
+ {label "[_ evaluation.lt_Will_the_task_be_subm]"}
+ {options {{"[_ evaluation.Yes_]" t} {"[_ evaluation.No_]" f}}}
+ {value t}
+ }
+
+ {late_submit_p:text(radio)
+ {label "[_ evaluation.lt_Can_the_student_submi]"}
+ {options {{"[_ evaluation.Yes_]" t} {"[_ evaluation.No_]" f}}}
+ {value t}
+ }
+
+ {requires_grade_p:text(radio)
+ {label "[_ evaluation.lt_Will_this_task_requir]"}
+ {options {{"[_ evaluation.Yes_]" t} {"[_ evaluation.No_]" f}}}
+ {value t}
+ }
+} -edit_request {
+
+ db_1row task_info { *SQL* }
+
+ set due_date [template::util::date::from_ansi $due_date_ansi]
+ set weight [format %.2f [lc_numeric $weight]]
+
+}
+
ad_return_template
+
+