%\VignetteEngine{knitr::knitr} \documentclass[a4]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{uebung} \IfFileExists{../../info.sty}{\usepackage{../../info}} {\IfFileExists{../info.sty}{\usepackage{../info}}{\usepackage{uebung-info}}} \usepackage{multicol} \usepackage{longtable} \usepackage{color} \usepackage{subfig} \title{Results Exam Math. Stat. \\ Winter 2021} \author{Dr.\ Not Me} \date{\today} <>= ############################################### ## Start of user settings (modify only here) ## ############################################### ## set relative path to folder containing all input files, ## set to "" if files are in the same folder as this Rnw-file rel_path <- "" manual_pointsFile_input <- "mathstat-points.csv" edoz_file_input <- "mathstat-edoz.txt" semester_PA_input <- NULL ## "mathstat-semester-PA.csv" ## Grading function gradeFunction_name <- "gradesPiecewiseLinear" ##"gradesLinear" ## ## Grading settings gradeFunction_settings <- list( pointsFor4 = 28, ## Points necessary for grade 4 pointsFor6 = 50 ## Points necessary for grade 6 ) ## Settings for results.pdf (these affect only the the appearance of the output) ## Define min and max achievable points (relevant for visualization of ## grading scale etc.) ## Use the same order as in manual.pointsFile max_points_q <- c(9, 13, 9, 14, 6, 9) min_points <- 0 max_points <- sum(max_points_q) step_size <- 0.5 ## step size (for presentation of grading scale only) ## Name of RData file to save results to (if NULL, results are not ## saved): rdata_file <- "examResults.RData" ## Expert settings: manual_pointsFile_sep <- "," ##"\t" # ########################## ## End of user settings ## ########################## @ %% Sweave document showing exam outcomes %% THE SOURCE OF THIS DOCUMENT IS *.Rnw %% DO NOT EDIT THE *.tex FILE !!! <>= # set knitr option library(knitr) opts_chunk$set(concordance=TRUE) opts_chunk$set(engine = 'R', dev = 'pdf', fig.width = 6, fig.height = 3, strip.white = TRUE, tidy = FALSE, echo = FALSE, error = FALSE, results = 'hide', message = FALSE) options(knitr.duplicate.label = "allow") # load sfsGrading package and check version package_installed <- require(sfsGrading) # if not installed, prompt user to install the package # sfs path: /sfs/w/ftp/Teaching/sfs-grading-package if(!package_installed){ stop(paste("Please install the package 'sfsGrading'", "using the following command:", "install.packages('https://stat.ethz.ch/Teaching/sfs-grading-package/sfsGrading_current.tar.gz', repos = NULL, type = 'source')" )) } # get version number of installed package installed_version <- packageVersion("sfsGrading") # check whether this corresponds to the latest one # sfs path: /sfs/w/ftp/Teaching/sfs-grading-package connection <- url("https://stat.ethz.ch/Teaching/sfs-grading-package/current-version.txt") latest_version <- readLines(connection) close(connection) # if not, prompt user to install the latest version of the package if(installed_version < latest_version){ stop(paste("Your version of 'sfsGrading' is: ", installed_version, ". The latest version is: ", latest_version, ". Please run the following command to update the package to the latest version: ", "install.packages('https://stat.ethz.ch/Teaching/sfs-grading-package/sfsGrading_current.tar.gz', repos = NULL, type = 'source')", sep="")) } ## check version of results_manual.Rnw results_manual_version <- "05May2023" # check whether this corresponds to the latest one # sfs path: /sfs/w/ftp/Teaching/sfs-grading-package connectionRes <- url("https://stat.ethz.ch/Teaching/sfs-grading-package/results_manual-version.txt") latest_results_manual_version <- readLines(connectionRes) close(connectionRes) # if not, prompt user to install the latest version of results_manual.Rnw ignore.check <- FALSE ## set to TRUE to enable old version (do you know what you do?) if(!ignore.check & (results_manual_version != latest_results_manual_version)){ stop(paste("Your version of 'results_manual.Rnw' is: ", results_manual_version, ". The latest version is: ", latest_results_manual_version, ". Please update to the latest version from /sfs/w/ftp/Teaching/sfs-grading-package", sep="")) } @ <>= ## generate absolute filenames ## Prepare folder name input_folder <- file.path(knitr:::input_dir(), rel_path) ## Student points manual_pointsFile <- file.path(input_folder, manual_pointsFile_input) ## Load edoz file edoz_file <- file.path(input_folder, edoz_file_input) ## Load semester performance file semester_PA_file <- if(exists("semester_PA_input") && !is.null(semester_PA_input)){ file.path(input_folder, semester_PA_input) }else{ NULL } @ <>= process_corrections_manual( manual.pointsFile = manual_pointsFile, edozFile = edoz_file, semesterPAfile = semester_PA_file, gradeFunction.name = gradeFunction_name, gradeFunction.settings = gradeFunction_settings, manual.pointsFile.sep = manual_pointsFile_sep, rdataFile = rdata_file, minPoints = min_points, maxPoints = max_points, maxPoints.q = max_points_q, stepsize = step_size) @ \begin{document} \input{childs/output-file-manual} \end{document}