-
-
Notifications
You must be signed in to change notification settings - Fork 223
Add: Dynamic problems for fitb questions. #1029
Conversation
| dynamic = self.options.get("dynamic") | ||
| if dynamic: | ||
| # Make sure we're server-side. | ||
| if not env.config.runestone_server_side_grading: |
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.
rats
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.
That's always my preference :). Of course, this is also how WebWork operates. Especially if we want to do symbolic math, linear algebra, etc., the code base for Python / server-side programs is more mature than JS.
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 we are in competition with webwork. There are things we can emulate from WebWork and there are things we can learn. My preference is always to push as much of the work as possible to the client, and for basic stuff it seems like it would be very easy to make it work in Javascript as well as Python.
That said, I really like the concept, I think we could do a lot with it.
I've not seen multi-line values for directives.unchanged before. That looks a little wonky, I assume the indentation is important there?
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'm not trying to compete with Webwork, but to take ideas / design inspiration from a proven system. I agree that client-side is nice to support, and for basic problems should have all the features. However, trying to support both server-side and client-side seems hard, since the two languages (Python and JavaScript) are fundamentally different animals.
I played with multi-line values for the directive. Correct, they must be indented. More restrictively, there must be no blank lines (although a line with only a comment character can work around that). Perhaps we could also have a =================== then have the code after that, which is think is what ActiveCode uses?
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.
...but thinking about this, if the client-side code is still possible using skulpt, correct? So we could potentially send Python to the browser, then use it there to check answers? We'd also have to do template replacement (e.g. {{=a}}, but that seems do-able.
...even more, what if all question types that run either client-side or server-side do all answer checking in Python? Currently, fitb has answer checking written in both languages, which is not great...
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.
It could work, the sad thing about skulpt is that it was never designed so that you could have skulpt run some python and return a result to Javascript. The way skulpt and Javascript communicate (if at all) is through the DOM.
I think we need more discussion on this. The server side stuff has a lot of benefit, but the fact is that most authors do not install a full runestone server, which makes writing stuff that relies on having a full server difficult.
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'd be happy to think more. To me, the core design question is: what language should dynamic problems be written in? Ideally, it would be a language that would execute in the same way on both client and server. Node.js and JavaScript are close, but these don't easily play with our Python-based server. If it is too hard to get Skulpt to talk with JS, perhaps Transcrypt?
ebf3b02 to
c895d19
Compare
|
Thoughts on improvements from today's conference call:
|
|
On a side note, do we ever seed the Python RNG somewhere in our web2py code? If so, I can't find it. I assume we should be doing this... |
|
Never mind. It looks like Python does it automatically when |
|
I've seen mention of things like pyv8 that provide python bindings that allow you to evaluate javascript from python rather easily. However they seem to have fallen out of fashion as many of them seem old and/or unmaintained. I do think the disparity between the |
|
Hmmm. So is the goal to do dynamic problems client-side, or assume use of |
|
There are many goals. 😄 And, I don't mean to pick on dynamic questions, it is just the proverbial straw that broke the camels back in this case. Both you and I want to do what we can to encourage more authors to use Runestone. I'm just trying to point out that we have unintentionally created another point of friction with several features:
All are good things, but the One solution would be to expand |
|
I agree re: Another approach: distribute the server as a Dockerized application? |
6a242cb to
b25264a
Compare
|
Given the progress on the bookserver, I'd like to revisit this. Would you re-consider this PR given that we can currently distribute web2py in Docker with everything necessary for server-side grading, plus the new bookserver will make it easy to install and run the backend in the future? |
…eComponents into bookserver
Fix: Use consistant naming between ajax and db tables.
…eComponents into bookserver
Fix: Match name sent to server with table name in db for dnd.
d2a09f0 to
5b85683
Compare
|
Closed in favor of #1225. |
This enables dynamic problems for fitb questions -- a quick, MVP pass.