Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
decker-production
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
HCI-Development
decker-production
Commits
c73afd65
Commit
c73afd65
authored
8 years ago
by
Henrik Tramberend
Browse files
Options
Downloads
Patches
Plain Diff
Do not generate exams for failed students
parent
04455317
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/tester.hs
+17
-1
17 additions, 1 deletion
app/tester.hs
with
17 additions
and
1 deletion
app/tester.hs
+
17
−
1
View file @
c73afd65
...
...
@@ -164,6 +164,7 @@ buildExam projectDir disposition examSource questionSources out = do
need
[
examSource
]
putLoud
"Reading questions ..."
questions
<-
readQuestions
questionSources
putNormal
$
"# Questions: "
++
show
(
length
questions
)
putLoud
"Reading exam data ..."
exam
<-
readExamData
examSource
let
studentInfoPath
=
...
...
@@ -171,10 +172,14 @@ buildExam projectDir disposition examSource questionSources out = do
projectDir
(
takeDirectory
examSource
)
(
examStudentInfoFile
exam
)
let
failedStudentPath
=
projectDir
</>
"grading/failed-students.yaml"
putLoud
"Reading students ..."
Students
studentMap
<-
readStudentInfo
studentInfoPath
(
examTrack
exam
)
failedStudents
<-
readFailedStudents
failedStudentPath
putLoud
"Generating exam ..."
let
examData
=
generateExam
exam
questions
(
Map
.
elems
studentMap
)
let
successful
=
filterFailed
failedStudents
studentMap
let
examData
=
generateExam
exam
questions
$
Map
.
elems
$
successful
putNormal
$
"# Students: "
++
show
(
Map
.
size
successful
)
putLoud
"About to show exam data ..."
putLoud
"Compiling templates ..."
templates
<-
compileTemplates
disposition
...
...
@@ -183,6 +188,11 @@ buildExam projectDir disposition examSource questionSources out = do
putLoud
"Compiling PDF ..."
compilePandocPdf
examPandoc
out
filterFailed
::
[
T
.
Text
]
->
Map
.
HashMap
T
.
Text
Student
->
Map
.
HashMap
T
.
Text
Student
filterFailed
failed
students
=
foldl
(
flip
Map
.
delete
)
students
failed
compileTemplates
::
FilePath
->
Action
MT
.
TemplateCache
compileTemplates
disposition
=
do
let
templateNames
=
...
...
@@ -431,6 +441,12 @@ readStudentInfo path track = do
"Students in track "
++
show
track
++
": "
++
show
(
length
trackStudents
)
return
$
Students
trackStudents
-- Reads list of failed students
readFailedStudents
::
FilePath
->
Action
[
T
.
Text
]
readFailedStudents
path
=
do
need
[
path
]
readYAML
path
-- Reads all the questions and returns them along with the base directory of
-- each.
readQuestions
::
[
FilePath
]
->
Action
[(
Question
,
FilePath
)]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment