Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Added a an exercise converse_inverse_and_contrapositive #18792

Closed
wants to merge 9 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

drewbent commented Apr 7, 2012

Followed the guidelines from here: https://trello.com/c/B1h5vfw6

Owner

sophiebits commented Apr 7, 2012

Hey, looks like you committed a couple .DS_Store files by mistake -- you'll want to remove them and probably set up your machine so it always ignores them:

http://help.github.com/ignore-files/

@sophiebits sophiebits commented on an outdated diff Apr 7, 2012

exercises/converse_inverse_and_contrapositive.html
+ <var id="CHOICES">{
+ "converse" : "If soccer practice will be canceled today, then it will rain.",
+ "inverse" : "If it does not rain today, soccer practice will not be canceled.",
+ "contrapositive" : "If soccer practice is not canceled today, then it is not raining.",
+ "other1" : "If I don't like soccer, then I won't go to soccer practice.",
+ "other2" : "When it rains I don't want to go to soccer practice." }
+ </var>
+ </div>
+
+ <p class="problem">Identify the <strong><var>TYPE</var></strong> of the given conditional statement.</p>
+
+ <p class="question">"If it rains today, soccer pratice will be canceled."</p>
+
+ <p class="solution"><var>CHOICES[TYPE]</var></p>
+ <ul class="choices" data-show="4" data-none="true">
+ <span data-each="['converse', 'inverse', 'contrapositive', 'other1', 'other2'] as key"><li><var>CHOICES[key]</var></li></span>
@sophiebits

sophiebits Apr 7, 2012

Owner

Not sure but if I remember right we have some way of iterating over dictionaries, so you can do data-each="CHOICES as key, value".

@sophiebits

sophiebits Apr 7, 2012

Owner

Also you want the data-each on the li and to get rid of the span.

@sophiebits sophiebits commented on an outdated diff Apr 7, 2012

exercises/converse_inverse_and_contrapositive.html
+ "contrapositive" : "If an animal does not eat peanuts, then it is not an elephant.",
+ "other1" : "Elephants also eat hay.",
+ "other2" : "Animals that eat peanuts may also like peanut butter." }
+ </var>
+ </div>
+
+ <p class="question">"Elephants eat peanuts."</p>
+ </div>
+
+ <div id="equations-and-equations" data-type="rain-and-soccer-practice">
+ <p class="question">"If <code>3x+1=7</code>, then <code>x=2</code>."</p>
+
+ <p class="solution">
+ <span data-if="TYPE === 'converse'">If <code>x=2</code>, then <code>3x+1=7</code></span>
+ <span data-if="TYPE === 'inverse'">If <code>3x+1≠7</code>, then <code>x≠2</code></span>
+ <span data-if="TYPE === 'contrapositive'">If <code>x≠2</code>, then <code>3x+1≠7</code></span>
@sophiebits

sophiebits Apr 7, 2012

Owner

nit: you're missing periods at the ends of these sentences.

@sophiebits sophiebits and 1 other commented on an outdated diff Apr 7, 2012

exercises/converse_inverse_and_contrapositive.html
+ <li>If <code>x=2</code>, then <code>3x+1=7</code></li>
+ <li>If <code>3x+1\not=7</code>, then <code>x\not=2</code></li>
+ <li>If <code>x\not=2</code>, then <code>3x+1\not=7</code></li>
+ <li>If <code>x=4</code>, then <code>3x+1=13</code></li>
+ <li>If <code>3x+1=10</code>, then <code>x=3</code></li>
+ </ul>
+ </div>
+ </div>
+
+ <div class="hints">
+ <p>Identify the hypothesis and the conclusion of the given statement.</p>
+ <p data-if="TYPE === 'converse'">The converse of the statement is a new statement in which the hypothesis and conclusion are reversed.</p>
+ <p data-if="TYPE === 'inverse'">The inverse of the statement is a new statement that leaves the hypothesis and conclusion in the same order, but negates both of them. In other words, it is the "not" hypothesis and the "not" conclusion.</p>
+ <p data-if="TYPE === 'contrapositive'">The contrapositive of the statement is a new statement that reverses the order and negates the hypothesis and conclusion. In other words, switch them and "not" them.</p>
+ <p data-if="TYPE === 'contrapositive'">If you really think about it, the contrapositive is the inverse of the converse.</p>
+ <p>Do not add any new opinions or any other new information to your statement.</p>
@sophiebits

sophiebits Apr 7, 2012

Owner

I realize this will take some code restructuring, but it would be nice if you could write things like:

In this statement, the hypothesis is "it rains today" and the conclusion is "soccer practice will be cancelled".
Thus, when we take the inverse, the hypothesis becomes "it does not rain today" and the conclusion becomes "soccer practice will not be cancelled".
The inverse of the original statement is, "If it does not rain today, soccer practice will not be cancelled."

(Including the actual answer as the last hint is particularly important.)

@drewbent

drewbent Apr 7, 2012

Contributor

Thanks for the help. I completely agree that these more personalized hints make more sense. I'll get started on it.

@xymostech xymostech closed this in 1fcb03d May 25, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment