vba - Interactive Quiz using ppt -
i posted rubbish question before , have gone away , done work on re-ask. i've made ppt quiz counts how many correct , incorrect answers person has given. feeds information user @ end. want happen want results stored can go in , see how each user has performed in quiz. ideally work on 6 networked computers storing quiz results in 1 place. if need can take file each of 6 computers.
my code far looks this:
dim username string dim numbercorrect integer dim numberwrong integer sub yourname() username = inputbox(prompt:="type name") msgbox " ready begin " + username, vbapplicationmodal, " orange 1c book 7" end sub sub correct() numbercorrect = numbercorrect + 1 activepresentation.slideshowwindow.view.next end sub sub incorrect() numberwrong = numberwrong + 1 activepresentation.slideshowwindow.view.next end sub sub start() numbercorrect = 0 numberwrong = 0 yourname activepresentation.slideshowwindow.view.next end sub sub results() msgbox "well done " & username & " got " & numbercorrect & " out of " & numbercorrect + numberwrong, vbapplicationmodal, "orange 1c book 7" end sub'
any appreciated. not sure begin next step.
here goes 1 option you... explanation first. code create txt file. each time reach results
macro add results file. so, 1 file keep results until don't delete them (or file). therefore i've added separation line , date/time information find appropriate results.
sub save_results_to_txt() 'set file results location activepresentation path 'or changed path string dim strwhere string strwhere = activepresentation.path 'let's set name of file separately dim strname string strname = "\results.txt" dim ff long ff = freefile open strwhere & strname append #ff write #ff, & vbtab & username write #ff, numbercorrect & vbtab & vbtab & numberwrong write #ff, string(30, "-") close #ff end sub
you need add save_results_to_txt
results
sub, possibly before msgbox
line.
your results.txt file like:
"2013-04-25 16:11:05 tom" "10 11" "------------------------------" "2013-04-25 16:11:23 mark" "11 10" "------------------------------"