Changes between Version 10 and Version 11 of BoltRef
- Timestamp:
- Dec 12, 2007, 10:23:23 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BoltRef
v10 v11 166 166 == Nesting and functions == 167 167 168 168 Control structures may be nested. 169 For example: 170 {{{ 171 sequence( 172 name("x"); 173 lesson(...), 174 sequence( 175 name("y"), 176 lesson(...), 177 exercise(...) 178 ) 179 ); 180 }}} 181 182 You can also use PHP functions as a way of organizing course structure: 183 184 {{{ 185 function my_unit() { 186 return sequence( 187 name("y"), 188 lesson(...), 189 exercise(...) 190 ) 191 } 192 193 sequence( 194 name("x"), 195 lesson(...), 196 my_unit() 197 ); 198 }}} 169 199 170 200 == Names and state == 171 201 202 In general, units must have unique logical names. 203 However, two units may have the same logical name if they are identical. 204 For example: 205 {{{ 206 function my_unit() { 207 return random( 208 name("y"), 209 lesson(...), 210 lesson(...) 211 ) 212 } 213 214 return sequence( 215 name("x"), 216 my_unit(), 217 exercise_set( 218 name("z"), 219 exercise(...), 220 review(.5, my_unit()) 221 ) 222 ); 223 }}} 224 225 This specifies a course in which my_unit() is displayed, 226 then an exercise is given. 227 If the student scores below .5 on the exercise, 228 he is shown my_unit() again and the exercise is repeated. 229 230 So there are two units with logical name 'y' in this course, 231 but they are identical, so this is allowed. 232 233 When there are multiple units with the same logical name, 234 they share a single state. 172 235 173 236 == Control structures == 174 237 === Sequences === 175 238 176 239 Sequences were described above. 177 240 178 241 === Random ===