Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crowdsourcehinter
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
crowdsourcehinter
Commits
2db65fe0
Commit
2db65fe0
authored
Aug 26, 2014
by
Piotr Mitros
Committed by
Piotr Mitros
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated a few comments
parent
d94f2cf5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
crowdxblock/crowdxblock.py
+22
-20
No files found.
crowdxblock/crowdxblock.py
View file @
2db65fe0
...
...
@@ -19,35 +19,36 @@ class CrowdXBlock(XBlock):
that specifically address their mistake. Additionally, the hints that this Xblock shows
are created by the students themselves. This doc string will probably be edited later.
"""
hint_database
=
Dict
(
default
=
{:
{}},
scope
=
Scope
.
user_state_summary
)
# database of hints. hints are stored as such: {"incorrect_answer": {"hint": rating}}. each key (incorrect answer)
# Database of hints. hints are stored as such: {"incorrect_answer": {"hint": rating}}. each key (incorrect answer)
# has a corresponding dictionary (in which hints are keys and the hints' ratings are the values).
HintsToUse
=
Dict
({},
scope
=
Scope
.
user_state
)
#
t
his is a dictionary of hints that will be used to determine what hints to show a student.
hint_database
=
Dict
(
default
=
{:
{}},
scope
=
Scope
.
user_state_summary
)
#
T
his is a dictionary of hints that will be used to determine what hints to show a student.
# flagged hints are not included in this dictionary of hints
WrongAnswers
=
List
([]
,
scope
=
Scope
.
user_state
)
#
t
his is a list of incorrect answer submissions made by the student. this list is mostly used for
HintsToUse
=
Dict
({}
,
scope
=
Scope
.
user_state
)
#
T
his is a list of incorrect answer submissions made by the student. this list is mostly used for
# feedback, to find which incorrect answer's hint a student voted on.
DefaultHints
=
Dict
(
default
=
{},
scope
=
Scope
.
content
)
#
a
dictionary of default hints. default hints will be shown to students when there are no matches with the
WrongAnswers
=
List
([],
scope
=
Scope
.
user_state
)
#
A
dictionary of default hints. default hints will be shown to students when there are no matches with the
# student's incorrect answer within the hint_database dictionary (i.e. no students have made hints for the
# particular incorrect answer)
Used
=
List
([],
scope
=
Scope
.
user_state
)
#
l
ist of which hints from the HintsToUse dictionary have been shown to the student
DefaultHints
=
Dict
(
default
=
{},
scope
=
Scope
.
content
)
#
L
ist of which hints from the HintsToUse dictionary have been shown to the student
# this list is used to prevent the same hint from showing up to a student (if they submit the same incorrect answers
# multiple times)
Voted
=
List
(
default
=
[],
scope
=
Scope
.
user_state
)
#
t
his list is used to prevent students from voting multiple times on the same hint during the feedback stage.
Used
=
List
(
[],
scope
=
Scope
.
user_state
)
#
T
his list is used to prevent students from voting multiple times on the same hint during the feedback stage.
# i believe this will also prevent students from voting again on a particular hint if they were to return to
# a particular problem later
Flagged
=
Dict
(
default
=
{},
scope
=
Scope
.
user_state_summary
)
#
t
his is a dictionary of hints that have been flagged. the keys represent the incorrect answer submission, and the
Voted
=
List
(
default
=
[],
scope
=
Scope
.
user_state
)
#
T
his is a dictionary of hints that have been flagged. the keys represent the incorrect answer submission, and the
# values are the hints the corresponding hints. even if a hint is flagged, if the hint shows up for a different
# incorrect answer, i believe that the hint will still be able to show for a student
Flagged
=
Dict
(
default
=
{},
scope
=
Scope
.
user_state_summary
)
def
student_view
(
self
,
context
=
None
):
"""
This function defines which files to access when a student views this xblock.
This view renders the hint view to the students. The HTML has the hints templated
in, and most of the remaining functionality is in the JavaScript.
"""
html
=
self
.
resource_string
(
"static/html/crowdxblock.html"
)
frag
=
Fragment
(
html
.
format
(
self
=
self
))
...
...
@@ -58,8 +59,9 @@ class CrowdXBlock(XBlock):
def
studio_view
(
self
,
context
=
None
):
"""
This function defines which files to access when an instructor views this xblock through the
studio view (and click "edit"). The only difference from student_view is the html script.
This function defines a view for editing the XBlock when embedding it in a course. It will allow
one to define, for example, which problem the hinter is for. It is unfinished and does not currently
work.
"""
html
=
self
.
resource_string
(
"static/html/crowdxblockstudio.html"
)
frag
=
Fragment
(
html
.
format
(
self
=
self
))
...
...
@@ -77,10 +79,10 @@ class CrowdXBlock(XBlock):
@XBlock.json_handler
def
clear_temp
(
self
,
data
,
suffix
=
''
):
"""
t
his clears all temprorary lists/dictionaries. This may not be relevant any longer
"""
TODO: Remove or fix.
T
his clears all temprorary lists/dictionaries. This may not be relevant any longer
but is intended to prevent hints from messing up when changing between units within
a section
a section
.
"""
remove_list
=
[]
# a list is used to systematically remove all key/values from a dictionary.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment