Skip to content

Commit a2fc658

Browse files
authored
Templates for flask
1 parent 646fdbf commit a2fc658

File tree

4 files changed

+202
-0
lines changed

4 files changed

+202
-0
lines changed

templates/bg.jpg

120 KB
Loading

templates/home.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<HTML>
2+
<head>
3+
4+
5+
</head>
6+
7+
<body>
8+
<h1>HELLO</h1>
9+
10+
11+
</body>
12+
</HTML>

templates/homepage.html

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
5+
</script>
6+
<script>
7+
function abc()
8+
{
9+
document.getElementById("ss").value=($('#ddlist option:selected').text());
10+
11+
if($('#ddlist option:selected').val()=="")
12+
{
13+
alert("Please Select a course to proceed.....");
14+
}
15+
else
16+
{
17+
confirm("The webcamera will be used for monitoring your understanding of the course material and receiving feedbcak w.r.t the video");
18+
19+
document.getElementById("form_dd").submit();
20+
}
21+
}
22+
</script>
23+
<body background="/static/bg.jpg" style="background-repeat: no-repeat; background-size: cover;" >
24+
<center>
25+
<div style="background-color: cyan;width: 50%;height: 80%">
26+
<br>
27+
<H1>DLearn</h1>
28+
<H3><i>A Deep Learning approach for Learning</i></h3>
29+
30+
<br>
31+
<br>
32+
Select a lecture to watch........
33+
<br><br>
34+
<form method="GET" action="{{ url_for('home') }}" id="form_dd" onsubmit="abc()">
35+
<select id="ddlist" name="video_id" >
36+
<option value="">Select</option>
37+
<option value="VO5vKowfMOQ">Perceptron</option>
38+
<option value="lkha188L4Gs">Universal Approximation Theorem</option>
39+
<option value="9kAQ8Em7SdM">Optimization</option>
40+
<option value="lTPg1hhd5Rs">Backpropagation Algorithm</option>
41+
<option value="cK_CK5u2p78">Gradient Descent</option>
42+
<option value="sd7qhTKIi4Y">Convergence</option>
43+
<option value="fChBkJ_UjRw">Regularization</option>
44+
<option value="2XbZ03D0Sf4">Convolutional Neural Networks</option>
45+
</select>
46+
<input type="hidden" name="subject" id="ss" value=""/>
47+
<input type="Submit" value="Submit" />
48+
<br><br><br><br>
49+
</form>
50+
</div>
51+
</body>
52+
</html>

templates/new.html

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
5+
6+
<script>
7+
// 2. This code loads the IFrame Player API code asynchronously.
8+
var tag = document.createElement('script');
9+
var first_launch = true;
10+
tag.src = "https://www.youtube.com/iframe_api";
11+
var firstScriptTag = document.getElementsByTagName('script')[0];
12+
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
13+
var tm='';
14+
15+
16+
17+
18+
19+
// 3. This function creates an <iframe> (and YouTube player)
20+
// after the API code downloads.
21+
var player;
22+
function onYouTubeIframeAPIReady() {
23+
24+
player = new YT.Player('player', {
25+
height: '390',
26+
width: '640',
27+
videoId: document.getElementById("v1").value,
28+
events: {
29+
'onReady': onPlayerReady,
30+
'onStateChange': onPlayerStateChange
31+
}
32+
});
33+
}
34+
35+
// 4. The API will call this function when the video player is ready.
36+
function onPlayerReady(event) {
37+
event.target.playVideo();
38+
}
39+
40+
// 5. The API calls this function when the player's state changes.
41+
// The function indicates that when playing a video (state=1),
42+
// the player should play for six seconds and then stop.
43+
var done = false;
44+
function onPlayerStateChange(event) {
45+
46+
if (event.data == YT.PlayerState.PLAYING && !done) {
47+
if(first_launch){
48+
document.getElementById("fm1").submit()
49+
50+
first_launch=false
51+
}
52+
setTimeout(stopVideo, 6000000);
53+
done = true;
54+
55+
}
56+
57+
58+
}
59+
60+
61+
function stopVideo() {
62+
player.stopVideo();
63+
64+
}
65+
66+
67+
68+
69+
function abc()
70+
{
71+
temp=player.getCurrentTime();
72+
//window.sessionStorage.setItem("iden",temp);
73+
confrim("Do u want to?");
74+
75+
}
76+
77+
function loadingPage(){
78+
79+
var st=document.getElementById("state_id").value;
80+
81+
if(st=="confused")
82+
{
83+
84+
s=document.getElementById("s1").value;
85+
v=document.getElementById("v1").value;
86+
skt=document.getElementById("seek1").value;
87+
88+
document.getElementById("url_for_rec").action="{{ url_for('perform_rec') }}"+"?subject="+s+"&video_id="+v+"&seek_time="+skt;
89+
console.log(document.getElementById("url_for_rec"));
90+
document.getElementById("url_for_rec").submit();
91+
}
92+
93+
}
94+
95+
</script>
96+
97+
98+
99+
</head >
100+
<body onload="loadingPage()" onbeforeunload="abc()" background="/static/bg1.jpg" style=""><center>
101+
102+
<!-- 1. The <iframe> (and video player) will replace this <div> tag. -->
103+
<div id="player" style="background-color: lightblue;" width=100% height=200%>
104+
</div>
105+
106+
<form action="{{ url_for('launch') }}" id="fm1">
107+
<input type ='hidden' id="s2" name='subject' value='{{sub}}'/>
108+
<input type='hidden' id="v2" name='video_id' value='{{you_vid}}'/>
109+
<input type='hidden' id="seek2" name='seek_time' value={{ seek_time }}/>
110+
111+
112+
</form>
113+
114+
<form method="GET" action="" id="url_for_rec" enctype = "multipart/form-data">
115+
<input type ='hidden' id="s1" name='subject' value='{{sub}}'/>
116+
<input type='hidden' id="v1" name='video_id' value='{{you_vid}}'/>
117+
<input type='hidden' id="seek1" name='seek_time' value={{ seek_time }}/>
118+
119+
120+
<input id="state_id" type="hidden" value="{{ state }}">
121+
122+
<div id="player" style="background-color: lightblue" width=90% height=200%>
123+
<br>
124+
<h3><i>Additional Notes</i></h3>
125+
126+
{% if state!= 'NONE' %}
127+
128+
{% endif %}
129+
130+
<textarea rows="25" cols="100">{{ wl }}</textarea>
131+
132+
{% if seek_time!= "NONE" %}
133+
134+
{% endif %}
135+
</div>
136+
</center>
137+
</body>
138+
</html>

0 commit comments

Comments
 (0)