NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name moodlehelper // @namespace fsmoodle // @description Small Helper for WHS TUT Moodle // @author Frieder Schüler // @license MIT // @include https://kompetenzraster.whs.tut.bw.schule.de/moodle/blocks/exastud/review_student.php* // @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js // @resource bootstrapJS https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js // @resource bootstrapCSS https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css // @grant GM_addStyle // @grant GM_getResourceText // @grant GM_getResourceURL // ==/UserScript== var buttonHtml = '<button type="button" class="btn" data-toggle="modal" data-target="#myModal">Generieren</button>'; var modalStart = '' + '<div class="modal fade" id="moodlehelperModal" role="dialog">' + ' <div class="modal-dialog">' + ' <!-- Modal content-->' + ' <div class="modal-content">' + ' <div class="modal-body">'; var modalEnd = '' + ' </div>\n' + ' </div>\n' + ' </div>\n' + '</div>'; var formStart = '' + '<form>' + ' <div class="form-group row">' + ' <label for="firstName" class="col-4 col-form-label">Vorname des Schüler</label> ' + ' <div class="col-8">' + ' <input id="firstName" name="firstName" class="form-control here" type="text">' + ' </div>' + ' </div>' + ' <div class="form-group row">' + ' <label for="import" class="col-4 col-form-label">Excel-Import</label> ' + ' <div class="col-8">' + ' <input id="import" name="import" placeholder="Hier Tabellezeile aus Excel einfügen" class="form-control here" type="text">' + ' </div>' + ' </div>'; var formTemplate = '' + ' <div class="form-group row">' + ' <label for="listening" class="col-4 col-form-label">Note Hören</label> ' + ' <div class="col-8">' + ' <select id="listening" name="listening" class="custom-select">' + ' <option value="1">1-2,4</option>' + ' <option value="2">2,5-3,4</option>' + ' <option value="3">3,5-4,4</option>' + ' <option value="4">4,5-6</option>' + ' </select>' + ' </div>' + ' </div> '; var formEnd = '' + ' <div class="form-group row">' + ' <div class="offset-4 col-8">' + ' <button name="submit" type="submit" class="btn btn-primary">Noten eintragen</button>' + ' </div>' + ' </div>' + '</form>'; var inject = function() { //--- Inject scripts & css var form = formTemplate; var modalHtml = modalStart + formStart + form + formEnd + modalEnd; $("head").append("<style>" + GM_getResourceText("bootstrapCSS") + "</style>"); $("body").append(modalHtml); $("body").append("<script>" + GM_getResourceText("bootstrapJS") + "</script>"); $("body").append("<script>" + GM_getResourceText("bootstrapJS") + "</script>"); $("#id_review").append(buttonHtml); }; inject();