Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Python3 Automarker
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
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
Show more breadcrumbs
David Paul
Python3 Automarker
Commits
34a3930f
Commit
34a3930f
authored
8 years ago
by
David Paul
Browse files
Options
Downloads
Patches
Plain Diff
Update exercises after student feedback
parent
5922d5c5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
exercises.py
+9
-9
9 additions, 9 deletions
exercises.py
with
9 additions
and
9 deletions
exercises.py
+
9
−
9
View file @
34a3930f
...
...
@@ -46,14 +46,14 @@ exercise.code = "weight = {} #TODO: Initialise weight with correct values\navai
exercise
.
tests
=
[
Test
(
"
Weight calculation
"
,
"
Overall weight: 310
\n
"
)]
exercise
.
checks
=
[
Check
(
"
You should use a for loop to loop over all keys in one of the dictionaries
"
,
"
for
"
),
Check
(
"
You should calculate the value
"
,
"
310
"
,
True
),
Check
(
"
You need to specify the correct weights in a dictionary
"
,
"
\"
pencil
\"
:(
\\
s)+10
"
),
Check
(
"
You need to specify the correct weights in a dictionary
"
,
"
\"
pen
\"
:(
\\
s)+20
"
),
Check
(
"
You need to specify the correct weights in a dictionary
"
,
"
\"
paper
\"
:(
\\
s)+4
"
),
Check
(
"
You need to specify the correct weights in a dictionary
"
,
"
\"
eraser
\"
:(
\\
s)+80
"
),
Check
(
"
You need to specify the correct availability in a dictionary
"
,
"
\"
pen
\"
:(
\\
s)+3
"
),
Check
(
"
You need to specify the correct availability in a dictionary
"
,
"
\"
pencil
\"
:(
\\
s)+5
"
),
Check
(
"
You need to specify the correct availability in a dictionary
"
,
"
\"
eraser
\"
:(
\\
s)+2
"
),
Check
(
"
You need to specify the correct availability in a dictionary
"
,
"
\"
paper
\"
:(
\\
s)+10
"
)]
Check
(
"
You need to specify the correct weights in a dictionary
"
,
"
[
\"
'
]
pencil
[
\"
'
]
:(
\\
s)+10
"
),
Check
(
"
You need to specify the correct weights in a dictionary
"
,
"
[
\"
'
]
pen
[
\"
'
]
:(
\\
s)+20
"
),
Check
(
"
You need to specify the correct weights in a dictionary
"
,
"
[
\"
'
]
paper
[
\"
'
]
:(
\\
s)+4
"
),
Check
(
"
You need to specify the correct weights in a dictionary
"
,
"
[
\"
'
]
eraser
[
\"
'
]
:(
\\
s)+80
"
),
Check
(
"
You need to specify the correct availability in a dictionary
"
,
"
[
\"
'
]
pen
[
\"
'
]
:(
\\
s)+3
"
),
Check
(
"
You need to specify the correct availability in a dictionary
"
,
"
[
\"
'
]
pencil
[
\"
'
]
:(
\\
s)+5
"
),
Check
(
"
You need to specify the correct availability in a dictionary
"
,
"
[
\"
'
]
eraser
[
\"
'
]
:(
\\
s)+2
"
),
Check
(
"
You need to specify the correct availability in a dictionary
"
,
"
[
\"
'
]
paper
[
\"
'
]
:(
\\
s)+10
"
)]
exercises
.
append
(
exercise
)
# Exercise 5
...
...
@@ -76,7 +76,7 @@ exercise.tests = [Test("a", "Enter a word/phrase to check: a\na is a palindrome\
Test
(
"
racecar
"
,
"
Enter a word/phrase to check: racecar
\n
racecar is a palindrome
\n
"
,
"
racecar
"
),
Test
(
"
Anna
"
,
"
Enter a word/phrase to check: Anna
\n
Anna is not a palindrome
\n
"
,
"
Anna
"
)]
exercise
.
checks
=
[
Check
(
"
You should use len to check the length of the string
"
,
"
len
\\
(
"
),
Check
(
"
You need to make a recursive call to is_palindrome
"
,
"
return(
\\
s)+is_palindrome
\\
(
"
),
Check
(
"
You need to make a recursive call to is_palindrome
"
,
"
return(
\\
s)+
(.)*
is_palindrome
\\
(
"
),
Check
(
"
You need a base case in your recursive function
"
,
"
return(
\\
s)+[^i][^s]
"
)]
exercises
.
append
(
exercise
)
...
...
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