Skip to content

feat: flashcard student view#1

Merged
tpreston2u merged 5 commits intomainfrom
feat--flashcard-student-view
Jul 24, 2023
Merged

feat: flashcard student view#1
tpreston2u merged 5 commits intomainfrom
feat--flashcard-student-view

Conversation

@tpreston2u
Copy link
Copy Markdown
Contributor

@tpreston2u tpreston2u commented Jul 6, 2023

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)

  1. Create a new directory for the xblock to go into and navigate to it (the documentation recommends naming it 'xblock_development').
  2. Clone the gamesxblock repo into the xblock_development directory:
  • gh repo clone edx/gamesxblock
  1. Create and activate a virtual environment inside the xblock_development directory:
  • virtualenv venv
  • source venv/bin/activate
  1. Clone the xblock sdk into the xblock_development directory:
  1. Create an empty directory named 'var' inside the xblock_development directory.
  2. Navigate to the xblock-sdk directory.
  3. Install xblock sdk requirements:
  • make install
  1. Return to the xblock_development directory.
  2. Install the gamesxblock:
  • pip install -e gamesxblock
  1. Create the SQLite database before running the xblock sdk
  • python xblock-sdk/manage.py migrate
  1. Run the xblock sdk server:
  • python xblock-sdk/manage.py runserver
  1. Navigate to http://localhost:8000 and select 'gamesblock' or 'Multiple GamesXBlock.'

Copy link
Copy Markdown

@connorhaugh connorhaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Comment thread games/games.py
#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):
Copy link
Copy Markdown

@connorhaugh connorhaugh Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread games/games.py Outdated
"""

#flip term_is_visible first to show definition
self.term_is_visible = not(self.term_is_visible)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Comment thread games/__pycache__/games.cpython-38.pyc Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure to not to include pyc files. In future commits you can ignore .pyc files by creating a .gitignore file

Copy link
Copy Markdown

@rayzhou-bit rayzhou-bit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need to make the changes Connor pointed out and it looks good to me!

@tpreston2u tpreston2u merged commit d9c5c66 into main Jul 24, 2023
@papphelix papphelix deleted the feat--flashcard-student-view branch November 21, 2025 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants