Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…inetoolkits into develop
  • Loading branch information
torinfo committed Aug 28, 2024
2 parents 74ca064 + 756af99 commit 024f1a5
Show file tree
Hide file tree
Showing 41 changed files with 614 additions and 189 deletions.
16 changes: 16 additions & 0 deletions languages/en-GB/website_code/php/management/users.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

define("USERS_MANAGE_ROLES", "Manage user roles");

// admin roles human names -------------------------------------------
define("USERS_ROLE_SUPER", "Super Admin");

define("USERS_ROLE_SYSTEM", "System Admin");
Expand All @@ -48,3 +49,18 @@
define("USERS_ROLE_PROJECTADMIN", "Project Admin");

define("USERS_ROLE_HARVESTADMIN", "Harvest Admin");
// admin roles info -------------------------------------------
define("USERS_ROLE_SUPER_INFO", "Super Admin Uitleg");

define("USERS_ROLE_SYSTEM_INFO", "System Admin Uitleg");

define("USERS_ROLE_TEMPLATEADMIN_INFO", "Template Admin Uitleg");

define("USERS_ROLE_METAADMIN_INFO", "Meta Admin Uitleg");

define("USERS_ROLE_USERADMIN_INFO", "User Admin Uitleg");

define("USERS_ROLE_PROJECTADMIN_INFO", "Project Admin Uitleg");

define("USERS_ROLE_HARVESTADMIN_INFO", "Harvest Admin Uitleg");

4 changes: 2 additions & 2 deletions modules/site/parent_templates/site/common/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ function parseContent(pageRef, sectionNum, contentNum, addHistory) {
$(data).find('page').each(function(index, value) {
var $page = $(this);
var $pageIndex = index;
if (pageID == $page.attr('linkID') || pageID == $page.attr('customLinkID')) {
if (pageID === $page.attr('linkID') || pageID === $page.attr('customLinkID')) {
// an ID match has been found for a page
pageIndex = index;
found = true;
Expand All @@ -1557,7 +1557,7 @@ function parseContent(pageRef, sectionNum, contentNum, addHistory) {

$page.find('section').each(function (index, value) {
var $section = $(this);
if (pageID == $section.attr('linkID') || pageID == $section.attr('customLinkID')) {
if (pageID === $section.attr('linkID') || pageID === $section.attr('customLinkID')) {
//an ID match has been found for a section
pageIndex = $pageIndex;
found = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,10 @@ button.ui-button-icon-only .ui-icon[class*=" fa-"] {


/* --PASSWORD PROTECTION BLOCK-------------------------------------------------------------- */
.x_pswdInfo {
margin-bottom: 2vmin;
}

.x_pswdInput:not(.old) {
width: 90vmin;
display: flex;
Expand Down Expand Up @@ -850,6 +854,11 @@ input#x_pagePswd.old {
font-size: 3.5vmin;
}

.vault .numberbtn, .vault #resetbtn, .vault input {
color: white;
font-weight: bold;
}

.vault input:focus, .vault input:hover{
border: 2px solid #ffffff;
outline: none;
Expand Down Expand Up @@ -1387,4 +1396,4 @@ a:focus .wcagLogo {

[data-cke-editorplaceholder]::before {
padding: 0.3em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ optional: feedback page synch play enable
}

// feedback if question has true/false answers
if (true) {
if (judge) {
var fb;
finishTracking(options);
if (options.answerType == "multiple" && options.type == "radio") {
Expand Down Expand Up @@ -165,6 +165,8 @@ optional: feedback page synch play enable


feedbackTxt += options[fb] != "" ? '<div class="feedback"><p>' + options[fb] + '</p></div>' : "";
}else {
finishTracking(options);
}

if (options.childNodes[index].getAttribute("enable") == "true" || (enable == true && ((options.childNodes[index].getAttribute("page") == undefined || options.childNodes[index].getAttribute("page") == "") && (options.childNodes[index].getAttribute("synch") == undefined || options.childNodes[index].getAttribute("synch") == "")))) {
Expand Down Expand Up @@ -201,6 +203,8 @@ optional: feedback page synch play enable
// no feedback needed so do change page / play / change media current time immediately
} else if (action >= 0) {
doAction(action);
} else {
$continueBtn.show();
}
}

Expand Down Expand Up @@ -233,6 +237,7 @@ optional: feedback page synch play enable

return {
_setup: function(options) {
console.log(options);
media = this;
let judgeOverride = options.judge?? "true";
judge = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3159,7 +3159,7 @@ function x_passwordPage(pswds) {
}else if(type == "vaultnumeric") {
$pswdBlock.find('.x_pswdInput').html('<div class="vault numeric"><div class="vault-door-frame"><div class="vault-door"></div></div></div>');
$pswdBlock.find('.vault-door')
.append('<input readonly type="text" id="x_pagePswd" name="x_pagePswd" style="grid-area: input;" aria-label="' + x_getLangInfo(x_languageData.find("password")[0], "label", "Password") + '">')
.append('<input type="text" id="x_pagePswd" name="x_pagePswd" style="grid-area: input;" aria-label="' + x_getLangInfo(x_languageData.find("password")[0], "label", "Password") + '">')
.append('<button class="numberbtn" style="grid-area: one;">1</button><button class="numberbtn" style="grid-area: two;">2</button><button class="numberbtn" style="grid-area: three;">3</button><button class="numberbtn" style="grid-area: four;">4</button><button class="numberbtn" style="grid-area: five;">5</button><button class="numberbtn" style="grid-area: six;">6</button><button class="numberbtn" style="grid-area: seven;">7</button><button class="numberbtn" style="grid-area: eight;">8</button><button class="numberbtn" style="grid-area: nine;">9</button><button class="numberbtn" style="grid-area: zero;">0</button><button id="resetbtn" style="grid-area: reset;">AC</button><button style="grid-area: unused;"> </button>')
.append('<button id="x_pagePswdBtn" style="grid-area: button;">' + (x_currentPageXML.getAttribute('passwordSubmit') != undefined && x_currentPageXML.getAttribute('passwordSubmit') != '' ? x_currentPageXML.getAttribute('passwordSubmit') : 'Submit') + '</button>');

Expand Down Expand Up @@ -4425,12 +4425,12 @@ function x_scaleImg(img, maxW, maxH, scale, firstScale, setH, enlarge) {
imgH = $img.data("origSize")[1];
}

if (enlarge != true) {
maxW = Math.min(maxW, imgW);
maxH = Math.min(maxH, imgH);
}
if (enlarge === false) {
maxW = Math.min(maxW, imgW);
maxH = Math.min(maxH, imgH);
}

if (imgW > maxW || imgH > maxH || firstScale != true || enlarge == true) {
if (imgW > maxW || imgH > maxH || firstScale != true || enlarge !== false) {
var scaleW = maxW / imgW,
scaleH = maxH / imgH,
scaleFactor = Math.min(scaleW, scaleH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ function XTResults(fullcompletion) {
matchSub.correct = (learnerAnswer === correctAnswer);
matchSub.learnerAnswer = learnerAnswer;
matchSub.correctAnswer = correctAnswer;
matchSub.judge = (state.interactions[i].result != null && state.interactions[i].result != null.judge != null ? state.interactions[i].result != null.judge : true);
matchSub.judge = (state.interactions[i].result != null && state.interactions[i].result.judge != null ? state.interactions[i].result.judge : true);
judge &= matchSub.judge;
results.interactions[nrofquestions - 1].subinteractions.push(matchSub);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@

l_total++;
if ($this.data("category").is($this.parent()) || !l_judge) {
$this.html($this.html() + '<span class="tick"><span class="ui-helper-hidden-accessible">' + x_getLangInfo(x_languageData.find("tick")[0], "label", "Correct") + '</span><span class="fa fa-fw fa-x-tick"></span></span>');
if(l_judge) {
$this.html($this.html() + '<span class="tick"><span class="ui-helper-hidden-accessible">' + x_getLangInfo(x_languageData.find("tick")[0], "label", "Correct") + '</span><span class="fa fa-fw fa-x-tick"></span></span>');
}
l_feedback.push("correct");
l_option.result = true;
l_correct++;
Expand All @@ -99,9 +101,10 @@
}
l_options.push(l_option);
});

$("#scoreTxt").html(l_correct);
$("#totalTxt").html(this.totaloptions);
if(l_judge) {
$("#scoreTxt").html(l_correct);
$("#totalTxt").html(this.totaloptions);
}
$("#feedback").show();

var result = {
Expand All @@ -120,6 +123,11 @@
var correctOptions = [],
correctAnswer = [],
correctFeedback = [];
let judge = true;

if(x_currentPageXML.getAttribute("judge") != undefined && x_currentPageXML.getAttribute("judge") == 'false'){
judge = false;
}

this.checked = false;
// Track the quiz page
Expand All @@ -128,6 +136,9 @@
{
this.weighting = x_currentPageXML.getAttribute("trackingWeight");
}
if(x_currentPageXML.getAttribute("judge") != undefined && x_currentPageXML.getAttribute("judge") == 'false'){
this.weighting= 0.0;
}
XTSetPageType(x_currentPage, 'numeric', 1, this.weighting);


Expand All @@ -143,12 +154,14 @@
.html(x_addLineBreaks(x_currentPageXML.getAttribute("text")))
.addClass("transparent"); /* without the text having a bg the labels strangely aren't selectable in IE */

var $feedback = $("#feedback");
var $feedback= $("#feedback");
if (x_currentPageXML.getAttribute("feedback") != undefined && x_currentPageXML.getAttribute("feedback") != "") {
$feedback.html(x_addLineBreaks(x_currentPageXML.getAttribute("feedback")));
}
if (x_currentPageXML.getAttribute("feedbackScore") != undefined && x_currentPageXML.getAttribute("feedbackScore") != "") {
$feedback.append('<p>' + x_addLineBreaks(x_currentPageXML.getAttribute("feedbackScore").replace("{i}", '<span id="scoreTxt"></span>').replace("{n}", '<span id="totalTxt"></span>')) + '</p>');
if(judge) {
$feedback.append('<p>' + x_addLineBreaks(x_currentPageXML.getAttribute("feedbackScore").replace("{i}", '<span id="scoreTxt"></span>').replace("{n}", '<span id="totalTxt"></span>')) + '</p>');
}
} else if ($feedback.html().length == 0) {
$feedback.remove();
}
Expand Down
30 changes: 26 additions & 4 deletions modules/xerte/parent_templates/Nottingham/models_html5/dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
{
this.weighting = x_currentPageXML.getAttribute("trackingWeight");
}
if(x_currentPageXML.getAttribute("judge") != undefined && x_currentPageXML.getAttribute("judge") == 'false'){
this.weighting= 0.0;
}

XTSetPageType(x_currentPage, 'numeric', $(x_currentPageXML).children().length, this.weighting);
var panelWidth = x_currentPageXML.getAttribute("panelWidth");
Expand Down Expand Up @@ -207,10 +210,11 @@
$thisInput
.val($.trim($thisInput.val()))
.prop("readonly", true);

$thisInput.parent().find(".result")
.removeClass("hidden")
.parent().find(".tickTxt").html(tick);
if(judge) {
$thisInput.parent().find(".result")
.removeClass("hidden")
.parent().find(".tickTxt").html(tick);
}

$feedback.html("");
$this.focus();
Expand All @@ -231,6 +235,24 @@
if($pageContents.data("currentQ")+1 == $(x_currentPageXML).children().length){
XTSetPageScore(x_currentPage, 100 * (correctAnswers / $(x_currentPageXML).children().length), x_currentPageXML.getAttribute("trackinglabel"));
}
if(!judge){
$feedback.html("");
$("#pageContents .question:eq(" + ($pageContents.data("currentQ") + 1) + ")").fadeIn();
$this
.data({
"attempt": 0,
"state": 0
})
.button({ label: $("#pageContents").data("submitTxt") });

var qNo = $pageContents.data("currentQ");

$("#pageContents .question:eq(" + (qNo + 1) + ") input").focus();
let question = $(x_currentPageXML).children()[qNo + 1];
let answers = question.getAttribute("answer").split(answerDelimeter);
XTEnterInteraction(x_currentPage, qNo + 1, 'fill-in', question.getAttribute("question"), answers, answers, null /* never used*/, x_currentPageXML.getAttribute("grouping"));
$pageContents.data("currentQ", qNo + 1);
}
} else { // incorrect
$this.data("attempt", $this.data("attempt") + 1);
var currentAttempt = $this.data("attempt"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

var pageIndex = 0;

this.weighting = 1.0;
this.weighting = 0.0;
if (x_currentPageXML.getAttribute("trackingWeight") != undefined)
{
this.weighting = x_currentPageXML.getAttribute("trackingWeight");
Expand Down Expand Up @@ -262,9 +262,15 @@
}

// Add download button
var $finishBtn = $('<button id="downloadBtn">');
var $downloadBtn = $('<button id="downloadBtn">');
var $submitBtn = $('<button id="submitBtn">');
var $finishSection = $('<div class="item"/>');
$finishBtn.appendTo($finishSection);
if(x_currentPageXML.getAttribute("showDownload") != "false"){
$downloadBtn.appendTo($finishSection);
}
if(x_currentPageXML.getAttribute("track") == "true"){
$submitBtn.appendTo($finishSection);
}
if (x_currentPageXML.getAttribute('download') && x_currentPageXML.getAttribute('download') == 'extra') {
$page = $('<div>')
.attr('id', 'page' + pageIndex)
Expand All @@ -278,20 +284,21 @@
}

if (x_currentPageXML.getAttribute('instructions') && x_currentPageXML.getAttribute('instructions') != "") {
$('<p>'+ x_currentPageXML.getAttribute('instructions') + '</p>').insertBefore($finishBtn);
$('<p>'+ x_currentPageXML.getAttribute('instructions') + '</p>').insertBefore($downloadBtn);
}

$("#pageContents").data("numPages", $("#pages").children(".page").length);


if(x_currentPageXML.getAttribute("track") == "true"){
$finishBtn.button({
label: x_currentPageXML.getAttribute('downloadTxt') != undefined ? x_currentPageXML.getAttribute('downloadTxt') : "Submit"
$submitBtn.button({
label: x_currentPageXML.getAttribute('submitTxt') != undefined ? x_currentPageXML.getAttribute('submitTxt') : "Submit"
}).click(function () {
documentation.track();
});
} else {
$finishBtn.button({
}
if(x_currentPageXML.getAttribute("showDownload") != "false"){
$downloadBtn.button({
icons: {
primary: "fa fa-x-download"
},
Expand Down Expand Up @@ -811,7 +818,7 @@
if (documentation.checkRequired(currentPage)) {
documentation.sendToXAPI($("#pageContents").data("docData"));
}
$("#downloadBtn").hide().prev().hide();
$("#submitBtn").hide();
}

this.showPage = function (page) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@
}

/* add ticks to correct answers */
#targetHolder input[readonly].correct+span:before, #targetHolder input[correct]+span:before, #targetHolder .target.correct+span:before, #targetHolder select[disabled].correct+span:before {
#targetHolder input[readonly].judged.correct+span:before, #targetHolder input[correct].judged+span:before, #targetHolder .target.correct+span:before, #targetHolder select[disabled].correct+span:before {
font-family: FontAwesome;
content: "\f00c";
color: green;
margin-left:1px;
}

/*gap fill: show red crosses when incorrect and in tracking mode*/
#targetHolder select[disabled]+span:before, #targetHolder .target.incorrect+span:before, #pageContents input[readonly]+span:before{
#targetHolder select[disabled]+span:before, #targetHolder .target.incorrect+span:before, #pageContents input[readonly].judeged+span:before{
font-family: FontAwesome;
content: "\f00d";
color: red;
Expand Down Expand Up @@ -206,4 +206,4 @@
#x_mainHolder.x_responsive #labelHolder .label {
font-size: 2vmin;
}
}
}
Loading

0 comments on commit 024f1a5

Please sign in to comment.