| |
156 |
156 |
# Course Name |
| |
157 |
157 |
if {[empty_string_p $course_name]} { |
| |
158 |
158 |
set course_name "No Course Name" |
| |
159 |
159 |
} |
| |
160 |
160 |
} else { |
| |
161 |
161 |
set course_name "No Course Name" |
| |
162 |
162 |
} |
| |
163 |
163 |
|
| |
164 |
164 |
set lesson_status "N/A" |
| |
165 |
165 |
|
| |
166 |
166 |
if { [string equal $deliverymethod "delivery-scorm"] } { |
| |
167 |
167 |
set icon "" |
| |
168 |
168 |
if { ! [ db_0or1row isanysuspendedsession {} ] } { |
| |
169 |
169 |
#item has no track for the user |
| |
170 |
170 |
#the icon should be the same as per "not yet visited" |
| |
171 |
171 |
append icon "<img src=\"/resources/lorsm/icons/flag_white.gif\" |
| |
172 |
172 |
alt=\"Not attempted\">" |
| |
173 |
173 |
} else { |
| |
174 |
174 |
switch -regexp $lesson_status { |
| |
175 |
175 |
null { |
| |
176 |
|
append icon "<img src=\"/resources/lorsm/icons/ |
| |
177 |
|
flag_white.gif\" alt=\"Not attempted\">" |
| |
|
176 |
append icon "<img src=\"/resources/lorsm/icons/flag_white.gif\" alt=\"Not attempted\">" |
| |
178 |
177 |
|
| |
179 |
178 |
} incomplete { |
| |
180 |
|
append icon "<img src=\"/resources/lorsm/icons/ |
| |
181 |
|
flag_orange.gif\" alt=\"Incomplete\">" |
| |
|
179 |
append icon "<img src=\"/resources/lorsm/icons/flag_orange.gif\" alt=\"Incomplete\">" |
| |
182 |
180 |
|
| |
183 |
181 |
} complete { |
| |
184 |
|
append icon "<img src=\"/resources/lorsm/icons/ |
| |
185 |
|
flag_green.gif\" alt=\"Completed\">" |
| |
|
182 |
append icon "<img src=\"/resources/lorsm/icons/flag_green.gif\" alt=\"Completed\">" |
| |
186 |
183 |
|
| |
187 |
184 |
} failed { |
| |
188 |
|
append icon "<img src=\"/resources/lorsm/icons/ |
| |
189 |
|
flag_red.gif\" alt=\"Failed\">" |
| |
|
185 |
append icon "<img src=\"/resources/lorsm/icons/flag_red.gif\" alt=\"Failed\">" |
| |
190 |
186 |
|
| |
191 |
187 |
} "not attempted" { |
| |
192 |
|
append icon "<img src=\"/resources/lorsm/icons/ |
| |
193 |
|
flag_white.gif\" alt=\"Not attempted\">" |
| |
|
188 |
append icon "<img src=\"/resources/lorsm/icons/flag_white.gif\" alt=\"Not attempted\">" |
| |
194 |
189 |
|
| |
195 |
190 |
} passed { |
| |
196 |
|
append icon "<img src=\"/resources/lorsm/icons/ |
| |
197 |
|
icon_accept.gif\" alt=\"Passed\">" |
| |
|
191 |
append icon "<img src=\"/resources/lorsm/icons/icon_accept.gif\" alt=\"Passed\">" |
| |
198 |
192 |
} default { |
| |
199 |
193 |
append icon "<span style=\"color: #fff\"> $lesson_status |
| |
200 |
|
**</span> <img src=\"/resources/lorsm/icons/ |
| |
201 |
|
flag_blue.gif\" alt=\"$lesson_status\">" |
| |
|
194 |
**</span> <img src=\"/resources/lorsm/icons/flag_blue.gif\" alt=\"$lesson_status\">" |
| |
202 |
195 |
} |
| |
203 |
196 |
} |
| |
204 |
197 |
} |
| |
205 |
198 |
set lesson_status $icon |
| |
206 |
199 |
} |
| |
207 |
200 |
|
| |
208 |
201 |
# DEDS: these are expensive |
| |
209 |
202 |
# and for demo purposes only |
| |
210 |
203 |
|
| |
211 |
204 |
db_0or1row get_last_viewed { } |
| |
212 |
205 |
set all_items [db_list get_total_items { }] |
| |
213 |
206 |
set total_item_count [llength $all_items] |
| |
214 |
207 |
if {$total_item_count > 0} { |
| |
215 |
208 |
set viewed_items [db_list get_viewed_items { }] |
| |
216 |
209 |
} else { |
| |
217 |
210 |
set viewed_items {} |
| |
218 |
211 |
} |
| |
219 |
212 |
set viewed_item_count [llength $viewed_items] |
| |
220 |
213 |
|
| |
221 |
214 |
ns_log Debug "lorsm - viewed_item_count: $viewed_item_count" |