math-exercises 2.2.75 → 2.2.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -84,7 +84,7 @@ const getAbsolueValueInequationsSupQuestion = (ops) => {
84
84
  exports.absolueValueInequationsSup = {
85
85
  id: "absolueValueInequationsSup",
86
86
  connector: "\\iff",
87
- label: "Résoudre une inéquation avec valeur absolue du type $|ax+b| > c",
87
+ label: "Résoudre une inéquation avec valeur absolue du type $|ax+b| > c$",
88
88
  isSingleStep: true,
89
89
  generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getAbsolueValueInequationsSupQuestion(opts), nb),
90
90
  qcmTimer: 60,
@@ -76,8 +76,8 @@ const getGraphicInequationQuestion = () => {
76
76
  const yMax = Math.max(...splinePoints.map((point) => point[1]));
77
77
  const intervalsNodes = intervals.map((i) => new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(i.a), new numberNode_1.NumberNode(i.b), i.closure));
78
78
  const answer = intervalsNodes.length === 1
79
- ? `S=${intervalsNodes[0].toTex()}`
80
- : `S=${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
79
+ ? `S=\\ ${intervalsNodes[0].toTex()}`
80
+ : `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
81
81
  const commands = [
82
82
  `S =Spline(${splinePoints
83
83
  .map((point) => `(${point[0]},${point[1]})`)
@@ -121,20 +121,20 @@ const getPropositions = (n, { answer, intervals, splinePoints, yValue }) => {
121
121
  (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\varnothing`);
122
122
  if (intervals.length === 1) {
123
123
  const interval = new intervalNode_1.IntervalNode(intervals[0].a.toTree(), intervals[0].b.toTree(), intervals[0].closure);
124
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=${interval.toRandomDifferentClosure().toTex()}`);
124
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${interval.toRandomDifferentClosure().toTex()}`);
125
125
  }
126
126
  else if (intervals.length === 2) {
127
127
  const rightIntervals = intervals.map((i) => new intervalNode_1.IntervalNode(i.a.toTree(), i.b.toTree(), i.closure));
128
128
  const fakeIntervals = intervals.map((i) => new intervalNode_1.IntervalNode(i.a.toTree(), i.b.toTree(), i.closure));
129
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=${rightIntervals[(0, coinFlip_1.coinFlip)() ? 0 : 1].toTex()}`);
130
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=${new unionIntervalNode_1.UnionIntervalNode(fakeIntervals.map((i) => i.toRandomDifferentClosure())).toTex()}`);
129
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${rightIntervals[(0, coinFlip_1.coinFlip)() ? 0 : 1].toTex()}`);
130
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(fakeIntervals.map((i) => i.toRandomDifferentClosure())).toTex()}`);
131
131
  }
132
132
  while (propositions.length < n) {
133
133
  let a = (0, randint_1.randint)(splinePoints[0][0], splinePoints[splinePoints.length - 1][0] + 1);
134
134
  let b = (0, randint_1.randint)(splinePoints[0][0], splinePoints[splinePoints.length - 1][0] + 1, [a]);
135
135
  if (a > b)
136
136
  [a, b] = [b, a];
137
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=${new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(a), new numberNode_1.NumberNode(b), closure_1.ClosureType.FF).toTex()}`);
137
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(a), new numberNode_1.NumberNode(b), closure_1.ClosureType.FF).toTex()}`);
138
138
  }
139
139
  return (0, exercise_1.shuffleProps)(propositions, n);
140
140
  };
@@ -76,7 +76,7 @@ const getKeys = (identifiers) => {
76
76
  };
77
77
  const isAnswerValid = (ans, { answer }) => {
78
78
  const inter = answer;
79
- return ans === inter || ans === "S=" + inter;
79
+ return ans === inter || ans === "S=\\ " + inter;
80
80
  throw Error("VEA not implemented");
81
81
  };
82
82
  const getGraphicInequationAffineQuestion = (opts) => {
@@ -108,8 +108,8 @@ const getTwoFunctionsInequationQuestion = () => {
108
108
  const ggb = new geogebraConstructor_1.GeogebraConstructor({ commands });
109
109
  const intervalsNodes = intervals.map((i) => new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(i.a), new numberNode_1.NumberNode(i.b), i.closure));
110
110
  const answer = intervalsNodes.length === 1
111
- ? `S=${intervalsNodes[0].toTex()}`
112
- : `S=${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
111
+ ? `S=\\ ${intervalsNodes[0].toTex()}`
112
+ : `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
113
113
  const question = {
114
114
  answer,
115
115
  instruction: `Déterminer graphiquement les solutions de l'inéquation $f(x) ${ineq.symbol} g(x)$ où $f$ et $g$ sont les fonctions représentées ci-dessous.`,
@@ -145,13 +145,13 @@ const getPropositions = (n, { answer, intervals, fSplinePoints, ineqSymbol }) =>
145
145
  (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\varnothing`);
146
146
  if (intervals.length === 1) {
147
147
  const interval = new intervalNode_1.IntervalNode(intervals[0].a.toTree(), intervals[0].b.toTree(), intervals[0].closure);
148
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=${interval.toRandomDifferentClosure().toTex()}`);
148
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${interval.toRandomDifferentClosure().toTex()}`);
149
149
  }
150
150
  else {
151
151
  const rightIntervals = intervals.map((i) => new intervalNode_1.IntervalNode(i.a.toTree(), i.b.toTree(), i.closure));
152
152
  const fakeIntervals = intervals.map((i) => new intervalNode_1.IntervalNode(i.a.toTree(), i.b.toTree(), i.closure));
153
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=${rightIntervals[(0, coinFlip_1.coinFlip)() ? 0 : 1].toTex()}`);
154
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=${new unionIntervalNode_1.UnionIntervalNode(fakeIntervals.map((i) => i.toRandomDifferentClosure())).toTex()}`);
153
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${rightIntervals[(0, coinFlip_1.coinFlip)() ? 0 : 1].toTex()}`);
154
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(fakeIntervals.map((i) => i.toRandomDifferentClosure())).toTex()}`);
155
155
  }
156
156
  while (propositions.length < n) {
157
157
  const isStrict = ineqSymbol === "<" || ineqSymbol === ">";
@@ -159,7 +159,7 @@ const getPropositions = (n, { answer, intervals, fSplinePoints, ineqSymbol }) =>
159
159
  const x2 = (0, randint_1.randint)(x1 + 1, x1 + 5);
160
160
  const x3 = (0, randint_1.randint)(x2 + 3, x2 + 6);
161
161
  const x4 = (0, randint_1.randint)(x3 + 1, x3 + 3);
162
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=${new unionIntervalNode_1.UnionIntervalNode([
162
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${new unionIntervalNode_1.UnionIntervalNode([
163
163
  new intervalNode_1.IntervalNode(x1.toTree(), x2.toTree(), isStrict ? closure_1.ClosureType.FO : closure_1.ClosureType.FF),
164
164
  new intervalNode_1.IntervalNode(x3.toTree(), x4.toTree(), isStrict ? closure_1.ClosureType.OF : closure_1.ClosureType.FF),
165
165
  ]).toTex()}`);
@@ -55,7 +55,7 @@ class InequationSolutionNode {
55
55
  return `S={${this.intervalSolution.toMathjs()}}`;
56
56
  }
57
57
  toTex() {
58
- return `S=${this.intervalSolution.toTex()}`;
58
+ return `S=\\ ${this.intervalSolution.toTex()}`;
59
59
  }
60
60
  simplify() {
61
61
  return this;
@@ -49,7 +49,7 @@ class UnionIntervalNode {
49
49
  return this.toTex();
50
50
  }
51
51
  toTex() {
52
- return this.sets.map((set) => set.toTex()).join("\\cup");
52
+ return this.sets.map((set) => set.toTex()).join("\\cup\\ ");
53
53
  }
54
54
  toIdentifiers() {
55
55
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.2.75",
3
+ "version": "2.2.76",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [