-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from ucfopen/dev/2.3.0
v2.3.0
- Loading branch information
Showing
20 changed files
with
516 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}) |
Oops, something went wrong.