Question about XBlock Fields

22 views
Skip to first unread message

Ethan C

unread,
Dec 5, 2016, 9:51:26 AM12/5/16
to General Open edX discussion
Hi everyone, 

I've been trying to create a way for administrators to upload a python problem to my xblock. To preface, I'm creating an xblock (https://github.com/ethanchewy/pybuddy) that does live syntax checking for python programming.

I'm trying to program a way for instructors to easily create and customize their Python problems for students. My end goal is to make it so easy that an instructor can simply copy and paste a python problem in a text box and my xblock takes that data and displays it with all the correct formatting (new lines & tabs). I'm not sure how to do that. I tried looking for examples in various existing XBlocks as well as the XBlock documentation but couldn't find anything.

I also looked at Xblock's field states and I know I can create a state where the instructor could set the data. I currently implemented it this way: https://github.com/ethanchewy/pybuddy/blob/master/pybuddy/pybuddy.py#L32-L41 . Right now, instructors would have to use unicode 
 for new lines and 	 for tabs. Am I supposed to program something in edX Studio? Is there any good example out there which shows a good way of programming a way for administrators to submit code with formatting.

Any help would be highly appreciated!

Cheers,
Ethan Chiu
Reply all
Reply to author
Forward
0 new messages