Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Hsin-Yu Chien
edx-platform-release
Commits
5185df38
Commit
5185df38
authored
12 years ago
by
Александр
Browse files
Options
Downloads
Patches
Plain Diff
continue vsepr grading
parent
94b70fd8
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
common/lib/capa/capa/chem/chemtools.py
+8
-0
8 additions, 0 deletions
common/lib/capa/capa/chem/chemtools.py
with
8 additions
and
0 deletions
common/lib/capa/capa/chem/chemtools.py
+
8
−
0
View file @
5185df38
from
collections
import
OrderedDict
def
vsepr_parse_user_answer
(
user_input
):
d
=
OrderedDict
(
eval
(
user_input
))
d
[
'
atoms
'
]
=
OrderedDict
(
sorted
(
d
[
'
atoms
'
].
items
()))
return
d
def
vsepr_build_correct_answer
(
geometry
,
atoms
):
correct_answer
=
OrderedDict
()
correct_answer
[
'
geometry
'
]
=
geometry
...
...
@@ -9,6 +15,8 @@ def vsepr_build_correct_answer(geometry, atoms):
def
vsepr_grade
(
user_input
,
correct_answer
):
print
user_input
,
type
(
user_input
)
print
correct_answer
,
type
(
correct_answer
)
if
user_input
[
'
geometry
'
]
!=
correct_answer
[
'
geometry
'
]:
return
False
if
user_input
[
'
atoms
'
].
values
()
!=
correct_answer
[
'
atoms
'
].
values
():
...
...
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