Skip to content

Commit

Permalink
Merge pull request #108 from ucfopen/dev/2.3.0
Browse files Browse the repository at this point in the history
v2.3.0
  • Loading branch information
clpetersonucf authored Feb 23, 2021
2 parents 7b7abfb + c431541 commit daa467b
Show file tree
Hide file tree
Showing 20 changed files with 516 additions and 69 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "materia-server-client-assets",
"version": "2.2.0",
"version": "2.3.0-alpha1",
"license": "AGPL-3.0",
"description": "Materia Server Client Assets contains all the javascript and css for Materia Server and the Materia Widget Development Kit.",
"author": "University of Central Florida, Center for Distributed Learning",
Expand Down
11 changes: 10 additions & 1 deletion src/css/my-widgets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,15 @@
}
}

.external {
padding-right: 16px;
background-size: 11px;
}

p {
line-height: 0.6;
}

.share-help {
position: absolute;
top: 10px;
Expand All @@ -530,7 +539,7 @@

#play_link {
width: 100%;
margin: 0;
margin: 0 0 5px 0;
height: 1.5em;
font-size: 1.1em;
padding-left: 3px;
Expand Down
51 changes: 51 additions & 0 deletions src/css/partials/_lti_embed_preview.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.preview {
header {
visibility: visible;
}
header h1 {
background: #68d053;
}

.container {
background: #ebebeb;
width: 500px;
margin: 0 auto;
text-align: center;
margin-top: 3em;
padding: 2em;
box-sizing: border-box;
position: relative;

h2 {
margin-top: 0;
}

p {
margin-bottom: 2em;
}

.button {
}

.widget_info {
display: flex;
align-items: center;
align-content: stretch;
position: relative;
width: 100%;
justify-content: center;
margin-top: -20px;

.widget_icon {
flex: 0 1 auto;
margin: 10px;
}

.widget_name {
flex: 0 1 auto;
font-size: 1.2em;
text-align: left;
}
}
}
}
2 changes: 1 addition & 1 deletion src/css/scores.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body.scores {
);
box-shadow: 0px 0px 34px 1px #999;

margin-top: 55px;
margin-top: 25px;
margin-bottom: 25px;
text-align: center;

Expand Down
25 changes: 3 additions & 22 deletions src/css/util-lti-picker.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// included here for now, should seprate in the future
@import 'partials/lti_embed_preview';

html {
background: white;
width: 100%;
Expand All @@ -20,28 +23,6 @@ header {
visibility: hidden;
}

.preview header {
visibility: visible;
}
.preview header h1 {
background: #68d053;
}

.preview .container {
background: #ebebeb;
width: 500px;
height: 300px;
margin: 0 auto;
text-align: center;
margin-top: 5em;
padding: 2em;
box-sizing: border-box;
}

.preview .container p {
margin-bottom: 2em;
}

.help-container {
margin: 0 auto;
width: 500px;
Expand Down
67 changes: 67 additions & 0 deletions src/css/util-qset-history.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
body,
html {
font-family: 'Lato', arial, serif;
}

#import_form {
background: #fff;
border: rgba(0, 0, 0, 0.11) 1px solid;
box-shadow: 1px 3px 10px #888;

h1 {
background: #f1814b;
padding: 6px 10px;
margin: 0px;
font-size: 18px;
font-weight: bold;
color: #ffffff;
}

thead {
tr {
height: 2em;
padding: 6px 0px;
border-bottom: solid 1px #888;
}
}

tbody {
tr {
height: 2em;
cursor: pointer;

td {
text-align: center;
}
&:hover {
background: #bde3ff;
}
}
}
}

.no_saves {
width: 50%;
margin-left: auto;
margin-right: auto;
text-align: center;

h3 {
font-size: 1.5em;
font-weight: bold;
}
}

.actions {
position: absolute;
width: 100%;
bottom: 0px;
padding-bottom: 14px;

text-align: center;
font-size: 1.1em;

a {
color: #000000;
}
}
74 changes: 74 additions & 0 deletions src/css/widget-create.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,60 @@ a {
margin-right: 13px;
}

#qset-rollback-confirmation-bar {
position: relative;
z-index: 5;
height: 52px;
width: 100%;
min-width: 1080px;
text-align: left;
white-space: nowrap;

color: #ffffff;
background: #f1814b;
border-radius: 5px 5px 0 0;

font-family: 'Lato', 'Arial', sans-serif;

h3 {
display: inline-block;
margin: 0 15px;
padding: 14px 0;

font-weight: bold;
}

p {
display: inline-block;
margin: 0 0 0 60px;
padding: 14px 0;

font-size: 0.8em;

span {
font-weight: bold;
}
}

button {
float: right;
margin: 10px 40px 10px -25px;
padding: 6px 15px;
color: #3d3d3d;
font-weight: bold;
font-size: 0.9em;
background: linear-gradient(#ffffff, #f8f8f8);
border: solid 1px #a3a3a3;
border-radius: 5px;

cursor: pointer;

&:hover {
background: linear-gradient(#ffffff, #ffe5cc);
}
}
}

.dot {
border-radius: 3px;
background: #ababab;
Expand Down Expand Up @@ -185,6 +239,26 @@ a {
width: 800px;
z-index: 10;
}
#confirm_dialog {
position: absolute;
top: -50%;
left: 50%;
margin: 0px -210px;
width: 480px;
height: 200px;
z-index: 2;
box-shadow: 0px 0px 1000px #000, 0px 0px 10px #000;
opacity: 0;
transition: all 0.3s ease;
}
#confirm_dialog.show {
opacity: 1;
box-shadow: none;
text-align: left;
top: 10%;
width: 480px;
z-index: 10;
}
#modal-cover {
background-color: #000000;
height: 10000px;
Expand Down
1 change: 1 addition & 0 deletions src/js/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require('./controllers/ctrl-question-import')
require('./controllers/ctrl-my-widgets-collaboration')
require('./controllers/ctrl-my-widgets-selected')
require('./controllers/ctrl-my-widgets-settings')
require('./controllers/ctrl-qset-history')
require('./directives/dir-beardable')
require('./directives/dir-datatable')
require('./directives/dir-date-validation')
Expand Down
11 changes: 9 additions & 2 deletions src/js/controllers/ctrl-lti-resource-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,16 @@ app.controller('LTIResourceSelectionCtrl', function (
$timeout(() => {
announceChoice()

// RETURN_URL is sent from the Tool Consumer at the time of LTI Launch
// provided by launch_presentation_return_url or content_item_return_url
// if RETURN_URL is set, we'll use it to inform the LTI Tool consumer of our choice
if (typeof RETURN_URL !== 'undefined' && RETURN_URL !== null) {
window.location =
RETURN_URL + '?embed_type=basic_lti&url=' + encodeURI(selectedWidget.embed_url)
// add a ? or & depending on RETURN_URL already containing query params
const seperator = RETURN_URL.includes('?') ? '&' : '?'
// endode the url
const url = encodeURI(selectedWidget.embed_url)
// redirect the client to the return url with our new variables
window.location = `${RETURN_URL}${seperator}embed_type=basic_lti&url=${url}`
}
}, 1000)
}
Expand Down
3 changes: 2 additions & 1 deletion src/js/controllers/ctrl-my-widgets-collaboration.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,10 @@ app.controller('MyWidgetsCollaborationController', function (
}

const _cancelDemote = (user) => {
const accessLevel = String($scope.selected.accessLevel)
user.warning = false
user.remove = false
return (user.access = ACCESS.FULL)
user.access = accessLevel
}

$scope.inputs = { userSearchInput: '' }
Expand Down
58 changes: 58 additions & 0 deletions src/js/controllers/ctrl-qset-history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const app = angular.module('materia')
app.controller('qsetHistoryCtrl', function ($scope, $sce) {
$scope.saves = []

const _setup = () => {
let id = _getInstId()
_getQsetHistory(id).then((result) => {
if (!result) return false
result.forEach((qset) => {
save = {
id: qset.id,
data: qset.data,
version: qset.version,
count: _readQuestionCount(qset.data),
created_at: new Date(parseInt(qset.created_at) * 1000).toLocaleString(),
}
$scope.saves.push(save)
})
$scope.$apply()
})
}

const _readQuestionCount = (qset) => {
let items = qset.items
if (items.items) items = items.items

return items.length
}

const _getQsetHistory = (inst_id) => {
return Materia.Coms.Json.get(`/api/instance/history?inst_id=${inst_id}`)
}

const _getInstId = () => {
const l = document.location.href
const id = l.substring(l.lastIndexOf('=') + 1)
return id
}

$scope.loadSaveData = (id) => {
$scope.saves.forEach((save) => {
if (id == save.id) {
return window.parent.Materia.Creator.onQsetHistorySelectionComplete(
JSON.stringify(save.data),
save.version,
save.created_at
)
}
})
}

$scope.closeDialog = (e) => {
e.stopPropagation()
return window.parent.Materia.Creator.onQsetHistorySelectionComplete(null)
}

_setup()
})
Loading

0 comments on commit daa467b

Please sign in to comment.