[opencms-dev] teacher/student pages

Riette van Beek r.van.beek at cmbi.kun.nl
Thu Oct 16 15:54:01 CEST 2003


Hi all,

New to openCMS, we are being asked to develop a template for web-based
courses. When a teacher (or guest) views the pages, they have to see the
course with exercises. When a 'teacher' opens the page, (s)he must see,
below each exercise, some element (button) which, when clicked, inserts the
answer at that place. Of course, whatever the teacher teaches, (s)he may not
have too much computer-savvy. (For the moment I am assuming that teacher =
course-developer)

A student taking the course should see explanation A, question A,
explanation B, question B, etcetera.
A teacher teaching the course (maybe using a beamer ... ) should see
explanation A, question A, button, explanation B, question B, button,
etcetera. When this teacher clicks a button (for question A), the answer to
the question above gets inserted at that point in the page, visible for the
teacher (and, via the beamer, for the class): explanation A, question A,
answer A, explanation B, question B,  etcetera..

My first question: How can we get this done in openCMS?

The ideal way for teachers to compose a course would be: in directory
'topic/answers' make  files 'answerA', 'answerB' containing the answer. Then
make a page in directory 'topic' containing explanation A, question A,
include or somehow link to the file 'teacher/answerA', explanation B,
question B, include or somehow link to the file 'teacher/answerB' etcetera.
Preferably the answer-files would already contain (template?!) the code for
detecting whether the viewer/user is teacher or not, if not, return, is
teacher, include the button + code to include the 'variable part of the
answer-file' (what the teacher types in to be the answer) in the course page
when the button is clicked (and ideally, a 'back-button so that the answer
disappears after clicking).

I found javascript-code for showing/hiding text, like answers. So, my second
question: Is javascript the way to go?

Even if javascript is the way to go, students ought not to see the clickable
element, and certainly not the answer!
The template that I am developing does determine whether the current user
belongs to group 'Teachers', but how can I transfer the value of this
variable to Javascript (this is my third question)?

Moreover, even if javascript is the way to go, it would be nice to have the
code in a file that the teachers can include in the WYSIWYG editor - which,
as it looks to me, strips all code from a file that is included. Question
four: How can I let a teacher easily and foolproof include a code-fragment?

Okay, another newbie ...... but I have seen so many good answers on this
list, that I hope .....

Thanks!

Riƫtte van Beek




More information about the opencms-dev mailing list