feat: flashcard student view#1
Conversation
connorhaugh
left a comment
There was a problem hiding this comment.
Hey! awesome work on this! I have a few questions/suggestions/hints from a python perspective that may or may not be helpful. I haven't tested your code, but great start!
| #May need to import more or less field types later (https://github.com/openedx/XBlock/blob/master/xblock/fields.py) | ||
| from xblock.fields import Integer, Scope, String, Boolean, List#, Dict | ||
|
|
||
| class GamesXBlock(XBlock): |
There was a problem hiding this comment.
In my head, I assumed that this was going to be three xblocks:
- A generic GamesXblock
- A FlashCard Xblock (which inherits from GamesXblock)
- A Matching Game (which inherits from GamesXblock)
I would imagine that the two might share a lot of fields, but have key differences. Can you talk a little about why you made the choice to go about it this way? (doing it as one xblock?)
There was a problem hiding this comment.
Ray and I based our decision to use one xblock on the way the capa block was implemented. From what we can tell, the capa block doesn't use inheritance for the different problem types. Our biggest motivator to keep them in one xblock is that each xblock will exist within its own folder if we separate them. We are always open to any further input though.
| """ | ||
|
|
||
| #flip term_is_visible first to show definition | ||
| self.term_is_visible = not(self.term_is_visible) |
There was a problem hiding this comment.
| self.term_is_visible = not(self.term_is_visible) | |
| if self.term_is_visible: | |
| self.term_is_visible = not(self.term_is_visible) | |
| return {'image': self.list[self.list_index]['definition_image'], 'text': self.list[self.list_index]['definition']} | |
| else: | |
| self.term_is_visible = not(self.term_is_visible) | |
| return {'image': self.list[self.list_index]['term_image'], 'text': self.list[self.list_index]['term']} |
This will keep the logic a little cleaner and more readable
There was a problem hiding this comment.
make sure to not to include pyc files. In future commits you can ignore .pyc files by creating a .gitignore file
rayzhou-bit
left a comment
There was a problem hiding this comment.
Just need to make the changes Connor pointed out and it looks good to me!
The gamesxblock flashcard student view.
Testing Information:
You will need to install the xblock sdk in order to view the xblock. The following steps reference the xblock documentation on readthedocs.io (https://edx.readthedocs.io/projects/xblock-tutorial/en/latest/getting_started/prereqs.html)