Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Bradley Miller
    @bnmnetp
    I’m guessing the fitb example in overview.rst needs to be updated?
    Isaiah Mayerchak
    @flysaiah
    The fitb directive is correct under the timed exam section, but the regular one is indeed incorrect. I'm not sure how we missed that one, but we'll update that when we do our pull request of Dragndrop.
    Bradley Miller
    @bnmnetp
    Could you do an update to the overview.rst doc and add an example for both the clickablearea and dragndrop components?
    Isaiah Mayerchak
    @flysaiah
    Yes.
    Isaiah Mayerchak
    @flysaiah
    After looking at overview.rst again, I found that the fitb example actually isn't incorrect--the error that you're getting on build is because there used to be a "textfield" role that was defined in textfield.py that we assumed was only used for fill in the blank questions--do we need to re-add this role or is it irrelevant now that we use the new fitb directive? We're updating overview now to include dragndrop and clickablearea.
    There is a "textfield" role being defined in overview.rst for an activecode demonstration--that's where the error is showing up.
    Bradley Miller
    @bnmnetp
    Aha, yes. So the textfield role should be put back into the python code for use with rst and Sphinx but there is no reason to worry about it from an RSE-0001 perspective.
    Isaiah Mayerchak
    @flysaiah
    Got it--we'll have a pull request ready with an updated overview.rst in a few minutes--we just have one small bug to iron out first.
    Isaiah Mayerchak
    @flysaiah
    The pull request has been made.
    Bradley Miller
    @bnmnetp
    @flysaiah on the drag and drop, the thing that I try to drag does not move when I drag. It drops when I let go of the mouse but that is not very intuitive. It used to drag...
    Bradley Miller
    @bnmnetp
    To clarify… the non-dragging behavior happens in Safari 9.0 but works fine in Chrome and Firefox… 9.0 is beta so if you could test it in your safari just to see...
    Question @flysaiah @riknos314 do the new dragndrop and clickablearea question types work inside the Timed Exam?
    If not, they should...
    Isaiah Mayerchak
    @flysaiah
    We'll look at the behavior in Safari, and getting both question types to work in Timed--currently it supports only MC and FITB.
    Isaiah Mayerchak
    @flysaiah
    Timed now supports the new components--however, in order to let it support them we either need to have timed.js loaded after all of its supported components' JS files, or we need a separate JS file that has the document.ready functions that will just be loaded after everything. We were leaning towards the second option, but we were wondering where we should put this separate auxiliary file, because it isn't really a part of any component and it depends on the other components, so common isn't really an intuitive place.
    Isaiah Mayerchak
    @flysaiah
    To clarify: timed.js needs to have all of the document.ready functions for all of its possible nested components inside timed.js, as well as having all of its possible nested components' respective JS files loaded before it, OR we need a separate JS file that just has the document.ready functions loaded after everything.
    Isaiah Mayerchak
    @flysaiah
    Also, we have confirmed that the dragged item is not being shown in Safari 8.0 as well. We're not sure why yet because Safari states that it supports HTML5 drag and drop functionality.
    Bradley Miller
    @bnmnetp
    Just as a thought, could the document.ready functions be triggered from a custom event that is created in timed.js ? Similar to what I did with the login/logout events? Is timed.js always loaded ? Or is it only loaded when the timed component is used?
    Kirby Olson
    @riknos314
    The problem with timed is that for the questions inside of a timed assessment, the constructor method for that component is called by timed. However, the document.onready function for say multiple choice will call the constructor method of all MC questions on the page, even if they are inside of a timed element, thus causing the timed element to not work. We just need to make sure that all instances of timed are fully converted from the intermediate html before the non-timed elements are, otherwise the timed assessments won't have any questions in them.
    If you take a quick look at the function in timed.js at line 250 the problem of the questions being converted prematurely becomes obvious
    Bradley Miller
    @bnmnetp
    Could the the constructor for multiple choice and take an extra parameter to indicate it is being called from timed? if that parameter is not there AND the component has data-timed set then the constructor would know not to do anything?
    Kirby Olson
    @riknos314
    Isaiah and I just decided that we think a more elegant solution would be to add an if statement to the document.onready function that would only call the constuctor methods of elements whose parent node isn't a timed element.
    Bradley Miller
    @bnmnetp
    Yep, that sounds like a good solution
    Isaiah Mayerchak
    @flysaiah
    Also--we fixed the safari problem; apparently Safari doesn't support drag-n-drop with any elements that are display:inline-block, so we had to modify our css rules to change our divs to inline with a float:left attribute. It works in Chrome, Firefox and Safari now.
    Bradley Miller
    @bnmnetp
    good work
    Kirby Olson
    @riknos314
    As we keep making more components have parts that depend on other components, such as allowing clickable area and drag n drop in timed assessments, it is getting harder and harder for us to figure out how to get sphinx to place the javascript files in an order that satisfies all of the dependencies created. Would it be possible for you to come in tomorrow so we can work on figuring out a method of resolving these dependencies as we move forward?
    Bradley Miller
    @bnmnetp
    We can do a hangout and brainstorm about this tomorrow. But, I have been thinking about this problem in the back of my mind. And I want to say that the real solution is to make the components smart enough that the order of the js files does not matter.
    Kirby Olson
    @riknos314
    I believe that currently they are order agnostic with the exception of needing the file with the constructor method of the component to come before any file that calls that constructor method.
    I'm not sure how we'd get around this because you can instantiate a prototype that hasn't yet been defined.
    *can't
    Isaiah Mayerchak
    @flysaiah
    One solution that we just tested is we added a new directory in RunestoneComponents that just has an init.py that adds all of our custom javascript files in the order we want. The other init.py files of each respective component still add their directives/css/etc, but we moved all of the addjavascript calls to our masterJS _init.py----it's a little hacky, but it solves all of our JS order problems for now and the future as well. What do you think of this?
    add_javascript*
    Bradley Miller
    @bnmnetp
    The constructor issue should not be a problem because all of the javascript files will be loaded before the document.ready event happens.
    putting all of the javascript into a separate __init__.py file is an OK solution if we really need to control the ordering. It kind of breaks the modularity of each component, but I guess in some cases that might be unavoidable as ultimately they work together and are interdependent.
    Kirby Olson
    @riknos314
    The ordering problem comes when one prototype expands upon another prototype, the prototype that is being expanded upon must be defined before the prototype that is expanding upon it.
    Kirby Olson
    @riknos314
    For instance, in the new timed implementation we have a class called timedMC which contains the timed-specific methods for the MC prototype. The timedMC prototype inherits the prototype of the MC class, then adds/overwrites some methods to make it work in a timed assessment. Since timedMC has line timedMC.prototype = new MultipleChoice(); as part of the declaration of the prototype (outside of a document.ready event), the file containing the MultipleChoice prototype must come before the file with the timedMC prototype.
    Isaiah Mayerchak
    @flysaiah
    We just found a better solution that doesn't require the master-js-adding python file, so the modularity of each component will still be preserved.
    Bradley Miller
    @bnmnetp
    Had some feedback from Barb on the clickableArea directive. She would also like to be able to provide an image or images and have them select. Or give a 2D array and have them click in the proper cell.
    Any thoughts? Would an clicking on an image be a separate component? Could we make the container a div instead of a pre so that any arbitrary html like an image or td could be clickable?
    Isaiah Mayerchak
    @flysaiah
    It's possible that we could implement stuff like tables into the current component, but doing a clickable image where someone can click different parts of an image is most likely going to have to be in a different component, just because all of the methods for processing it/evaluating it are going to be completely different. We need some time to think it through, though.
    Unless she's thinking of choosing between multiple images, and only being able to click an image as a whole (instead of different parts of the same image)--that would probably be doable in our current component with minimal tweaking.
    Bradley Miller
    @bnmnetp
    So, if we can put things (including images) into a table and pick from the table then Barb is probably happy. — so we can avoid picking parts of the same image.
    Isaiah Mayerchak
    @flysaiah
    Ok. I think that can still work with the current component--I'll probably add a data-table option that will allow for that functionality.
    (In the intermediate HTML)
    Isaiah Mayerchak
    @flysaiah
    So, am I right in thinking that what we're doing now is making an option that allows the author to create a table and designate certain table cells as being clickable?
    Bradley Miller
    @bnmnetp
    That is one way to approach it. The other way would be to make the clickablearea component flexible enough that it is a container, and any embedded html element could be clickable.
    Isaiah Mayerchak
    @flysaiah
    We'll do the second approach--that sounds much better.
    Bradley Miller
    @bnmnetp
    @riknos314 I see what you mean now about webpack and its namespace limitations. I think this is a big problem for us as we can’t control what other .js files people may use on their website.
    Kirby Olson
    @riknos314
    It is unfortunate. I haven't looked into whether or not using the AMD style modules has the same namespacing as the commonJS conventions, but I'm not hopeful.
    Bradley Miller
    @bnmnetp
    On the other hand, to make it easy for people to use the components outside of Sphinx, We really should bundle them up as one minified whole. Can you check into a couple of other options. Even if it is just a script to package them up together into a single runestone.js file. ?