forked from joerunde/edx-adapt
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Secure user with anonymized id (#17)
Default insecure user-id files Add encapsulation of user_name in html course’s templates Exchange urls with relative protocol Dropp templates which are not used anonymized student id add indentation rule in .editconfig for html files
- Loading branch information
Igor Degtiarov
authored
Jan 20, 2017
1 parent
f5db2b5
commit 818f571
Showing
20 changed files
with
1,897 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ charset = utf-8 | |
|
||
[*.yml] | ||
indent_size = 2 | ||
|
||
[*.html] | ||
indent_style = tab |
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,44 @@ | ||
<html> | ||
<head> | ||
<style> | ||
h3 { | ||
text-align: center; | ||
} | ||
table, tr, td { | ||
border: 1px solid black; | ||
border-collapse: collapse; | ||
text-align: justify; | ||
} | ||
td { | ||
padding-right: 5px; | ||
padding-left: 8px; | ||
padding-top: 2px; | ||
padding-bottom: 2px; | ||
height: 22px; | ||
width: 75px; | ||
text-align: center; | ||
} | ||
p { | ||
line-height: 150%; | ||
text-align: justify; | ||
} | ||
table { padding: 0px; } | ||
</style> | ||
<script type="text/javascript"> | ||
function resizeIframe() { | ||
height = document.getElementById('all').offsetHeight + 25; | ||
window.parent.document.getElementById("2006_data").height = height + 'px'; | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<table width="100%" border="1"> | ||
<h3>2006 Data</h3> | ||
<tr><td>16</td><td>13</td><td>11</td><td>1</td><td>19</td><td>5</td><td>2</td><td>23</td><td>-7</td><td>8</td><td>10</td></tr> | ||
<tr><td>15</td><td>-13</td><td>-7</td><td>6</td><td>23</td><td>-16</td><td>-25</td><td>6</td><td>-13</td><td>15</td><td>25</td></tr> | ||
<tr><td>3</td><td>2</td><td>14</td><td>23</td><td>9</td><td>10</td><td>-1</td><td>10</td><td>26</td><td>9</td><td>10</td></tr> | ||
<tr><td>19</td><td>10</td><td>22</td><td>-3</td><td>-10</td><td>1</td><td>7</td><td>14</td><td>-11</td><td>6</td><td>17</td></tr> | ||
<tr><td>8</td><td>29</td><td>23</td><td>10</td><td>-4</td><td>-7</td><td>2</td><td>10</td><td>10</td><td>14</td><td>6</td></tr> | ||
</table> | ||
</body> | ||
</html> |
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,109 @@ | ||
<html> | ||
<head> | ||
<style> | ||
table, tr, td { | ||
border: 1px solid black; | ||
border-collapse: collapse; | ||
text-align: justify; | ||
} | ||
td { | ||
padding-right: 5px; | ||
padding-left: 8px; | ||
padding-top: 2px; | ||
padding-bottom: 2px; | ||
height: 22px; | ||
width: 75px; | ||
text-align: justify; | ||
} | ||
p { | ||
line-height: 150%; | ||
text-align: justify; | ||
} | ||
table { padding: 0px; } | ||
</style> | ||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> | ||
<script src="//edx-adapt-dev.raccoongang.com/static/js/server_interaction.js" type="text/javascript"></script> | ||
<script type="text/javascript"> | ||
function getUrlVars() { | ||
var vars = {}; | ||
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { | ||
vars[key] = value; | ||
}); | ||
return vars; | ||
} | ||
|
||
function resizeIframe() { | ||
height = document.getElementById('all').offsetHeight + 25; | ||
window.parent.document.getElementById("table_form").height = height + 'px'; | ||
} | ||
|
||
function createTable(tablename) { | ||
dbg = document.getElementById("dbg"); | ||
table = document.getElementById(tablename); | ||
|
||
vars = getUrlVars(this.location.href); | ||
console.log(vars); | ||
console.log(vars["data"]); | ||
|
||
data = parent.document.getElementById(vars["data"]); | ||
//labelstring = vars["labels"]; | ||
|
||
data_matrixs = data.getAttribute('data'); | ||
data_matrix = JSON.parse(data_matrixs); | ||
|
||
var tableHTML = "<table>"; | ||
|
||
tableHTML += "<tr><td> </td><td>Celtics</td><td>Nets</td><td>Knicks</td><td>76ers</td><td>Raptors</td><td>Bulls</td><td>Cavaliers</td><td>Pistons</td></tr>"; | ||
|
||
teams = ['Rockets','Magic','Lakers','Blazers']; | ||
|
||
for (row in data_matrix) | ||
{ | ||
var rowlabel = parseInt(row)+1; | ||
tableHTML += "<tr> <td style=\"width:130px\">"+teams[rowlabel-1]+"</td>"; | ||
for (col in data_matrix[row]) | ||
{ | ||
tableHTML += "<td>" + data_matrix[row][col] + "</td>"; | ||
} | ||
tableHTML += "</tr>"; | ||
} | ||
tableHTML += "</table>"; | ||
table.innerHTML = tableHTML; | ||
} | ||
|
||
function display_problem_callback(e) | ||
{ | ||
if (e.detail.display == true) | ||
{ | ||
//We're in the right place, display the problem | ||
createTable("table"); | ||
resizeIframe(); | ||
} else { | ||
resizeIframe(); | ||
} | ||
} | ||
|
||
function display_problem_error_callback(e) | ||
{ | ||
document.getElementById('form').innerHTML = "Error connecting to RL server, panic wildly then notify somebody. " + e.detail.err; | ||
resizeIframe(); | ||
} | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<div id="all"> | ||
<p id="dbg"></p> | ||
<p id="table"></p> | ||
|
||
<script type="text/javascript"> | ||
vars = getUrlVars(); | ||
document.addEventListener("display_problem_request", display_problem_callback); | ||
document.addEventListener("display_problem_request_error", display_problem_error_callback); | ||
window.edx_adapt.display_problem_request(vars['user_id'], edx_adapt.get_problem_name()); | ||
|
||
</script> | ||
|
||
</div> | ||
</body> | ||
</html> |
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,89 @@ | ||
<html> | ||
<head> | ||
<style> | ||
table, tr, td { | ||
border: 1px solid black; | ||
border-collapse: collapse; | ||
text-align: justify; | ||
} | ||
td { | ||
padding-right: 5px; | ||
padding-left: 8px; | ||
padding-top: 2px; | ||
padding-bottom: 2px; | ||
height: 22px; | ||
width: 75px; | ||
text-align: justify; | ||
} | ||
p { | ||
line-height: 150%; | ||
text-align: justify; | ||
} | ||
table { padding: 0px; } | ||
</style> | ||
<script type="text/javascript"> | ||
function getUrlVars() { | ||
var vars = {}; | ||
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { | ||
vars[key] = value; | ||
}); | ||
return vars; | ||
} | ||
|
||
function resizeIframe() { | ||
height = document.getElementById('all').offsetHeight + 25; | ||
window.parent.document.getElementById("table_form").height = height + 'px'; | ||
} | ||
|
||
|
||
function createTable(tablename) { | ||
dbg = document.getElementById("dbg"); | ||
table = document.getElementById(tablename); | ||
|
||
vars = getUrlVars(this.location.href); | ||
console.log(vars); | ||
console.log(vars["data"]); | ||
|
||
data = parent.document.getElementById(vars["data"]); | ||
//labelstring = vars["labels"]; | ||
|
||
data_matrixs = data.getAttribute('data'); | ||
data_matrix = JSON.parse(data_matrixs); | ||
|
||
var tableHTML = "<table>"; | ||
|
||
//tableHTML += "<tr><td> </td><td>Celtics</td><td>Nets</td><td>Knicks</td><td>76ers</td><td>Raptors</td><td>Bulls</td><td>Cavaliers</td><td>Pistons</td></tr>"; | ||
|
||
teams = ['Treadmill A','Treadmill B','Treadmill C','Treadmill D']; | ||
|
||
for (row in data_matrix) | ||
{ | ||
var rowlabel = parseInt(row)+1; | ||
tableHTML += "<tr> <td style=\"width:130px\">"+teams[rowlabel-1]+"</td>"; | ||
for (col in data_matrix[row]) | ||
{ | ||
tableHTML += "<td>" + data_matrix[row][col] + "</td>"; | ||
} | ||
tableHTML += "</tr>"; | ||
} | ||
tableHTML += "</table>"; | ||
table.innerHTML = tableHTML; | ||
} | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<div id="all"> | ||
<p id="dbg"></p> | ||
<p id="table">Data under here? <br> | ||
|
||
</p> | ||
|
||
<script type="text/javascript"> | ||
createTable("table"); | ||
resizeIframe(); | ||
</script> | ||
|
||
</div> | ||
</body> | ||
</html> |
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,107 @@ | ||
<html> | ||
<head> | ||
<style> | ||
table, tr, td { | ||
border: 1px solid black; | ||
border-collapse: collapse; | ||
text-align: justify; | ||
} | ||
td { | ||
padding-right: 5px; | ||
padding-left: 8px; | ||
padding-top: 2px; | ||
padding-bottom: 2px; | ||
height: 22px; | ||
width: 75px; | ||
text-align: justify; | ||
} | ||
p { | ||
line-height: 150%; | ||
text-align: justify; | ||
} | ||
table { padding: 0px; } | ||
</style> | ||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> | ||
<script src="//edx-adapt-dev.raccoongang.com/static/js/server_interaction.js" type="text/javascript"></script> | ||
<script type="text/javascript"> | ||
function getUrlVars() { | ||
var vars = {}; | ||
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { | ||
vars[key] = value; | ||
}); | ||
return vars; | ||
} | ||
|
||
function resizeIframe() { | ||
height = document.getElementById('all').offsetHeight + 25; | ||
window.parent.document.getElementById("table_form2").height = height + 'px'; | ||
} | ||
|
||
|
||
function createTable(tablename) { | ||
dbg = document.getElementById("dbg"); | ||
table = document.getElementById(tablename); | ||
|
||
vars = getUrlVars(this.location.href); | ||
console.log(vars); | ||
console.log(vars["data"]); | ||
|
||
data = parent.document.getElementById(vars["data"]); | ||
//labelstring = vars["labels"]; | ||
|
||
data_matrixs = data.getAttribute('data'); | ||
data_matrix = JSON.parse(data_matrixs); | ||
|
||
var tableHTML = "<table>"; | ||
|
||
//tableHTML += "<tr><td> </td><td>Celtics</td><td>Nets</td><td>Knicks</td><td>76ers</td><td>Raptors</td><td>Bulls</td><td>Cavaliers</td><td>Pistons</td></tr>"; | ||
|
||
for (row in data_matrix) | ||
{ | ||
var rowlabel = parseInt(row)+1; | ||
tableHTML += "<tr>";// <td style=\"width:130px\">Game "+rowlabel+"</td>"; | ||
for (col in data_matrix[row]) | ||
{ | ||
tableHTML += "<td>" + data_matrix[row][col] + "</td>"; | ||
} | ||
tableHTML += "</tr>"; | ||
} | ||
tableHTML += "</table>"; | ||
table.innerHTML = tableHTML; | ||
} | ||
|
||
function display_problem_callback(e) | ||
{ | ||
if (e.detail.display == true) | ||
{ | ||
//We're in the right place, display the problem | ||
createTable("table"); | ||
resizeIframe(); | ||
} else { | ||
resizeIframe(); | ||
} | ||
} | ||
|
||
function display_problem_error_callback(e) | ||
{ | ||
document.getElementById('form').innerHTML = "Error connecting to RL server, panic wildly then notify somebody. " + e.detail.err; | ||
resizeIframe(); | ||
} | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<div id="all"> | ||
<p id="dbg"></p> | ||
<p id="table"></p> | ||
|
||
<script type="text/javascript"> | ||
vars = getUrlVars(); | ||
document.addEventListener("display_problem_request", display_problem_callback); | ||
document.addEventListener("display_problem_request_error", display_problem_error_callback); | ||
window.edx_adapt.display_problem_request(vars['user_id'], edx_adapt.get_problem_name()); | ||
</script> | ||
|
||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.