Kate,
Here's a little script I use. You may need to modify it a bit, but it
gives you the general idea.
Kind regards,
Herta
==== cut from here
#!/bin/bash2
#+
# Description
# ===========
# rudimentary procedure to find all users for a given course
#
# Parameters
# ==========
# none
#
# Prerequisites
# =============
# ORACLE_SID must be defined
#
# TBD
# ===
# rewrite in perl
#
# Modification History
# ====================
# Date | Name | Modification Description
#
------------+------------------------+---------------------------------------
# 20-Feb-2002 | Herta Van den Eynde | initial version
# | |
#_
echo "ORACLE_SID = " $ORACLE_SID
echo -n "Course id: "
read CRS_ID
echo -n "bb50 password: "
stty -echo
read PWD
stty echo
echo ""
TOF=/var/tmp/users-in-course.tmp.`date +%Y%m%d`
BFN=`basename $0`
LF=/var/tmp/users-in-course.log.`date +%Y%m%d`
ROF=/var/tmp/${BFN%.*}-${CRS_ID}.rep
echo "sqlplus -s bb50/$PWD@$ORACLE_SID << EOF" > $TOF
echo "" >> $TOF
echo "SET LINE 132" >> $TOF
echo "SET PAGES 200" >> $TOF
echo "SET FEEDBACK OFF" >> $TOF
echo "" >> $TOF
echo "COLUMN course_id NOPRINT new_value crsid FORMAT A6" >> $TOF
echo "COLUMN course_name NOPRINT new_value crsnm FORMAT A30" >> $TOF
echo "" >> $TOF
echo "COLUMN user_id HEADING 'User Id' FORMAT A13" >> $TOF
echo "COLUMN role HEADING 'Role' FORMAT A4" >> $TOF
echo "COLUMN firstname HEADING 'First Name' FORMAT A20" >> $TOF
echo "COLUMN lastname HEADING 'Last Name' FORMAT A40" >> $TOF
echo "COLUMN email HEADING 'e-Mail Address' FORMAT A50" >> $TOF
echo "" >> $TOF
echo "TTITLE SKIP 1 'Users in Course ' crsid ' - ' crsnm -" >> $TOF
echo "SKIP 2 " >> $TOF
echo "" >> $TOF
echo "BREAK ON role" >> $TOF
echo "" >> $TOF
echo "SELECT c.course_id, c.course_name," >> $TOF
echo " i.role," >> $TOF
echo " u.user_id, u.firstname, u.lastname, u.email" >> $TOF
echo "FROM bb50.course_main c, bb50.course_users i, bb50.users u" >> $TOF
echo "WHERE c.course_id = '"$CRS_ID"'" >> $TOF
echo "AND i.crsmain_pk1 = c.pk1" >> $TOF
echo "AND i.crsmain_sos_id_pk2 = c.sos_id_pk2" >> $TOF
echo "AND u.pk1 = i.users_pk1" >> $TOF
echo "AND u.sos_id_pk2 = i.users_sos_id_pk2" >> $TOF
echo "ORDER BY i.role, u.lastname, u.email;" >> $TOF
echo "" >> $TOF
echo "QUIT" >> $TOF
echo "EOF" >> $TOF
chmod 750 $TOF
$TOF > $ROF
rm $TOF
echo "Output in: " $ROF
exit
==== cut to here
Kate Boardman wrote:
>Dear all, I know I have the building block documentation within my grasp,
>but what I've looked at doesn't make much sense to non-techie me. I've
>received a query from an academic who wants to get his students from his
>blackboard course to something outside of Bb, but needs to be able to pick
>up their user-id. It all went over my head, so I said I'd forward to where I
>know someone else might know. Amongst you guys out there, can anyone explain
>where to get the $user_id from for a Bb course (we're linux + oracle), or is
>this going to be more than something the academic can do and is something we
>need a serious bit of block building to get hold of?
>
>Thanks!
>
>~~~~~~~~~~~~~~~~~~~~~
>Kate Boardman
>Learning Technologies Team
>IT Service
>University of Durham
>South Road
>Durham DH1 3LE
>
>Tel.: 0191 374 1502
>Email: [log in to unmask] <mailto:[log in to unmask]>
>Web: http://www.dur.ac.uk/k.l.boardman
>
>
>-----Original Message-----
>From: [log in to unmask] [mailto:[log in to unmask]]
>Sent: 07 November 2002 15:12 PM
>To: Kate Boardman
>Subject: extracting userid
>
>
>Hi Kate,
>
>I've asked Stuart the following question:
>
>I need to create a dynamic external URL, e.g.
>
>http://www.dur.ac.uk/~dma0jfb/test.php?user_id=$user_id
>
>where I extract the $user_id used in the BlackBoard Login,
>
>within one of my DUO course. The question is what the "Smart Text"
>(or trick) required to achieve this.
>
>Could you posibly post this for me please - that is if it makes sense?
>
>Thanks,
>
>James
>--
>Department of Mathematical Sciences, University of Durham, Durham, DH1 3LE.
>WWW: http://maths.dur.ac.uk/~dma0jfb/
>
>
|