Closed symbolist closed 5 years ago
There are some existing XBlock conventions that I'd like you to use here please:
def student_view_data(self, context=None):
(dndv2 example, video example)
v1_student_view_data
handler that can retrieve this data, but the underlying methods should follow the existing API as documented in the edX wiki and implemented in existing blocks. However, I can probably add a method to get this data to the new runtime quite easily, in which case we won't need the v1_student_view_data
handler at all.student_view_context
to student_view_data
student_view_data
since that is aggressively cached in a user-agnostic way. Instead, convention is for such data to be in an XBlock handler called student_view_user_state
- see this drag and drop v2 example, problem-builder, and xblock-poll@bradenmacdonald I have made the following changes:
student_view_context()
to student_view_data()
.student_view_user_state()
.@symbolist Code looks good now, thanks! I will test this together with the other PR and then approve.
Test notes:
git clone git@github.com:open-craft/labxchange-xblocks.git
make studio-shell
, pip install -e /edx/src/labxchange-xblocks/
, make studio-restart
make lms-shell
, pip install -e /edx/src/labxchange-xblocks/
, make lms-restart
./manage.py lms generate_course_blocks --courses 'course-v1:LX+XB+TEST' --force_update
:+1: for what you have so far.
@ormsbee I have sent you an invite to a course with these XBlocks setup. Let me know whenever you signup and I can add you as course staff.
@symbolist: Did the signup, username dave
@ormsbee Added to course team.
One note: there is very little styling included. Adding it via the LX frontend to avoid need to bump up this package version whenever we tweak anything.
Hmm. Looks like the import did not work correctly.
@ormsbee Okay, so I was in the middle of a rebase when I exported and so the archive was missing the olx. I have created another course with the content and invited you as course staff.
Sorry for the inconvenience!
@ormsbee Let me know whenever you have completed your testing and I can merge this.
@symbolist: Simulation box size seems a bit small, but that's out of the scope of my concerns. LGTM in terms of merging. Thank you.
@ormsbee Yes, simulations do not fit in the courseware width. We show them in a large modal in the LX interface.
Adds the following XBlocks: