Slashdot Mirror


Are Written Computer Science Exams a Fair Measure?

me! asks: "I seem to have this inability to write substantial chunks of code (500+) in exam conditions (for uni). I have been writing code for years for open source and commercial applications, so I know a thing or two. There is just something about exams and code that does not work for me. I find that I need to be sitting in front of a computer to get a problem out, to get in the 'vibe', have you will. I have done exams on computers (closed environment) that involve coding, and it work so much better for me. So what I am asking is...how do people tackle exams that involve solving problems on the fly, on paper, in exams?" I have this exact same problem, and I've never thought written tests were a fair way to measure someone's knowledge of coding. It's fine when you are asking questions about design and structure, but when you need to write code it falls way short. How do you feel about it?

2 of 695 comments (clear)

  1. jesus loves the little children by Anonymous Coward · · Score: -1, Troll

    jesus loves the little children, jesus loves them in the ass

    jesus loves the little children, and jesus is gay

  2. src by Anonymous Coward · · Score: -1, Troll
    C# Sourcecode for Slashdot Troll Bot!!!

    Published under the TPL (Trolling Public License)

    usingSystem;usingSystem.Drawing;usingSystem.Collec tions;usingSystem.ComponentModel;usingSystem.Windo ws.Forms;usingSystem.Data;usingSystem.Data.OleDb;u singSystem.Runtime.InteropServices;namespaceSlashm an{publicclassMainFrm:System.Windows.Forms.Form{[D llImport("winmm.dll")]publicstaticexternlongPlaySo und(Stringlpszname,longhModule,longdwFlags);privat eboolmanualMode=false;privateboolcontextTroll=fals e;privateboolcontextTrollOnly=false;privatestringl atestStory="";privatestringlatestStoryDisplay="";p rivatestringlatestURL="";privatestringlatestTime=" ";privatestringlastStory="";privateintselTroll=1;p rivateSystem.Randomrand=newSystem.Random();private DateTimenextCheck=System.DateTime.Now+System.TimeS pan.FromSeconds(6);privateSystem.Windows.Forms.Lab ellabel1;privateSystem.Windows.Forms.LinkLabellink URL;privateSystem.Windows.Forms.LabellabelTime;pri vateSystem.Windows.Forms.ButtonbuttonCheck;private booltrying=false;privateSystem.Timers.TimertheTime r;privateSystem.Windows.Forms.LabellabelNextCheck; privatestringmainURL="http:privatestringreplyURL=" http:privateSystem.Data.DataTabletrollTable;privat eSystem.Data.DataSettrollSet;privateSystem.Data.Da taTablecontextTable;privateSystem.Data.DataSetcont extSet;privateSystem.Windows.Forms.ButtonbtnPost;p rivateboolisposting=false;privateintpreinctroll=0; privatestringdirBase="";privateSystem.Windows.Form s.ButtonbtnOptions;privateSystem.Windows.Forms.Con textMenutrayMenu;privateSystem.Windows.Forms.MenuI temmenuItem1;privateSystem.Windows.Forms.MenuItemm enuItem2;privateSystem.Windows.Forms.MenuItemmenuI tem3;protectedSystem.Windows.Forms.NotifyIcontIcon ; rivateSystem.ComponentModel.IContainercomponents;p rivateOleDbConnectiondbConn;privateOleDbDataAdapte rdbTrollsAdapter;privateSystem.Windows.Forms.Label lbResult;privateOleDbDataAdapterdbContextAdapter;p ublicMainFrm(){InitializeComponent();
    SlashCfg.Se tDefaults();ReadDB();}protectedoverride voidDispose(booldisposing){if(disposing){if(compon ents!=null){components.Dispose();}}base.Dispose(di sposing);}#regionWindowsFormDesignergeneratedcodep rivatevoidInitializeComponent(){this.components=ne wSystem.ComponentModel.Container();System.Resource s.ResourceManagerresources=newSystem.Resources.Res ourceManager(typeof(MainFrm));this.linkURL=newSyst em.Windows.Forms.LinkLabel();this.label1=newSystem . indows.Forms.Label();this.labelTime=newSystem.Wind ows.Forms.Label();this.labelNextCheck=newSystem.Wi ndows.Forms.Label();this.buttonCheck=newSystem.Win dows.Forms.Button();this.theTimer=newSystem.Timers . imer();this.btnOptions=newSystem.Windows.Forms.But ton();this.btnPost=newSystem.Windows.Forms.Button( );this.tIcon=newSystem.Windows.Forms.NotifyIcon(th is.components);this.trayMenu=newSystem.Windows.For ms.ContextMenu();this.menuItem1=newSystem.Windows. Forms.MenuItem();this.menuItem3=newSystem.Windows. Forms.MenuItem();this.menuItem2=newSystem.Windows. Forms.MenuItem();this.lbResult=newSystem.Windows.F orms.Label();((System.ComponentModel.ISupportIniti alize)(this.theTimer)).BeginInit();this.SuspendLay out();this.linkURL.Location=newSystem.Drawing.Poin t(16,48);this.linkURL.Name="linkURL";this.linkURL. Size=newSystem.Drawing.Size(432,23);this.linkURL.T abIndex=0;this.linkURL.LinkClicked+=newSystem.Wind ows.Forms.LinkLabelLinkClickedEventHandler(this.li nkURL_LinkClicked);this.label1.Location=newSystem. Drawing.Point(16,16);this.label1.Name="label1";thi s.label1.Size=newSystem.Drawing.Size(80,23);this.l abel1.TabIndex=1;this.label1.Text="LastCheck:";thi s.labelTime.Location=newSystem.Drawing.Point(104,1 6);this.labelTime.Name="labelTime";this.labelTime. Size=newSystem.Drawing.Size(128,23);this.labelTime . abIndex=2;this.labelTime.Text="00:00";this.labelNe xtCheck.Location=newSystem.Drawing.Point(240,16);t his.labelNextCheck.Name="labelNextCheck";this.labe lNextCheck.Size=newSystem.Drawing.Size(208,23);thi s.labelNextCheck.TabIndex=3;this.labelNextCheck.Te xt="NextCheckin0Seconds";this.buttonCheck.Location =newSystem.Drawing.Point(376,120);this.buttonCheck . ame="buttonCheck";this.buttonCheck.TabIndex=4;this . uttonCheck.Text="CheckNow";this.buttonCheck.Click+ =newSystem.EventHandler(this.buttonCheck_Click);th is.theTimer.Enabled=true;this.theTimer.Interval=10 00;this.theTimer.SynchronizingObject=this;this.the Timer.Elapsed+=newSystem.Timers.ElapsedEventHandle r(this.OnFireTimer);this.btnOptions.Location=newSy stem.Drawing.Point(200,120);this.btnOptions.Name=" btnOptions";this.btnOptions.TabIndex=5;this.btnOpt ions.Text="Options";this.btnOptions.Click+=newSyst em.EventHandler(this.btnOptions_Click);this.btnPos t.Location=newSystem.Drawing.Point(288,120);this.b tnPost.Name="btnPost";this.btnPost.TabIndex=7;this . tnPost.Text="PostNow";this.btnPost.Click+=newSyste m.EventHandler(this.btnPost_Click);this.tIcon.Cont extMenu=this.trayMenu;this.tIcon.Icon=((System.Dra wing.Icon)(resources.GetObject("tIcon.Icon")));thi s.tIcon.Text="SlashMan";this.tIcon.Visible=true;th is.tIcon.DoubleClick+=newSystem.EventHandler(this. DblClickTrayIcon);this.trayMenu.MenuItems.AddRange (newSystem.Windows.Forms.MenuItem[]{this.menuItem1 , his.menuItem3,this.menuItem2});this.menuItem1.Defa ultItem=true;this.menuItem1.Index=0;this.menuItem1 . ext="Open...";this.menuItem1.Click+=newSystem.Even tHandler(this.menuItem1_Click);this.menuItem3.Inde x=1;this.menuItem3.Text="-";this.menuItem2.Index=2 ; his.menuItem2.Text="Exit";this.menuItem2.Click+=ne wSystem.EventHandler(this.menuItem2_Click);this.lb Result.Location=newSystem.Drawing.Point(16,80);thi s.lbResult.Name="lbResult";this.lbResult.Size=newS ystem.Drawing.Size(432,23);this.lbResult.TabIndex= 8;this.lbResult.Text="LastResult:None";this.AutoSc aleBaseSize=newSystem.Drawing.Size(5,13);this.Clie ntSize=newSystem.Drawing.Size(472,149);this.Contro ls.AddRange(newSystem.Windows.Forms.Control[]{this . bResult,this.btnPost,this.btnOptions,this.buttonCh eck,this.labelNextCheck,this.labelTime,this.label1 , his.linkURL});this.Icon=((System.Drawing.Icon)(res ources.GetObject("$this.Icon")));this.MaximizeBox= false;this.Name="MainFrm";this.StartPosition=Syste m.Windows.Forms.FormStartPosition.CenterScreen;thi s.Text="SlashMan";this.SizeChanged+=newSystem.Even tHandler(this.SizeChang);((System.ComponentModel.I SupportInitialize)(this.theTimer)).EndInit();this. ResumeLayout(false);}#endregion[STAThread]staticvo idMain(){Application.Run(newMainFrm());}privatevoi dReadDB(){try{dirBase=System.Diagnostics.Process.G etCurrentProcess().MainModule.FileName;dirBase=dir Base.Substring(0,dirBase.LastIndexOf("\\"));System . O.Directory.CreateDirectory(dirBase);stringmdbFile ="Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+di rBase+"\\Slashman.mdb";dbConn=newOleDbConnection(m dbFile);dbTrollsAdapter=newOleDbDataAdapter();OleD bCommanddbInsert=newOleDbCommand("INSERTINTOtrolls (ID,Subject,Body)Values(?,?,?)",dbConn);dbInsert.P arameters.Add("ID",OleDbType.Numeric,0,"ID");dbIns ert.Parameters.Add("Subject",OleDbType.VarChar,255 , Subject");dbInsert.Parameters.Add("Body",OleDbType . har,65535,"Body");OleDbCommanddbUpdate=newOleDbCom mand("UPDATEtrollsSETSubject=?,Body=?WHEREID=?",db Conn);dbUpdate.Parameters.Add("Subject",OleDbType. VarChar,255,"Subject");dbUpdate.Parameters.Add("Bo dy",OleDbType.Char,65535,"Body");dbUpdate.Paramete rs.Add("ID",OleDbType.Numeric,0,"ID");OleDbCommand dbDel=newOleDbCommand("DELETEFROMtrollsWHEREID=?", dbConn);dbDel.Parameters.Add(newOleDbParameter("ID ",OleDbType.Numeric,0,"ID"));dbTrollsAdapter.Inser tCommand=dbInsert;dbTrollsAdapter.UpdateCommand=db Update;dbTrollsAdapter.DeleteCommand=dbDel;dbTroll sAdapter.SelectCommand=newOleDbCommand("SELECT*FRO Mtrolls",dbConn);dbContextAdapter=newOleDbDataAdap ter();dbContextAdapter.SelectCommand=newOleDbComma nd("SELECT*FROMContext",dbConn);dbConn.Open();trol lSet=newSystem.Data.DataSet("trollset");trollTable =newDataTable("trolls");dbTrollsAdapter.Fill(troll Table);trollSet.Tables.Add(trollTable);if(trollTab le.Rows.Count==0){System.Windows.Forms.MessageBox. Show("Thetrollsdatabaseismissingorempty.");throwne wSystem.Exception("Thetrollsdatabaseismissingoremp ty.");}contextSet=newSystem.Data.DataSet("contexts et");contextTable=newDataTable("Context");dbContex tAdapter.Fill(contextTable);contextSet.Tables.Add( contextTable);this.Visible=true;this.Update();}fin ally{dbConn.Close();}}privateboolSendMail(stringfr om,stringto,stringsubject,stringbody){try{System.W eb.Mail.MailMessagetheMail=newSystem.Web.Mail.Mail Message();theMail.From="your@email.com";theMail.To =to;theMail.Subject=subject;theMail.Body=body;theM ail.BodyFormat=System.Web.Mail.MailFormat.Text;Sys tem.Web.Mail.SmtpMail.SmtpServer="your.server.com" ; ystem.Web.Mail.SmtpMail.Send(theMail);returntrue;} catch(Exceptione){System.Windows.Forms.MessageBox. Show(e.Message);returnfalse;}}privatevoidUpdateFor m(){this.labelTime.Text=latestTime;this.linkURL.Te xt=latestStoryDisplay;}privatestringGetTaggedText( stringfrom,stringtagBegin,stringtagEnd){intbegin=f rom.IndexOf(tagBegin);if(begin==-1)thrownewSystem. Exception("tagBeginnotfound");stringretstr=from.Su bstring(begin+tagBegin.Length);intend=retstr.Index Of(tagEnd);if(end==-1)thrownewSystem.Exception("ta gEndnotfound");returnretstr.Substring(0,end);}priv atestringStripTags(stringfrom){stringret=from;intb egin=ret.IndexOf("=0){intend=ret.IndexOf(">",be gin);if(end==-1)break;ret=ret.Remove(begin,(end-be gin)+1);begin=ret.IndexOf("=0){intidx=(int)context Table.Rows[i]["Post"];subj=trollTable.Rows[idx-1][ "Subject"].ToString();body=trollTable.Rows[idx-1][ "Body"].ToString();break;}}}if(i==contextTable.Row s.Count){if(contextTrollOnly){thrownewSystem.Excep tion("Nocontexttrollexistsforthispost.");}preinctr oll=SlashCfg.curTrollIndex;if(SlashCfg.curTroll==0 ){SlashCfg.curTrollIndex++;if(SlashCfg.curTrollInd ex>=trollTable.Rows.Count)SlashCfg.curTrollInde x=1;selTroll=SlashCfg.curTrollIndex;}else{selTroll =SlashCfg.curTroll;}if(selTroll>=trollTable.Row s.Count){thrownewSystem.Exception("Theselectedtrol lisgreaterthanthenumberoftrollsinthetable.");}subj =trollTable.Rows[selTroll]["Subject"].ToString();b ody=trollTable.Rows[selTroll]["Body"].ToString();} if(SlashCfg.appendPostfix){body+="

    "+SlashCfg.app endPosttext;}PrePro(refsubj);PrePro( refbody);}privatevoidPostComment(){/*stringxtheSub j,xtheBody;GetTrollData(outxtheSubj,outxtheBody);S ystem.Windows.Forms.MessageBox.Show(xtheBody,xtheS ubj);return;*/if(isposting)return;isposting=true;i f(manualMode)PlaySound(Application.StartupPath+"\\ alert.wav",0,1);try{stringtheSubj="",theBody="";if (!manualMode){GetTrollData(outtheSubj,outtheBody); }UpdateStatus("Readingcommentspage...");stringpage Text=DoHttpGet(latestURL);stringtagSID="";stringSI D=GetTaggedText(pageText,tagSID,tagEND);stringCID= GetTaggedText(pageText,tagCID,tagEND);stringPID=Ge tTaggedText(pageText,tagPID,tagEND);stringreplyPag e=replyURL+"?";replyPage+="sid="+SID+"&";replyPage +="pid="+PID+"&";replyPage+="cid="+CID+"&";replyPa ge+="op=Reply&mode=flat&commentsort=0&threshold=-1 ";UpdateStatus("RequestingReplyPage...");pageText= DoHttpGet(replyPage);SID=GetTaggedText(pageText,ta gSID,tagEND);PID=GetTaggedText(pageText,tagPID,tag END);stringKEY=GetTaggedText(pageText,tagKEY,tagEN D);System.Collections.Specialized.NameValueCollect ionnvs=newSystem.Collections.Specialized.NameValue Collection();nvs.Add("sid",SID);nvs.Add("pid",PID) ; vs.Add("mode","flat");nvs.Add("startat","");nvs.Ad d("threshold","-1");nvs.Add("commentsort","0");nvs . dd("formkey",KEY);nvs.Add("rlogin","1");nvs.Add("u nickname",SlashCfg.username);nvs.Add("upasswd",Sla shCfg.password);nvs.Add("op","Submit");nvs.Add("po sttype","1");if(manualMode){PromptTrollData(outthe Subj,outtheBody);}else{UpdateStatus("Waiting20seco nds...");System.Threading.Thread.Sleep(21000);}nvs . dd("postersubj",theSubj);nvs.Add("postercomment",t heBody);pageText=DoHttpPost(replyURL,nvs);stringta gErrorResult="";stringtagPostResult="FACE=\"arial, helvetica\"SIZE=\"4\"COLOR=\"#FFFFFF\"> ";stringtagPostResultEnd="";stringPostResult=GetTa ggedText(pageText,tagPostResult,tagPostResultEnd); boolisOK=(pageText.IndexOf(tagErrorResult)==-1);if ((!isOK)&&(PostResult=="PostComment")){try{PostRes ult=GetTaggedText(pageText,tagErrorResult,".");}ca tch{}while((PostResult.Length>0)&&((PostResult[ 0]127)))PostResult=PostResult.Substring(1);}if(isO K){CID=GetTaggedText(pageText,tagCID,tagEND);lbRes ult.Text="PostedComment";stringlink="http:}else{lb Result.Text="ERROR:"+PostResult;}isposting=false;} catch(System.Exception){isposting=false;throw;}Upd ateStatus("PostComplete.");}privatevoidTryRead(){i f(trying)return;trying=true;stringtagTitle=@"FACE= ""arial,helvetica""SIZE=""4""COLOR=""#FFFFFF""> ";stringtagTitleEnd="";stringtagUrl="

    (";stringtagUrlEnd="ReadMore...";UpdateStatus("Che ckingNow...");boolretryPost=false;try{stringpagest r=DoHttpGet(mainURL);latestStory=StripTags(GetTagg edText(pagestr,tagTitle,tagTitleEnd));latestStoryD isplay=latestStory;latestURL=GetHref(GetTaggedText (pagestr,tagUrl,tagUrlEnd));latestURL+="&threshold =-1";latestTime=System.DateTime.Now.ToString();if( (lastStory.Length>0)&&(latestStory!=lastStory)) {PlayAlert();PostComment();}}catch(System.Exceptio ne){if(e.Message.IndexOf("(404)")>0){SlashCfg.c urTrollIndex=preinctroll;retryPost=true;}latestSto ryDisplay=e.Message;latestURL="ERROR";latestTime=" ERROR";}if(retryPost==false){lastStory=latestStory ; extCheck=DateTime.Now.AddSeconds(SlashCfg.checkInt ervalMin+rand.Next(SlashCfg.checkIntervalMax-Slash Cfg.checkIntervalMin));}else{nextCheck=DateTime.No w.AddSeconds(5);}UpdateForm();trying=false;}privat evoidbuttonCheck_Click(objectsender,System.EventAr gse){TryRead();}privatevoidOnFireTimer(objectsende r,System.Timers.ElapsedEventArgse){if(trying)retur n;if(isposting)return;if(DateTime.Now>nextCheck ){TryRead();}UpdateStatus("NextCheckin"+(int)((nex tCheck-DateTime.Now).TotalSeconds)+"Seconds.");}pr ivatevoidNavigateLink(){try{System.Diagnostics.Pro cess.Start(latestURL);}catch{}}privatevoidPlayAler t(){}privatevoidlinkURL_LinkClicked(objectsender,S ystem.Windows.Forms.LinkLabelLinkClickedEventArgse ){NavigateLink();}privatevoidbtnPost_Click(objects ender,System.EventArgse){if((latestURL==null)||(la testURL=="ERROR")||(latestURL.Length==0)){System.W indows.Forms.MessageBox.Show("Mustgetthepostfirst! (PressCheckNow)","Error",System.Windows.Forms.Mess ageBoxButtons.OK,System.Windows.Forms.MessageBoxIc on.Stop);return;}try{PostComment();}catch{}}privat evoidbtnOptions_Click(objectsender,System.EventArg se){Slashman.OptionsFrmopts=newSlashman.OptionsFrm ();opts.trollTable=trollTable;opts.ShowDialog(this );if(opts.pressedOK){dbTrollsAdapter.Update(trollT able);trollTable.AcceptChanges();}else{trollTable. RejectChanges();}}privatevoidShowMe(){this.Visible =true;this.Activate();this.WindowState=System.Wind ows.Forms.FormWindowState.Normal;}privatevoidHideM e(){this.Visible=false;}privatevoidmenuItem1_Click (objectsender,System.EventArgse){ShowMe();}private voidmenuItem2_Click(objectsender,System.EventArgse ){this.Close();}privatevoidSizeChang(objectsender, System.EventArgse){if(this.WindowState==System.Win dows.Forms.FormWindowState.Minimized){HideMe();}}p rivatevoidDblClickTrayIcon(objectsender,System.Eve ntArgse){ShowMe();}}}