csev / cc4e

C Programming for Everybody
https://www.cc4e.com/
Other
260 stars 90 forks source link

Quiz typo, correct answer? #65

Closed srcatto closed 1 year ago

srcatto commented 1 year ago

Couldn't find the page/code for this.

https://www.cc4e.com/lessons/core Quiz: Types, Operators, and Expressions

(a) Q7 If the result of the logical expression (12>10) is assignmed to an integer variable in C, what is the value that is assigned?

Typo - is assignmed Correct answer is expected to be 1 as, 12 > greater than 10, true (would be 0 if false. Accepted as correct is 0, False. K&R pg 189 appendix A 7.6 relational operators.

1 discussion report the question option is "\1". A browser render/typo in source issue?

(b) Q12 Since ANSI C does not have a predevined value for 'true', which of these is the most "correct" way to define a true value in ANSI C code?

typo - predevined typo - #define TRUE (1)

Correct answer would be a non 0 value, that is 1 according to lessons. Marked as wrong, the TRUE (1). The correct answer is TRUE (0==0) makes sense to me. I've seen this before. Using gcc -ansi to test. Both of those return 1 i.e. non 0 so either would be right.

rkj6124 commented 1 year ago

@srcatto I tried to check this, seems like the quizzes are configured using tsugitools , which I think is a cloud based quizz configurer. If you try to inspect you can see the quiz page is sending the request to - "https://www.cc4e.com/mod/gift/quiz.php". I found gift is a repo under tsugitools project ("https://github.com/tsugitools/gift") So its only natural that you weren't able to find the code for this issue, as the quizzes are being fetched from tsugitools and an API key might have been configured to fetch the quizzes. So, the typos can't be fixed as part of code change, the configured quizz which contains the typo needs to be modified at TsugiCloud.

csev commented 1 year ago

The quizzes are in another private repo. But then they get loaded into the cloud servers and even into Coursera. So to fix a typo there are 1-4 places that need to be fixed. We can keep this open and I will fix it. Thanks.

csev commented 1 year ago

@srcatto I just fixed this in the repo and on the web site. Nice to get this before the course moves onto Coursera. I removed Q12 - I had other complaints on that question - so poof! it is gone :) Thans.