|
@@ -37,7 +37,8 @@ angular.module('app')
|
37
|
37
|
.trim();
|
38
|
38
|
$scope.macros.forEach(function(macro)
|
39
|
39
|
{
|
40
|
|
- text = text.replace(new RegExp($scope.escapeRegExp(macro.latex) + "([^a-zA-Z])", "g"), function($1, $2)
|
|
40
|
+ var regex = macro.latex.match(/[a-zA-Z0-9]$/) != null ? "([^a-zA-Z0-9])" : "";
|
|
41
|
+ text = text.replace(new RegExp($scope.escapeRegExp(macro.latex) + regex, "g"), function($1, $2)
|
41
|
42
|
{
|
42
|
43
|
return macro.html + $2;
|
43
|
44
|
});
|
|
@@ -92,18 +93,11 @@ angular.module('app')
|
92
|
93
|
{
|
93
|
94
|
$scope.Data.Output += question.Text + "\n";
|
94
|
95
|
|
95
|
|
- var goodAnswersCount = 0;
|
96
|
|
- question.Answers.forEach(function(answer)
|
97
|
|
- {
|
98
|
|
- if (answer.Correct) {
|
99
|
|
- ++goodAnswersCount;
|
100
|
|
- }
|
101
|
|
- });
|
|
96
|
+
|
102
|
97
|
|
103
|
98
|
question.Answers.forEach(function(answer)
|
104
|
99
|
{
|
105
|
|
- $scope.Data.Output += "\t" + (goodAnswersCount > 1 ? "[" : "(") + (answer.Correct ? "x" : "") +
|
106
|
|
- (goodAnswersCount > 1 ? "]" : ")") + answer.Text + "\n";
|
|
100
|
+ $scope.Data.Output += "\t[" + (answer.Correct ? "x" : "") + "]" + answer.Text + "\n";
|
107
|
101
|
});
|
108
|
102
|
$scope.Data.Output += "\n";
|
109
|
103
|
});
|
|
@@ -118,11 +112,13 @@ angular.module('app')
|
118
|
112
|
$scope.addMacro("\\RR", "\\mathbb{R}");
|
119
|
113
|
$scope.addMacro("\\CC", "\\mathbb{C}");
|
120
|
114
|
$scope.addMacro("\\QQ", "\\mathbb{Q}");
|
|
115
|
+ $scope.addMacro("\\NN", "\\mathbb{N}");
|
|
116
|
+ $scope.addMacro("\\ZZ", "\\mathbb{Z}");
|
121
|
117
|
$scope.addMacro("\\di", "\\displaystyle");
|
122
|
118
|
$scope.addMacro("\\dd", "\\text{d}");
|
123
|
119
|
$scope.addMacro("<<", "«");
|
124
|
120
|
$scope.addMacro(">>", "»");
|
125
|
|
- $scope.addMacro("<", "<");
|
|
121
|
+ $scope.addMacro("<", "< ");
|
126
|
122
|
$scope.addMacro(">", ">");
|
127
|
123
|
$scope.addMacro("\\\'{E}", "É");
|
128
|
124
|
$scope.addMacro("\\\'{A}", "À");
|