-
-
Notifications
You must be signed in to change notification settings - Fork 223
Fix: Provide a more functional, usable fill-in-the-blank question. #412
Conversation
bnmnetp
left a comment
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.
Could you update the test source in test/_sources/index.rst to use the new syntax. We are running all of the new tests on our Jenkins server and this one will unless the sources is updated.
| # A string of reStructuredText that will be included at the beginning of every | ||
| # source file that is read. | ||
| rst_prolog = ( | ||
| # For fill-in-the-blank questions, provide a convenient means to indicate a blank. |
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.
Existing books will need to update their conf.py in order to get this. We'll need to do that for pip, thinkcspy, pythonds, etc.
Although if I understand this correctly an author is free to use :blank:foo if they want.
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.
Yes, that's correct; any form of :blank:`foo` (where foo can be anything) works. Would you like me to submit PRs for these books? Or would you prefer to edit them yourself?
|
Re; |
|
ready to merge this as soon as test/.../index.rst is updated for fitb. Thanks! |
| this.feedbackArray = JSON.parse(this.scriptSelector(this.origElem).html()); | ||
|
|
||
| this.createFITBElement(); | ||
| this.checkServer("fillb"); |
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 creating a checklist/writing up a document on writing a component...
You should check for the existence of a sid key in the opts passed to the constructor. If sid is populated (as it will be for grading) then checkServer will do the right thing in the grading interface with respect to populating the correct answer.
In fact the right way to do this is to add an init to RunestoneBase that takes care of this for everything and then make sure that each component calls RunestoneBase.prototype.init.apply(this, arguments)
Note I just wrote this... And I'll push a new runestonebase.js to master momentarily.
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.
Sounds good! Done in 11d9059.
|
I'll work on updating the tests! |
|
Great shouldn't take you long, you should only need to update index.rst in fitb/test |
Docs: Clarify, remove old material.
Fix: Make tests run cross-platform, instead of relying on a bash script.
|
I refactored the test framework to make it cross-platform, and DRY the code. FITB tests pass when using the Chrome driver, but not under PhantomJS -- for some reason, the PhamtomJS driver doesn't transform the HTML on the page into question format (by running code in fitb.js), while Chrome does. ??? I'm not sure if this fails on other platforms or not. I've only tested under Windows. On Windows/Chrome, I see two test failures. Do these fail on other OSes? |
|
If I try to run the tests individually, for example I'm guessing this is somehow related to your |
|
Bryan, One more thing... We need to keep the Runestone Components compatible with both Python 2.7 and 3.x |
|
To run tests on just one question type, Re: Python 3, oops! I'm spoiled with my shiny new syntax. I'll fix. |
|
OK, fixed pushed. On Python 2.7, all tests pass (Chrone driver) except one dnd test. |
|
I ran the tests under Python 2.7 and Python 3.6 on upstream/master, and got the same test failures as reported above. Do these fail on Linux as well? |
|
When I run this on macOS I get 1 fail and 43 errors. I'm trying to figure out if its a problem with phantoms or what. But its hard to debug because the only way I can get the tests to run AT ALL is to run the top level script. I get import errors when I try to run a single test. |
|
Changing to Allows me to run the script from the local test directory with the line:
Once I finally got my old version of chromedriver out of the way all of the fitb tests ran successfully on my mac. I think we ought to consider the absolute syntax rather than the indirect syntax for the import statements so that we can run the tests individually. This would be the most common mode for development I would think. |
|
@bjones1 don't change the imports. I've just done it on my local copy of your PR. I'll merge with master and accept if we get same test results. Then we'll see what happens on Jenkins with the CI kicks in. |
|
Thanks for the merge. However, I'm certainly in favor of making testing easier -- I'd be very happy to use absolute imports. |
|
Good, since I made the change 😄 In other news, the failure and the error were both problems. One was where I had mis-placed a close div tag in the dragndrop directive. A second came from your refactoring where we lost the import of With those fixes ALL tests are now passing with the Chrome driver. Hopefully they all pass with the PhantomJS driver on windows too. In order to help us actually SEE the problems uncovered I've also added a line so that Its all pushed so if you have a moment, grab the changes and run all the tests on windows with PhantomJS and let me know how it goes. |
|
Whoops -- sorry for injecting a bug. I'm glad that the tests caught this, plus another problem. The PhantomJS drivers on Windows still fail the tests, however. I'm not sure what's going on there, but I'll just use Chrome instead. |
|
No worries. That is what the tests are there for. It also seems that we can use Chrome in a headless mode. Which would allow us to use it instead of PhantomJS for CI testing. |
|
Ah, very nice. I trust Chrome a bit more than PhamtomJS, as well... |
This implements the changes discussed in #405, plus adds a few new features and bug fixes. The final form: