Skip to content

Commit

Permalink
Adding @learning-objective, pt 1 #2172
Browse files Browse the repository at this point in the history
  • Loading branch information
ds26gte committed Sep 17, 2024
1 parent 63924d4 commit a8b7ccf
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/preproc.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,17 @@
'())))

(define *assessments*
(let ([assessments-file (format "distribution/~a/learning-objectives-dict.js" *natlang*)])
(let ([assessments-file (format "distribution/~a/assessments.js" *natlang*)])
(if (file-exists? assessments-file)
(call-with-input-file assessments-file read-json)
'())))

(define *learning-objectives*
(let ([learning-objectives-file (format "distribution/~a/learning-objectives.js" *natlang*)])
(if (file-exists? learning-objectives-file)
(call-with-input-file learning-objectives-file read-json)
'())))

(define *starter-files-used* '())
(define *opt-starter-files-used* '())

Expand Down Expand Up @@ -1922,6 +1928,12 @@
(cond [(not c)
(printf "WARNING: ~a: Ill-named @~a ~a\n\n" (errmessage-context) directive lbl)]
[else (display lbl o)]))]
[(string=? directive "learning-objective")
(let* ([lbl (string->symbol (read-group i directive))]
[c (hash-ref *learning-objectives* lbl #f)])
(cond [(not c)
(printf "WARNING: ~a: Ill-named @~a ~a\n\n" (errmessage-context) directive lbl)]
[else (display lbl o)]))]
[(string=? directive "opt-project")
(let* ([arg1 (read-commaed-group i directive read-group)]
[project-file (first arg1)]
Expand Down

0 comments on commit a8b7ccf

Please sign in to comment.