-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwwconvert.html
59 lines (59 loc) · 2.54 KB
/
wwconvert.html
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<html>
<head>
<title>WebWork Classlist Converter</title>
<script type="text/javascript" src="libjs/papaparse.min.js"></script>
<script type="text/javascript" src="libjs/clipboard.min.js"></script>
<script type="text/javascript" src="wwconvert.js"></script>
<style type="text/css">
.textdump {
width: 100%;
height: 10em;
}
</style>
</head>
<body>
<h1>Athena CSV ↦ WebWork .lst converter</h1>
<p>This webpage will let you load (or paste) an UGA Athena CSV export file
into the standard format for WebWork .lst import suggested at
<a href="http://www.math.uga.edu/webwork">the WebWork FAQ</a>.</p>
<p>All of the code is local javascript that should work in a modern
browser (I've tested a new version of Chrome) and should <em>involve
no network calls beyond the initial page load</em>. This means that
this webapp should be entirely safe to use with your students'
sensitive data! I however make no guarantee of this, and you are
advised to either
<a href="https://github.com/hchapman/uga-webwork-tools">read the
source</a>
yourself, or not use the service.</p>
<h2>1. Upload or paste your Athena CSV data</h2>
<input type="file" id="csvupload"
onchange="loadFileToTextarea(this.files, this.dataset.dstid)"
data-dstid="csvdata"><br>
<textarea id="csvdata"
class="textdump"></textarea><br>
<h2>2. Click the convert button</h2>
<input type="button" id="convert"
onclick="convertData(this.dataset.srcid, this.dataset.dstid)"
value="Convert!"
data-srcid="csvdata"
data-dstid="lstdata"><br>
<h2>3. Copy the WebWork .lst formatted data into WebWork</h2>
<textarea id="lstdata"
class="textdump"></textarea>
<input type="button" id="copybutton" value="Copy to Clipboard"
data-clipboard-target="#lstdata"
data-tooltip="#copyinfo">
<span id="copyinfo"></span>
</body>
<script type="text/javascript">
var clipboard = new Clipboard("#copybutton");
clipboard.on('success', function(e) {
var tip = document.querySelector(e.trigger.dataset.tooltip);
tip.innerHTML = "Copied!";
});
clipboard.on('error', function(e) {
var tip = document.querySelector(e.trigger.dataset.tooltip);
tip.innerHTML = "Press ⌘+C or Ctrl+C to copy!";
});
</script>
</html>