Difference between revisions of "Team:Cambridge-JIC/Make Your Own"
KaterinaMN (Talk | contribs) (Created page with "{{:Team:Cambridge-JIC/Templates/Menu}} <html> <section style="background-color:#fff"> <div class="slide" style="min-height:0px"> <div style="width: 80%; margin: 3...") |
|||
Line 7: | Line 7: | ||
<h1 style="line-height:1.295em"> Make Your Own </h1> | <h1 style="line-height:1.295em"> Make Your Own </h1> | ||
</div></div></section> | </div></div></section> | ||
+ | |||
+ | <style> | ||
+ | #cam-quiz { | ||
+ | background-color: #fff; | ||
+ | border: 0px; | ||
+ | } | ||
+ | |||
+ | .cam-quiz-question, .cam-quiz-result { | ||
+ | border: 5px solid; | ||
+ | border-color: #a3c1ad; | ||
+ | padding: 5px; | ||
+ | margin: 0px; | ||
+ | } | ||
+ | |||
+ | .cam-quiz-question { | ||
+ | background-color: #fff; | ||
+ | } | ||
+ | |||
+ | .cam-quiz-answer { | ||
+ | border: 1px solid green; | ||
+ | background-color: white; | ||
+ | color: black; | ||
+ | display: inline-block; | ||
+ | padding: 0 1em; | ||
+ | cursor: pointer; | ||
+ | margin: 0 0.2em; | ||
+ | } | ||
+ | |||
+ | .cam-quiz-answer:hover, .cam-quiz-selected { | ||
+ | background-color: green; | ||
+ | color: white; | ||
+ | } | ||
+ | |||
+ | .cam-quiz-answer.cam-quiz-selected { | ||
+ | font-weight: bold; | ||
+ | } | ||
+ | |||
+ | .cam-quiz-result { | ||
+ | background-color: #fff; | ||
+ | } | ||
+ | </style> | ||
+ | <script> | ||
+ | quiz = function(elem){ | ||
+ | this.elem = $(elem); | ||
+ | this.steps = []; | ||
+ | |||
+ | this.step = function(question, answers) { | ||
+ | this.question = question; | ||
+ | this.answers = {}; | ||
+ | this.bind = function(target, keys) { | ||
+ | if (typeof keys === "undefined") { | ||
+ | keys = Object.keys(this.answers); | ||
+ | } | ||
+ | |||
+ | for (var i=0; i<keys.length; i++) { | ||
+ | key = keys[i]; | ||
+ | this.answers[key].target = target; | ||
+ | } | ||
+ | }; | ||
+ | this.elem = function(quiz, index) { | ||
+ | elem = $('<div class="cam-quiz-question">'); | ||
+ | elem.append($('<h3>').text(this.question)); | ||
+ | for (key in this.answers) { | ||
+ | elem.append($('<div class="cam-quiz-answer">') | ||
+ | .text(this.answers[key].answer) | ||
+ | .data("key", key) | ||
+ | .data("step", this) | ||
+ | .data("quiz", quiz) | ||
+ | .data("index", index) | ||
+ | .click(function(){ | ||
+ | key = $(this).data("key"); | ||
+ | step = $(this).data("step"); | ||
+ | quiz = $(this).data("quiz"); | ||
+ | index = $(this).data("index"); | ||
+ | ref = quiz.steps[index]; | ||
+ | ref.elem.find('.cam-quiz-selected').removeClass('cam-quiz-selected'); | ||
+ | $(this).addClass('cam-quiz-selected'); | ||
+ | |||
+ | for (var i=quiz.steps.length; --i>index;) { | ||
+ | quiz.steps[i].elem.remove(); | ||
+ | quiz.steps.pop(); | ||
+ | } | ||
+ | |||
+ | quiz.steps[index].option = key; | ||
+ | nstep = step.answers[key].target; | ||
+ | switch (typeof nstep) { | ||
+ | case "object": | ||
+ | var nindex = quiz.steps.length; | ||
+ | var nref = { | ||
+ | 'step': nstep, | ||
+ | 'elem': nstep.elem(quiz, nindex), | ||
+ | 'option': undefined | ||
+ | }; | ||
+ | quiz.steps.push(nref); | ||
+ | quiz.elem.append(nref.elem); | ||
+ | break; | ||
+ | case "function": | ||
+ | options = []; | ||
+ | for (var i=0; i<quiz.steps.length; i++) { | ||
+ | options.push(quiz.steps[i].option); | ||
+ | } | ||
+ | var nref = { | ||
+ | 'step': undefined, | ||
+ | 'elem': $('<div class="cam-quiz-result">') | ||
+ | .append(nstep(options)), | ||
+ | 'option': undefined | ||
+ | }; | ||
+ | quiz.steps.push(nref); | ||
+ | quiz.elem.append(nref.elem); | ||
+ | break; | ||
+ | default: | ||
+ | alert("Quiz error! Please contact the site maintainers...."); | ||
+ | break; | ||
+ | } | ||
+ | })); | ||
+ | } | ||
+ | return elem; | ||
+ | }; | ||
+ | |||
+ | for (key in answers) { | ||
+ | answer = answers[key]; | ||
+ | this.answers[key] = { | ||
+ | 'answer': answer, | ||
+ | 'target': undefined | ||
+ | }; | ||
+ | } | ||
+ | }; | ||
+ | |||
+ | this.start = function(step) { | ||
+ | index = this.steps.length; | ||
+ | ref = { | ||
+ | 'step': step, | ||
+ | 'elem': step.elem(this, index), | ||
+ | 'option': undefined | ||
+ | }; | ||
+ | this.steps.push(ref); | ||
+ | this.elem.append(ref.elem); | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | $(document).ready(function(){ | ||
+ | q = new quiz('#cam-quiz'); | ||
+ | |||
+ | step0 = new q.step("You have developed a new product, complete with comprehensive documentation (design files, source code and schematics).", { | ||
+ | 1: "Proceed" | ||
+ | }); | ||
+ | step1 = new q.step("Do you want to release your product for others to remix, customise and redistribute?", { | ||
+ | 0: "no", | ||
+ | 1: "yes" | ||
+ | }); | ||
+ | step2a = new q.step("Do you want complete legal control over your product and/or documentation at all times and to prevent derivatisation?", { | ||
+ | 0: "no", | ||
+ | 1: "yes" | ||
+ | }); | ||
+ | step2b = new q.step("Do you want to have the option to legally impose conditions such as attribution on your documentation?", { | ||
+ | 0: "no", | ||
+ | 1: "yes" | ||
+ | }); | ||
+ | step3a = new q.step("Do you want to commercialise your product and make it proprietary?", { | ||
+ | 0: "no", | ||
+ | 1: "yes" | ||
+ | }); | ||
+ | step3b = new q.step("Do you want to allow for proprietary derivatives being made from your designs, schematics and software?", { | ||
+ | 0: "no", | ||
+ | 1: "yes" | ||
+ | }); | ||
+ | step3c = new q.step("Your product could be released under the CC0 'No Rights Reserved' License, or even unlicensed.", { | ||
+ | 1: "Learn more" | ||
+ | }); | ||
+ | step4a = new q.step("Your product could be released under standard commercial license.", { | ||
+ | 1: "OK" | ||
+ | }); | ||
+ | step4b = new q.step("Your product's documentation could be released under a CC NonCommercial - NoDerivs license. Note that CC licenses are applicable only to copyrighted material, such as designs, schematics and software.", { | ||
+ | 1: "OK" | ||
+ | }); | ||
+ | step4c = new q.step("A Permissive license is most appropriate for your documentation.", { | ||
+ | 1: "OK" | ||
+ | }); | ||
+ | step4d = new q.step("A Copyleft license is most appropriate for your product and/or documentation. This can be general, hardware-specific or software-specific. Note that general and software specific licenses are applicable only to copyrighted material.", { | ||
+ | 0: "General", | ||
+ | 1: "Hardware-specific", | ||
+ | 2: "Software-specific" | ||
+ | }); | ||
+ | step5a = new q.step("Examples of Permissive licenses include: BSD, MIT and CC Attribution.", { | ||
+ | 1: "Learn more" | ||
+ | }); | ||
+ | step5b = new q.step("Do you want a license that attempts to deal directly with patent law?", { | ||
+ | 0: "no", | ||
+ | 1: "yes", | ||
+ | 2: "don't know", | ||
+ | }); | ||
+ | step5c = new q.step("The general Copyleft options: viral CC Attribution - ShareAlike licenses", { | ||
+ | 1: "Learn more about viral licenses" | ||
+ | }); | ||
+ | step5e = new q.step("The GNU GPL license is a well-known Copyleft software license.", { | ||
+ | 1: "Learn more about GNU GPL" | ||
+ | }); | ||
+ | step5d = new q.step("Your product is no longer open-source hardware (OSH), and should not be labelled as such.", { | ||
+ | 1: "Learn more about OSH" | ||
+ | }); | ||
+ | step6a = new q.step("A CERN OHL is most appropriate for your product.", { | ||
+ | 1: "Learn more about CERN OHL" | ||
+ | }); | ||
+ | step6b = new q.step("A TAPR OHL is most appropriate for your product.", { | ||
+ | 1: "Learn more about TAPR OHL" | ||
+ | }); | ||
+ | |||
+ | final3c = function(options) { | ||
+ | window.location.href="#CC0"; | ||
+ | return $('<h3>').text('You are being redirected to the page with information about the CC0 license.') | ||
+ | } | ||
+ | |||
+ | final5a = function(options) { | ||
+ | window.location.href="#permissive"; | ||
+ | return $('<h3>').text('You are being redirected to the page with information about Permissive licenses.') | ||
+ | } | ||
+ | |||
+ | final6a = function(options) { | ||
+ | window.location.href="#CERN"; | ||
+ | return $('<h3>').text('You are being redirected to the page with information about the CERN OHL.') | ||
+ | } | ||
+ | |||
+ | final6b = function(options) { | ||
+ | window.location.href="#TAPR"; | ||
+ | return $('<h3>').text('You are being redirected to the page with information about the TAPR OHL.') | ||
+ | } | ||
+ | |||
+ | final5b2 = function(options) { | ||
+ | window.location.href="#CERNTAPR"; | ||
+ | return $('<h3>').text('You are being redirected to the page with information on choosing between CERN and TAPR OHLs.') | ||
+ | } | ||
+ | |||
+ | final5c0 = function(options) { | ||
+ | window.location.href="#GNU"; | ||
+ | return $('<h3>').text('You are being redirected to the page with information about the GNU GPL.') | ||
+ | } | ||
+ | |||
+ | final5c1 = function(options) { | ||
+ | window.location.href="#viral"; | ||
+ | return $('<h3>').text('You are being redirected to the page with information about viral licenses.') | ||
+ | } | ||
+ | |||
+ | final5d = function(options) { | ||
+ | window.location.href="#OSH"; | ||
+ | return $('<h3>').text('You are being redirected to the page with information about OSH.') | ||
+ | } | ||
+ | |||
+ | |||
+ | step0.bind(step1, [1]); | ||
+ | step1.bind(step2a, [0]); | ||
+ | step1.bind(step2b, [1]); | ||
+ | step2a.bind(step2b, [0]); | ||
+ | step2a.bind(step3a, [1]); | ||
+ | step2b.bind(step3c, [0]); | ||
+ | step2b.bind(step3b, [1]); | ||
+ | step3a.bind(step4b, [0]); | ||
+ | step3a.bind(step4a, [1]); | ||
+ | step3b.bind(step4d, [0]); | ||
+ | step3b.bind(step4c, [1]); | ||
+ | step3c.bind(final3c, [1]); | ||
+ | step4a.bind(step5d, [1]); | ||
+ | step4b.bind(step5d, [1]); | ||
+ | step4c.bind(step5a, [1]); | ||
+ | step4d.bind(step5c, [0]); | ||
+ | step4d.bind(step5b, [1]); | ||
+ | step4d.bind(step5e, [2]); | ||
+ | step5a.bind(final5a, [1]); | ||
+ | step5b.bind(step6a, [0]); | ||
+ | step5b.bind(step6b, [1]); | ||
+ | step5b.bind(final5b2, [2]); | ||
+ | step5c.bind(final5c1, [1]); | ||
+ | step5d.bind(final5d, [1]); | ||
+ | step5e.bind(final5c0, [1]); | ||
+ | step6a.bind(final6a, [1]); | ||
+ | step6b.bind(final6b, [1]); | ||
+ | |||
+ | q.start(step0); | ||
+ | }); | ||
+ | |||
+ | </script> | ||
+ | |||
+ | <section style="background:white"> | ||
+ | <div class="slide"> | ||
+ | <div style="width: 80%; margin: 30px 50px;color:black;min-height:0px"> | ||
+ | <div id="cam-quiz" style="width: 80%; margin: 30px 50px"> | ||
+ | <h2> Find the License for your Project </h2> | ||
+ | </div> | ||
+ | <noscript>Enable JavaScript to be able to display the quiz properly.</noscript></div> | ||
+ | </section> | ||
+ | |||
+ | |||
</html> | </html> | ||
{{:Team:Cambridge-JIC/Templates/Footer}} | {{:Team:Cambridge-JIC/Templates/Footer}} |
Revision as of 17:08, 13 September 2015