-
Notifications
You must be signed in to change notification settings - Fork 0
/
generic_vorlesung_mini.rnw
174 lines (147 loc) · 7.03 KB
/
generic_vorlesung_mini.rnw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{fancyhdr}
\renewcommand{\familydefault}{\sfdefault}
\geometry{a4paper, total={210mm,297mm}, left=20mm, right=20mm, top=15mm, tmargin=39mm, headheight=70mm, bottom=20mm}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,RE]{\includegraphics{img/pfh_logo3.png}}
\fancyfoot{}
\fancyfoot[RO,RE]{\thepage}
\thispagestyle{fancy}
\renewcommand{\familydefault}{\sfdefault}
<<include=FALSE>>=
modulnamen <- data.frame(read.csv("mn.csv", sep=";", encoding = "UTF-8"))
modulnamen$Studiengang <- factor(modulnamen$Studiengang)
itemlevels <- read.csv2("itemlevels.csv", header = TRUE, sep = ";", stringsAsFactors = TRUE)
titles <- read.csv2("cover_title.csv", header = TRUE, sep = ";", encoding = "UTF-8")
studiengaenge <- list(
BScGM1 = "Campusstudiengang\\\\ B.Sc. General Management\\\\ 1. Semester",
BScGM1ABWL = "Campusstudiengang\\\\ B.Sc. General Management\\\\1. Semester\\\\ (nur Mathematik und Einführung in die BWL)",
BScGM2 = "Campusstudiengang\\\\ B.Sc. General Management\\\\ 2. Semester",
BScGM3 = "Campusstudiengang\\\\ B.Sc. General Management\\\\ 3. Semester",
BScGM4 = "Campusstudiengang\\\\ B.Sc. General Management\\\\ 4. Semester",
BScGM5 = "Campusstudiengang\\\\ B.Sc. General Management\\\\ 5. Semester",
BScPsy1 = "Campusstudiengang\\\\ B.Sc. Psychologie/Wirtschaftspsychologie\\\\ 1. Semester",
BScPsy2 = "Campusstudiengang\\\\ B.Sc. Psychologie/Wirtschaftspsychologie\\\\ 2. Semester",
BScPsy3 = "Campusstudiengang\\\\ B.Sc. Psychologie/Wirtschaftspsychologie\\\\ 3. Semester",
BScPsy4 = "Campusstudiengang\\\\ B.Sc. Psychologie/Wirtschaftspsychologie\\\\ 4. Semester",
BScPsy5 = "Campusstudiengang\\\\ B.Sc. Psychologie/Wirtschaftspsychologie\\\\ 5. Semester",
BScPsy6 = "Campusstudiengang\\\\ B.Sc. Psychologie/Wirtschaftspsychologie\\\\ 6. Semester",
MAGMWS = "Campusstudiengang\\\\ M.Sc. General Management\\\\ Wintersemester",
MAGM = "Campusstudiengang\\\\ M.Sc. General Management")
studiengang_id <- unlist(strsplit(studiengang_modul_id, "_"))[1]
studiengang <- studiengaenge[[studiengang_id]]
if(nrow(subset(titles, id==studiengang_modul_id, select = title))>0){
title <- paste("Campus\\\\", titles[titles$id==studiengang_modul_id, 2])
}else{
title <- studiengang
}
offsets <- list(BScGM1 = 9, BScGM1ABWL = 9, BScGM2 = 9, BScGM3 = 9, BScGM4 = 9, BScGM5 = 9, BScPsy1 = 9, BScPsy2 = 9, BScPsy3 = 9, BScPsy4 = 9, BScPsy5 = 9, BScPsy6 = 9, MAGM = 10, MAGMWS = 10)
dozentenwahl <- FALSE
dozent <- ""
@
\begin{document}
\title{Evaluation der Vorlesungen\\
\Sexpr{title}
}
\date{
\Sexpr{datum}
}
\author{}
\maketitle
\renewcommand*\contentsname{Vorlesungen}
\setcounter{tocdepth}{1}
\tableofcontents
<<run-all, include=FALSE>>=
# Dateiname
data <-
read.csv(
inFile$datapath, quote = "'\"", na.strings = c("", "\"\""), encoding = "UTF-8"
)
#data <-
# read.csv(
# "data/BScGM1.csv", quote = "'\"", na.strings = #c("", "\"\""), stringsAsFactors =
# FALSE, encoding = "UTF-8"
# )
source("generic_syntax_file.r", encoding = "UTF-8", local = TRUE)
# select complete answers only
data <- data[!is.na(data$submitdate),]
# write.table(head(data[1:8,c(1:3,9:15)]), file = "logger.csv", append = TRUE, sep=",")
fragen <- 25 # questions per module
offset <- offsets[[studiengang_id]] # col number of first module question
spalten <- ncol(data)
module <- (spalten - offset + 1) / fragen
# write.table(c("module: ", module), file = "logger.csv", append = TRUE, sep=",")
library(knitr)
out = NULL
# if "Alle" was selected, analyse all modules
alle_dozenten <- length(unlist(strsplit(studiengang_modul_id, "_"))) == 1
#message(paste("Hi:", alle_dozenten))
#print(paste("Hi:", alle_dozenten))
# analysis per module
for (i in 1:module) {
#for (i in 1:3) {
# only execute knitting if "all" or if module matches
if(alle_dozenten || ((unlist(strsplit(studiengang_modul_id, "_")))[2] == i)){
# special case BScGM1: 2 modules already evaluated
# if(i>1 && studiengang_id == "BScGM1"){
# offset <- 11
# }
# special case BScGM5 Vertiefungsfach
if(i>4 && studiengang_id == "BScGM3"){
offset <- 10
}
# special case BScGM5 Vertiefungsfach
if(i>4 && studiengang_id == "BScGM5"){
offset <- 16
}
# special case BScGM5 Vertiefungsfach
if(i>8 && studiengang_id == "BScPsy3"){
offset <- 13
}
# special case BScGM5 Vertiefungsfach
if(i>18 && studiengang_id == "BScPsy3"){
offset <- 4
}
# 2nd special case MAGM: Vertiefungswahl
if(i>6 && studiengang_id == "MAGM"){
offset <- 16
}
# 2nd special case MAGM: Vertiefungswahl
if(i>8 && studiengang_id == "MAGMWS"){
offset <- 16
}
start <- ((i-1)*fragen)+offset
# write.table(c("start", start), file = "logger.csv", append = TRUE, sep=",")
modulname <- modulnamen$Veranstaltung[modulnamen$Studiengang==studiengang_id][i]
dozent <- modulnamen$Dozent[modulnamen$Studiengang==studiengang_id][i]
dozentenwahl <- modulnamen$Dozentenwahl[modulnamen$Studiengang==studiengang_id][i]
source("label_items.r", encoding = "UTF-8", local = TRUE)
studiengangsdaten <- data[,start:(start+fragen-1)]
# write.table(head(studiengangsdaten[1:5,1:5]), file = "logger.csv", append = TRUE, sep=",")
if((dozentenwahl == 1) && (!alle_dozenten)){
dozent_id <- as.integer((unlist(strsplit(studiengang_modul_id, "_")))[3])
dozent_factor <- paste("A", dozent_id, sep="")
colnames(studiengangsdaten) <- c("k1", "k1a_SQ001","k1a_SQ002", "k1a_SQ003", "k1a_SQ004", "k1a_SQ005", "k1b_SQ001", "k1b_SQ002", "k1b_SQ003", "k1b_SQ004", "k1b_SQ005", "k1b_SQ006", "k1b_SQ007", "k1b_SQ008", "k1b_SQ009", "k1c_SQ001", "k1c_SQ002", "k1c_SQ003", "k1c_SQ004", "k1d_SQ001", "k1d_SQ002", "k1e_SQ001", "k1f", "k1fa", "k1fb")
studiengangsdaten <- studiengangsdaten[studiengangsdaten$k1 == dozent_factor,]
dozent <- (unlist(strsplit(as.character(dozent), ", ")))[dozent_id]
}
studiengangsdaten <- studiengangsdaten[!is.na(studiengangsdaten[,2]),]
if(nrow(studiengangsdaten)==0){
out = c(out, knit_child('keineAntworten.rnw'))
}else{
colnames(studiengangsdaten) <- c("k1", "k1a_SQ001","k1a_SQ002", "k1a_SQ003", "k1a_SQ004", "k1a_SQ005", "k1b_SQ001", "k1b_SQ002", "k1b_SQ003", "k1b_SQ004", "k1b_SQ005", "k1b_SQ006", "k1b_SQ007", "k1b_SQ008", "k1b_SQ009", "k1c_SQ001", "k1c_SQ002", "k1c_SQ003", "k1c_SQ004", "k1d_SQ001", "k1d_SQ002", "k1e_SQ001", "k1f", "k1fa", "k1fb")
for (c in 1:21){
factor(studiengangsdaten[,c], levels = levels(data[,offset+c-1]))
}
out = c(out, knit_child('modulanalyse.rnw'))
}
}
}
@
%\Sexpr{paste(mydebugger, collapse = '\n ')}
\Sexpr{paste(out, collapse = '\n ')}
\end{document}