Building Your Own Blocks - Home

Download Report

Transcript Building Your Own Blocks - Home

Building Your Own Blocks
Joseph Loiacono
Florida Atlantic University
Follow Along
• This presentation can be found by going to
http://tinyurl.com/jldevcon
Overview
• Introduction
• Demonstration Of Building Blocks
–
–
–
–
–
SSO Modules
AlcoholEdu Course Link
Known Issues Module
My Courses Module
Advanced User Search
• Preview of Building Blocks in Development
Florida Atlantic University
•
•
•
•
A public institution with 7 campuses
28,000 students and growing
Using Blackboard since 2001
Celebrating 50th Anniversary this Fall
About Me
Joseph Loiacono
Computer Applications Coordinator
Florida Atlantic University
[email protected]
Single Sign On – Training Site
• Developed a secure website to manage
scheduling of training courses using PHP and
MySQL
Single Sign On – Training Site
• The module creates a link to the training site so
that users will not need to login separately
Single Sign On – Training Site
//C o nc at us e rnam e and s e c re t
S tring tp lainT e xt = tke y+ ts e s s io nUs e rNam e ;
//C re ate M D 5 has h
M e s s ag e D ig e s t tm d A lg o rithm = M e s s ag e D ig e s t.g e tI ns tanc e ("M D 5 ");
tm d A lg o rithm .up d ate (tp lainT e xt.g e tB yte s ());
b yte [] td ig e s t = tm d A lg o rithm .d ig e s t();
S tring B uf f e r the xS tring = ne w S tring B uf f e r();
f o r (int i = 0 ; i < td ig e s t.le ng th; i+ + ) {
tp lainT e xt = I nte g e r.to He xS tring (0 xF F & td ig e s t[i]);
if (tp lainT e xt.le ng th() < 2 ) {
tp lainT e xt = "0 " + tp lainT e xt;
}
the xS tring .ap p e nd (tp lainT e xt);
}
//A s s ig ning has h to c p T e xt s tring
S tring tc p T e xt = the xS tring .to S tring ();
Single Sign On – Training Site
$ re s ult = m ys q l_ q ue ry( $ s q l ) o r d ie ( 'Unab le to c o nne c t to
D atab as e . P le as e c o ntac t the S ys te m A d m inis trato r' );
$ num = m ys q l_ num _ ro ws ( $ re s ult );
//us e r alre ad y in training d b
if (($ num ! = 0 ) | | ($ num ! = NUL L ) | | ($ num ! = ""))
{
s e s s io n_ s tart();
$ _ S E S S I O N["us e rnam e "] = $ training ap p us e r;
$ _ S E S S I O N["s e ls e s id "] = $ s e ls e s id ;
//d ire c t us e r to e nro ll p ag e if the y c am e f ro m the p ub lic
c ale nd ar, o the rwis e s e nd the m to m ain m e nu
if (($ s e ls e s id = = "") | | (! is s e t($ s e ls e s id )) | | ($ s e ls e s id = =
NUL L )) {
he ad e r('L o c atio n:
http s ://s wis e .f au.e d u/training /m e nu.p hp ');
} e ls e {
Single Sign On – Combined Course
• I developed a similar module for a Combined
Courses site I developed
Single Sign On – Combined Course
• The site allows users
to search for their
courses by the Course
Reference Number
(CRN)
• and add them to a
queue
• before requesting that
the courses be
combined.
A script periodically collects the data and generates snapshot files
AlcoholEdu
• Our Office of New Student and Owl Family
Programs (Orientation) using a product called
AlcoholEdu
AlcoholEdu
• I developed a simple course link using a form
that posted user information from Blackboard to
their site
< inp ut typ e = "hid d e n"
< inp ut typ e = "hid d e n"
< inp ut typ e = "hid d e n"
< inp ut typ e = "hid d e n"
< inp ut typ e = "hid d e n"
< /f o rm >
nam e = "s s o " value = "< % = s s o val% > " />
nam e = "s id " value = "< % = s id val% > " />
nam e = "s ln" value = "< % = las tnam e % > " />
nam e = "s f n" value = "< % = f irs tnam e % > " />
nam e = "s lg n" value = "< % = e m ail% > " />
f unc tio n js te s t(){
alwin = wind o w.o p e n('ab o ut:b lank','ae d uwin','he ig ht= 8 0 0 ,wid th=
1 0 2 4 ,m e nub ar,s c ro llb ars ,re s izab le ,title b ar,to o lb ar')
d o c um e nt.ae d uf o rm .s ub m it();
alwin.f o c us ();
}
AlcoholEdu
• The string identifying the course is stored in a
text file paired up with the course batchuid to
allow for multiple course to use it
S tring file nam e = "c d ata.txt";
S tring fullp ath = d irs tr + file nam e ;
S tring m atc h= "N";
F ile fp = ne w F ile (fullp ath);
if(fp .e xis ts ()){
try {
B uffe re d R e ad e r fin = ne w B uffe re d R e ad e r(ne w F ile R e ad e r(fullp ath));
S tring line ;
while ((line = fin.re ad L ine ()) != null){
S tring line _ arr[] = line .s p lit("\\| ");
if(line _ arr[0 ].e q uals (c _ b atc huid )){
ae id val = line _ arr[1 ];
m atc h= "Y";
}
Known Issues
• This module lists Known Issue headlines that
are expandable and collapsible
Known Issues
• Originally plain HTML module
< s tro ng > C lic k o n the link to s e e m o re info rm atio n< /s tro ng > < b r /> < b r />
< a hre f= "javas c rip t:to g g le L aye r('Hint5 ');"> » Inte rne t E xp lo re r 9 no t fully c o m p atib le
with B lac kb o ard < /a> < b r />
< d iv id = "Hint5 " c las s = "HintB o x" s tyle = "d is p lay: no ne ;">
< p > T he re are s e ve ral is s ue s re late d to the d is p lay o f c o nte nt and the availab ility o f
c e rtain to o ls in B lac kb o ard whe n us ing Inte rne t E xp lo re r 9 :< /p > < b lo c kq uo te > < p >
W he n “ c o m p atib ility vie w” is < s tro ng > e nab le d < /s tro ng > < /p > < ul> < li> the o p tio ns
m e nus that are availab le to ins truc to rs in vario us are as o f the c o urs e d o no t fully
d is p lay.< /li> < /ul> < p > W he n “ c o m p atib ility vie w” is < s tro ng > NO T < /s tro ng >
e nab le d < /p > < ul> < li> the g rad e c e nte r will no t d is p lay.< /li> < li> ins truc to rs c anno t
re o rd e r ite m s (d rag and d ro p d o e s no t func tio n).< /li> < /ul> < /b lo c kq uo te >
< /d iv>
< /d iv>
Known Issues
• Developed as a Building Block to allow
Administrators to Add/Modify/Remove/Reorder
issues without knowledge of HTML, Javascript,
or CSS
Known Issue – Add
•
Uses the VTBE to add the issue content
Known Issue – Add
<bbNG:form action="addki2.jsp" method="post" onSubmit="return validateForm();">
<bbNG:dataCollection>
<bbNG:step title="Subject:">
<bbNG:dataElement label="" isRequired="true" labelFor="subject">
<bbNG:textElement name="subject" value="" size="100" maxLength="255"
isRequired="true" title="Title" />
</bbNG:dataElement>
</bbNG:step>
<bbNG:step title="Issue Text:">
<bbNG:dataElement label="" labelFor="newmessage">
<bbNG:textbox name="newmessage" isRow3Collapsed="False" isUrlLink="True" isContentLinking="true"
isStandalonePage="false" isContentLinking="True" text="" isMathML="false" />
</bbNG:dataElement>
</bbNG:step>
<bbNG:stepSubmit />
</bbNG:dataCollection>
</bbNG:form>
Known Issues - Add
• A text file is created to store the file [ki#.txt]
• A list (index) file is updated to track the issues
Known Issue – Add
if (null ! = re q ue s t.g e tP aram e te r("ne wm e s s ag e te xt")){
ne wte xt = re q ue s t.g e tP aram e te r("ne wm e s s ag e te xt");
ne ws ub je c t = re q ue s t.g e tP aram e te r("s ub je c t");
F ile d ir2 a = null;
d ir2 a = P lug I nUtil.g e tC o nf ig D ire c to ry("f au","kno wnis s ue s ");
S tring d irs tr2 = d ir2 a.g e tP ath()+ "/";
f ile nam e 2 = "lis t.txt";
f ullp ath2 = d irs tr2 + f ile nam e 2 ;
f ullp ath3 = d irs tr2 ;
try {
B uf f e re d R e ad e r f in2 = ne w B uf f e re d R e ad e r(ne w F ile R e ad e r(f ullp ath2 ));
S tring line 2 ;
while ((line 2 = f in2 .re ad L ine ()) ! = null){
late s t = line 2 ;
f ile d ata = f ile d ata + line 2 + "\n";
}
f in2 .c lo s e ();
} c atc h (I O E xc e p tio n e ){
}
Known Issues – List file
• The List file is a pipe delimited file that contains
four columns [PK, Order, Subject, Delete Flag]
0|0|0|Y
1|1|Internet Explorer 9 not fully compatible with Blackboard|N
2|3|Announcement Email Notification|N
3|4|Saving test answers with Firefox 4|N
4|6|Microsoft Office Files Prompt for Authentication|Y
5|7|Error Message when Viewing Assignment Attempts|N
6|5|RESOLVED: Respondus Test Settings Issue|Y
7|2|Course Reports not working|N
Known Issues – Modify Issue
• Modify Issue allows an Admin to modify an
existing issue using the VTBE, and the files get
updated accordingly
Known Issues – Remove Issue
• Remove issue simply alters the delete flag in the
list file
Known Issues – Reorder Issues
• Reorder Issue uses drag and drop functionality
to change the order of the issues
Known Issues – Reorder Issues
• Uses Scriptaculous drag and drop functionality
http://madrobby.github.com/scriptaculous/
• Updates list file
• Deleted issues are listed as hidden rows
if(ite m .kiav.e q uals ("N")){
//A vailab le Is s ue s
c av= c av+ 1 ;
c m o d = c av % 2 ;
if(c m o d = = 1 ){
ro wb g = "# d d d d d d ";
} e ls e {
ro wb g = "# d d d d d d ";
}
o ut.p rint("< tr id = 'ite m _ " + ite m .kip k + "'> < td b g c o lo r= '" +
ro wb g + "'> " + ite m .kis ub je c t + "< /td > < /tr> ");
My Courses
• Alternative My Courses
module
• Organizes courses by
data source (semester)
• More descriptive
availability information
• Allows for additional
information within
module
My Courses - Message
• An optional message is displayed at beginning
of the module.
• It can be modified from the Building Blocks
Settings area
My Courses - Message
• It uses the VTBE and stores the data in a text
file
My Courses - Terms
• Data Source names are paired with display
names
My Courses – Combined Courses
• Students enrolled in combined courses can see
a message indicating the individual section that
they are enrolled in
My Course – Combined Courses
• This information can be updated in Settings area
My Courses - Hide
• By clicking on the Manage button, users can
Show/Hide their courses
My Courses - Hide
if (p k.e q uals (hid e p k)){
hid e = "hid e ";
} e ls e {
hid e = "";
}
//S e t Hid e f o r c o urs e s as re q ue s te d
c d .s e tV alue (p k,hid e );
c d .s ave ();
}
%>
< /b b D ata:c o nte xt>
< b b UI :m o d ule P e rs o nalizatio nR e c e ip t>
< b r />
< b > T he M o d ule has b e e n up d ate d .< /b >
< b r />
< /b b UI :m o d ule P e rs o nalizatio nR e c e ip t>
My Courses – Show Instructor
• Clicking on the
instructor name
book icon will show/hide the
My Courses - Availability
• The module displays (unavailable to students) in
place of the original (unavailable) message
• There are additional availability message
relating to Duration
My Courses – Availability
I nte g e r.to S tring (e nrd ate .g e t(C ale nd ar.D A Y_ O F _ M O NT H));
C ale nd ar e xp d ate = c m .g e tE nro llm e ntD ate ();
e xp d ate .ad d (C ale nd ar.D A Y_ O F _ M O NT H, us e num );
if (c alto d ay.af te r(e xp d ate )){
c _ availab le _ ind = "N";
}
} e ls e {
avm e s s ag e = "unavailab le to s tud e nts af te r " + us e num 2 + " d ays ";
c _ availab le _ ind = "N";
}
}
}
if (c m .g e tI s A vailab le ()){
e _ availab le _ ind = "Y";
} e ls e {
e _ availab le _ ind = "N";
}
My Courses – Data Source
• Our data source convention for courses is
COURSES + _ + YYYY + term [S=Spring,
R=Summer, F=Fall]
• Those data sources are automatically renamed
to push the most recent semester to the top, and
the display name is automatically generated
My Courses – Data Source
//C re ate D is p lay f rie nd ly D ata S o urc e Nam e s
if ((d s s tr.le ng th()> = 1 3 ) & &
(d s s tr.s ub s tring (0 ,9 ).e q uals ("C O UR S E S _ 2 "))){
s e m ye ar= d s s tr.s ub s tring (8 ,1 2 );
if (d s s tr.s ub s tring (1 2 ,1 3 ).e q uals ("F ")){
s e m te m p = "0 8 ";
d s d n= "F all " + s e m ye ar;
} e ls e if (d s s tr.s ub s tring (1 2 ,1 3 ).e q uals ("S ")){
s e m te m p = "0 1 ";
d s d n= "S p ring " + s e m ye ar;
} e ls e if (d s s tr.s ub s tring (1 2 ,1 3 ).e q uals ("R ")){
s e m te m p = "0 5 ";
d s d n= "S um m e r " + s e m ye ar;
}
s e m e s te r= s e m ye ar + s e m te m p ;
} e ls e if (d s s tr.e q uals ("S YS T E M ")){
s e m e s te r= "0 0 0 "+ d s s tr;
} e ls e {
s e m e s te r= "0 0 "+ d s s tr;
}
My Courses - Data Source
• The remaining data source display names are
read from the file
S tring d irs tr3 = d irs tr;
F ile d ir3 = ne w F ile (d irs tr3 );
S tring f ullp ath3 = "";
S tring f ile nam e 3 = "";
f ile nam e 3 = "d s d n.txt";
f ullp ath3 = d irs tr3 + f ile nam e 3 ;
try {
B uf f e re d R e ad e r f in3 = ne w B uf f e re d R e ad e r(ne w F ile R e ad e r(f ullp ath3 ));
S tring line 3 ;
while ((line 3 = f in3 .re ad L ine ()) ! = null){
S tring line _ arr3 [] = line 3 .s p lit("\\| ");
if (! s e m e s te r.e q uals ("0 0 0 S YS T E M ")){
if (s e m e s te r.s ub s tring (2 ,s e m e s te r.le ng th()).e q uals (line _ arr3 [0 ])){
My Courses - Class
• A class was created to store all of the necessary
data
c _ b atc huid = c _ b id ;
p ro flis t= p ro f;
s e m d is = s e m d ;
ro le m e s s = rm ;
s tatus = vis ;
avm e s s = avm ;
}
p ub lic S tring to S tring () {
re turn c o urs e id ;
}
}
L is t< B b C o urs e s > b b c o urs e lis t= ne w A rrayL is t< B b C o urs e s > ();
b b c o urs e lis t.ad d (ne w
B b C o urs e s (s e m e s te r,c o urs e id ,c o urs e title ,p k,ro le ,c _ availab le _ ind ,e _ availab le _ ind ,c _ b a
tc huid ,p ro flis t,d s s tr,d s d n,ro le m e s s ,is hid d e n,avm e s s ag e ));
My Courses - Comparator
• A comparator is used to sort the courses by Data
Source and Role
C o m p arato r s o rtb yd atas o urc e = ne w C o m p arato r() {
// S o rt the d ate b y S e m e s te r > R o le > C o urs e I D
S tring ro le lis t2 [] =
{"I NS T R UC T O R ","T E A C HI NG _ A S S I S T A NT ","C O UR S E _ B UI L D E R ","G R A D E R ","S T U
D E NT "};
p ub lic int c o m p are (O b je c t o 1 , O b je c t o 2 ) {
B b C o urs e s c m 1 = (B b C o urs e s ) o 1 ;
B b C o urs e s c m 2 = (B b C o urs e s ) o 2 ;
S tring
S tring
S tring
S tring
S tring
S tring
s 1 = (S tring )(c m 1 .d s s tr);
s 2 = (S tring )(c m 2 .d s s tr);
c 1 = (S tring )(c m 1 .c o urs e id );
c 2 = (S tring )(c m 2 .c o urs e id );
r1 = (S tring )(c m 1 .ro le );
r2 = (S tring )(c m 2 .ro le );
//S e t R o le O rd e r
My Courses – Course Link
• One change required from Bb8 to Bb9 – the course URL
//Version 8
//hrefstr="/webapps/portal/frameset.jsp?tab=courses&url=/bin/common/
course.pl?course_id=" + item.bbpk;
//Version 9
hrefstr="/webapps/portal/frameset.jsp?tab_tab_group_id=_2_1&url=%2
Fwebapps%2Fblackboard%2Fexecute%2Flauncher%3Ftype%3DC
ourse%26id%3D_" + item.bbpk + "_1%26url%3D";
Advanced User Search
• Shares most code with the My Courses Module
• Similar to native enrollment search, but includes
Course and Enrollment Availability and student
id number
Advanced User Search
• Also displays Duration information
Advanced User Search
• Retrieves user info from username using UserSearch
I te rato r i = us e rL is t.ite rato r();
L is t< C o urs e > c L is t= null;
L is t< Us e rI nf o > ls = ne w A rrayL is t< Us e rI nf o > ();
while (i.has Ne xt()){
Us e r u = (Us e r) i.ne xt();
I d uid = u.g e tI d ();
s e rp k= u.g e tI d ().to E xte rnalS tring ();
B b P e rs is te nc e M anag e r b b P m =
B b S e rvic e M anag e r.g e tP e rs is te nc e S e rvic e ().g e tD b P e rs is te nc e M anag e r();
C o urs e D b L o ad e r c L o ad e r = (C o urs e D b L o ad e r)
b b P m .g e tL o ad e r(C o urs e D b L o ad e r.T YP E );
c L is t = c L o ad e r.lo ad B yUs e rI d (uid );
L is tI te rato r c m I te rato r = c L is t.lis tI te rato r();
while (c m I te rato r.has Ne xt()){
Future Plans
• Working on Building Block to include text based
column in combined courses containing
individual section information
• Planning Building Block to replace Combined
Course website
Tips
• EduGarage:
http://www.edugarage.com
• Bb Open Source Listserv:
http://lists.vcu.edu/cgi-bin/wa?A0=BBOPEN_SRC&D=0&F=&H=0&O=T&S=&T=0
Questions
???
Please provide feedback for this session by emailing
[email protected].
The title of this session is:
[Building Your Own Blocks]