Ex330 - Student Test Scores

Background: Examples
Related: Ex001

Description:
This example stores John and Mary's test scores on midTerms and finals in English and Science courses. John elects to skip the English midTerm while Mary elects to skip the Science midTerm. The tests are scheduled on specific dates.


NLI Script

(; Create db items)
(new 'course)
(new 'test)
(new 'date)
(new 'score)

(; Create a course named english101
   with midTerm on 6/28/01
   and final on 12/29/01)
(new 'english101 'course)
(set (it) test (block 
                 (new 'midTerm1e 'test)
                 (set+ (it) date '6/28/01)
                 (it)))
(set (it) test (block 
                 (new 'final1e 'test)
                 (set+ (it) date '12/29/01)
                 (it)))

(; Create a course named science201
   with midTerm on 6/30/01
   and final on 12/31/01)
(new 'science201 'course)
(set (it) test (block 
                 (new 'midTerm1s 'test)
                 (set+ (it) date '6/30/01)
                 (it)))
(set (it) test (block 
                 (new 'final1s 'test)
                 (set+ (it) date '12/31/01)
                 (it)))


(; Create a students named john and mary)
(new 'student)
(new 'john 'student)
(new 'mary 'student)

(; Create english101's students' test scores)
(; Note, john elects to skip the midTerm)
(set+ english101 student john test final1e score '83)
(set+ english101 student mary test midTerm1e score '92)
(set+ english101 student mary test final1e score '97)

(; Create science201's students' test scores)
(; Note, mary elects to skip the midTerm)
(set+ science201 student john test midTerm1s score '95)
(set+ science201 student john test final1s score '92)
(set+ science201 student mary test final1s score '85)


(; Get john's score on english101's final1e)
(; Gets 83)
(get english101 student john test final1e score *)

(; Get the test on which mary's score was 92)
(; Gets midTerm1e)
(get (get course instance *) student mary test * score 92)

Notes:

Download Database:
Ex330.zip (23 KB)
The creation of rolex replica the watch is inspired by the retro and elegant money of rolex replica watches the brand's round watch. The chronograph is omega replica simple and stylish, with the line features of rolex replica uk the watch series.

CM ©2000-2007