| |
137 |
137 |
} |
| |
138 |
138 |
|
| |
139 |
139 |
ad_proc -public dates_calc { |
| |
140 |
140 |
-start_date:required |
| |
141 |
141 |
-end_date:required |
| |
142 |
142 |
} { |
| |
143 |
143 |
Returns the number of minutes, hours or dates given a start |
| |
144 |
144 |
and end date. |
| |
145 |
145 |
|
| |
146 |
146 |
@param start_date Starting date |
| |
147 |
147 |
@param end_date Ending date |
| |
148 |
148 |
@author Ernie Ghiglione (ErnieG@mm.st) |
| |
149 |
149 |
} { |
| |
150 |
150 |
|
| |
151 |
151 |
set start [clock scan "$start_date"] |
| |
152 |
152 |
set end [clock scan "$end_date"] |
| |
153 |
153 |
|
| |
154 |
154 |
set difference [expr {$end - $start}] |
| |
155 |
155 |
|
| |
156 |
156 |
if {$difference >= 0 && $difference < 60} { |
| |
157 |
|
return "$difference seconds" |
| |
|
157 |
return "[_ lorsm.difference_seconds]" |
| |
158 |
158 |
} elseif {$difference >= 60 && $difference < 3600} { |
| |
|
159 |
set tempval [expr {$difference / 60.0}] |
| |
|
160 |
return "[_ lorsm.tempval_minutes]" |
| |
159 |
161 |
|
| |
160 |
|
return "[expr {$difference / 60.0}] minutes" |
| |
161 |
|
|
| |
162 |
162 |
} elseif {$difference >= 3600 && $difference < 86400} { |
| |
163 |
|
return "[expr {$difference / 60.0 /60.0 }] hours" |
| |
|
163 |
set tempval [expr {$difference / 60.0 /60.0 }] |
| |
|
164 |
return "[_ lorsm.tempval_hours]" |
| |
164 |
165 |
|
| |
165 |
166 |
} else { |
| |
166 |
|
return "[expr {$difference / 60.0 / 60.0 / 24.0}] days" |
| |
|
167 |
set tempval [expr {$difference / 60.0 / 60.0 / 24.0}] |
| |
|
168 |
return "[_ lorsm.tempval_days]" |
| |
167 |
169 |
} |
| |
168 |
170 |
} |
| |
169 |
171 |
|
| |
170 |
172 |
|
| |
171 |
173 |
ad_proc -public fix_href2 { |
| |
172 |
174 |
-item_id:required |
| |
173 |
175 |
-identifierref:required |
| |
174 |
176 |
-fs_package_id:required |
| |
175 |
177 |
-fs_local_package_id:required |
| |
176 |
178 |
-folder_id:required |
| |
177 |
179 |
-type:required |
| |
178 |
180 |
-track_id:required |
| |
179 |
181 |
} { |
| |
180 |
182 |
Function use to fix the HREF of resources. |
| |
181 |
183 |
It could be that the reference to a resource is outside the |
| |
182 |
184 |
scope of the learning object (somewhere on the web) instead |
| |
183 |
185 |
of a file or resource in the course. |
| |
184 |
186 |
|
| |
185 |
187 |
Therefore, this function determines whether ther link to the |
| |
186 |
188 |
resource is within the course materials. If that is the case |