You are on page 1of 16

B GIAO THNG VN TI TRNG I HC HNG HI VIT NAM KHOA CNG NGH THNG TIN

----------------------------

BO CO THC TP TT NGHIP
ti
XY DNG MODULE TCH HP CHO H THNG T CHC THI TRC NGHIM DA TRN MOODLE

Gio vin hng dn: T.S Nguyn Cnh Ton Sinh vin : V nh Trung Phm Tin Vit Lp : CNT49H Hi Phng, thng nm 2012

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

Mc lc 3.2.5. Mng (Array)...............................................................................11 KT LUN...................................................................................................15 LI NI U CHNG I: KIN TRC H THNG MOODLE 1.1. 1.2. 1.3. 1.4. Yu cu ca ti: a. -: b. Yu cu chc nng vi tng mng: CHNG II: PHN TCH THIT K H THNG 2.1. S phn r chc nng: T yu cu chc nng trn, ta c s phn r chc nng. Hnh 2.1 S phn r chc nng 2.1.1. H thng: Hnh 2.2 S phn r chc nng h thng Yu cu chung:

Sinh vin: V nh Trung Lp CNT49H1

Trang 2

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

2.1.2. Qun tr: Hnh 2.3 S phn r chc nng qun tr 2.1.3. Sinh vin: Hnh 2.4 S phn r chc nng sinh vin 2.1.4. Ging vin: Hnh 2.5 S phn r chc nng ging vin 2.1.7. Ngi dng: Hnh 2.8. S phn r chc nng ngi dng 2.2. S mc ng cnh: Hnh 2.9 S mc ng cnh 2.3. Chc nng h thng: 2.3.1. S d liu mc nh chc nng h thng: Hnh 2.10 S lung d liu mc nh chc nng h thng 2.3.2. S d liu mc di nh chc nng h thng: Hnh 2.11 S lung d liu mc di nh chc nng h thng

Sinh vin: V nh Trung Lp CNT49H1

Trang 3

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

2.4. Chc nng qun tr: 2.4.1. S lung d liu mc nh chc nng qun tr: Hnh 2.12 S lung d liu mc nh chc nng qun tr 2.4.2. S lung d liu mc di nh chc nng qun tr: 2.4.2.1. Chc nng : Hnh 2.13 S lung d liu mc di nh chc nng 2.4.2.2. Chc nng: Hnh 2.14 S lung d liu mc di nh chc nng 2.5. Chc nng ngi dng l sinh vin: 2.5.1. S lung d liu mc nh chc nng ngi dng l sinh vin: Hnh 2.15 S lung d liu mc nh chc nng ngi dng l sinh vin 2.5.2. S lung d liu mc di nh chc nng ngi dng l sinh vin: 2.5.2.1. Chc nng : Hnh 2.16 S lung d liu mc di nh chc nng 2.5.2.2. Chc nng : Hnh 2.17 S lung d liu mc di nh chc nng 2.6. Chc nng ngi dng l ging vin: 2.6.1. S lung d liu mc nh chc nng ngi dng l ging vin:
Sinh vin: V nh Trung Lp CNT49H1 Trang 4

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

Hnh 2.20 S lung d liu mc nh chc nng ngi dng l ging vin 2.6.2. S lung d liu mc di nh chc nng ngi dng l ging vin, nhn vin: 2.6.2.1. Chc nng: Hnh 2.21 S lung d liu mc di nh chc nng 2.6.2.2. Chc nng: Hnh 2.22 S lung d liu mc di nh chc nng 2.9. Chc nng ngi dng: 2.9.1. S lung d liu mc nh chc nng ngi dng: Hnh 2.35 S lung d liu mc nh chc nng ngi dng 2.9.2. S lung d liu mc di nh chc nng ngi dng: 2.9.2.1. Chc nng: Hnh 2.36 S lung d liu mc di nh chc nng 2.9.2.2. Chc nng: Hnh 2.37 S lung d liu mc di nh chc nng 2.9.2.3. Chc nng: Hnh 2.38 S lung d liu mc di nh chc nng 2.10. S thc th - quan h: 2.10.1. Xc nh cc thc th: Chi tit cc thc th: 2.10.2. Quan h gia cc thc th:

Sinh vin: V nh Trung Lp CNT49H1

Trang 5

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

2.11.2. Cc bng c s d liu: STT 1 2 3 4 5 6 7 Tn trng Id Kiu trng rng Int 11 Null

Sinh vin: V nh Trung Lp CNT49H1

Trang 6

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

CHNG III: C S L THUYT V CNG C 3.1. : 3.1.1. Frame work: 3.1.1.1. Lch s pht trin: 3.1.1.2. : 3.1.1.2.1. 3.1.1.2.2. : 3.1.1.2.3. : 3.1.1.2.4. : 3.1.2. : 3.1.2.2. : 3.1.2.3 : 3.1.2.4. : 3.1.2.5. : 3.1.2.6. : 3.2. ASP.NET V LP TRNH HNG I TNG 3.2.1. Tng quan v ASP.NET 3.2.2. Cc kiu lp trnh trong ASP.NET: Trong lp trnh c hai kiu lp trnh chng ta thng s dng l: lp trnh hng th tc v lp trnh hng i tng.
o Lp trnh hng th tc: l cch lp trnh gii quyt vn

no theo yu cu a ra v n i theo hng gii quyt tng bc mt n khi t c kt qu. Kiu lp trnh hng th tc cn c gi l kiu lp trnh t trn xung hoc lp trnh theo hm (function). Khi s dng kiu lp trnh ny chng ta khng xy dng sn cc hm x l m ch to ra hm khi gp mt vn no .
o Lp trnh hng i tng: l kiu lp trnh da trn mt nn

Sinh vin: V nh Trung Lp CNT49H1

Trang 7

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

tng cc lp c xy dng sn. Ngha l chng ta phi xc nh trc nhng g s phi lm, nhng trng hp s xy ra xy dng lp c nhng chc nng cn thit cho qu trnh xy dng ng dng. 3.2.3. Mt s khi nim trong lp trnh hng i tng: Lp (Class): mt lp c th c hiu l khun mu to ra cc i tng. Trong mt lp, ngi ta thng dng cc bin m t cc thuc tnh v cc hm m t cc phng thc ca i tng. Khi nh ngha c lp, ta c th to ra cc i tng t lp ny. vic s dng c d dng, thng qua h thng hm to (constructor), ngi ta dng lp nh mt kiu d liu to ra cc i tng. o V d: To class ConMeo to class cho i tng ConMeo chng ta cn xc nh 2 phn: Thuc tnh: Tn, tui, mu lng, Hnh ng (phng thc): chy, ku, cn, co, i tng (Object): o Th hin mt lp thnh mt thc th no . o C th to nhiu i tng t mt lp. V d: V d: Nh ti c mt con mo. Nh bn ti c nui mt con mo. o Cc i tng khc nhau s c c tnh khc nhau. V d: Con mo ca ti c tn l Mimi c lng mu trng.

Sinh vin: V nh Trung Lp CNT49H1

Trang 8

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

Con mo ca bn ti c tn l Doremon c lng mu vng. Tuy 2 con mo trn c nhng c im khc nhau nhng n cng l lp con mo. Thuc tnh (Attribute) v phng thc (Method): o Thuc tnh L cc c tnh, c im ca mt lp. Thuc tnh bao gm: Cc bin: lu tr cc gi tr. Biu thc get v set: cho php ly v gn gi tr. o Phng thc L cc hnh ng c th c thc hin t lp. Phng thc cng ging nh hm nhng l hm ring ca lp. Phng thc c th nhn vo cc tham s v tr v cc gi tr. Tnh k tha: l mt u im ca OOP n gip chng ta m rng v pht trin chng trnh m khng lm nh hng n nhng thnh phn c sn. 3.2.4. Biu thc chnh qui (Regular Expression): Biu thc chnh qui (Regular Expression) bt ngun t ngn ng Perl v hin nay hu nh c trong tt c ngn ng lp trnh. L mt phn rt quan trng trong qu trnh x l chui v h tr cc lp trnh vin gim bt cc dng m trong qu trnh x l chui bng nhng biu thc ngn gn nhng em li kt qu nh s mong i. Nhng s dng tt biu thc chnh qui (Regular Expression) th khng phi d dng nu chng ta khng i ng
Sinh vin: V nh Trung Lp CNT49H1 Trang 9

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

hng v hiu ht cc k hiu ca

n. Biu thc chnh qui (Regular

Expression) thng s dng trong nhng trng hp sau:


o Kim tra gi tr cc phn t trong Form. o X l yu cu phc tp trong chui nh bc tch, thay i

ni dung, loi b cc k t khng cn thit. 3.2.4.1. Mt s hm h tr biu thc chnh qui: Tham chiu
o Trong lp trnh c hai loi bin chng ta thng s dng

truyn gi tr vo hm l bin tham tr v bin tham chiu.


Bin tham tr: khi truyn gi tr vo hm, mi s thay

i ca bin tham tr trong thn hm khng nh hng n bin ban u.


Bin tham chiu: khi truyn gi tr vo hm, th gi

tr ca bin tham chiu s thay i bi ni dung x l trong thn hm c gi.


o V d:

3.2.4.2. Cc k hiu biu thc chnh qui K t ^ $ \ . [] [^] () * ngha i din cho k t u tin ca chui i din cho k t cui cng ca chui Hin th cc k t c bit nh: $, *, ., \ i din cho k t bt k, k c du cch K hiu tp hp Du m ng trc 1 tp hp, mang ngha ph nh tp hp i din cho tp hp cc mu con Du * i din cho s ln xut hin ca k t ng trc n
Trang 10

Sinh vin: V nh Trung Lp CNT49H1

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

t 0 n ln + ? {} \w \W \s \S \d \A \Z Tng t nh du *, k t ng trc du + c th xut hin t 1 n ln K t ng trc du ? c th xut hin t 0 1 ln i din cho s ln lp li k t ng trc i din cho cc ch ci, ch s v du _ Ph nh ca \w Ly tp hp cc khong trng Ph nh ca \s, ly tt c cc k t, tr khong trng i din cho cc ch s Tng ng vi du ^ Tng ng vi du $

3.2.5. Mng (Array) Mng l g? Nh chng ta bit, bin l mt ni lu tr s hoc ch. Vn l, bin ch c th lu tr mt gi tr duy nht. Cn mng l mt bin c bit, n c th lu tr nhiu gi tr trong mt bin duy nht. V d: chng ta ch c th lu tr mt tn ca nhn vin trong mt bin. Nhng i vi mng chng ta c th lu tr hng ngn tn nhn vin khc nhau: Mng c th lu tr tt c cc gi tr bin ca bn di mt tn duy nht. V bn c th truy cp gi tr bng cch tham chiu n tn mng. Mi phn t mng c ch s ring (index) chng ta c th truy cp chng mt cch d dng. 1. Mng s nguyn

Mng s nguyn l mng c ch s (index or key) l dng s. Chng ta thng gi l mng lin tc. C 2 cch to ra mt mng s nguyn: V d 1: V d 2:

Sinh vin: V nh Trung Lp CNT49H1

Trang 11

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

2. 3. Mng a chiu

Mng a chiu l mng m mi phn t trong mng chnh c th l mt mng v mi phn t trong mng con cng c th l mt mng con khc. Chng ta thng gi mng a chiu l mng lng. V d: 3.2.6. Mt s phng thc thng s dng trong ASP. - Phng thc SESSION: c hiu l khong thi gian ngi s dng giao tip vi 1 ng dng. Mt session c bt u khi ngi s dng truy cp vo ng dng ln u tin, v kt thc khi ngi s dng thot khi ng dng. - Phng thc COOKEI: l 1 on d liu c ghi vo a cng hoc b nh ca my ngi s dng. N c trnh duyt gi ngc ln li server mi khi browser ti 1 trang web t server. Nhng thng tin c lu tr trong cookie hon ton ph thuc vo website trn server. Mi website c th lu tr nhng thng tin khc nhau trong cookie, v d thi im ln cui ta gh thm website, nh du ta login hay cha, v.v... 3.3. H qun tr MS SQL SERVER: 3.3.1. Tng quan v MS SQL SERVER: * Cc loi lnh: MS Sql Server gm nhng lnh gip ngi s dng thc hin nhng chc nng khc nhau. Cc chc nng ny c nhm thnh cc loi sau: - Cc lnh m t d liu. - Cc lnh thao tc d liu. - Lnh hi d liu. - Cc lnh iu khin thao tc. - Cc lnh qun tr c s d liu: Gm cc lnh:

Sinh vin: V nh Trung Lp CNT49H1

Trang 12

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

+ To v duy tr CSDL. + To v duy tr cc phn. + Chuyn vic s dng ti cc CSDL v cc bng. * Cc thnh t: - Tn trng. - Kiu d liu (Data Type). - Hng s (Constant). - Cc t kha (Keyword). - Cc lnh (Expression). - Cc iu kin tm kim (Search Conditions). - Cc mnh xc nh phm vi. * Cc hm trong MS Sql Server: phn loi cc hm thnh cc lp: - Cc hm tp hp. - Cc hm chui. - Cc hm ngy gi. - Cc hm Logic. - Cc hm c bit. * Lin kt: - Lin kt ngang bng. - Lin kt khng ngang bng. - Lin kt ngoi. - Lin kt vi chnh n. 3.3.2. : 3.4. Cc cng c h tr ng dng v pht trin Website: - HTML: Nm bt c cc th x l giao din, cu trc, thuc tnh cu hnh nn khung trang web. Quan trng nht vn l cc th <table>, <div>, <ul> <li>, - CSS: Thit k giao din cho Website.

Sinh vin: V nh Trung Lp CNT49H1

Trang 13

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

- JAVASCRIPT JQUERY - AJAX: Thit k cc s kin, hiu ng v quan trng hn l ta s dung m ajax gi d liu CHNG IV: CI T CHNG TRNH. 4.1. Chc nng h thng: 4.1.1. ng nhp: - Ngi dng s c cp 1 ti khon ng nhp vo h thng, khi ng nhp thnh cng, h thng s thc hin kim tra phn quyn v ra nhng giao din tng tc tng ng. 4.1.2. ng xut: - Khi ti khon mun thot khi h thng s thc hin thot khi h thng thng qua chc nng ng xut. 4.2. Chc nng ngi dng: 4.3. Chc nng qun tr: 4.3.1. Form qun l quyn: 4.3.2. Form cp nht quyn: 4.3.3. Form to mi quyn: 4.3.4. Form xa quyn: 4.3.5. Form qun l ti khon: 4.3.6. Form : 4.3.7. Form : 4.4. Chc nng sinh vin: 4.4.1. Form : 4.4.2. Form:

4.5. Chc nng ging vin:


Sinh vin: V nh Trung Lp CNT49H1 Trang 14

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

- Ngi dng l ging vin ng nhp vo h thng s c th xem cc thng bo, gi phn hi, qun l thng bo n, upload ti liu, chia s nh, cp nht ti khon... 4.5.1. Form : 4.5.2. Form : 4.5.3. Form : 4.5.4. Form:

KT LUN Trong thi gian lm n tt nghip, vi s c gng ca bn thn, s hng dn tn tnh ca thy gio Ts. Nguyn Cnh Ton cng cc thy, cc chuyn vin ca trung tm qun tr mng trng i hc Hng hi Vit Nam

Sinh vin: V nh Trung Lp CNT49H1

Trang 15

Bo co thc tp tt nghip

Gio vin hng dn T.s: Nguyn Cnh Ton

gip em hon thnh n tt nghip ny, tng bc xy dng c h thng p ng cc yu cu h thng m trng i hc Hng hi t ra. Cui cng, em xin chn thnh cm n s hng dn, gip ca thy gio Ts. Nguyn Cnh Ton v cc thy, cc chuyn vin ca trung tm qun tr mng trng i hc Hng hi Vit Nam. Em cng chn thnh cm n cc thy c gio trong khoa Cng ngh thng tin, trng i hc Hng Hi Vit Nam tn tnh ging dy em trong sut qu trnh hc trng, xin cm n cc bn sinh vin nhit tnh ng h, gip em trong thi gian hc tp.

Hi Phng, thng nm 2012 Sinh vin V nh Trung

Sinh vin: V nh Trung Lp CNT49H1

Trang 16