266 lines
10 KiB
HTML
266 lines
10 KiB
HTML
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset- "UTF-8" />
|
|
<meta name="description" content="Visualization of video lecture taxonomy">
|
|
<meta name="keywords" content="video, taxonomy, quality, properties, instruction, visualization">
|
|
<meta name="author" content="Martin Putzlocher">
|
|
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
|
<link rel='stylesheet' href='./css/w3.css'>
|
|
<link rel='stylesheet' href='./css/w3-colors-signal.css'>
|
|
|
|
<title>Video Taxonomy Visualization</title>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.1.1/chart.min.js"></script>
|
|
|
|
<script>
|
|
/*
|
|
function processForm(e) {
|
|
if (e.preventDefault) e.preventDefault();
|
|
|
|
// do what you want with the form
|
|
|
|
// You must return false to prevent the default form behavior
|
|
return false;
|
|
}
|
|
|
|
var form = document.getElementById('newEntryForm');
|
|
if (form.attachEvent) {
|
|
form.attachEvent("submit", processForm);
|
|
} else {
|
|
form.addEventListener("submit", processForm);
|
|
}
|
|
*/
|
|
Chart.defaults.font.size = 20;
|
|
function createChart(data, videotitle) {
|
|
var chrt = document.getElementById("chartId").getContext("2d");
|
|
var chartId = new Chart(chrt, {
|
|
type: 'radar',
|
|
data: {
|
|
labels: Array.from(data.keys()),
|
|
datasets: [{
|
|
label: videotitle,
|
|
data: Array.from(data.values()),
|
|
backgroundColor: "rgba(128,128,128,0.5)",
|
|
pointBackgroundColor: ['yellow', 'aqua', 'pink', 'lightgreen', 'lightblue', 'gold', 'maroon'],
|
|
borderColor: ['black'],
|
|
borderWidth: 1,
|
|
pointRadius: 6,
|
|
}],
|
|
},
|
|
options: {
|
|
scales: {
|
|
r: {
|
|
angleLines: {
|
|
display: true
|
|
},
|
|
min: 0,
|
|
max: 4,
|
|
ticks: {
|
|
// forces step size to be 50 units
|
|
stepSize: 1,
|
|
font: {
|
|
size: 20
|
|
}
|
|
}
|
|
}
|
|
},
|
|
responsive: false,
|
|
elements: {
|
|
line: {
|
|
borderWidth: 3
|
|
}
|
|
}
|
|
},
|
|
plugins: {
|
|
legend: {
|
|
labels: {
|
|
// This more specific font property overrides the global property
|
|
fontSize: 20
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
return chartId;
|
|
};
|
|
|
|
|
|
let data = new Map();
|
|
data.set("instructional principle", 4); // instructional principle
|
|
data.set("visibility", 2); // visibility / audio
|
|
data.set("segmentation", 3); // segmentation
|
|
data.set("activity", 4); // activity
|
|
data.set("interactivity", 4); // interactivity
|
|
data.set("dynamic drawing", 3); // dynamic drawing
|
|
data.set("translatability", 2); // translatability
|
|
|
|
function loadNewRadarChart(chartId, data, videotitle) {
|
|
// let removalIndex = chartId.data.datasets.indexOf(ds1); //Locate index of ds1
|
|
let removalIndex = 0;
|
|
if(removalIndex >= 0) { //make sure this element exists in the array
|
|
chartId.data.datasets.splice(removalIndex, 1);
|
|
}
|
|
|
|
// chartId.data.labels.push(Array.from(data.keys()));
|
|
chartId.data.datasets =[{
|
|
label: videotitle,
|
|
data: Array.from(data.values()),
|
|
backgroundColor: "rgba(128,128,128,0.5)",
|
|
pointBackgroundColor: ['yellow', 'aqua', 'pink', 'lightgreen', 'lightblue', 'gold', 'maroon'],
|
|
borderColor: ['black'],
|
|
borderWidth: 1,
|
|
pointRadius: 6,
|
|
}];
|
|
chartId.update();
|
|
|
|
};
|
|
|
|
function setNewValues() {
|
|
|
|
console.log("Hi!");
|
|
|
|
let nameValue = document.getElementById("videoname").value;
|
|
console.log(nameValue);
|
|
|
|
data_ins = parseInt(document.getElementById("ins_sel").value);
|
|
data.set("instructional principle", data_ins);
|
|
data_vis = parseInt(document.getElementById("vis_sel").value);
|
|
data.set("visibility", data_vis);
|
|
data_seg = parseInt(document.getElementById("seg_sel").value);
|
|
data.set("segmentation", data_seg);
|
|
data_act = parseInt(document.getElementById("act_sel").value);
|
|
data.set("activity", data_act);
|
|
data_int = parseInt(document.getElementById("int_sel").value);
|
|
data.set("interactivity", data_int);
|
|
data_dyn = parseInt(document.getElementById("dyn_sel").value);
|
|
data.set("dynamic drawing", data_dyn);
|
|
data_tra = parseInt(document.getElementById("tra_sel").value);
|
|
data.set("translatability", data_tra);
|
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
loadNewRadarChart(chartHandleId, data, nameValue);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h1 class="w3-container w3-green">Video lectures taxonomy</h1>
|
|
<h2 class="w3-container w3-gray">Video information</h2>
|
|
|
|
<div class="w3-light-gray">
|
|
<p>Please fill in information on your video</p>
|
|
<form name="newEntryForm" class="w3-container w3-white w3-border w3-border-green" action="javascript:setNewValues();">
|
|
<label class="w3-text-green" for="videoname"><b>Name of Video</b></label>
|
|
<input class="w3-input w3-border w3-light-grey" type="text" id="videoname" name="videoname" value="name of video">
|
|
|
|
<div class="w3-row-padding">
|
|
<div class="w3-half">
|
|
<label class="w3-text-green" for="ins_sel"><b>A Instructional principle</b></label>
|
|
<select class="w3-select w3-border w3-white" name="ins_sel" id="ins_sel">
|
|
<option value="0" selected>not acceptable</option>
|
|
<option value="1">minimal requirements</option>
|
|
<option value="2">medium quality</option>
|
|
<option value="3">high quality</option>
|
|
<option value="4">excellent quality</option>
|
|
<!-- further options -->
|
|
</select>
|
|
</div>
|
|
<div class="w3-half">
|
|
<label class="w3-text-green" for="vis_sel"><b>B Visibility / Audio</b></label>
|
|
<select class="w3-select w3-border w3-white" name="vis_sel" id="vis_sel">
|
|
<option value="0" selected>not acceptable</option>
|
|
<option value="1">minimal requirements</option>
|
|
<option value="2">medium quality</option>
|
|
<option value="3">high quality</option>
|
|
<option value="4">excellent quality</option>
|
|
<!-- further options -->
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="w3-row-padding">
|
|
<div class="w3-half">
|
|
<label class="w3-text-green" for="seg_sel"><b>C Segmentation</b></label>
|
|
<select class="w3-select w3-border w3-white" name="seg_sel" id="seg_sel">
|
|
<option value="0" selected>not acceptable</option>
|
|
<option value="1">minimal requirements</option>
|
|
<option value="2">medium quality</option>
|
|
<option value="3">high quality</option>
|
|
<option value="4">excellent quality</option>
|
|
<!-- further options -->
|
|
</select>
|
|
</div>
|
|
<div class="w3-half">
|
|
<label class="w3-text-green" for="act_sel"><b>D Activity</b></label>
|
|
<select class="w3-select w3-border w3-white" name="act_sel" id="act_sel">
|
|
<option value="0" selected>not acceptable</option>
|
|
<option value="1">minimal requirements</option>
|
|
<option value="2">medium quality</option>
|
|
<option value="3">high quality</option>
|
|
<option value="4">excellent quality</option>
|
|
<!-- further options -->
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="w3-row-padding">
|
|
<div class="w3-half">
|
|
<label class="w3-text-green" for="int_sel"><b>E Interactivity</b></label>
|
|
<select class="w3-select w3-border w3-white" name="int_sel" id="int_sel">
|
|
<option value="0" selected>not acceptable</option>
|
|
<option value="1">minimal requirements</option>
|
|
<option value="2">medium quality</option>
|
|
<option value="3">high quality</option>
|
|
<option value="4">excellent quality</option>
|
|
<!-- further options -->
|
|
</select>
|
|
</div>
|
|
<div class="w3-half">
|
|
<label class="w3-text-green" for="dyn_sel"><b>F Principle of Dynamic Drawing</b></label>
|
|
<select class="w3-select w3-border w3-white" name="dyn_sel" id="dyn_sel">
|
|
<option value="0" selected>not acceptable</option>
|
|
<option value="1">minimal requirements</option>
|
|
<option value="2">medium quality</option>
|
|
<option value="3">high quality</option>
|
|
<option value="4">excellent quality</option>
|
|
<!-- further options -->
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="w3-row-padding">
|
|
<div class="w3-half">
|
|
<label class="w3-text-green" for="tra_sel"><b>G Translatability</b></label>
|
|
<select class="w3-select w3-border w3-white" name="tra_sel" id="tra_sel">
|
|
<option value="0" selected>not acceptable</option>
|
|
<option value="1">minimal requirements</option>
|
|
<option value="2">medium quality</option>
|
|
<option value="3">high quality</option>
|
|
<option value="4">excellent quality</option>
|
|
<!-- further options -->
|
|
</select>
|
|
</div>
|
|
<div class="w3-half">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="w3-container w3-margin">
|
|
<input class="w3-btn w3-green" type="submit" name="do_entry" value="OK" onlick="javascript:setNewValues();">
|
|
<input class="w3-btn w3-grey" type="reset" name="reset" value="Reset">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<hr/>
|
|
<canvas id="chartId" aria-label="chart" height="500" width="700"></canvas>
|
|
|
|
<script>
|
|
let chartHandleId = createChart(data, "title");
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|