Wikiversity talk:MOOC Interface

Proposal
Moved from MOOC Interface:

The MOOC Interface is a JavaScript interface developed by User:Sebschlicht that extends the standard MediaWiki user interface to better support integrated MOOC offerings for students. The improvements include integrated video, discussion, and quizzes within a lesson resource page.

Demonstration
A video demonstrating the functionality has been created and is available at File:Wikiversity-MOOC-Script-Demo.ogv.

Issue
The issue with the MOOC Interface is that the additional JavaScript functionality is not loaded by default. It is only available to logged-in users who add the code from User:Sebschlicht/common.js to their own common.js file.

Proposal
Sebschlicht has asked that the User:Sebschlicht/common.js code be added to MediaWiki:Common.js file so that it is automatically loaded and available to all users. Please consider the proposal, discuss as needed, and then vote to either support adding Sebschlicht/common.js to MediaWiki:Common.js for all users or oppose adding Sebschlicht/common.js to MediaWiki:Common.js for all users.

Discussion
Preliminary discussion has been provided at:
 * User talk:Dave Braunschweig/Archive
 * User talk:Dave Braunschweig/Archive
 * Wikiversity talk:Colloquium
 * Colloquium

Dave Braunschweig
I like the functionality and appreciate the work that User:Renepick and User:Sebschlicht have put into this project. As I indicated initially, I would prefer to have seen this be developed as a gadget that users could turn on and off as desired. Most user additions to MediaWiki seem to be developed as gadgets, and only included in the default configuration once there is consensus to do so. I am concerned about the security of User:Sebschlicht/mooc.js, which anyone could edit with malicious intent. If this proposal is approved, it would be my recommendation that the mooc.js code be protected in the MediaWiki: namespace rather than under User:Sebschlicht. -- Dave Braunschweig (discuss • contribs) 17:44, 25 October 2014 (UTC)


 * Only Sebschlicht (and maybe admins) can edit User:Sebschlicht/mooc.js. So the risk of malicious code only comes from sebschlicht. As requested before we'd love to have a code review to see that the code is save and secure. Actually I already walked through almost all the code since I closely advised sebschlicht during development. I could not find any security issues other than the fact that in the current solution sebschlicht would be able to deploy malicious code (I indicated this clearly before and there are solutions to this). We would love to transfer all the javascripts to the protected MediaWiki:Common.js namespace for example create a MediaWiki:Common.js/mooc.js similar to MediaWiki:Common.js/Slideshows.js which is called from MediaWiki:Common.js. In our oppionion only one problem exists which is that currently Sebschlicht and I cannot edit MediaWiki:Common.js and similar files so we could only slowly fix bugs if we discover them as soon as classroom starts next week. As seen in User:sebschlicht/common.js we currently allow only scripts to be loaded from user:sebschlicht name space this of course could and schould be changed to MediaWiki:common.js as soon as the scripts are globally deployed. and common.js is appended. --Renepick (discuss • contribs) 14:17, 26 October 2014 (UTC)


 * I tested this with a non-administrative account and confirmed that User:Sebschlicht/mooc.js can only be edited by Sebschlicht and custodians/bureaucrats (and, I suppose, stewards). So it becomes an implementation question of whether the best place for the code is User:Sebschlicht/mooc.js because Sebschlicht can maintain it there, or the best place for the code is in MediaWiki: namespace and we address the issue of one of us updating code.  I'm inclined to go with User:Sebschlicht/mooc.js as the test location, and MediaWiki: as the production code.  This would allow Sebschlicht to test and adjust as needed without impacting others, and an administrative copy to MediaWiki: when it's ready.  -- Dave Braunschweig (discuss • contribs) 23:42, 26 October 2014 (UTC)
 * I am happy to follow's Dave's advice here. Thanks for your expertise and following this so closely, Dave. -- Jtneill - Talk - c 23:48, 26 October 2014 (UTC)

I hope I understand Dave's propsal correctly and try to reformulate it in a more concrete way. For the next three months (basically during the time our lecture runs) we will append common.js with the code from user:sebschlicht/common.js during this time User:Sebschlicht and indirectly I can maintain the code fixing bugs and adapting to the needs of the students and also incorporating feedback in User:Sebschlicht's namespace. A volunteering custodian (as far as I understand this would be dave) would control User:Sebschlicht that he does not do something harmful. User:SebSchlicht and I will then (for example by the middle of February) give a sign that the first stable version can go into production. At that time we will transfer the files in User:sebschlicht's namespace to the global protected namespace and also adapt the little code that is in MediaWiki:common.js to load the other files from the global namespace. I would strongly encourage the above described procedure. --Renepick (discuss • contribs) 20:17, 27 October 2014 (UTC)

Also I don't want to be impatient but would like to ask if it was possible to transfer the code to common.js by Tuesday evening? Our first lecture starts this Wednesday. I know that half of the supporting votes are from people related to the project but so far I don't see any objections. It would make the life for our students and by the end of the day also for me much easier if the update could take place in this time window. As stated elsewhere I am sorry for my late request which was due to the fact of my accident and being in hospital for 5 weeks. --Renepick (discuss • contribs) 20:17, 27 October 2014 (UTC)


 * I believe James and I would be more comfortable with the production code in the MediaWiki: namespace. I think that's essential to giving Sebschlicht a test environment where code can be tested and corrected without impacting live users.  Based on the votes below, I don't have a problem with implementing this by Tuesday evening, although I do need clarification on which time zone we're looking at to designate evening.  Please let me know sometime Tuesday where the code is that is to be copied to MediaWiki:Common.js, and what additional code needs to be copied into another page in the MediaWiki namespace that the Common.js code will call.  We should probably do a naming convention that won't conflict in the future, perhaps something like MediaWiki:Extension-mooc.js or MediaWiki:Addin-mooc.js.  If multiple files are necessary, that's fine, too.  Just let me know.  -- Dave Braunschweig (discuss • contribs) 21:49, 27 October 2014 (UTC)


 * First of all thank you guys very much for your support! My team and I appreciate this a lot. That being said I think we have to separate between bug fixing and testing further developments. Obviously further developments should not be running on production code. But I think User:Sebschlicht should have the ability to do quickfixes in the first time. I like the idea of James how he just imported the common.js from User:sebschlicht as a temporary solution (It doesn't have to be the three months I suggested but I guess a couple of days or weeks would be nice and also take work load from you guys.). Tuesday evening American time is fine for me since this will be still before Wednesday morning European time. I will go to sleep know but provide you with exact details of files tomorrow in case you don't want to go with James' intermediate solution. --Renepick (discuss • contribs) 22:40, 27 October 2014 (UTC)


 * I understand that you want to get class started first, and James has already (almost) made that possible. However, by the weekend, I'd like to see MediaWiki:Common.js updated to include a MediaWiki file or files rather than the User namespace.  I'm just trying to come up with a process that will work not just for this situation, but for user interface enhancements in general.  -- Dave Braunschweig (discuss • contribs) 23:46, 27 October 2014 (UTC)


 * That is perfect for us. I was just seeing the fact that we might have to fix bugs and this would be troublesome for you guys. I will see User:Sebschlicht on thursday. We will try to come up with a naming convention and concrete files and changes needed for moving to the mediawiki namespace so that this can be done before the weekend by you. Also we will write down the documentation here and integrate it to the scripts. If I oversaw something then please let me know. --Renepick (discuss • contribs) 18:45, 28 October 2014 (UTC)


 * Hey Dave I have just met with User:Sebschlicht. What we would do now is the following: 1.) create one single file User:Sebschlicht/Addin-Mooc.js which will be one merged file with all the necessary java script. The functions will be refactored to follow the naming-scheme Addin-Mooc-FUNCTIONNAME. 2.) We will update the necesarry templates so that the id's of the divs will follow the naming scheme Addin-Mooc-ID. 3.) we will create a file User:Sebschlicht/Addin-Mooc.css containing all necessary css flags for elements with id's starting with Addin-Mooc-.... When this is complete we will ping you and ask you to move User:Sebschlicht/Addin-Mooc.js to Mediawiki:Common.js/Addin-Mooc.js and also move User:Sebschlicht/Addin-Mooc.css to Mediawiki:Common.css/Addin-Mooc.css. Since refactoring testing needs some time we would ask you for patience until 2 weeks (13th of November). As for Documentation we suggest to move Mooc-Module to Mooc-Module and update the documentation (especially how lua, css and javascript interacts with the templates. Alternatively we could also do the documentation here in this page (but we have the feeling Mooc-Module is a better choice.)) Java script and css will be documented by Noveber 13th but the entire system will need another 14 days. We understand that we don't fulfill your wish to have everything completed by this weekend but hope that this is a fine solution for you? Also you might want to consider moving the stuff together with User:Sebschlicht and in this timeframe give him probationary custodian rights so you just have a smoother process of bugfixing. (if that was neccessary) --Renepick (discuss • contribs) 14:14, 30 October 2014 (UTC)


 * The timeframe is fine. The approach sounds good.  I'm willing to support probationary custodianship, but Sebschlicht will need to request at Candidates for Custodianship and give the community an opportunity to consider the request.  Also, just FYI, custodians can't grant custodianship.  We need a bureaucrat or steward to do that.  That's why it requires community notice and support (or at least lack of objection).  -- Dave Braunschweig (discuss • contribs) 14:40, 30 October 2014 (UTC)


 * Hey Dave, we switched to the refactored code right now. There are 4 core files that should move to the MediaWiki namespace:


 * Again: The first JS file loads the other JS files automatically and it is necessary that is does even in global namespace. Thus when/after moving the files to the global namespace please change the import statements to import the files from global namespace rather than mine:


 * Next to these core files there are several other files such as templates and Lua scripts that are necessary for the addin to work. Assuming that there is no method to protect them but for User:Renepick and me, we may protect them later. If you have questions please let us know. --Sebschlicht (discuss • contribs) 18:00, 13 November 2014 (UTC)


 * Whatever the process is, we want to have it well-documented here, so that other custodians can perform the same updates, and others know what to remove if something blows up. In terms of getting code updates copied when you need them, it's probably best to post at Request custodian action.  That way several of us should see it.  If you want to also drop a quick note on my talk page or send an email, I'll get an update sooner, but that should be in addition to the RCA post so that everyone can follow the current status. -- Dave Braunschweig (discuss • contribs) 21:49, 27 October 2014 (UTC)


 * I fully agree that documentation is important. I can assure you from other projects where User:Sebschlicht worked as my student assistent that this is also important to us. For the reason of lecture start we had to finish the scripts but we still blocked time after deployment for documentation. Do I understand it correctly that you wish the main documentation to be on this very page? Our idea was to have documentation or at least a link to the getting started page on Category:MOOC but we could also link from that page to the discussion here. --Renepick (discuss • contribs) 22:40, 27 October 2014 (UTC)


 * I recommend documenting here for now. Category:MOOC could apply to any page generically as MOOC-related, including studies both for and against massive open online courses.  -- Dave Braunschweig (discuss • contribs) 23:46, 27 October 2014 (UTC)

I've moved / deployed as indicated above, with the exception of moving the .css file under MediaWiki:Common.css rather than MediaWiki:Common.js. I also had to update the import statements in MediaWiki:Common.js/addin-mooc.js, as well as in MediaWiki:Common.js and MediaWiki:Common.css. However, when I check the Web Science page, it doesn't appear as though it is working correctly. -- Dave Braunschweig (discuss • contribs) 21:02, 13 November 2014 (UTC)


 * The .css file location was a typo, thanks for correcting. It is amazing to see how fast you reacted, thank you again for all your support! As far as I can tell everything works fine. Your issue might be related to the strong caching of JS or the URL: Every API request targets the HTTPS URLs. If you browse to any MOOC page using a HTTP URL all the JS depending on these API requests won't work, due to cross-origin AJAX requests. In short: Simply try again with clean cache and make sure to use the HTTPS URL. --Sebschlicht (discuss • contribs) 10:32, 14 November 2014 (UTC)


 * @ User:Sebschlicht I wasn't aware of the fact that the Mediawiki API needs HTTPS. Could we do a redirect in the sense of http://stackoverflow.com/questions/4723213/detect-http-or-https-then-force-https-in-javascript in the case a person browses a page using http? I think mediawiki goes for https anyway. --Renepick (discuss • contribs) 10:58, 14 November 2014 (UTC)


 * Yes this is a good idea. I changed the code on the german Wikiversity to do so, but I can not check if it works. The Apache server redirects me to the HTTPS page automatically. I will check it at a PC that actually had this issue before. --Sebschlicht (discuss • contribs) 13:00, 14 November 2014 (UTC)


 * Hey Dave, please have a look at the following table:

Would you please change the value  in line 88 to. This value affects the loading time of the main JS file and thus enhances the user experience. This step is not required, just an improvement we can make since everything seems working properly. --Sebschlicht (discuss • contribs) 10:52, 14 November 2014 (UTC)


 * ✅ -- Dave Braunschweig (discuss • contribs) 13:39, 14 November 2014 (UTC)

Newmangledmatt
I think this looks great. The discussion feature is very necessary for any online learning courses and the current form of discussions i not very intuitive. Having said that, it would be great if there could be an upvote/downvote feature for the discussions so that the most asked questions and answers can pop up at the top. Also, the ability to collapse a discussion thread and all its children would be very helpful as well. The quizzes look great as well. Is there a plan to track which courses have been completed by the students like KahnAcademy or CodeAcadmy? --ttam (discuss • contribs) 21:45, 25 October 2014 (UTC)
 * Thanks for the great feedback! We are currently in the discussion with wikimedia foundation. If we really make it an extension out of it with support of Wikimedia than we will support up and down voting. In the current proof of concept it would be to complex to store these kind of information in a reliable way by only using wikimedia page content (parsed by lua) as a data base and java script. Collapsing a discussion thread is already implemented I just forgot to demonstrate it in the screencast. --Renepick (discuss • contribs) 14:01, 26 October 2014 (UTC)
 * Tracking students like kahn is difficult due to the privacy policy of Wikimedia foundation. I would also love this. Especially a teacher would want to know which quiz questions provide trouble in order to improve the material. But as I have said: This is rather an issue of political will of Wikimedia foundation / community than a technical problem--Renepick (discuss • contribs) 14:01, 26 October 2014 (UTC)

James Neill
I think this functionality looks very promising and great that you're in discussion with WMF about possible further development. It would make sense to allow User:Sebschlicht and Renepick to test further with their upcoming Web Science cohort by enabling this js code. However, as with Dave Braunschweig's security concern, I would prefer to see this code in the MediaWiki namespace with protection. and Renepick could you indicate the specific code you would want added to the MediaWiki namespace? or myself or someone else should be able to arrange it if there are no other concerns. -- Jtneill - Talk - c 23:15, 26 October 2014 (UTC)
 * Hey James, thank yoo for your feedback. If I understand your question correctly I must say that all the JavaScript code is needed to provide the full functionality of the interface:
 * User:Sebschlicht/mooc.js
 * depends on User:Sebschlicht/common.js to
 * load User:Sebschlicht/moocDiscussions.js


 * For a deployment we would merge the resource loading part of common.js into mooc.js. The CSS files should not harm the security and can be left where they are. As suggested by Rene in his video and Dave I think the branch model with the master in MediaWiki: and develop in User:Sebschlicht: is the way to go. This would reduce the con of beeing able to load resources, since a protected version in MediaWiki: can only load what is referred explicitly. We should refactor all the CSS classes and ids before deployment, if it's deployed this way, in order to avoid collisions with other pages. --Sebschlicht (discuss • contribs) 10:42, 27 October 2014 (UTC)

Summary of Pros

 * Adding the JavaScript content to MediaWiki:Common.js allows all users to interact with the MOOC as designed without any additional effort on their part aside from having JavaScript enabled in their browser.
 * A larger user base and more feedback would help us a lot to improve the interface. This will of course affect the quality of a future MediaWiki extension that works arround some problems we have now.

Summary of Cons

 * Having this JavaScript automatically loaded in the browser means that the community must trust the code Sebschlicht adds, not just to MediaWiki:Common.js, but also any code that is called by these functions.

Support

 * : Obviously as the requester I support the request. I have been guiding User:Sebschlicht to develop these scripts over the last 5 months. They have been presented at |OERde14 (The German Conference about OER) and many people in the audience where unhappy because they had this high barrier of creating an account and copying common.js to their userspace before they could start using the scripts. --Renepick (discuss • contribs) 14:30, 26 October 2014 (UTC)
 * : im looking forward this project. im in srilanka, my friends and my self offering free learning content for student. we are planned to move moodle, (bcz my language tamil not available for wiki university yet) . i saw video demonstration simply worth to try. i support..--Shameermbm (discuss • contribs) 18:13, 26 October 2014 (UTC)
 * : I'm also supporting the project. I'm an colleague of René at the university and know the project for a fair amount of time. In my opinion, the project supports teachers during content creation and is highly convenient for students for learning new things. I consider it as huge benefit if the scripts would get available for all users of wikiversity -Lkastler (discuss • contribs) 19:45, 26 October 2014 (UTC)
 * : For trialling the common.js but with proposed User code also in MediaWiki namespace and protected. -- Jtneill - Talk - c 23:18, 26 October 2014 (UTC)
 * : I am teaching this course with a lot of support by René and we really need such functionality in order to provide a decent learning environment - Steffen Staab 7:44, 27 October 2014 (UTC)
 * : I think that the interface is an improvement for students that would benefit from the quite smooth and uniform interface with on-page discussion. Teachers have a point-and-click experience and do not need to care about templates or content location. In-place-edits and all the creation processes help to save time, since most of them bulk multiple actions. I am the lead developer in this project and would would love to see the code in action. --Sebschlicht (discuss • contribs) 10:42, 27 October 2014 (UTC)
 * : No new argument, simply emphasizing that this is a great improvement in user experience!--Rob Nowman (discuss • contribs) 11:09, 27 October 2014 (UTC)
 * : Leighblackall (discuss • contribs) 18:36, 27 October 2014 (UTC)

Conclusion
The MOOC Interface script has been imported to MediaWiki:Common.js -. Please test and comment. -- Jtneill - Talk - c 22:01, 27 October 2014 (UTC)
 * Thank you James for importing User:Sebschlicht/Common.js in Mediawiki:Common.js. unfortunately it is not working when being logged out as you can check on this page. I guess the reason is that Sebschlicht always had the file under User:Sebschlicht/common.js with the common in lowercase. Even though this was not a problem for local testing the import seems to be broken due to case sensitivity. So could you try to either move User:Sebschlicht/common.js to User:Sebschlicht/Common.js or changing the import to importScript("User:Sebschlicht/common.js");            // MOOC interface? --Renepick (discuss • contribs) 22:28, 27 October 2014 (UTC)
 * ✅ -- Dave Braunschweig (discuss • contribs) 23:49, 27 October 2014 (UTC)
 * Works out of the box. I am very happy, that the students can now use the new interface without additional afford, thank you all! For a moment I thought everything is broken, but only because my common.js loads twice for me. Didn't get that at first. We will find a fix for that. Maybe I simply keep logged out ^.^ --188.109.215.225 (discuss) 10:05, 28 October 2014 (UTC)