Commit 388ab813 authored by Curtis Adam's avatar Curtis Adam

Add a new card type "Lecture with transcription bonus" and expand the card type configuration

parent 1f281f84
...@@ -1526,6 +1526,28 @@ ...@@ -1526,6 +1526,28 @@
"subject": "Thema" "subject": "Thema"
} }
}, },
"cardType19": {
"name": "Vorlesung mit Bonus-Mitschriften",
"longName": "Vorlesung mit Bonus-Mitschriften: A | B | C | D | E | F",
"content1": "A",
"content2": "B",
"content3": "C",
"content4": "D",
"content5": "E",
"content6": "F",
"placeholders": {
"subject": "Gib das Thema des Würfels an!",
"content1": "Vorne",
"content2": "Rechts",
"content3": "Hinten",
"content4": "Links",
"content5": "Oben",
"content6": "Unten"
},
"editorLabels": {
"subject": "Thema"
}
},
"tooltip": { "tooltip": {
"toggle3D": "3D-Ansicht aktivieren / deaktivieren", "toggle3D": "3D-Ansicht aktivieren / deaktivieren",
"contrast": "Setze die Präsentation in den Kontrastmodus", "contrast": "Setze die Präsentation in den Kontrastmodus",
......
...@@ -1528,6 +1528,28 @@ ...@@ -1528,6 +1528,28 @@
"subject": "Thema" "subject": "Thema"
} }
}, },
"cardType19": {
"name": "Vorlesung mit Bonus-Mitschriften",
"longName": "Vorlesung mit Bonus-Mitschriften: A | B | C | D | E | F",
"content1": "A",
"content2": "B",
"content3": "C",
"content4": "D",
"content5": "E",
"content6": "F",
"placeholders": {
"subject": "Gib das Thema des Würfels an!",
"content1": "Vorne",
"content2": "Rechts",
"content3": "Hinten",
"content4": "Links",
"content5": "Oben",
"content6": "Unten"
},
"editorLabels": {
"subject": "Thema"
}
},
"tooltip": { "tooltip": {
"contrast": "Setze die Präsentation in den Kontrastmodus", "contrast": "Setze die Präsentation in den Kontrastmodus",
"backToCardset": "Zurück zur Karteiansicht", "backToCardset": "Zurück zur Karteiansicht",
......
...@@ -143,6 +143,10 @@ export let CardType = class CardType { ...@@ -143,6 +143,10 @@ export let CardType = class CardType {
return config.cardTypesWithLearningUnit.includes(cardType); return config.cardTypesWithLearningUnit.includes(cardType);
} }
static gotTranscriptBonus (cardType) {
return config.cardTypesWithTranscriptBonus.includes(cardType);
}
static gotLearningGoal (cardType) { static gotLearningGoal (cardType) {
return config.cardTypesWithLearningGoal.includes(cardType); return config.cardTypesWithLearningGoal.includes(cardType);
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
//16: Zielerreichung //16: Zielerreichung
//17: Inverses Fragen //17: Inverses Fragen
//18: Cube //18: Cube
//19: Vorlesung mit Bonus-Mitschrift
let cardTypesWithDictionary = [1]; let cardTypesWithDictionary = [1];
let cardTypesWithDifficultyLevel = [0, 1, 3, 5, 6, 7, 11, 12, 13, 15, 17, 18]; let cardTypesWithDifficultyLevel = [0, 1, 3, 5, 6, 7, 11, 12, 13, 15, 17, 18];
let cardTypesWithLearningModes = [0, 1, 3, 4, 5, 6, 11, 12, 13, 15, 16, 17]; let cardTypesWithLearningModes = [0, 1, 3, 4, 5, 6, 11, 12, 13, 15, 16, 17];
...@@ -27,6 +28,7 @@ let cardTypesWithCardsetTitleNavigation = [14]; ...@@ -27,6 +28,7 @@ let cardTypesWithCardsetTitleNavigation = [14];
let cardTypesWithSwapAnswerQuestionButton = [1, 17]; let cardTypesWithSwapAnswerQuestionButton = [1, 17];
let cardTypesWithDefaultMobilePreview = [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; let cardTypesWithDefaultMobilePreview = [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let cardTypesWithMarkdeepHelp = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]; let cardTypesWithMarkdeepHelp = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18];
let cardTypesWithTranscriptBonus = [19];
let cardTypesOrder = [ let cardTypesOrder = [
{cardType: 0}, {cardType: 0},
{cardType: 15}, {cardType: 15},
...@@ -45,7 +47,8 @@ let cardTypesOrder = [ ...@@ -45,7 +47,8 @@ let cardTypesOrder = [
{cardType: 8}, {cardType: 8},
{cardType: 9}, {cardType: 9},
{cardType: 14}, {cardType: 14},
{cardType: 18} {cardType: 18},
{cardType: 19}
]; ];
//0: left //0: left
...@@ -359,6 +362,33 @@ let cardTypeCubeSides = [ ...@@ -359,6 +362,33 @@ let cardTypeCubeSides = [
} }
], ],
//18: Kubus //18: Kubus
[
{
"contentId": 1,
"defaultStyle": "default"
},
{
"contentId": 2,
"defaultStyle": "default"
},
{
"contentId": 3,
"defaultStyle": "default"
},
{
"contentId": 4,
"defaultStyle": "default"
},
{
"contentId": 5,
"defaultStyle": "default"
},
{
"contentId": 6,
"defaultStyle": "default"
}
],
//19: Vorlesung mit Bonus-Mitschrift
[ [
{ {
"contentId": 1, "contentId": 1,
...@@ -402,5 +432,6 @@ module.exports = { ...@@ -402,5 +432,6 @@ module.exports = {
defaultTextAlign, defaultTextAlign,
defaultCentered, defaultCentered,
swapAnserQuestionCardTypeResult, swapAnserQuestionCardTypeResult,
cardTypeCubeSides cardTypeCubeSides,
cardTypesWithTranscriptBonus
}; };
...@@ -965,4 +965,21 @@ const markdeepHelper = new MeteorMathJax.Helper({ ...@@ -965,4 +965,21 @@ const markdeepHelper = new MeteorMathJax.Helper({
} }
}); });
Template.registerHelper("gotTranscriptBonus", function (cardset_id) {
let cardset = Cardsets.findOne({_id: cardset_id}, {fields: {_id: 1, cardGroups: 1, shuffled: 1, cardType: 1}});
if (cardset !== undefined) {
if (cardset.shuffled) {
let cardsetGroup;
for (let i = 0; i < cardset.cardGroups.length; i++) {
cardsetGroup = Cardsets.findOne({_id: cardset.cardGroups[i]}, {fields: {_id: 1, cardType: 1}});
if (cardsetGroup !== undefined && CardType.gotTranscriptBonus(cardsetGroup.cardType)) {
return true;
}
}
} else if (CardType.gotTranscriptBonus(cardset.cardType)) {
return true;
}
}
});
Template.registerHelper('markdeep', markdeepHelper.getTemplate()); Template.registerHelper('markdeep', markdeepHelper.getTemplate());
...@@ -2,8 +2,9 @@ import {Cardsets} from "../../../../api/cardsets"; ...@@ -2,8 +2,9 @@ import {Cardsets} from "../../../../api/cardsets";
import {Session} from "meteor/session"; import {Session} from "meteor/session";
import {TranscriptBonus, TranscriptBonusList} from "../../../../api/transcriptBonus"; import {TranscriptBonus, TranscriptBonusList} from "../../../../api/transcriptBonus";
import {Route} from "../../../../api/route"; import {Route} from "../../../../api/route";
import "./learningUnit.html";
import {Template} from "meteor/templating"; import {Template} from "meteor/templating";
import {CardType} from "../../../../api/cardTypes";
import "./learningUnit.html";
/* /*
* ############################################################################ * ############################################################################
...@@ -19,21 +20,23 @@ Template.selectLearningUnit.helpers({ ...@@ -19,21 +20,23 @@ Template.selectLearningUnit.helpers({
}).fetch(); }).fetch();
let lectures = []; let lectures = [];
for (let c = 0; c < cardsets.length; c++) { for (let c = 0; c < cardsets.length; c++) {
for (let d = 0; d < cardsets[c].transcriptBonus.dates.length; d++) { if (CardType.gotTranscriptBonus(cardsets[c].cardType)) {
let transcriptBonus = cardsets[c].transcriptBonus; for (let d = 0; d < cardsets[c].transcriptBonus.dates.length; d++) {
transcriptBonus.cardset_id = cardsets[c]._id; let transcriptBonus = cardsets[c].transcriptBonus;
if (TranscriptBonusList.canBeSubmittedToLecture(transcriptBonus, d)) { transcriptBonus.cardset_id = cardsets[c]._id;
let lecture = {}; if (TranscriptBonusList.canBeSubmittedToLecture(transcriptBonus, d)) {
lecture.name = cardsets[c].name; let lecture = {};
lecture.info = TranscriptBonusList.getLectureInfo(cardsets[c].transcriptBonus, d); lecture.name = cardsets[c].name;
lecture.cardset_id = cardsets[c]._id; lecture.info = TranscriptBonusList.getLectureInfo(cardsets[c].transcriptBonus, d);
lecture.date_id = d; lecture.cardset_id = cardsets[c]._id;
lecture.shuffled = cardsets[c].shuffled; lecture.date_id = d;
lecture.quantity = cardsets[c].quantity; lecture.shuffled = cardsets[c].shuffled;
lecture.cardType = cardsets[c].cardType; lecture.quantity = cardsets[c].quantity;
lecture.difficulty = cardsets[c].difficulty; lecture.cardType = cardsets[c].cardType;
lecture.kind = cardsets[c].kind; lecture.difficulty = cardsets[c].difficulty;
lectures.push(lecture); lecture.kind = cardsets[c].kind;
lectures.push(lecture);
}
} }
} }
} }
......
...@@ -2,11 +2,13 @@ ...@@ -2,11 +2,13 @@
{{#if this.quantity}} {{#if this.quantity}}
{{#if isPublished this.kind}} {{#if isPublished this.kind}}
{{#if isCardsetOwnerAndLecturer _id}} {{#if isCardsetOwnerAndLecturer _id}}
{{#if gotTranscriptBonus _id}}
<div class="hidden-xs btn-group"> <div class="hidden-xs btn-group">
<a type="button" id="transcriptBonus" class="btn btn-sm btn-raised transcriptsBtn" <a type="button" id="transcriptBonus" class="btn btn-sm btn-raised transcriptsBtn"
{{disableIfOffline}}><span class="flex-content">{{{getNavigationIcon "transcript"}}}{{_ "transcriptForm.bonus.button"}}</span> {{disableIfOffline}}><span class="flex-content">{{{getNavigationIcon "transcript"}}}{{_ "transcriptForm.bonus.button"}}</span>
</a> </a>
</div> </div>
{{/if}}
{{/if}} {{/if}}
{{/if}} {{/if}}
{{/if}} {{/if}}
......
...@@ -136,13 +136,15 @@ ...@@ -136,13 +136,15 @@
</a> </a>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if gotBonus this.transcriptBonus.enabled}} {{#if gotTranscriptBonus this._id}}
{{#if isCardsetOwner this._id}} {{#if gotBonus this.transcriptBonus.enabled}}
<a class="resultNavigationElement bonusTranscriptProgress" data-id="{{this._id}}" {{#if isCardsetOwner this._id}}
title="{{_ <a class="resultNavigationElement bonusTranscriptProgress" data-id="{{this._id}}"
"transcriptForm.bonus.form.button.list"}}"> title="{{_
<i class="fa fa-clipboard" data-id="{{this._id}}"></i> "transcriptForm.bonus.form.button.list"}}">
</a> <i class="fa fa-clipboard" data-id="{{this._id}}"></i>
</a>
{{/if}}
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if isActiveRoute regex="shuffle"}} {{#if isActiveRoute regex="shuffle"}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment