-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
return {'ok': False, 'msg': result} | ||
return {'ok': True, 'msg': self.success_message} | ||
|
||
def cfn(self, e, ans): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this function is needed for the XBlock version – it looks quite JSInput-specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smarnach Ah, yes - missed that somehow when I was cleaning up. Thanks!
@itsjeyd Looks quite good so far! I did a first pass through the code, and added a few comments. So far I didn't do any manual testing – will do this in the next iteration. |
f8162db
to
0a934ed
Compare
cc17da2
to
a838256
Compare
d14939a
to
273232b
Compare
df52b71
to
06d0cbb
Compare
<span class="reset-label" aria-hidden="true">{% trans "Reset" %}</span> | ||
<span class="sr">{% trans "Reset board to initial state" %}</span> | ||
</button> | ||
<button class="redo" title="Redo"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title
attribute should be translated.
@singingwolfboy I addressed all of your comments. Please let me know if there is anything else you would like me to address. |
raise ValueError | ||
# If we get to this point, it means that vector and point data is valid; | ||
# the only thing left to check is whether data contains a list of checks: | ||
return 'checks' in data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be:
if 'checks' not in data:
raise ValueError
return True
Or do you mean to have this return either True or False?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@singingwolfboy Ah, yes, now that this method raises ValueError
if it comes across invalid data, it doesn't actually need to return True
or False
. So this:
if 'checks' not in data:
raise ValueError
should be enough. Thanks!
I only found one last little issue, and everything else looks good. After you address it, 👍 from me. |
@singingwolfboy That's great, thank you! The fix for the last issue is here: c03551d |
<div id="vectordraw"> | ||
<div class="menu" style="width: {{ self.width }}px;"> | ||
<div class="controls"> | ||
<span class="sr" id="element-list-add-label">{% trans "Select element to add to board" %}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itsjeyd can we make this a label element and change the aria-labelledby attribute below to a for attribute? It's better supported and won't trigger test failures.
@itsjeyd can you make the :focus state on all of the buttons match the :hover state? Currently, there is no way for a keyboard user to know what button the are currently focused on. |
|
||
/* Make sure screen-reader content is hidden in the workbench: */ | ||
.vectordraw_block .sr { | ||
display: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itsjeyd you cannot have display:none on SR text. display none is the same as aria-hidden, so this text is not exposed to a screen reader user. all of the other styles below are effective for exposing it only to screen reader users.
@itsjeyd this is looking great. I love the addition of the properties panel for keyboard only users. I also think it will help users with dexterity issues as well as all users who want to position things precisely. My only suggestion is that some sort of grid can be toggled into view. While attempting to use the manual controls I found it very difficult to position vectors using trial and error. |
👍 |
70abbb5
to
685b588
Compare
685b588
to
461371b
Compare
@cptvitamin Thanks for the feedback! I addressed your comments: 461371b. As for your suggestion about making available a grid to help keyboard users place vectors, this is already available as an opt-in feature. Course authors can set an "Axis" option to "True" in Studio to get something like this: To promote the use of this feature I changed the default for the "Axis" option to "True" (it was disabled by default before) and added a comment to the help text that points out that enabling the option makes an exercise more accessible for keyboard users. It would also be possible to add functionality for toggling the axis on demand but this would require more substantial changes (JSXGraph does not provide an API for toggling the axis after the drawing board has been created), so this is not something we can implement right now (considering that we are close to the merge deadline for this work). Please let me know if there is anything else I should address. |
Mark is out sick today, and possibly tomorrow as well, so I don't think we On Thu, Dec 10, 2015 at 6:31 AM, Tim Krones [email protected]
|
@sarina Oh, that's really unfortunate! We'd really like to get these XBlocks into the release, since the client wants to start using them, and the next release will be in January. Is there anyone who could fill in for Mark? Alternatively, since we already have done a full accessibility review cycle on these XBlocks, addressed Mark's comments and have +1s from the other code reviews, it might be reasonable to just merge them now given the circumstances. If it turns out we need further accessibility tweaks, we could add them later, but things should be looking pretty good already. On the ActiveTable XBlock, there are no open questions left and only a formal +1 is missing, and on this one it's only Tim's last comment that's waiting for an answer from Mark. |
OK, I would be fine with you merging this in, as long as you make certain On Thu, Dec 10, 2015 at 10:08 AM, Sven Marnach [email protected]
|
@sarina Thanks a lot! That's a great relief for us. :) |
@sarina Yes, and we'll make sure to follow up with Mark next week. |
VectorDraw XBlock
This XBlock allows course authors to define vector drawing exercises. To complete a vector drawing exercise, students must correctly place a set of predefined vectors (and points) on a board.
All data associated with this XBlock is stored in XBlock fields. Vectors, points, and expected result for an exercise must be defined using JSON, but we are also planning on adding WYSIWYG functionality to Studio that will allow authors to specify vectors and expected results by drawing them (cf. below). This functionality will not replace existing functionality for specifying elements that are part of the exercise; it will instead be offered as an alternative method for creating content. For a given exercise, student state consists of:
The amount of data to store for an exercise depends on how complex it is (i.e., how many vectors and points there are in total); based on examples from an existing JSInput implementation, it should not exceed 1-2K per problem, per student. Grading happens by comparing the set of elements on the board to a set of conditions specified by the course author ("expected result"). Minimally, this involves checking for each required element whether or not it is present in a given answer. Additional checks may include:
None of these operations are very expensive computationally, and the grader short-circuits as soon as it encounters a failing check (there is currently no notion of a partially correct answer), so we don't expect there to be any performance bottlenecks. We haven't performed any load testing.
We'd like to get this XBlock on edx.org for Davidson College by mid-December.
Testing
Install the XBlock on Devstack via:
Add
vectordraw
to the Advanced Module List in your course settings.Add a "Vector Drawing" block to a unit.
Customize the Vector Drawing block. You can use one of the examples from the jsinput-vectordraw repository (e.g., 2_boxIncline_multiVector) for this purpose. Note that values of "Vectors", "Points", "Expected result" settings need to be valid JSON.
Partner information hosted on edx.org (Davidson College)
Merge deadline mid-December
JIRA Story OSPR-935
Confluence / Product Asset N/A
Sandbox URL LMS (Example), Studio (Example; see author notes below about a known glitch)
Dependencies N/A
PR Author(s) Notes / To-Do
Reviewers