Commit 3d8f162e authored by Curtis Adam's avatar Curtis Adam

Add cardType category to cardsets

parent d1f3f69f
......@@ -591,8 +591,8 @@
},
"card": {
"cardType0": {
"name": "Lerneinheit",
"front": "Lernzielfrage",
"name": "Lernkartei",
"front": "Lernziel",
"back": "Lernziel-Review",
"hint": "Links | Literatur ",
"lecture": "Lerninhalt",
......@@ -607,7 +607,7 @@
}
},
"cardType1": {
"name": "Vokabel",
"name": "Vokabeltrainer",
"front": "Fremdwort",
"back": "Übersetzung",
"placeholders": {
......@@ -645,7 +645,7 @@
}
},
"cardType4": {
"name": "Zitat",
"name": "Zitatensammlung",
"front": "Zitat",
"back": "Zitierte Person",
"hint": "Quellenangabe",
......@@ -671,6 +671,32 @@
"editorLabels": {
"subject": "Kompetenzziel"
}
},
"cardType6": {
"name": "Befehlssatz",
"front": "Fachbegriff",
"back": "Definition | Beschreibung",
"placeholders": {
"front": "Fachbegriff",
"back": "Definition | Beschreibung des Fachbegriffs"
},
"editorLabels": {
"subject": "Thema"
}
},
"cardType7": {
"name": "Abstracts",
"front": "Abstracts",
"back": "Zitierte Person",
"hint": "Quellenangabe",
"placeholders": {
"front": "Zitat",
"back": "Zitierte Person",
"hint": "Quellenangabe"
},
"editorLabels": {
"subject": "Thema"
}
}
},
"courseIteration": {
......
......@@ -699,6 +699,32 @@
"editorLabels": {
"subject": "Subject"
}
},
"cardType6": {
"name": "Instruction set",
"front": "Frontside",
"back": "Definition",
"placeholders": {
"front": "Frontside",
"back": "Definition"
},
"editorLabels": {
"subject": "Subject"
}
},
"cardType7": {
"name": "Abstracts",
"front": "Abstracts",
"back": "Cited person",
"hint": "Reference",
"placeholders": {
"front": "Citation",
"back": "Cited person",
"hint": "Reference"
},
"editorLabels": {
"subject": "Subject"
}
}
},
"courseIteration": {
......
......@@ -173,9 +173,6 @@ var CardsSchema = new SimpleSchema({
cardGroup: {
type: String
},
cardType: {
type: Number
},
lecture: {
type: String,
optional: true,
......@@ -201,13 +198,16 @@ var CardsSchema = new SimpleSchema({
learningUnit: {
type: String,
optional: true
},
cardType: {
type: Number
}
});
Cards.attachSchema(CardsSchema);
Meteor.methods({
addCard: function (cardset_id, subject, hint, front, back, difficulty, cardGroup, cardType, lecture, centerTextElement, date, learningGoalLevel, backgroundStyle, learningUnit) {
addCard: function (cardset_id, subject, hint, front, back, difficulty, cardGroup, lecture, centerTextElement, date, learningGoalLevel, backgroundStyle, learningUnit) {
check(cardset_id, String);
check(subject, String);
check(hint, String);
......@@ -215,7 +215,6 @@ Meteor.methods({
check(back, String);
check(difficulty, Number);
check(cardGroup, String);
check(cardType, Number);
check(lecture, String);
check(centerTextElement, [Boolean]);
check(date, Date);
......@@ -231,7 +230,7 @@ Meteor.methods({
if (!cardset.shuffled) {
cardGroup = "0";
}
if (cardType !== 2 || cardType !== 3 || cardType !== 5) {
if (cardset.cardType !== 2 || cardset.cardType !== 3 || cardset.cardType !== 5) {
if (subject === "") {
throw new Meteor.Error("Missing subject");
}
......@@ -248,13 +247,13 @@ Meteor.methods({
cardset_id: cardset_id,
difficulty: difficulty,
cardGroup: cardGroup,
cardType: cardType,
lecture: lecture,
centerTextElement: centerTextElement,
date: date,
learningGoalLevel: learningGoalLevel,
backgroundStyle: backgroundStyle,
learningUnit: learningUnit
learningUnit: learningUnit,
cardType: cardset.cardType
}, function (err, card) {
card_id = card;
});
......@@ -364,14 +363,13 @@ Meteor.methods({
});
}
},
updateCard: function (card_id, subject, hint, front, back, difficulty, cardType, lecture, centerTextElement, date, learningGoalLevel, backgroundStyle, learningUnit) {
updateCard: function (card_id, subject, hint, front, back, difficulty, lecture, centerTextElement, date, learningGoalLevel, backgroundStyle, learningUnit) {
check(card_id, String);
check(subject, String);
check(hint, String);
check(front, String);
check(back, String);
check(difficulty, Number);
check(cardType, Number);
check(lecture, String);
check(centerTextElement, [Boolean]);
check(date, Date);
......@@ -390,7 +388,7 @@ Meteor.methods({
throw new Meteor.Error("not-authorized");
}
}
if (cardType !== 2 || cardType !== 3 || cardType !== 5) {
if (cardset.cardType !== 2 || cardset.cardType !== 3 || cardset.cardType !== 5) {
if (subject === "") {
throw new Meteor.Error("Missing subject");
}
......@@ -406,13 +404,13 @@ Meteor.methods({
front: front,
back: back,
difficulty: difficulty,
cardType: cardType,
lecture: lecture,
centerTextElement: centerTextElement,
date: date,
learningGoalLevel: learningGoalLevel,
backgroundStyle: backgroundStyle,
learningUnit: learningUnit
learningUnit: learningUnit,
cardType: cardset.cardType
}
});
Cardsets.update(card.cardset_id, {
......
......@@ -47,7 +47,14 @@ if (Meteor.isServer) {
if (Meteor.settings.public.university.singleUniversity) {
universityFilter = Meteor.settings.public.university.default;
}
return Cardsets.find({college: {$ifNull: [universityFilter, {$exists: true}]}}, {fields: {_id: 1, name: 1, quantity: 1, kind: 1}});
return Cardsets.find({college: {$ifNull: [universityFilter, {$exists: true}]}}, {
fields: {
_id: 1,
name: 1,
quantity: 1,
kind: 1
}
});
});
}
......@@ -167,6 +174,9 @@ const CardsetsSchema = new SimpleSchema({
},
cardGroups: {
type: [String]
},
cardType: {
type: Number
}
});
......@@ -221,8 +231,9 @@ Meteor.methods({
* @param {String} course - Assigned university course
* @param {Boolean} shuffled - Is the cardset made out of shuffled cards
* @param {String} cardGroups - The group names of the shuffled cards
* @param {Number} cardType - The type that this cardset allows
*/
addCardset: function (name, description, visible, ratings, kind, moduleActive, module, moduleShort, moduleNum, moduleLink, college, course, shuffled, cardGroups) {
addCardset: function (name, description, visible, ratings, kind, moduleActive, module, moduleShort, moduleNum, moduleLink, college, course, shuffled, cardGroups, cardType) {
if (Meteor.settings.public.university.singleUniversity || college === "") {
college = Meteor.settings.public.university.default;
}
......@@ -239,6 +250,7 @@ Meteor.methods({
check(college, String);
check(course, String);
check(shuffled, Boolean);
check(cardType, Number);
let quantity;
if (shuffled) {
if (!Roles.userIsInRole(Meteor.userId(), ['admin', 'editor', 'lecturer', 'university', 'pro'])) {
......@@ -291,7 +303,8 @@ Meteor.methods({
webNotification: true,
wordcloud: false,
shuffled: shuffled,
cardGroups: cardGroups
cardGroups: cardGroups,
cardType: cardType
});
},
/**
......@@ -489,8 +502,9 @@ Meteor.methods({
* @param {String} moduleLink - Link to the module description
* @param {String} college - Assigned university
* @param {String} course - Assigned university course
* @param {Number} cardType - The type that this cardset allows
*/
updateCardset: function (id, name, description, moduleActive, module, moduleShort, moduleNum, moduleLink, college, course) {
updateCardset: function (id, name, description, moduleActive, module, moduleShort, moduleNum, moduleLink, college, course, cardType) {
if (Meteor.settings.public.university.singleUniversity) {
college = Meteor.settings.public.university.default;
}
......@@ -504,9 +518,10 @@ Meteor.methods({
check(moduleLink, String);
check(college, String);
check(course, String);
check(cardType, Number);
// Make sure only the task owner can make a task private
var cardset = Cardsets.findOne(id);
let cardset = Cardsets.findOne(id);
if (!Roles.userIsInRole(this.userId, [
'admin',
......@@ -528,9 +543,23 @@ Meteor.methods({
moduleNum: moduleNum.trim(),
moduleLink: moduleLink.trim(),
college: college.trim(),
course: course.trim()
course: course.trim(),
cardType: cardType
}
});
Cards.update({
cardset_id: cardset._id
},
{
$set: {
cardType: cardType
}
},
{
multi: true
}
);
},
/**
* Update the cardGroups of the shuffled cardset
......
......@@ -134,10 +134,10 @@ Router.route('/cardset/:_id/newcard', {
}
});
Router.route('/cardset/:_id/editcard/:cardid', {
Router.route('/cardset/:_id/editcard/:card_id', {
name: 'editCard',
data: function () {
return Cards.findOne({_id: this.params.cardid});
return Cards.findOne({_id: this.params.card_id});
}
});
......
......@@ -58,7 +58,8 @@ var initTestNotificationsCardset = function () {
"learners": 0,
"editors": [],
"shuffled": false,
"cardGroups": []
"cardGroups": [],
"cardType": 0
}
];
};
......@@ -74,11 +75,11 @@ var initTestNotificationsCards = function () {
"hint": "Hint of NotificationsTest: Card Nr. 1",
"cardset_id": "NotificationsTestCardset",
"cardGroup": "0",
"cardType": 0,
"lecture": "",
"centerTextElement": [false, false, false, false],
"learningGoalLevel": 0,
"backgroundStyle": 0
"backgroundStyle": 0,
"cardType": 0
},
{
"_id": "NotificationsTestCard2",
......@@ -89,11 +90,11 @@ var initTestNotificationsCards = function () {
"hint": "Hint of NotificationsTest: Card Nr. 2",
"cardset_id": "NotificationsTestCardset",
"cardGroup": "0",
"cardType": 0,
"lecture": "",
"centerTextElement": [false, false, false, false],
"learningGoalLevel": 1,
"backgroundStyle": 0
"backgroundStyle": 0,
"cardType": 0
},
{
"_id": "NotificationsTestCard3",
......@@ -104,11 +105,11 @@ var initTestNotificationsCards = function () {
"hint": "Hint of NotificationsTest: Card Nr. 3",
"cardset_id": "NotificationsTestCardset",
"cardGroup": "0",
"cardType": 0,
"lecture": "",
"centerTextElement": [false, false, false, false],
"learningGoalLevel": 2,
"backgroundStyle": 0
"backgroundStyle": 0,
"cardType": 0
},
{
"_id": "NotificationsTestCard4",
......@@ -119,11 +120,11 @@ var initTestNotificationsCards = function () {
"hint": "Hint of NotificationsTest: Card Nr. 4",
"cardset_id": "NotificationsTestCardset",
"cardGroup": "0",
"cardType": 0,
"lecture": "",
"centerTextElement": [false, false, false, false],
"learningGoalLevel": 3,
"backgroundStyle": 0
"backgroundStyle": 0,
"cardType": 0
},
{
"_id": "NotificationsTestCard5",
......@@ -134,11 +135,11 @@ var initTestNotificationsCards = function () {
"hint": "Hint of NotificationsTest: Card Nr. 5",
"cardset_id": "NotificationsTestCardset",
"cardGroup": "0",
"cardType": 0,
"lecture": "",
"centerTextElement": [false, false, false, false],
"learningGoalLevel": 4,
"backgroundStyle": 0
"backgroundStyle": 0,
"cardType": 0
}
];
};
......@@ -325,19 +326,6 @@ Meteor.startup(function () {
);
}
cards = Cards.find({cardType: {$exists: false}}).fetch();
for (let i = 0; i < cards.length; i++) {
Cards.update({
_id: cards[i]._id
},
{
$set: {
cardType: 0
}
}
);
}
cards = Cards.find({lecture: {$exists: false}}).fetch();
for (let i = 0; i < cards.length; i++) {
Cards.update({
......@@ -351,23 +339,10 @@ Meteor.startup(function () {
);
}
cards = Cards.find({cardType: 3}).fetch();
for (let i = 0; i < cards.length; i++) {
Cards.update({
_id: cards[i]._id
},
{
$set: {
cardType: 2
}
}
);
}
cards = Cards.find({centerTextElement: {$exists: false}}).fetch();
for (let i = 0; i < cards.length; i++) {
let centerTextElement;
if (cards[i].cardType === 2) {
if (Cardsets.findOne({_id: cards[i].cardset_id}).cardType === 2) {
centerTextElement = [true, true, false, false];
} else {
centerTextElement = [false, false, false, false];
......@@ -425,19 +400,6 @@ Meteor.startup(function () {
);
}
cards = Cards.find({difficulty: 0, cardType: {$ne: 2}}).fetch();
for (let i = 0; i < cards.length; i++) {
Cards.update({
_id: cards[i]._id
},
{
$set: {
difficulty: 1
}
}
);
}
let cardsets = Cardsets.find({moduleLink: {$exists: false}}).fetch();
for (let i = 0; i < cardsets.length; i++) {
Cardsets.update({
......@@ -521,6 +483,19 @@ Meteor.startup(function () {
);
}
cardsets = Cardsets.find({cardType: {$exists: false}}).fetch();
for (let i = 0; i < cardsets.length; i++) {
Cardsets.update({
_id: cardsets[i]._id
},
{
$set: {
cardType: 0
}
}
);
}
cardsets = Cardsets.find({shuffled: {$exists: false}}).fetch();
for (let i = 0; i < cardsets.length; i++) {
Cardsets.update({
......@@ -546,6 +521,22 @@ Meteor.startup(function () {
});
}
cardsets = Cardsets.find({}).fetch();
for (let i = 0; i < cardsets.length; i++) {
Cards.update({
cardset_id: cardsets[i]._id
},
{
$set: {
cardType: cardsets[i].cardType
}
},
{
multi: true
}
);
}
let leitner = Leitner.find({skipped: {$exists: false}}).fetch();
for (let i = 0; i < leitner.length; i++) {
Leitner.update({
......
......@@ -137,6 +137,7 @@ Template.cardset.helpers({
Session.set('previousModuleLink', Cardsets.findOne(Router.current().params._id).moduleLink);
Session.set('previousCollegeName', Cardsets.findOne(Router.current().params._id).college);
Session.set('previousCourseName', Cardsets.findOne(Router.current().params._id).course);
Session.set('previousCardType', Cardsets.findOne(Router.current().params._id).cardType);
},
'selectedForLearning': function () {
if (Session.get('selectingCardsetToLearn')) {
......
......@@ -10,9 +10,9 @@
{{#if isNew}}
{{#if isCourseIteration}}
{{_ "courseIteration.modal.new"}}
{{else}}
{{else}}
{{_ "modal-dialog.newcarddeck"}}
{{/if}}
{{/if}}
{{else}}
{{_ "modal-dialog.editcard"}}
{{/if}}
......@@ -33,26 +33,55 @@
for="setName">{{_ "modal-dialog.name"}}</label>
<div class="col-md-9">
<input class="form-control" type="text" id="setName"
placeholder="{{#if isCourseIteration}}{{_ "courseIteration.modal.placeholder.name"}}{{else}}{{_ "modal-dialog.nameplaceholder"}}{{/if}}"
placeholder="{{#if isCourseIteration}}{{_
"courseIteration.modal.placeholder.name"}}{{else}}{{_
"modal-dialog.nameplaceholder"}}{{/if}}"
value="{{#if isNew}}{{getShuffleName}}{{else}}{{name}}{{/if}}">
<span id="helpSetName" class="help-block name"></span>
</div>
<br>
<label id="setCardTypeLabel" class="col-md-3 control-label" for="setCardType">{{_
"cardType"}}</label>
<div class="dropdown">
<div class="btn-group col-xs-12 col-sm-12 col-md-9">
<button id="setCardType" type="button"
class="btn btn-raised btn-default setCardTypeDropdown longButton"
data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false"
value="{{#if isNew}}0{{else}}{{cardType}}{{/if}}">
{{#if isNew}}{{_ "card.cardType0.name"}}{{else}}{{getCardTypeName cardType}}{{/if}}
</button>
<button type="button"
class="btn btn-raised dropdown-toggle setCardTypeDropdown"
data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only"></span>
</button>
<ul class="dropdown-menu btn-raised longButton">
{{> cardTypeList}}
</ul>
<span id="helpSetCardType" class="help-block cardType"></span>
</div>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<span class="moduleRadioButtonGroup">
<label id="enableModule" class="moduleRadioButtonLabel radio-inline"><input type="radio"
class="moduleRadioButton"
name="optradio"
value="true"
checked="{{#if
isModuleActive}}checked{{/if}}">{{_
<label id="enableModule" class="moduleRadioButtonLabel radio-inline"><input
type="radio"
class="moduleRadioButton"
name="optradio"
value="true"
checked="{{#if
isModuleActive}}checked{{/if}}">{{_
"modal-dialog.moduleActivated"}}</label>
<label id="disableModule" class="moduleRadioButtonLabel radio-inline"><input type="radio"
class="moduleRadioButton"
name="optradio" value="false"
checked="{{#unless
isModuleActive}}checked{{/unless}}">{{_
<label id="disableModule" class="moduleRadioButtonLabel radio-inline"><input
type="radio"
class="moduleRadioButton"
name="optradio" value="false"
checked="{{#unless
isModuleActive}}checked{{/unless}}">{{_
"modal-dialog.moduleDeactivated"}}</label>
</span>
</div>
......@@ -63,7 +92,9 @@
isModuleActive}}{{_ "modal-dialog.optional"}}{{/unless}}</label>
<div class="col-md-10">
<textarea class="form-control" data-provide="markdown" rows="6"
placeholder="{{#if isCourseIteration}}{{_ "courseIteration.modal.placeholder.description"}}{{else}}{{_ "modal-dialog.descriptionplaceholder"}}{{/if}}"
placeholder="{{#if isCourseIteration}}{{_
"courseIteration.modal.placeholder.description"}}{{else}}{{_
"modal-dialog.descriptionplaceholder"}}{{/if}}"
id="setDescription"
value="{{#if
isNew}}{{getShuffleDescription}}{{else}}{{description}}{{/if}}"></textarea>
......@@ -130,10 +161,11 @@
data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false"
value="{{#unless isNew}}{{getCollege this.college
0}}{{/unless}}">{{#if
0}}{{/unless}}">{{#if
isNew}}{{#unless isShuffleRoute}}{{_
"modal-dialog.college_required"}}{{/unless}}{{else}}{{getCollege this.college
1}}{{/if}}</button>
"modal-dialog.college_required"}}{{/unless}}{{else}}{{getCollege
this.college
1}}{{/if}}</button>
<button class="btn dropdown-toggle btn-raised setCollegeDropdown"
type="button"
data-toggle="dropdown"
......@@ -163,10 +195,10 @@
data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false"
value="{{#unless isNew}}{{getCourse this.course
0}}{{/unless}}" {{isDisabled
0}}{{/unless}}" {{isDisabled
this.college}}>{{#if isNew}}{{#unless isShuffleRoute}}{{_
"modal-dialog.course_required"}}{{/unless}}{{else}}{{getCourse this.course
1}}{{/if}}</button>
1}}{{/if}}</button>
<button type="button"
class="btn btn-raised dropdown-toggle setCourseDropdown"
data-toggle="dropdown"
......@@ -212,4 +244,15 @@
"modal-dialog.save"}}{{/if}}</button>
</div>
{{/unless}}
</template>
\ No newline at end of file
</template>
<template name="cardTypeList">
<li class="cardType" value="2" data="2"><a href="#">{{_ "card.cardType2.name"}}</a></li>
<li class="cardType" value="0" data="0"><a href="#">{{_ "card.cardType0.name"}}</a></li>
<li class="cardType" value="3" data="3"><a href="#">{{_ "card.cardType3.name"}}</a></li>
<li class="cardType" value="6" data="6"><a href="#">{{_ "card.cardType6.name"}}</a></li>
<li class="cardType" value="5" data="5"><a href="#">{{_ "card.cardType5.name"}}</a></li>
<li class="cardType" value="4" data="4"><a href="#">{{_ "card.cardType4.name"}}</a></li>
<li class="cardType" value="7" data="7"><a href="#">{{_ "card.cardType7.name"}}</a></li>
<li class="cardType" value="1" data="1"><a href="#">{{_ "card.cardType1.name"}}</a></li>
</template>
......@@ -24,6 +24,10 @@ function cardsetRoute() {
return Router.current().route.getName() === 'cardsetlistid' || Router.current().route.getName() === 'cardsetdetailsid' || Router.current().route.getName() === 'admin_cardset';
}
function getCardTypeName(cardType) {
return TAPi18n.__('card.cardType' + cardType + '.name');
}
function activateModule() {
$('.moduleRadioButton')[0].checked = true;
$('.moduleRadioButton')[1].checked = false;
......@@ -58,6 +62,18 @@ export function cleanModal() {
$('#setName').css('border-color', '');
$('#helpSetName').html('');
if (newCardsetCourseIterationRoute()) {
$('#setCardType').html(getCardTypeName(0));
$('#setCardType').val(0);
} else {
$('#setCardType').html(getCardTypeName(Session.get('previousCardType')));
$('#setCardType').val(Session.get('previousCardType'));
}
$('#setCardTypeLabel').css('color', '');
$('#setCardType').css('border-color', '');
$('#helpSetCardType').html('');
if (newCardsetCourseIterationRoute()) {
if (shuffleRoute()) {
$('#setDescription').val(Session.get("ShuffleTemplate").description);
......@@ -210,6 +226,12 @@ export function saveCardset() {
$('#helpSetName').html(TAPi18n.__('modal-dialog.name_required'));
$('#helpSetName').css('color', '#b94a48');
}
if ($('#setCardType').val() === "") {
$('#setCardTypeLabel').css('color', '#b94a48');
$('#setCardType').css('border-color', '#b94a48');
$('#helpSetCardType').html(TAPi18n.__('modal-dialog.name_required'));
$('#helpSetCardType').css('color', '#b94a48');
}
if ($('#setDescription').val() === "" && Session.get('moduleActive')) {
$('#setDescriptionLabel').css('color', '#b94a48');
$('#setDescription').css('border-color', '#b94a48');
......@@ -255,8 +277,10 @@ export function saveCardset() {
($('#setModuleNum').val() !== "" || !Session.get('moduleActive')) &&
($('#setCollege').val() !== "" || !Session.get('moduleActive') || Meteor.settings.public.university.singleUniversity) &&
($('#setCourse').val() !== "" || !Session.get('moduleActive'))) {
let name, description, module, moduleShort, moduleNum, moduleLink, college, course, shuffled, cardGroups;
let name, cardType, description, module, moduleShort, moduleNum, moduleLink, college, course, shuffled,
cardGroups;
name = $('#setName').val();
cardType = $('#setCardType').val();
description = $('#setDescription').val();
module = $('#setModule').val();
moduleShort = $('#setModuleShort').val();
......@@ -279,7 +303,7 @@ export function saveCardset() {
Meteor.call("addCourseIteration", name, description, false, true, 'personal', Session.get('moduleActive'), module, moduleShort, moduleNum, moduleLink, college, course);
$('#setCardsetCourseIterationFormModal').modal('hide');
} else {
Meteor.call("addCardset", name, description, false, true, 'personal', Session.get('moduleActive'), module, moduleShort, moduleNum, moduleLink, college, course, shuffled, cardGroups, function (error, result) {
Meteor.call("addCardset", name, description, false, true, 'personal', Session.get('moduleActive'), module, moduleShort, moduleNum, moduleLink, college, course, shuffled, cardGroups, Number(cardType), function (error, result) {
$('#setCardsetCourseIterationFormModal').modal('hide');
if (result) {
$('#setCardsetCourseIterationFormModal').on('hidden.bs.modal', function () {
......@@ -295,7 +319,7 @@ export function saveCardset() {
if (courseIterationRoute()) {
Meteor.call("updateCourseIteration", name, description, Session.get('moduleActive'), module, moduleShort, moduleNum, moduleLink, college, course);
} else {
Meteor.call("updateCardset", Router.current().params._id, name, description, Session.get('moduleActive'), module, moduleShort, moduleNum, moduleLink, college, course);
Meteor.call("updateCardset", Router.current().params._id, name, description, Session.get('moduleActive'), module, moduleShort, moduleNum, moduleLink, college, course, Number(cardType));
}
$('#setCardsetCourseIterationFormModal').modal('hide');
return true;
......@@ -361,6 +385,11 @@ Template.cardsetCourseIterationFormContent.onRendered(function () {
},
additionalButtons: additionalButtons
});
$('#setCardsetCourseIterationFormModal').on('show.bs.modal', function () {
if (!shuffleRoute()) {
cleanModal();
}