Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imawizard/measureup2anki
https://github.com/imawizard/measureup2anki
anki measureup
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/imawizard/measureup2anki
- Owner: imawizard
- Created: 2024-04-21T11:14:43.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-09-30T12:02:27.000Z (3 months ago)
- Last Synced: 2024-10-31T05:21:26.832Z (2 months ago)
- Topics: anki, measureup
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# measureup2anki
is just a small tool to help importing your bought MeasureUp tests into Anki.
## Usage
1. Log into your MeasureUp account
2. Open the learning locker
3. Get your `PHPSESSID` e.g. from the Developer Tools' network tab
4. Clone the repository and run the tool with:```sh
git clone https://github.com/imawizard/measureup2anki measureup2anki && cd $_
go run . dump $COOKIE [$TEST] # Insert your PHPSESSID here
# Leave 2nd param empty to get a list instead
go run . produce [$TEST]
```5. Create a deck in Anki and set up the card type
6. Import the .csv in `/out` into the Anki deck## Anki Card
### Front Template
```html
{{Text}}{{#Image}}
{{Image}}
{{/Image}}
{{#Exhibits}}
{{Exhibits}}
{{/Exhibits}}
var get = (i) => document.getElementById("option-" + i);
var show = (el) => el.classList.remove("hidden");
var options = [
`{{Option-1}}`,
`{{Option-2}}`,
`{{Option-3}}`,
`{{Option-4}}`,
`{{Option-5}}`,
`{{Option-6}}`,
`{{Option-7}}`,
`{{Option-8}}`,
].filter(o => String(o));
options
.map((o, i) => ["{{Type}}" !== "liveScreen" ? Math.random() * options.length : i, o])
.sort()
.map(p => p[1])
.forEach((o, i) => {
var el = get(i + 1);
show(el);
el.innerHTML = "<li>" + o + "</li>";
});
```
### Back Template
```html
{{Image}}
{{Explanation}}
var get = (i) => document.getElementById("option-" + i);
var getAll = () => Array.of(...document.getElementsByClassName("option"));
var show = (el) => el.classList.remove("hidden");
var wrong = (el) => el.classList.add("wrong");
var answer = {{Answer}};
switch ("{{Type}}") {
case "singleChoice":
show(get(answer));
break;
case "multipleChoice":
answer.forEach((i) => show(get(i)));
break;
case "contentTable":
getAll().forEach((el, i) => {
if (el.textContent == "") {
return;
}
show(el);
if (!answer.includes(i)) {
wrong(el);
}
});
break;
case "liveScreen":
for (var i = 1; i <= answer.length; i++) {
var el = get(i);
show(el);
var il = el.children[0];
il.innerHTML = il.innerHTML.split(" ╱ ")[answer[i - 1]];
}
break;
case "buildList":
case "buildListReorder":
// Do nothing as the explanation already includes the answer.
case "selectPlaceMup":
// Do nothing, just show the explanation.
break;
}
```
### Styling
```css
.card {
font-family: arial;
font-size: 18px;
text-align: left;
color: black;
background-color: white;
}
.option {
list-style-type: circle;
}
.option.back {
}
.image {
border: solid 1px;
background: white;
border-radius: 4px;
}
.exhibit {
border: solid 1px;
background: white;
border-radius: 4px;
}
.hidden {
display: none;
}
.wrong {
text-decoration: line-through;
}
```