// Syntax: // Comment for reader's benefit, not parsed // # Template Number - +100 for each new type of problem, +10 for each new subtype // Learning Objective(s) for this template - when this template should be used // ? // If student gets the answer right, what OTHER objectives should get credit // Usually, counterpoint to the point of the error, say allocation for missing // deallocation, Declaration for out of scope error, assignment for incorrect // referencing, etc. // Make sure there is no overlap between this and antecedents! // : // If student gets the answer wrong, what OTHER objectives should get discredit // Make sure there is no overlap between this and antecedents! // > // The template itself, no double quotes, preceded and succeeded by a single > // > // Type: debug / output / code // Hardness: The student's correct percentage up to which this template will be used // Note: Syntax for learning objectives (in antecedent, ifCorrect, ifWrong) // is dot.separated, with {,} to represent alternates. // e.g., a.{b,c} is a.b and a.c // This is NOT graph structured, i.e., a,{b,c}.d is not accounted for to mean // a.b.d or a.c.d // Pointer - Accessing pointer out of scope # 101 Pointer.Declaration.scope.Accessing pointer out of scope ? Pointer.Declaration.{Correct,scope.Correct} > {(){{;=;=;}<<;}} > Type: debug Hardness: 100 # 102 Pointer.Declaration.scope.Accessing pointer out of scope ? Pointer.Declaration.{Correct,scope.Correct} > {(){{=;;=;}<<;}} > Type: debug Hardness: 100 # 103 Pointer.Declaration.scope.Accessing pointer out of scope ? Pointer.Declaration.{Correct,scope.Correct} > {(){=;{;=;}<<;}} > Type: debug Hardness: 100 // Pointer - Dangling Pointer # 201 Pointer.Dereferencing.Dereferencing pointer after the variable to which it points goes out of scope ? Variable.Declaration.{Correct,scope.Correct} > {(){;{=;=;}<<;}} > Type: debug Hardness: 100 # 202 Pointer.Dereferencing.Dereferencing pointer after the variable to which it points goes out of scope ? Variable.Declaration.{Correct,scope.Correct} > {(){;{=;{=;}}<<;}} > Type: debug Hardness: 100 # 211 Pointer.Dereferencing.Dereferencing pointer before initializing/allocating > {(){;=;<<;=;}} > Type: debug Hardness: 100 # 212 Pointer.Dereferencing.Dereferencing pointer before initializing/allocating > {(){=;;<<;=;}} > Type: debug Hardness: 100 # 213 Pointer.Dereferencing.Dereferencing pointer before initializing/allocating ? Pointer.Declaration.scope.Correct > {(){;{=;<<;=;}}} > Type: debug Hardness: 100 # 214 Pointer.Dereferencing.Dereferencing pointer before initializing/allocating ? Variable.Declaration.scope.Correct > {(){=;{;<<;=;}}} > Type: debug Hardness: 100 # 215 Pointer.Dereferencing.Dereferencing pointer before initializing/allocating ? Pointer.Declaration.scope.Correct > {(){;{<<;=;=;}}} > Type: debug Hardness: 100 # 216 Pointer.Dereferencing.Dereferencing pointer before initializing/allocating ? Pointer.Declaration.scope.Correct > {(){;<<;{=;=;}}} > Type: debug Hardness: 100 # 217 Pointer.Dereferencing.Dereferencing pointer before initializing/allocating > {(){;<<;=;=;}} > Type: debug Hardness: 100 // Pointer - Code OK # 301 Pointer.{Dereferencing.Correct,Deallocation.Correct} ? Pointer.{Declaration.Correct,Allocation.Correct} > {(){;=new;<<;delete;}} > Type: output Hardness: 100 # 302 Pointer.{Dereferencing.Correct,Deallocation.Correct} ? Pointer.{Declaration.{Correct,scope.Correct},Allocation.Correct} > {(){;{=new;<<;}delete;}} > Type: output Hardness: 100 # 303 Pointer.{Dereferencing.Correct,Deallocation.Correct} ? Pointer.{Declaration.{Correct,scope.Correct},Allocation.Correct} > {(){;{=new;}<<;{delete;}}} > Type: output Hardness: 100 # 304 Pointer.{Dereferencing.Correct,Deallocation.Correct} ? Pointer.{Declaration.{Correct,scope.Correct},Allocation.Correct} > {(){;=new;{<<;}delete;}} > Type: output Hardness: 100 # 311 Pointer.Dereferencing.Correct ? Pointer.{Declaration.{Correct,scope.Correct},Assignment.Correct} > {(){;{=;=;<<;}}} > Type: output Hardness: 100 # 312 Pointer.Dereferencing.Correct ? Pointer.{Declaration.Correct,Assignment.Correct} : Pointer.{Declaration.Correct,Assignment.Correct,Dereferencing.Correct,Deallocation.Correct} > {(){=;{;=;<<;}}} > Type: output Hardness: 100 # 313 Pointer.Dereferencing.Correct ? Pointer.{Declaration.Correct,Assignment.Correct} > {(){;=;=;<<;}} > Type: output Hardness: 100 # 314 Pointer.Dereferencing.Correct ? Pointer.{Declaration.Correct,Assignment.Correct} > {(){=;;=;<<;}} > Type: output Hardness: 100 // Pointer - Semantic Error # 401 Pointer.Dereferencing ? Variable.Referencing.Referencing variable before initializing its value : Variable.Referencing.Correct > {(){;;=;<<;}} > Type: debug Hardness: 100 # 411 Pointer.Anonymous Variable.Referencing.Referencing anonymous variable before initializing its value ? Pointer.Anonymous Variable.Referencing.Correct > {(){;=new;<<;delete;}} > Type: debug Hardness: 100 # 412 Pointer.Anonymous Variable.Referencing.Referencing anonymous variable before initializing its value ? Pointer.{Anonymous Variable.Referencing.Correct,Declaration.scope.Correct} > {(){;{=new;<<;}delete;}} > Type: debug Hardness: 100 # 413 Pointer.Anonymous Variable.Referencing.Referencing anonymous variable before initializing its value ? Pointer.{Anonymous Variable.{Referencing.Correct,scope.Correct},Declaration.scope.Correct} > {(){;{=new;}<<;{delete;}}} > Type: debug Hardness: 100 // Pointer - Lost Objects # 501 Pointer.Deallocation.No pointer pointing to the anonymous variable ? Pointer.Allocation.Correct > {(){;=new;<<;}} > Type: debug Hardness: 100 # 502 Pointer.Deallocation.No pointer pointing to the anonymous variable ? Pointer.{Declaration.scope.Correct,Allocation.Correct} > {(){;{=new;<<;}}} > Type: debug Hardness: 100 # 503 Pointer.Deallocation.No pointer pointing to the anonymous variable ? Pointer.{Declaration.scope.Correct,Allocation.Correct,Anonymous Variable.scope.Correct} > {(){;{=new;}<<;}} > Type: debug Hardness: 100 # 504 Pointer.Deallocation.No pointer pointing to the anonymous variable ? Pointer.Allocation.Correct > {(){{;=new;<<;}=;<<;}} > Type: debug Hardness: 100 # 505 Pointer.Deallocation.No pointer pointing to the anonymous variable ? Pointer.Allocation.Correct > {(){=;{;=new;<<;}<<;}} > Type: debug Hardness: 100 # 506 Pointer.Deallocation.No pointer pointing to the anonymous variable ? Pointer.Allocation.Correct > {(){;=new;{;=new;<<;}<<;}} > Type: debug Hardness: 100 # 507 Pointer.Deallocation.No pointer pointing to the anonymous variable ? Pointer.{Allocation.Correct,Assignment.Correct} > {(){;=;=;{;=new;<<;}<<;}} > Type: debug Hardness: 100 # 508 Pointer.Deallocation.No pointer pointing to the anonymous variable ? Pointer.{Allocation.Correct,Assignment.Correct} > {(){;=new;{;=;=;<<;}<<;}} > Type: debug Hardness: 100