R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > par4 = '16' > par3 = 'a92b735e76a7dbc2e980b599a3fc50ff' > par2 = 'y3' > par1 = 'a-129045610_0.198037687223405_Thu Dec 12 16:33:45 2013' > par4 <- '16' > par3 <- 'a92b735e76a7dbc2e980b599a3fc50ff' > par2 <- 'y3' > par1 <- 'a-129045610_0.198037687223405_Thu Dec 12 16:33:45 2013' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: aston2 > #To cite this work: I. Holliday, 2012, MC Mock Q11 (v1.2.1) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Ian.Holliday/rwasp_May_mock6.wasp/ > #Source of accompanying publication: > # > library(digest) > par4 <- as.numeric(par4) > if(exists('par2')) { + if (par2 != 'wnga') { + if (digest(par2,ser=F) == par3) { + par4 = par4 + 4 + lastanswer <- 'correct' + } + if (digest(par2,ser=F) != par3) { + par4 = par4 - 2 + lastanswer <- 'Incorrect' + } + } + if (par2 == 'wnga') { + lastanswer <- 'Skipped Question' + } + } > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Your last Question',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,lastanswer,1,TRUE) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/1larq1386866643.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'End of MC exam. Please, write the hash code on your paper.',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Hash Code',1,TRUE) > a<-table.element(a,digest(paste(par1,'_',par4,sep=''),ser=F)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Your exam score',1,TRUE) > a<-table.element(a,par4) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Maximum exam score',1,TRUE) > a<-table.element(a,20) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/2sbg21386866643.tab") > > > > proc.time() user system elapsed 0.472 0.128 0.571