This repository was archived by the owner on Apr 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSWAPRhtmlOutput.py
More file actions
45 lines (37 loc) · 1.73 KB
/
SWAPRhtmlOutput.py
File metadata and controls
45 lines (37 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import sys
#takes in information from the webparser. Insert arguments as a list, which should be: [question number, question, evaluator response, comments]
#*Make sure to use finish() to close out of the document*
class htmlOutput:
def __init__(self, labNumber):
self.file=open("./lab" + str(labNumber) + ".html" , "wt")
self.file.write(
"""<b>This is how the course instructors evaluated this video. Please compare your own responses to the instructors' responses:</b>
<br><br>
<table>
<tbody>
<tr>
<td width="3%">#</td>
<td width="37%">Assessment Item</td>
<td width="60%">Instructors' Response</td>
</tr>""")
def addItem(self, item):
if len(item) != 4:
sys.exit("only three items in evaluator assessment. input : " + item)
self.file.write("""\n
<tr>
<td>""" + str(item[0]) + """</td>
<td><b>""" + str(item[1]) + """</b>
</td>
<td><b>""" + str(item[2]) + """</b>""" + str(item[3]) + """<br><br></td>
</tr>""")
def finish(self):
self.file.write("""
</tbody>
</table>""")
self.file.close()
if False:
#this will create lab2.html in current directory
z = htmlOutput(2)
z.addItem([1, "The video presentation is clear and easy to follow.", "STRONGLY AGREE", "The student does an excellent job highlighting what he is talking about through zooming, highlighting with animated boxes, and clearly speaking."])
z.addItem([2, "Does the video introduce the problem and state the main result?", "HARD TO TELL", "He has done a better job than the previous videos, but it still need more work so that a person who doesn't know anything about this lab can still have a clear picture about what's going on in the lab from the beginning of the presentation."])
z.finish()