RemRem 			Vocabulary Training programRem						  byRem					 André ClaaßenRemlabel init	if not(isopen("Vocabulary"))		open "PDRData:Vocabulary/Vocabulary"	endif	if(isindex("English")=FALSE)		createindex "English", 30	endif	if(isindex("German")=FALSE)		createindex "German", 30	endif	if(isindex("Date_Input")=FALSE)		createindex "Date_Input"	endif	if(isindex("Difficulty")=FALSE)		createindex "Difficulty"	endif	key 1, "goto test"	key 5, "showindex"	key 7, "tofront"+Chr$(34)+"Vocabulary"+Chr$(34)+":set"+chr$(34)+"Vocabulary"+chr$(34)	key 9, "goto listen"	key 10,"goto sa"	gosub mainendlabel Test	clr	def [note]=STRING	def [rn]=NUM	def [t1]=NUM	def [z1]=NUM	let [rn]=now	let [z1]=0	def [n]=NUM	def [r]=NUM:rem "Correct Answers"	def [text]=STRING	def [l]=NUM:rem "Language : the compared word"	def [f]=NUM	def [p]=NUM		def [num]=NUM	set "Vocabulary"	fcloseall	loadscrmask("PDRData:Vocabulary/Quiz")	forminput "Enter number of words to test (Num: "+str$(cnt)+") ?",[text]	if (len([text]))		fopen "con:0/125/640/75/ V O C A B U L A R Y - T R A I N I N G , Status window "		let [num]=val([text])		setindex "Difficulty"		let [n]=1		show off		menuoff		gosub nextds		while([n]<[num]+1)			gosub quiz			gosub nextds:Rem Get the next record			let[n]=[n]+1		wend		menuon		gosub evaluate		show on		fclose	endif	loadscrmask("PDRData:Vocabulary/Vocabulary")returnlabel nextds	def[w]=NUM	def[s]=NUM	def[nr]=NUM	rem The larger the difficulty factor of the record is,    rem the harder the word is.	let[s]=20	while ([s])		let [nr] = int(rnd*cnt+0.5)		let [w] = index([nr])+1		if(1/([w])> rnd)			let[s]=1			read[nr]		endif		let[s]=[s]-1	wendlabel n_end	clr [w],[s],[nr]returnlabel quiz	if (rnd<0.5)		let [German]=""		show		fieldinput [German],"Enter a German word!"		let [l] = FALSE:rem "Compare with German"		gosub testword	else		let [English]=""		show		fieldinput [English],"Enter an English word!"		let [l] = TRUE:rem "Compare with English"		gosub testword	endifreturnlabel testwordprint "Word Nr : "+str$([n])+"   "if([l])	let [text]=[English]else	let [text]=[German]endiflet [f]=0undoif(len([text])>1)	if([l])		let [f]=instr([English],[text])	else		let [f]=instr([German],[text])	endifendifif([f])	print "!!! Right !!!"+CR	let[Difficulty]=[Difficulty]+1	replace	let[r]=[r]+1else	print "Incorrect"+CR+"Right answer :"	if([l])		print[English]+CR	else		print[German]+CR	endif	if([Difficulty])		let[Difficulty]=[Difficulty]-1		replace	endifendifreturn		rem "Grades : "rem "Very good		100~92 %"rem "good 			 91~81 %"rem "Satisifactory	 80~67 %"rem "Average		 66~50 %"rem "Fair			 50~30 %"rem "Poor			 30~ 0 %"label evaluate	let [p]=int(100*[r]/[num]+0.5)	if([p]>91 and [p]<101):let [note] = "Very good":endif	if([p]>80 and [p]< 92):let [note] = "Good":endif	if([p]>66 and [p]< 81):let [note] = "Satisfactory":endif	if([p]>49 and [p]< 67):let [note] = "Average":endif	if([p]>29 and [p]< 50):let [note] = "Fair":endif	if([p]<31):			   let [note] = "Poor":endif	let[n]=formalert("[0][You had "+str$([r])+" of "+str$([num])+" correct|Grade : "+[note]+"][OK]")returnlabel main	fcloseall	def[n]=NUM	menu 0,0," File "	menu 0,1," about Vocabuary ",ON,"I"	menu 0,2,"-------------------",OFF	menu 0,3," End",ON,"Q"		menu 1,0," Quiz "	menu 1,1," Test",ON,"T"	menu 1,2,"-------------------",OFF	menu 1,3," Difficulity ",ON,"D"	menu 2,0," Index "	menu 2,1," Select index ",ON,"I"	menuon	while TRUE		wait		if menu			switch menux				case 0					switch menuy						case 1							let[n]=formalert("[0][Vocabulary Trainer|Professional Application|    by André Claaßen][OK]")						case 3							goto prg_end					endswitch				case 1					switch menuy						case 1							gosub Test						case 3							gosub indexdifficulty					endswitch				case 2					switch menuy						case 1							showindex					endswitch			endswitch		endif				if mouse			if len(file$) and len(field$)				maskinput field$,"",mousex,mousey			endif		endif		if close			if file$="Vocabulary"				set file$				goto prg_end			endif		endif		if active		endif		if gadget			gosub HandleGadget		endif		if sized		endif	wendendlabel indexdifficulty	def [w]=NUM	setindex "Difficulty"	fopen 1,"con:0/11/640/188/Difficulty factors"	print 1,CR    print 1,"     English                       German	    		 Difficulty"    print 1,CR    print 1,"============================================================================="+CR+CR	loadprtmask "PDRData:Vocabulary/difficulty"	formoutput 1	let[w]=formalert("[1][Output finished!][OK]")	fclose 1	clr[w]returnlabel sa	save "PDRData:Vocabulary/Vocabulary.prg"endlabel listen	clr	def [n]=NUM	if(formalert("[2][Really want to print the listing?][Yes|No]")=1)		fopen 3,"prt:"		list 3		fclose 3	endifendlabel prg_end	menuoff	close	endreturnlabel HandleGadgetswitch gadgetid	case 9:rem !		if mode:rem Search mode			find		else:rem Input mode			if changed				replace			else				append			endif		endif	case 10:rem gearshift		if mode			inputmode		else			searchmode		endif	case 11:rem Eraser		clear	case 12:rem Plus		if double			last		else			next		endif	case 13:rem Minus		if double			first		else			prev		endif	case 14:rem Card file		showindex	case 15:rem Trashcan		if formalert("[3][Realy delete the data record?][Yes|No]")=1			delete		endifendswitch