author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
701,849
01.10.2018 14:28:39
-46,800
e61fee1335ff73a64541a1154ba83421ef1c6b5f
add english subtitle files for two sample classroom lesson videos
[ { "change_type": "MODIFY", "old_path": "subtitles/en/parity-magic-trick.vtt", "new_path": "subtitles/en/parity-magic-trick.vtt", "diff": "WEBVTT\n+Kind: captions\n+Language: en\nNOTE\nComputer Science Education Research,\n" }, { "change_type": "ADD", "old_path": null, "new_path": "subtitles/en/product-code-check-digits.vtt", "diff": "+WEBVTT\n+Kind: captions\n+Language: en\n+\n+NOTE\n+Computer Science Education Research,\n+University of Canterbury, New Zealand\n+Subtitle file for the video \"CS Unplugged - Product Code Check Digits (sample classroom lesson)\"\n+Author: Alasdair Smith\n+Date: 01/10/2018\n+\n+00:00:04.120 --> 00:00:06.460\n+[Product code check digits]\n+\n+00:00:06.840 --> 00:00:09.620\n+Cool, so the last lesson we did we looked at\n+\n+00:00:09.620 --> 00:00:14.060\n+how computers can detect errors\n+and correct them.\n+\n+00:00:14.060 --> 00:00:20.380\n+Hand's up if you've ever been to the supermarket\n+and you've scanned in your groceries\n+\n+00:00:20.380 --> 00:00:22.920\n+and it comes up with the grocery items?\n+\n+00:00:22.920 --> 00:00:24.260\n+Have you guys done that?\n+\n+00:00:24.260 --> 00:00:24.940\n+Yeah?\n+\n+00:00:24.950 --> 00:00:33.160\n+Hands down, so what happens when you've scanned\n+it and it isn't reading properly?\n+\n+00:00:33.160 --> 00:00:35.240\n+What does the checkout person do?\n+\n+00:00:35.240 --> 00:00:38.540\n+Or what would the checkout person do?\n+\n+00:00:38.540 --> 00:00:44.460\n+You have to ask them and they'll scan something?\n+\n+00:00:44.460 --> 00:00:48.460\n+Yeah, they do scan something, and sometimes\n+they have to key in something don't they?\n+\n+00:00:48.460 --> 00:00:52.320\n+It just can't be read because it might be\n+folded and so they have to do something\n+\n+00:00:52.320 --> 00:00:53.460\n+what do they have to do?\n+\n+00:00:53.460 --> 00:00:57.980\n+Don't they have that on their key, don't they\n+have that little barcode thingymabob.\n+\n+00:00:57.980 --> 00:01:01.760\n+-- They do they do.\n+-- And don't they scan that on the machine\n+\n+00:01:01.760 --> 00:01:02.720\n+and it sorta--\n+\n+00:01:02.720 --> 00:01:06.420\n+They do but that still doesn't tell us\n+what the product is.\n+\n+00:01:06.420 --> 00:01:12.020\n+So at the bottom of a product you've got the\n+barcode right; the black and the white?\n+\n+00:01:12.020 --> 00:01:14.480\n+But then you've got some numbers underneath.\n+\n+00:01:14.480 --> 00:01:18.080\n+And those numbers have a thing\n+called a checksum at the end.\n+\n+00:01:18.080 --> 00:01:18.840\n+Yep?\n+\n+00:01:18.840 --> 00:01:24.180\n+You sort of have a barcode that will be a\n+bit smaller so you can put it in as a person.\n+\n+00:01:24.180 --> 00:01:25.420\n+Yeah yeah absolutely.\n+\n+00:01:25.420 --> 00:01:29.180\n+So they have to type in the numbers because\n+they just can't read it right?\n+\n+00:01:29.180 --> 00:01:34.300\n+And so that last number is called a checksum\n+and I'm gonna teach you guys today how it works.\n+\n+00:01:34.300 --> 00:01:37.539\n+Dylan, could you just go and get something\n+from the back of the classroom there that's\n+\n+00:01:37.540 --> 00:01:41.260\n+got a 13 digit barcode for us,\n+and we'll see how it works.\n+\n+00:01:45.260 --> 00:01:49.280\n+Cool, so call out the numbers loud and proud\n+but I don't want to know the 13th number.\n+\n+00:01:49.280 --> 00:01:52.180\n+I only want to know the 12 digits before that.\n+\n+00:01:52.180 --> 00:02:12.780\n+9, 3, 1, 0, 4, 9, 2, 0, 0, 0, 4 and 5.\n+\n+00:02:12.780 --> 00:02:16.580\n+Okay I'm just gonna read that back to you\n+can you double check that for me?\n+\n+00:02:16.580 --> 00:02:26.800\n+9, 3, 1, 0, 4, 9, 2, 0, 0, 0, 4, 5.\n+\n+00:02:26.800 --> 00:02:27.560\n+True?\n+\n+00:02:27.569 --> 00:02:28.569\n+Cool.\n+\n+00:02:28.569 --> 00:02:32.310\n+Okay so now we've got these numbers up on\n+the board what I need you guys to do is to\n+\n+00:02:32.310 --> 00:02:34.879\n+help me add up just this top row.\n+\n+00:02:34.880 --> 00:02:37.280\n+-- So 9+1 is?\n+-- 10.\n+\n+00:02:37.280 --> 00:02:39.220\n+-- 10+4 is?\n+-- 14.\n+\n+00:02:39.220 --> 00:02:41.760\n+-- 14+2 is?\n+-- 16.\n+\n+00:02:41.760 --> 00:02:45.580\n+-- 16+4 is?\n+-- 20.\n+\n+00:02:45.580 --> 00:02:52.050\n+And we're only interested in the ones column,\n+so what number in 20 is in the ones column?\n+\n+00:02:52.050 --> 00:02:53.050\n+Sam?\n+\n+00:02:53.050 --> 00:02:54.050\n+2.\n+\n+00:02:54.050 --> 00:02:55.360\n+That's in the tens good try.\n+\n+00:02:55.360 --> 00:02:56.360\n+Zero?\n+\n+00:02:56.360 --> 00:02:59.230\n+Zero, so we're just gonna record the zero\n+here.\n+\n+00:02:59.230 --> 00:03:01.069\n+Because that's the only number\n+we're interested in.\n+\n+00:03:01.069 --> 00:03:02.980\n+Now we're gonna add up the bottom column.\n+\n+00:03:02.980 --> 00:03:05.360\n+-- 3+0 is?\n+-- 3.\n+\n+00:03:05.360 --> 00:03:07.880\n+-- 3+9 is?\n+-- 12.\n+\n+00:03:07.880 --> 00:03:12.120\n+-- 12+0 is?\n+-- 12, 12.\n+\n+00:03:12.120 --> 00:03:14.560\n+-- 12+5 is?\n+-- 17.\n+\n+00:03:14.560 --> 00:03:17.790\n+17 but we're only interested in the ones column?\n+\n+00:03:17.790 --> 00:03:19.060\n+7.\n+\n+00:03:19.060 --> 00:03:23.260\n+Now the bottom one we're gonna times by 3,\n+but here's the trick.\n+\n+00:03:23.260 --> 00:03:25.060\n+We're only interested in the ones column.\n+\n+00:03:25.060 --> 00:03:29.400\n+What's 7x3 and what's the\n+value in the ones column?\n+\n+00:03:30.060 --> 00:03:30.900\n+Freddy.\n+\n+00:03:30.900 --> 00:03:32.000\n+1.\n+\n+00:03:32.000 --> 00:03:34.340\n+Who else got 1?\n+\n+00:03:34.340 --> 00:03:35.600\n+Cool.\n+\n+00:03:36.580 --> 00:03:37.880\n+It is equal to 1.\n+\n+00:03:37.880 --> 00:03:39.520\n+What's 0+1?\n+\n+00:03:40.780 --> 00:03:41.400\n+1.\n+\n+00:03:41.400 --> 00:03:42.280\n+Cool.\n+\n+00:03:42.280 --> 00:03:48.240\n+Now, if I had to\n+make 0 - which is really 10 - right?\n+\n+00:03:48.240 --> 00:03:51.040\n+'Cause we're only interested in the ones column.\n+\n+00:03:51.049 --> 00:03:56.459\n+If I had to make 0, what would be that\n+missing number in there?\n+\n+00:03:56.460 --> 00:03:57.880\n+Zero?\n+\n+00:03:57.880 --> 00:04:00.340\n+One plus what makes 10?\n+\n+00:04:00.340 --> 00:04:01.620\n+9.\n+\n+00:04:01.620 --> 00:04:05.180\n+The checksum is 9.\n+\n+00:04:05.189 --> 00:04:06.659\n+True or false?\n+\n+00:04:06.660 --> 00:04:07.500\n+True.\n+\n+00:04:07.500 --> 00:04:08.000\n+Cool.\n+\n+00:04:08.000 --> 00:04:13.840\n+So that's the mathematical equation that's\n+underneath every single barcode, right?\n+\n+00:04:13.840 --> 00:04:19.520\n+Okay, so let's have a look at what happens\n+if I heard something wrong.\n+\n+00:04:19.520 --> 00:04:23.380\n+Let's say that I heard the 4 as a 5.\n+\n+00:04:23.380 --> 00:04:28.680\n+So the first thing that would change is this,\n+would this be a zero still?\n+\n+00:04:28.680 --> 00:04:30.460\n+-- No.\n+-- What would that become?\n+\n+00:04:30.460 --> 00:04:31.460\n+1.\n+\n+00:04:31.460 --> 00:04:37.320\n+Okay which then changes\n+1+1 isn't 1 anymore, what is it?\n+\n+00:04:37.320 --> 00:04:38.060\n+2.\n+\n+00:04:38.060 --> 00:04:39.520\n+That becomes 2.\n+\n+00:04:39.520 --> 00:04:42.920\n+So 2 plus what makes 10?\n+\n+00:04:42.920 --> 00:04:44.180\n+Is it 9?\n+\n+00:04:44.180 --> 00:04:45.040\n+No.\n+\n+00:04:45.040 --> 00:04:47.420\n+It becomes 8.\n+\n+00:04:47.420 --> 00:04:54.160\n+And so because I typed in one number wrong,\n+the checksum is incorrect,\n+\n+00:04:54.160 --> 00:04:58.200\n+and it beeps back at you to say it's not right.\n+\n+00:04:58.200 --> 00:05:00.520\n+And so you have to type the number in again.\n+\n+00:05:00.520 --> 00:05:05.360\n+And because we're people, what do you think\n+the most common mistake is\n+\n+00:05:05.360 --> 00:05:07.280\n+when we're typing in numbers?\n+\n+00:05:07.280 --> 00:05:10.000\n+What's the thing we would get wrong the most?\n+\n+00:05:10.000 --> 00:05:11.770\n+-- Robert?\n+-- The number.\n+\n+00:05:11.770 --> 00:05:16.200\n+Yeah the number, what would we do with the\n+numbers that would make it different?\n+\n+00:05:17.000 --> 00:05:19.320\n+Might not write them all?\n+\n+00:05:19.320 --> 00:05:21.900\n+Yeah what, would I read the number wrong?\n+\n+00:05:21.910 --> 00:05:22.910\n+What would I do?\n+\n+00:05:22.910 --> 00:05:28.410\n+You might put instead of the 1, instead of\n+it being 9, 1, it might be 1, 9.\n+\n+00:05:28.410 --> 00:05:34.750\n+Yeah, so did you notice, that this was the\n+first number, this was the second number,\n+\n+00:05:34.750 --> 00:05:37.690\n+this is the first number,\n+this is the second number.\n+\n+00:05:37.690 --> 00:05:44.240\n+The reason for that is, is that the most common\n+mistakes we make is we swap these around.\n+\n+00:05:44.940 --> 00:05:48.800\n+I might read 93, but my fingers type in 39.\n+\n+00:05:48.800 --> 00:05:50.800\n+True? Have you ever done that when you're typing?\n+\n+00:05:50.800 --> 00:05:52.840\n+And you get your letters around\n+the wrong way?\n+\n+00:05:52.840 --> 00:06:00.100\n+And that's the kind of thing: this checksum\n+stops us from going in\n+\n+00:06:00.100 --> 00:06:06.520\n+to buy a pack of Pokemon cards and getting charged for a solar panel robot kit.\n+\n+00:06:06.520 --> 00:06:07.280\n+True?\n+\n" }, { "change_type": "ADD", "old_path": null, "new_path": "subtitles/en/sorting-networks.vtt", "diff": "+WEBVTT\n+Kind: captions\n+Language: en\n+\n+NOTE\n+Computer Science Education Research,\n+University of Canterbury, New Zealand\n+Subtitle file for the video \"CS Unplugged - Sorting Networks (sample classroom lesson)\"\n+Author: Alasdair Smith\n+Date: 01/10/2018\n+\n+00:00:05.060 --> 00:00:10.000\n+[Sorting Networks]\n+\n+00:00:11.480 --> 00:00:15.360\n+So we've come outside today\n+to learn a little bit more about how computers work,\n+\n+00:00:15.360 --> 00:00:21.160\n+and what we have is, this is like a\n+supercomputer made out of chalk.\n+\n+00:00:21.160 --> 00:00:24.919\n+And I'm gonna show you why in a moment,\n+I need six volunteers.\n+\n+00:00:24.919 --> 00:00:26.150\n+Awesome.\n+\n+00:00:26.150 --> 00:00:30.710\n+What I'm gonna do is I'm gonna give you a\n+disk, and you need to go and stand on the\n+\n+00:00:30.710 --> 00:00:33.430\n+circles - the far far away ones.\n+\n+00:00:33.430 --> 00:00:35.830\n+So Rhylee you go away over\n+in that far away one.\n+\n+00:00:35.830 --> 00:00:39.090\n+Robert you go into the next one.\n+\n+00:00:39.090 --> 00:00:42.900\n+Ellie you go over to that next one.\n+\n+00:00:42.900 --> 00:00:45.150\n+Kourash can you go over there.\n+\n+00:00:45.150 --> 00:00:47.629\n+Lewis can you go into the last one.\n+\n+00:00:47.629 --> 00:00:48.629\n+Okay!\n+\n+00:00:48.629 --> 00:00:52.219\n+So I've got you guys here and this is all\n+about teamwork.\n+\n+00:00:52.219 --> 00:00:55.850\n+And it's all about organising data.\n+\n+00:00:55.850 --> 00:00:59.460\n+So you guys are the start of the data you're\n+coming in and you're all out of order, we've\n+\n+00:00:59.460 --> 00:01:05.460\n+got the number 5, number 2, number 1,\n+number 3, number 6 and number 4.\n+\n+00:01:05.460 --> 00:01:10.680\n+And so before we start going into the supercomputer,\n+all I need to teach you is this symbol here.\n+\n+00:01:10.680 --> 00:01:12.900\n+What does this symbol here mean?\n+\n+00:01:12.900 --> 00:01:14.479\n+What does it mean Lewis?\n+\n+00:01:14.480 --> 00:01:15.420\n+Smaller then bigger.\n+\n+00:01:15.420 --> 00:01:19.940\n+Smaller then bigger what's some more mathematical\n+terms that we could use for smaller and bigger\n+\n+00:01:19.940 --> 00:01:21.200\n+-- yep?\n+-- Less than or greater than\n+\n+00:01:21.200 --> 00:01:27.100\n+Less than or greater than. Awesome, so what\n+we have is the orange line is the less than,\n+\n+00:01:27.100 --> 00:01:28.940\n+and the blue line is the greater than.\n+\n+00:01:28.940 --> 00:01:33.560\n+So let's see how this works. Can you all\n+take a step into the box.\n+\n+00:01:33.560 --> 00:01:37.980\n+Can you say hi to the person next to you and\n+give them a big smile.\n+\n+00:01:37.990 --> 00:01:39.100\n+Not too cheesy.\n+\n+00:01:39.100 --> 00:01:42.500\n+Now what you need to do is decide: have I\n+got the bigger number\n+\n+00:01:42.500 --> 00:01:44.600\n+or have I got the smaller number.\n+\n+00:01:44.600 --> 00:01:47.100\n+And then the bigger number\n+follows the blue line,\n+\n+00:01:47.100 --> 00:01:50.400\n+the smaller number follows the orange line, go.\n+\n+00:01:51.120 --> 00:01:55.320\n+Now, you need to look around and check everyone's\n+there and then you need to say hi and give\n+\n+00:01:55.320 --> 00:01:58.000\n+the person a big smile go.\n+\n+00:01:58.000 --> 00:02:02.960\n+Now decide who's got the smaller, who's got\n+the greater number.\n+\n+00:02:07.480 --> 00:02:08.640\n+Do you guys know what to do?\n+\n+00:02:08.649 --> 00:02:12.810\n+Do the next one I didn't see anyone smiling\n+and saying hello, smile and say hello.\n+\n+00:02:12.810 --> 00:02:13.810\n+Hi.\n+\n+00:02:13.810 --> 00:02:15.980\n+Now make your decision go.\n+\n+00:02:20.420 --> 00:02:21.260\n+Hello!\n+\n+00:02:21.480 --> 00:02:22.120\n+Nice.\n+\n+00:02:23.500 --> 00:02:24.660\n+What number do you have?\n+\n+00:02:25.840 --> 00:02:27.880\n+I have 4 so I'll go this way.\n+\n+00:02:27.880 --> 00:02:28.860\n+Perfect.\n+\n+00:02:33.980 --> 00:02:37.040\n+Cool so I'm gonna get you guys to turn and\n+face me this way and we're gonna see what\n+\n+00:02:37.040 --> 00:02:40.860\n+happened to our numbers, can you turn and\n+hold up your numbers please?\n+\n+00:02:40.860 --> 00:02:44.000\n+Oh, wow Kourash what number have you got?\n+\n+00:02:44.000 --> 00:02:45.360\n+-- One.\n+-- What number have you got Lewis?\n+\n+00:02:45.360 --> 00:02:46.360\n+Two.\n+\n+00:02:46.360 --> 00:02:47.100\n+Three.\n+\n+00:02:47.100 --> 00:02:47.640\n+Four.\n+\n+00:02:47.640 --> 00:02:48.540\n+Five.\n+\n+00:02:48.540 --> 00:02:49.280\n+Six.\n+\n+00:02:49.280 --> 00:02:51.060\n+Okay what just happened to our numbers?\n+\n+00:02:51.080 --> 00:02:55.520\n+We put them into our supercomputer that's\n+chalk that's like a supercomputer,\n+\n+00:02:55.520 --> 00:02:58.480\n+and we processed it and what happened?\n+\n+00:02:59.140 --> 00:03:01.980\n+We came back in the right order.\n+\n+00:03:01.980 --> 00:03:04.680\n+Oh, do you think that would work with everything?\n+[Tip: This activity can be used to sort anything!]\n+\n+00:03:04.680 --> 00:03:05.600\n+Yes.\n+[Tip: This activity can be used to sort anything!]\n+\n+00:03:05.600 --> 00:03:07.840\n+What kind of things\n+could we sort in order do you think?\n+\n+00:03:07.840 --> 00:03:08.740\n+-- Yep?\n+-- Books.\n+\n+00:03:08.740 --> 00:03:10.060\n+We could sort books, what else?\n+\n+00:03:10.580 --> 00:03:11.220\n+Letters?\n+\n+00:03:11.220 --> 00:03:12.240\n+Yes, what else?\n+\n+00:03:12.240 --> 00:03:13.080\n+Bells?\n+\n+00:03:13.080 --> 00:03:14.100\n+Yes, what else?\n+\n+00:03:14.100 --> 00:03:15.700\n+Notes.\n+\n+00:03:15.700 --> 00:03:17.400\n+Yes, what else?\n+\n+00:03:17.400 --> 00:03:18.400\n+What about big numbers?\n+\n+00:03:18.409 --> 00:03:20.690\n+Really big numbers could we do that?\n+\n+00:03:20.690 --> 00:03:22.020\n+-- Yes.\n+-- Yep, cool.\n+\n+00:03:22.020 --> 00:03:26.440\n+[Book titles (alphabetical)]\n+\n+00:03:34.640 --> 00:03:43.100\n+[Large Numbers (numeric order)]\n+\n+00:03:44.360 --> 00:03:50.260\n+[Letters (alphabetical)]\n+\n+00:03:51.500 --> 00:03:58.460\n+[Handbells (musical pitch, higher or lower)]\n+\n+00:03:58.740 --> 00:04:00.440\n+Which one sounds lower and which one's higher?\n+\n+00:04:00.440 --> 00:04:01.420\n+I'm lower.\n+\n+00:04:01.420 --> 00:04:03.040\n+You're lower, sweet.\n+\n+00:04:08.420 --> 00:04:11.020\n+Okay, let's sound one at a time.\n+\n+00:04:11.880 --> 00:04:14.100\n+Yep. Which one sounds lower?\n+\n+00:04:14.480 --> 00:04:15.560\n+This one's lower.\n+\n+00:04:15.560 --> 00:04:18.100\n+Yep, let's try play it once more to make sure.\n+\n+00:04:19.880 --> 00:04:21.500\n+That's sounds good.\n+\n+00:04:27.620 --> 00:04:30.240\n+Let's hear it, let's hear it one more time.\n+\n+00:04:30.240 --> 00:04:31.560\n+Yep.\n+\n+00:04:31.560 --> 00:04:33.480\n+Okay, keep going.\n+\n" } ]
Python
MIT License
uccser/cs-unplugged
add english subtitle files for two sample classroom lesson videos
701,849
01.10.2018 14:36:30
-46,800
96936e834b342bb229d0139c3a3a394d604093ae
Fix name in one subs file
[ { "change_type": "MODIFY", "old_path": "subtitles/en/sorting-networks.vtt", "new_path": "subtitles/en/sorting-networks.vtt", "diff": "@@ -45,7 +45,7 @@ Robert you go into the next one.\nEllie you go over to that next one.\n00:00:42.900 --> 00:00:45.150\n-Kourash can you go over there.\n+Kourosh can you go over there.\n00:00:45.150 --> 00:00:47.629\nLewis can you go into the last one.\n@@ -169,7 +169,7 @@ happened to our numbers, can you turn and\nhold up your numbers please?\n00:02:40.860 --> 00:02:44.000\n-Oh, wow Kourash what number have you got?\n+Oh, wow Kourosh what number have you got?\n00:02:44.000 --> 00:02:45.360\n-- One.\n" } ]
Python
MIT License
uccser/cs-unplugged
Fix name in one subs file
701,857
06.06.2019 10:29:00
-43,200
95f9829ea79941994c4fb6473632bcc3a276636e
Added a sentance and link to the main text on the about page which links to the Computational Thinking page, to make the links on the About page consistent
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/general/about.html", "new_path": "csunplugged/templates/general/about.html", "diff": "{% endblocktrans %}\n</p>\n+ <p>\n+ {% url 'general:computational_thinking' as computational_thinking_url %}\n+ {% blocktrans trimmed %}\n+ For an explanation on the connections between CS Unplugged and Computational Thinking skills, see our <a href=\"{{ computational_thinking_url }}\">Computational Thinking and CS Unplugged page</a>.\n+ {% endblocktrans %}\n+ </p>\n+\n<p>\n{% url 'general:people' as people_url %}\n{% blocktrans trimmed %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Added a sentance and link to the main text on the about page which links to the Computational Thinking page, to make the links on the About page consistent
701,857
06.06.2019 10:51:53
-43,200
cd1d36a21a207547317736a0afa10488c31491e3
Moved myself from the past contributors to current, yay!
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/general/people.html", "new_path": "csunplugged/templates/general/people.html", "diff": "<li>Jack Morgan - {% trans \"Project Manager &amp; Technical Team\" %}</li>\n<li>Hayley van Waas - {% trans \"Technical Team\" %}</li>\n<li>Courtney Bracefield - {% trans \"Technical Team\" %}</li>\n+ <li>Caitlin Duncan - {% trans \"Content Writer\" %}</li>\n</ul>\n<h3>{% trans \"Previous Team Members\" %}</h3>\n<ul>\n<li>Behshid Ghorbani - {% trans \"Content Writer\" %}</li>\n- <li>Caitlin Duncan - {% trans \"Content Writer\" %}</li>\n<li>Hayden Jackson - {% trans \"Technical Team\" %}</li>\n<li>Jordan Griffiths - {% trans \"Technical Team\" %}</li>\n<li>Sarang Love Leehan - {% trans \"Creative Content Developer &amp; Illustrator\" %}</li>\n" } ]
Python
MIT License
uccser/cs-unplugged
Moved myself from the past contributors to current, yay!
701,857
06.06.2019 13:53:13
-43,200
9258f3e3c283c782441512f962f3fac699308f67
Modified the first paragraph on the 'What is Computer Science' page so that it reads better and refers to Computer Science as a subject, rather than a 'term', and added a link to the Computational Thinking page
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/general/what-is-computer-science.html", "new_path": "csunplugged/templates/general/what-is-computer-science.html", "diff": "<h1>{% trans \"What is Computer Science?\" %}</h1>\n<p>\n+ {% url 'general:computational_thinking' as computational_thinking_url %}\n{% blocktrans trimmed %}\n- The term \"Computer Science\" has become widely used in recent years as the skills associated with the subject have become crucial to developing innovative digital technology, and qualifications in this area are highly sought after.\n+ In todays digital world, Computer Science has become an important subject for everyone to learn about.\n+ The knowledge and <a href=\"{{ computational_thinking_url }}\">Computational Thinking skills</a> associated with it are now crucial to developing innovative digital technology, understanding modern society, and qualifications in this area are highly sought after.\n{% endblocktrans %}\n</p>\n<p>\n{% blocktrans trimmed %}\n- This is where computer science comes in; many areas of Computer Science are employed to make the system work well, and most of them are illustrated through Unplugged.\n+ This is where Computer Science comes in; many areas of Computer Science are employed to make the system work well, and most of them are illustrated through Unplugged.\nHow could you search billions of items in a fraction of a second (Searching Algorithms)?\nHow do you make sure that it's easy to use (Human-Computer Interaction)?\nWe need to keep it secure - users don't want other people to know what they are searching for, and the search engine doesn't want commercial interests to manipulate search ranking (Computer Security and Encryption)?\n<p>\n{% blocktrans trimmed %}\n- The areas above cover much of what the subject of computer science is about.\n+ The areas above cover much of what the subject of Computer Science is about.\nProgramming is just a tool for implementing ideas (well, it's a very powerful tool, and requires considerable skill to use well).\nBut programming on its own isn't enough to create software that people love to use, and Computer Science is the area that gives programmers the inside knowledge to make their software fast, efficient, reliable, secure, usable, intelligent, scalable, and even delightful!\n{% endblocktrans %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Modified the first paragraph on the 'What is Computer Science' page so that it reads better and refers to Computer Science as a subject, rather than a 'term', and added a link to the Computational Thinking page
701,857
06.06.2019 16:48:27
-43,200
c5fd9aff38afa46e633ca1e59abbe8ee4ad0262a
Set up basic folders, markdown files, and yaml configuration files for the Image Representation topic. Added the Image Representation topic to structure.yaml
[ { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "diff": "+# Image Representation\n+\n+Images are everywhere on computers and digital devices, and they are one of the main ways we interact with them.\n+Digital devices store everything using digits, so how do they use these digits to create the images we see on our computer screens, our smartphones, and our tablets?\n+How do these devices convert a long list of digits into photos, video game graphics, and web pages?\n+This unit will explore how we can represent pictures and colours using binary digits, how these are displayed using pixels on a screen, and why the way we represent these images changes what we see.\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "+# Colour by numbers\n+\n+Test\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "+# Image Representation\n+\n+Test\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/structure/image-representation/image-representation.yaml", "diff": "+unit-plans:\n+ - unit-plan/unit-plan.yaml\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/structure/image-representation/unit-plan/lessons/lessons.yaml", "diff": "+colour-by-numbers:\n+ duration: 45\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/structure/image-representation/unit-plan/unit-plan.yaml", "diff": "+lessons: lessons/lessons.yaml\n+\n+age-groups:\n+ 5-7:\n+ colour-by-numbers:\n+ number: 1\n+ 8-10:\n+ colour-by-numbers:\n+ number: 1\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/structure/structure.yaml", "new_path": "csunplugged/topics/content/structure/structure.yaml", "diff": "@@ -4,6 +4,7 @@ topics:\n- searching-algorithms\n- sorting-networks\n- kidbots\n+ - image-representation\nage-groups: age-groups.yaml\nprogramming-challenges-structure: programming-challenges-structure.yaml\n" } ]
Python
MIT License
uccser/cs-unplugged
Set up basic folders, markdown files, and yaml configuration files for the Image Representation topic. Added the Image Representation topic to structure.yaml
701,857
10.06.2019 12:20:18
-43,200
bc6d5002f5b29f473fc95b8107c8f5e849d57c2d
Added general headings for image-rep unit plan and lesson 1. Began adding content to these.Added note about completing the binary numbers lesson first to the ima-rep introduction
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "new_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "diff": "@@ -4,3 +4,4 @@ Images are everywhere on computers and digital devices, and they are one of the\nDigital devices store everything using digits, so how do they use these digits to create the images we see on our computer screens, our smartphones, and our tablets?\nHow do these devices convert a long list of digits into photos, video game graphics, and web pages?\nThis unit will explore how we can represent pictures and colours using binary digits, how these are displayed using pixels on a screen, and why the way we represent these images changes what we see.\n+We recommend completing lesson 1 (for the relevant age group) of the Binary Numbers unit before beginning this unit.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "# Colour by numbers\n-Test\n+{comment May need to split this into two seperate lessons for jnr vs snr}\n+\n+## Key questions\n+\n+- How do computers represent images when they can only store numbers?\n+\n+\n+# Teaching observations\n+\n+\n+\n+\n+## Lesson starter\n+\n+Print colouring sheets\n+\n+# Notes on resources\n+\n+A normal writing pencil or black colouring pencil.\n+Erasers - These are good to have as students will likely make some mistakes!\n+\n+\n+# Teaching observations\n+\n+\n+\n+## Lesson activities\n+\n+\n+\n+\n+\n+# Teaching observations\n+\n+\n+\n+\n+## Applying what we have just learnt\n+\n+\n+\n+\n+## Lesson reflection\n+\n+\n+This is just for black and white images, but what about coloured ones? We will explore this at older ages.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "# Image Representation\n-Test\n+Computers today use digits to represent information - that's why they're called digital systems.\n+But we use computers to store, display, and manipulate many different types of data, not just digits.\n+\n+\n+This unit will include some discussions about, and use of, binary so we recommend completing lesson 1 of the Binary Numbers unit before beginning this unit.\n+\n+\n+## Digital Technologies | Data Representation\n+\n+\n+\n+{comment this image is currently too big for the page}\n+\n+{image file-path=\"img/topics/binary-picture-showing-bits.png\" alt=\"If we look closely at an image on a computer screen we can see it is made up of a grid of tiny dots called pixels. The colour of each of these is stored inside a computer using binary.\"}\n+\n+## Vocabulary Explained\n+\n+**Pixel**\n+\n+\n+\n+\n+\n+\n+## Real world implications\n+\n+\n+\n+\n+\n+\n+\n+\n+## Reflection questions\n+\n+- What was most surprising about the learning that happened from the teaching of this unit?\n+- Who were the students who were very systematic in their activities?\n+- Who were the students who were very detailed in their activities?\n+- What would I change in my delivery of this unit?\n" } ]
Python
MIT License
uccser/cs-unplugged
Added general headings for image-rep unit plan and lesson 1. Began adding content to these.Added note about completing the binary numbers lesson first to the ima-rep introduction
701,857
10.06.2019 16:28:58
-43,200
d25fbb1be9bbc5610dac498fb8173a3dd9291633
Adding content to the image-rep unit plan and lesson 1
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "new_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "diff": "@@ -4,4 +4,5 @@ Images are everywhere on computers and digital devices, and they are one of the\nDigital devices store everything using digits, so how do they use these digits to create the images we see on our computer screens, our smartphones, and our tablets?\nHow do these devices convert a long list of digits into photos, video game graphics, and web pages?\nThis unit will explore how we can represent pictures and colours using binary digits, how these are displayed using pixels on a screen, and why the way we represent these images changes what we see.\n+\nWe recommend completing lesson 1 (for the relevant age group) of the Binary Numbers unit before beginning this unit.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "{comment May need to split this into two seperate lessons for jnr vs snr}\n-## Key questions\n+{comment Need to figure out how to properly link to resources, then add in pixel painter}\n-- How do computers represent images when they can only store numbers?\n+.\n+\n+## Key question\n+- How do computers represent images when they can only store numbers?\n-# Teaching observations\n+## Lesson starter\n+Print pixel painter sheets. In the Colouring type list choose the first option 'Black and White (2 possible binary values)'.\n+Choose one of the images from the list, ideally one of the 6 or 8 page options to start with.\n+{comment Maybe suggest doing the activity as a group first?}\n-## Lesson starter\n-Print colouring sheets\n+{comment Maybe have a really simple one for the teacher to demonstrate with? Like a letter, as in the classic CSU.}\n# Notes on resources\nA normal writing pencil or black colouring pencil.\n-Erasers - These are good to have as students will likely make some mistakes!\n-\n-\n-# Teaching observations\n+Erasers - These are good to have as students will likely make some mistakes.\n## Lesson activities\n-\n-\n-\n-\n-# Teaching observations\n+.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "# Image Representation\n+**We recommend completing lesson 1 of the Binary Numbers unit before beginning this unit.**\n+\nComputers today use digits to represent information - that's why they're called digital systems.\nBut we use computers to store, display, and manipulate many different types of data, not just digits.\n-This unit will include some discussions about, and use of, binary so we recommend completing lesson 1 of the Binary Numbers unit before beginning this unit.\n-## Digital Technologies | Data Representation\n+## Digital Technologies | Data Representation\n+All data on computers is stored using just 0's and 1's.\n{comment this image is currently too big for the page}\n{image file-path=\"img/topics/binary-picture-showing-bits.png\" alt=\"If we look closely at an image on a computer screen we can see it is made up of a grid of tiny dots called pixels. The colour of each of these is stored inside a computer using binary.\"}\n-## Vocabulary Explained\n-\n-**Pixel**\n+{comment Could include Algorithms as well because of RLE/encoding Algorithms}\n+## Vocabulary Explained\n+### Pixel\n+Pixel is short for \"picture element\"...\n-## Real world implications\n+## Real world implications\n+Screen resolutions, file sizes, image quality, image processing time.\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding content to the image-rep unit plan and lesson 1
701,857
11.06.2019 14:12:05
-43,200
e7c68bf20ad239cc7a174f7ed1f04419c7c2e007
Added content to image-rep unit plan and lesson 1
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "new_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "diff": "@@ -5,4 +5,4 @@ Digital devices store everything using digits, so how do they use these digits t\nHow do these devices convert a long list of digits into photos, video game graphics, and web pages?\nThis unit will explore how we can represent pictures and colours using binary digits, how these are displayed using pixels on a screen, and why the way we represent these images changes what we see.\n-We recommend completing lesson 1 (for the relevant age group) of the Binary Numbers unit before beginning this unit.\n+We recommend completing lesson 1 (for the relevant age group) of the [Binary Numbers unit]('topics:unit_plan' 'binary-numbers' 'unit-plan') before beginning this unit.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "Print pixel painter sheets. In the Colouring type list choose the first option 'Black and White (2 possible binary values)'.\nChoose one of the images from the list, ideally one of the 6 or 8 page options to start with.\n+Teacher: Computer screens are divided up into a grid of small squares, which we call picture elements, or pixels. *Instructions on writing \"picture elements\" then changing to pixels*.\n+Each of these pixels can be a different colour, and they can display different images.\n+In a black and white image, each pixel can be either black or white.\n+\n+\n+\n+\n+\n+\n+\n{comment Maybe suggest doing the activity as a group first?}\n{comment Maybe have a really simple one for the teacher to demonstrate with? Like a letter, as in the classic CSU.}\n+\n+\n# Notes on resources\nA normal writing pencil or black colouring pencil.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "# Image Representation\n-**We recommend completing lesson 1 of the Binary Numbers unit before beginning this unit.**\n+**We recommend completing lesson 1 (for the relevant age group) of the [Binary Numbers unit]('topics:unit_plan' 'binary-numbers' 'unit-plan') before beginning this unit.**\n-Computers today use digits to represent information - that's why they're called digital systems.\n-But we use computers to store, display, and manipulate many different types of data, not just digits.\n+Images are everywhere on computers and digital devices.\n+If you think of all the different devices you use and what you do with them, it is likely that almost all of these will involve a screen of some kind!\n+Everything you see on computer screens, whether it is photographs, videos, websites, even text, is an image that a digital device has been programmed to display.\n+{comment Add teaching this in action video here}\n+All information that modern computers store and process is stored as digits, using binary digits.\n+This means that everything you see in computer images is stored inside a computer using just 0's and 1's, and these are used to *represent* images.\n+\n+Computer screens are divided into a grid of tiny squares called pixels.\n+These pixels can each show a different colour, and because they are so small when we look at a screen we don't see the individual pixels, instead we see them blend together into an image.\n+If you look very very closely at a computer or TV screen (especially older ones) then you might be able to see these individual pixels. Be careful not to hurt your eyes though!\n+\n+The digits stored in the computer tell each of these pixels what colour they should be and when they should change colour, which means computers can turn a bunch of random looking binary digits into all the beautiful images we see on our screens!\n## Digital Technologies | Data Representation\nAll data on computers is stored using just 0's and 1's.\n-{comment this image is currently too big for the page}\n+\n+\n+\n+{comment This image is currently too big for the page}\n{image file-path=\"img/topics/binary-picture-showing-bits.png\" alt=\"If we look closely at an image on a computer screen we can see it is made up of a grid of tiny dots called pixels. The colour of each of these is stored inside a computer using binary.\"}\n@@ -24,15 +37,35 @@ All data on computers is stored using just 0's and 1's.\n### Pixel\n-Pixel is short for \"picture element\"...\n+The word pixel is abbreviation of *picture element*. On computer screens (and printers) an image is almost always displayed using a grid of tiny coloured squares, called pixels.\n+\n+\n+{comment Older version, which matches the pixels.md file in the glossary: This term is an abbreviation of picture element, the name given to the tiny squares that make up a grid that is used to represent images on a computer.}\n+\n+### Display Resolution\n+The resolution of a screen refers to the number or density of pixels on the screen.\n+It is usually defined as either the number of pixels per inch on the screen, or the width x height of the screen measured in pixels (e.g. 1920x1080 pixels).\n## Real world implications\n-Screen resolutions, file sizes, image quality, image processing time.\n+{comment Check conventions around using numerals vs words}\n+\n+The more bits we use to store the colour of a pixel, the more different colours we can make.\n+If we use one bit to store the colour of a pixel then we only have two options for what that colour can be (remember, with one bit we can represent two different values only, because we can only use 0 or 1).\n+If we use 8 bits (or 1 byte) then we can represent 256 different colours instead, which\n+\n+\n+\n+- Screen resolutions\n+\n+\n+- File sizes and image quality\n+\n+- Image processing time. Need better hardware to run newer games, streaming quality, matters a lot for creators and artists.\n" } ]
Python
MIT License
uccser/cs-unplugged
Added content to image-rep unit plan and lesson 1
701,857
11.06.2019 14:54:45
-43,200
706917a05246ec6afb89237a75141a69fa9653e9
Added images for image-rep lesson 1
[ { "change_type": "ADD", "old_path": "csunplugged/static/img/topics/letter-zooming-to-pixels.png", "new_path": "csunplugged/static/img/topics/letter-zooming-to-pixels.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/topics/letter-zooming-to-pixels.png differ\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png", "new_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png differ\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter.png", "new_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/topics/pixel-visible-grid-with-letter.png differ\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "## Lesson starter\n-Print pixel painter sheets. In the Colouring type list choose the first option 'Black and White (2 possible binary values)'.\n-Choose one of the images from the list, ideally one of the 6 or 8 page options to start with.\n+\nTeacher: Computer screens are divided up into a grid of small squares, which we call picture elements, or pixels. *Instructions on writing \"picture elements\" then changing to pixels*.\nEach of these pixels can be a different colour, and they can display different images.\nIn a black and white image, each pixel can be either black or white.\n+{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the lower case letter 'a' are shown. These progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\n+...\n+{image file-path=\"img/topics/pixel-visible-grid-with-letter.png\" alt=\"A six by five grid is shown. Some of the squares are white and others are coloured black to create the shape of the letter 'a'.\"}\n+...\n-{comment Maybe suggest doing the activity as a group first?}\n-\n-\n-{comment Maybe have a really simple one for the teacher to demonstrate with? Like a letter, as in the classic CSU.}\n-\n+{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"to write\"}\n# Notes on resources\n@@ -38,11 +37,12 @@ In a black and white image, each pixel can be either black or white.\nA normal writing pencil or black colouring pencil.\nErasers - These are good to have as students will likely make some mistakes.\n-\n+Print pixel painter sheets. In the Colouring type list choose the first option 'Black and White (2 possible binary values)'.\n+Choose one of the images from the list, ideally one of the 6 or 8 page options to start with.\n## Lesson activities\n-.\n+\n" } ]
Python
MIT License
uccser/cs-unplugged
Added images for image-rep lesson 1
701,857
12.06.2019 14:08:17
-43,200
788a71fbf6d5f0db6d89e7a1205416a50d91b941
Add classroom resources and resource notes panel
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "{comment Need to figure out how to properly link to resources, then add in pixel painter}\n-.\n-\n-## Key question\n+## Key questions\n+- How do you think computers display images on a screen?\n- How do computers represent images when they can only store numbers?\n## Lesson starter\n+{panel type=\"general\"}\n+# Notes on resources\n-Teacher: Computer screens are divided up into a grid of small squares, which we call picture elements, or pixels. *Instructions on writing \"picture elements\" then changing to pixels*.\n-Each of these pixels can be a different colour, and they can display different images.\n-In a black and white image, each pixel can be either black or white.\n+For this activity you will need to print out Pixel Painter worksheets:\n-{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the lower case letter 'a' are shown. These progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\n+ - Print enough for one page per child.\n+ - For this activity use the *Black and White (2 possible binary values)* colouring option. Choose the first option in the *Colouring type* list\n+ - The first time you do this activity choose either the *Kauri tree* or *Butterfly* option in the *Image* list. Children can move on to the large images in the future.\n-...\n+Children will need:\n-{image file-path=\"img/topics/pixel-visible-grid-with-letter.png\" alt=\"A six by five grid is shown. Some of the squares are white and others are coloured black to create the shape of the letter 'a'.\"}\n+ - A black pencil, colouring pencil, crayon, or felt tip pen.\n+ - Erasers if they are using pencils. It's not neccesary for every child to have one, but it is useful to have them incase students make mistakes when colouring in.\n-...\n+{panel end}\n-{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"to write\"}\n+Put students into groups of 6 children. If there aren't enough students to have all full groups then this can be done with groups of 2 or 3 instead.\n+Teacher: Computer screens are divided up into a grid of small squares, which we call picture elements, or pixels. *Instructions on writing \"picture elements\" then changing to pixels*.\n+Each of these pixels can be a different colour, and they can display different images.\n+In a black and white image, each pixel can be either black or white.\n-# Notes on resources\n-A normal writing pencil or black colouring pencil.\n-Erasers - These are good to have as students will likely make some mistakes.\n+{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the lower case letter 'a' are shown. These progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\n+\n+...\n+\n+{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"A six by five grid is shown. Some of the squares are white and others are coloured black to create the shape of the letter 'a'. To the right of each row of squares there are five binary digits which describe the image.\"}\n+\n+A 0 indicates a white square and a 1 indicates a black square.\n-Print pixel painter sheets. In the Colouring type list choose the first option 'Black and White (2 possible binary values)'.\n-Choose one of the images from the list, ideally one of the 6 or 8 page options to start with.\n## Lesson activities\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -12,7 +12,7 @@ Everything you see on computer screens, whether it is photographs, videos, websi\nAll information that modern computers store and process is stored as digits, using binary digits.\nThis means that everything you see in computer images is stored inside a computer using just 0's and 1's, and these are used to *represent* images.\n-Computer screens are divided into a grid of tiny squares called pixels.\n+Computer screens are divided into a grid of tiny squares called {glossary-link term=\"pixel\"}pixels{glossary-link end}.\nThese pixels can each show a different colour, and because they are so small when we look at a screen we don't see the individual pixels, instead we see them blend together into an image.\nIf you look very very closely at a computer or TV screen (especially older ones) then you might be able to see these individual pixels. Be careful not to hurt your eyes though!\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/structure/image-representation/unit-plan/lessons/lessons.yaml", "new_path": "csunplugged/topics/content/structure/image-representation/unit-plan/lessons/lessons.yaml", "diff": "colour-by-numbers:\nduration: 45\n+ generated-resources:\n+ - pixel-painter\n+ classroom-resources:\n+ - coloring-pens\n" } ]
Python
MIT License
uccser/cs-unplugged
Add classroom resources and resource notes panel
701,857
13.06.2019 14:08:30
-43,200
d5488fadc3798822f1addb8578b8f7b79da0ad32
Added lesson reflection to colour by numbers lesson
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/glossary/pixel.md", "new_path": "csunplugged/topics/content/en/glossary/pixel.md", "diff": "# Pixel\n-This term is an abbreviation of picture element, the name given to the tiny squares that make up a grid that is used to represent images on a computer.\n+The word pixel is an abbreviation of *picture element*. On computer screens (and printers) an image is almost always displayed using a grid of tiny coloured squares, which are called pixels.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "# Colour by numbers\n-{comment May need to split this into two seperate lessons for jnr vs snr}\n-\n{comment Need to figure out how to properly link to resources, then add in pixel painter}\n## Key questions\n@@ -27,7 +25,7 @@ For this activity you will need to print out Pixel Painter worksheets:\nChildren will need:\n- A black pencil, colouring pencil, crayon, or felt tip pen.\n- - Erasers if they are using pencils. It's not neccesary for every child to have one, but it is useful to have them incase students make mistakes when colouring in.\n+ - Erasers if they are using pencils. It's not necessary for every child to have one, but it is useful to have them incase students make mistakes when colouring in.\n{panel end}\n@@ -49,12 +47,13 @@ A 0 indicates a white square and a 1 indicates a black square.\n## Lesson activities\n-\n+- Colouring each image and putting them in order.\n## Applying what we have just learnt\n+- Creating your own. Use grid printable, colour in and then read the numbers out to another child (or group).\n@@ -62,4 +61,15 @@ A 0 indicates a white square and a 1 indicates a black square.\n## Lesson reflection\n-This is just for black and white images, but what about coloured ones? We will explore this at older ages.\n+This is just for black and white images, why can't we do more than two colours with this activity?\n+\n+ - If we can only use one binary digit for each we can only represent two different colours.\n+ This means each pixel can only be one of two different colours.\n+\n+What could we do to represent more colours?\n+\n+ - If we want each pixel to be able to show more colours other than black and white then we need to use more numbers (or binary digits) to represent the colour of each pixel. This will be explored in future lessons.\n+\n+{comment Come back and split lessons later once all the other content is done}\n+\n+We will explore this at older ages.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -37,7 +37,7 @@ All data on computers is stored using just 0's and 1's.\n### Pixel\n-The word pixel is abbreviation of *picture element*. On computer screens (and printers) an image is almost always displayed using a grid of tiny coloured squares, called pixels.\n+The word pixel is an abbreviation of *picture element*. On computer screens (and printers) an image is almost always displayed using a grid of tiny coloured squares, called pixels.\n{comment Older version, which matches the pixels.md file in the glossary: This term is an abbreviation of picture element, the name given to the tiny squares that make up a grid that is used to represent images on a computer.}\n" } ]
Python
MIT License
uccser/cs-unplugged
Added lesson reflection to colour by numbers lesson
701,857
14.06.2019 12:04:02
-43,200
5f3a3614d5b76d7481593f88f78c95532eb3493e
Writing Digital Technologies sections in image rep unit plan
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "# Image Representation\n-**We recommend completing lesson 1 (for the relevant age group) of the [Binary Numbers unit]('topics:unit_plan' 'binary-numbers' 'unit-plan') before beginning this unit.**\n+{panel type=\"text\"}\n+# Preparatory knowledge\n+\n+Students should have completed lesson 1 (for the relevant age group) of the [Binary Numbers unit]('topics:unit_plan' 'binary-numbers' 'unit-plan') before beginning this unit.\n+\n+{panel end}\nImages are everywhere on computers and digital devices.\nIf you think of all the different devices you use and what you do with them, it is likely that almost all of these will involve a screen of some kind!\nEverything you see on computer screens, whether it is photographs, videos, websites, even text, is an image that a digital device has been programmed to display.\n+Because modern computers store data as digits, computer images are stored inside a computer using just 0's and 1's, and these are used to represent images.\n+\n{comment Add teaching this in action video here}\n-All information that modern computers store and process is stored as digits, using binary digits.\n-This means that everything you see in computer images is stored inside a computer using just 0's and 1's, and these are used to *represent* images.\n+{comment Old version of text: All information that modern computers store and process is stored using just two states, represented by binary digits. This means that everything you see in computer images is stored inside a computer using just 0's and 1's, and these are used to *represent* images.}\n+\n+{panel type=\"text\"}\n+\n+# Terminology note\n+\n+In this unit and its lesson plans the word **image** is used to refer to what is displayed on a computer screen at any time.\n+It includes everything seen on a screen, such as videos, websites, apps, text, rather than just referring to static pictures or photos.\n+\n+{panel end}\n+\nComputer screens are divided into a grid of tiny squares called {glossary-link term=\"pixel\"}pixels{glossary-link end}.\nThese pixels can each show a different colour, and because they are so small when we look at a screen we don't see the individual pixels, instead we see them blend together into an image.\n@@ -19,19 +35,36 @@ If you look very very closely at a computer or TV screen (especially older ones)\nThe digits stored in the computer tell each of these pixels what colour they should be and when they should change colour, which means computers can turn a bunch of random looking binary digits into all the beautiful images we see on our screens!\n-## Digital Technologies | Data Representation\n-All data on computers is stored using just 0's and 1's.\n+## Digital Technologies | Data Representation\n+All data on computers is represented with digits, and using these digits to represent other types of data is a core concept of Computer Science.\n+At this point you have probably noticed the words **represent** and **representation** are being used a lot, so let's look at exactly what we mean by this.\n{comment This image is currently too big for the page}\n{image file-path=\"img/topics/binary-picture-showing-bits.png\" alt=\"If we look closely at an image on a computer screen we can see it is made up of a grid of tiny dots called pixels. The colour of each of these is stored inside a computer using binary.\"}\n+The type of information a set of digits **represents** changes the way we interpret it.\n+For example, if a set of digits represents an image then we interpret those digits as the colours of different pixels.\n+If it is meant to be text on the other hand, we interpret it as letters.\n+The ability for computers to represent multiple types of information using just two states (represented with binary digits) is one of the things that makes them so powerful.\n+\n+Just like learning about the binary number system, exploring image representation introduces students to the Computational Thinking concepts of Abstraction and Decomposition.\n+Students learn to break down images into pixels and then to digits, and how too move back up from digits, to pixels, to images.\n+\n+\n+## Digital Technologies | Algorithms\n+\n{comment Could include Algorithms as well because of RLE/encoding Algorithms}\n+When pixels are used to represent images, the process we go through to convert digits into these pixels is an Algorithm.\n+There are many different algorithms computers use to do this, and the one they use depends on things like the file type of the images being displayed, for example if it is a picture like a .png or .jpeg, or a video file like an .mp4 or .avi; or what resolution the image is.\n+We also use Algorithms to compress images to smaller file sizes, which means they use less memory, can be processed more quickly, and are faster to download.\n+\n+{comment Through lerning about image representation students practice algorithmic thinking and pattern matching...}\n## Vocabulary Explained\n@@ -39,7 +72,6 @@ All data on computers is stored using just 0's and 1's.\nThe word pixel is an abbreviation of *picture element*. On computer screens (and printers) an image is almost always displayed using a grid of tiny coloured squares, called pixels.\n-\n{comment Older version, which matches the pixels.md file in the glossary: This term is an abbreviation of picture element, the name given to the tiny squares that make up a grid that is used to represent images on a computer.}\n" } ]
Python
MIT License
uccser/cs-unplugged
Writing Digital Technologies sections in image rep unit plan
701,857
14.06.2019 14:07:50
-43,200
7a93dddac6e9655697ec45f486fba37da1d00692
Added real world implications section, and added compress to glossary
[ { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/glossary/compress.md", "diff": "+#Compress\n+\n+To compress something means to make it smaller.\n+In computing we generally apply this to data compression, where we decrease the the number of bits we use to repesent a piece of information (e.g. decrease the size of a file) using a compression algorithm.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -34,7 +34,9 @@ If you look very very closely at a computer or TV screen (especially older ones)\nThe digits stored in the computer tell each of these pixels what colour they should be and when they should change colour, which means computers can turn a bunch of random looking binary digits into all the beautiful images we see on our screens!\n-\n+There are many different methods we can use to convert images into digital data and back again, and the method we choose depends on what the images are used for.\n+A black and white image, where each pixel can be only either black or white, is much simpler to represent using digits than a full length, colour, high-definition, film is!\n+In this unit students are introduced to simple examples of how they can use digits to create images, how the number of colours an image can include is based on the number of bits used to store it, and how images are compressed so computers can process them faster.\n## Digital Technologies | Data Representation\n@@ -83,21 +85,21 @@ It is usually defined as either the number of pixels per inch on the screen, or\n## Real world implications\n-{comment Check conventions around using numerals vs words}\n-\n+The way images are digitally repersented effects how they are displayed, created, stored, and manipulated.\nThe more bits we use to store the colour of a pixel, the more different colours we can make.\nIf we use one bit to store the colour of a pixel then we only have two options for what that colour can be (remember, with one bit we can represent two different values only, because we can only use 0 or 1).\n-If we use 8 bits (or 1 byte) then we can represent 256 different colours instead, which\n-\n+If we use 8 bits (or 1 byte) then we can display 256 different colours instead, and if we use 24 bits (3 bytes) then we can display over 16 million different colours, which is more than the human eye can see!\n+However, using more bits to represent a colour will increase the size of an image file, which means it will take up more space in memory and take longer for a computer to process.\n+Filmakers have to use powerful computers and store large amounts of data when they are editing their videos, otherwise it would take them far too long to do this or they would have to decrease the quality of their films.\n+This is also why old computers can't always run newer games, the older computers simply can't process the game graphics quickly enough to display them.\n-- Screen resolutions\n+For some types of images there are ways we can {glossary-link term=\"compress\"}compress{glossary-link end} them.\n+This means we can decrease the size of the image files without losing, or only losing a small amount of, quality and information.\n+Image compression algorithms allow us to store, process, transmit, and create images more quickly.\n-- File sizes and image quality\n-\n-\n-- Image processing time. Need better hardware to run newer games, streaming quality, matters a lot for creators and artists.\n+{comment Check conventions around using numerals vs words}\n" } ]
Python
MIT License
uccser/cs-unplugged
Added real world implications section, and added compress to glossary
701,857
14.06.2019 16:24:19
-43,200
4089036b85ad7036748788ceaf149031c47ed863
Working on lesson 1
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "# Colour by numbers\n-{comment Need to figure out how to properly link to resources, then add in pixel painter}\n+{comment Do learning outcomes at some point. They go in the yaml file}\n## Key questions\n@@ -29,7 +29,9 @@ Children will need:\n{panel end}\n-Put students into groups of 6 children. If there aren't enough students to have all full groups then this can be done with groups of 2 or 3 instead.\n+Put students into groups of 6. If there aren't enough students to have all full groups then this can be done with groups of 2 or 3 instead.\n+\n+\nTeacher: Computer screens are divided up into a grid of small squares, which we call picture elements, or pixels. *Instructions on writing \"picture elements\" then changing to pixels*.\nEach of these pixels can be a different colour, and they can display different images.\n" } ]
Python
MIT License
uccser/cs-unplugged
Working on lesson 1
701,857
17.06.2019 11:16:51
-43,200
ca16fcd6bf43b3d229887fb3187f67a34a8e13b0
Adding content to lesson 1
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "# Notes on resources\n-\nFor this activity you will need to print out Pixel Painter worksheets:\n- - Print enough for one page per child.\n+ - Print enough for one page per child, and spare copies in case of mistakes.\n- For this activity use the *Black and White (2 possible binary values)* colouring option. Choose the first option in the *Colouring type* list\n- The first time you do this activity choose either the *Kauri tree* or *Butterfly* option in the *Image* list. Children can move on to the large images in the future.\nChildren will need:\n- - A black pencil, colouring pencil, crayon, or felt tip pen.\n- - Erasers if they are using pencils. It's not necessary for every child to have one, but it is useful to have them incase students make mistakes when colouring in.\n+ - A normal writing pencil. They can also use a black pencil or felt tip pen, but easily erasable pencils are preferable.\n+ - Erasers.\n{panel end}\n-Put students into groups of 6. If there aren't enough students to have all full groups then this can be done with groups of 2 or 3 instead.\n+Say to the students: Computer screens are divided up into a grid of small squares, each of which can display a colour.\n+We call these squares picture elements, or pixels.\n+Write the words \"picture elements\" on the board.\n+To show how we get the word pixels, circle the \"pi\" of picture and the \"el\" of elements, and write \"pixel\" underneath.\n-Teacher: Computer screens are divided up into a grid of small squares, which we call picture elements, or pixels. *Instructions on writing \"picture elements\" then changing to pixels*.\n-Each of these pixels can be a different colour, and they can display different images.\n-In a black and white image, each pixel can be either black or white.\n+Say to students: Each of these pixels can be a different colour, and when we have a lot of them on a screen they form an image.\n+Has anyone heard of pixels before? What about megapixels?\n+\n+{panel type=\"general\"}\n+\n+# Teaching observations\n+Megapixel means one million pixels.\n+Students may have heard the term \"megapixels\" used before because cameras are often described as being a certain number of megapixels, for example a phone with a 12-megapixel camera.\n+This describes the resolution of the photos a camera can take. A 12-mega pixel camera can produce an image with 12 million pixels in it.\n+\n+{panel end}\n+\n+Television screens are also made up of pixels.\n+Every image we see on a screen, whether it is a picture, a video, or text, is shown using pixels.\n+For example, if we want to display the letter *a* we can divide it into squares.\n+If we zoom in further and further on the letter we can see a grid of pixels similar to these:\n{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the lower case letter 'a' are shown. These progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\n-...\n-{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"A six by five grid is shown. Some of the squares are white and others are coloured black to create the shape of the letter 'a'. To the right of each row of squares there are five binary digits which describe the image.\"}\n+In a black and white image, each pixel can be either black or white.\n+\n+\n+*explanation of images/pixels being stored using numbers, e.g. binary digits. How these can be converted to the colour of each pixel.*\n+\nA 0 indicates a white square and a 1 indicates a black square.\n+{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"A six by five grid is shown. Some of the squares are white and others are coloured black to create the shape of the letter 'a'. To the right of each row of squares there are five binary digits which describe the image.\"}\n+\n+\n+\n## Lesson activities\n+Put students into groups of 6. If there aren't enough students to have all full groups then this can be done with groups of 2 or 3 instead.\n+\n+Now we are going to take binary digits and create images from these.\n+\n- Colouring each image and putting them in order.\n+- Advise students to colour the squares in lightly at first so it is easy to erase mistakes. They can colour the squares in darker later if they want to.\n## Applying what we have just learnt\n+\n- Creating your own. Use grid printable, colour in and then read the numbers out to another child (or group).\n+- Whole class one using the bigger images.\n+\n@@ -74,4 +104,4 @@ What could we do to represent more colours?\n{comment Come back and split lessons later once all the other content is done}\n-We will explore this at older ages.\n+(We will explore this at older ages.)\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/learning-outcomes.yaml", "new_path": "csunplugged/topics/content/en/learning-outcomes.yaml", "diff": "@@ -326,3 +326,11 @@ sorting-demonstrate-alphabet-knowledge:\nsorting-comparing-musical-pitch:\ntext: Compare musical pitch in musical notation and aurally.\n+\n+# IMAGE REPRESENTATION OUTCOMES\n+\n+image-rep-explain-pixels:\n+ text: Explain that the images shown by computers are made up of pixels, each of which can display a different colour.\n+\n+image-rep-describe-digits-representing-images:\n+ text: Describe how images can be stored and represented using digits.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/structure/image-representation/unit-plan/lessons/lessons.yaml", "new_path": "csunplugged/topics/content/structure/image-representation/unit-plan/lessons/lessons.yaml", "diff": "colour-by-numbers:\nduration: 45\n+ learning-outcomes:\n+ - image-rep-explain-pixels\n+ - image-rep-describe-digits-representing-images\ngenerated-resources:\n- pixel-painter\nclassroom-resources:\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/structure/learning-outcomes.yaml", "new_path": "csunplugged/topics/content/structure/learning-outcomes.yaml", "diff": "@@ -448,3 +448,13 @@ sorting-demonstrate-alphabet-knowledge:\nsorting-comparing-musical-pitch:\ncurriculum-areas:\n- music\n+\n+# IMAGE REPRESENTATION OUTCOMES\n+\n+image-rep-explain-pixels:\n+ curriculum-areas:\n+ - decomposition\n+\n+image-rep-describe-digits-representing-images:\n+ curriculum-areas:\n+ - abstraction\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding content to lesson 1
701,857
17.06.2019 14:51:07
-43,200
6078990d2e0b7ee9c60e8747b2b867daff4f67ff
Working on lesson 1 content
[ { "change_type": "ADD", "old_path": "csunplugged/static/img/topics/a_in_binary_code.png", "new_path": "csunplugged/static/img/topics/a_in_binary_code.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/topics/a_in_binary_code.png differ\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "@@ -46,24 +46,25 @@ Megapixel means one million pixels.\nStudents may have heard the term \"megapixels\" used before because cameras are often described as being a certain number of megapixels, for example a phone with a 12-megapixel camera.\nThis describes the resolution of the photos a camera can take. A 12-mega pixel camera can produce an image with 12 million pixels in it.\n-{panel end}\n-\nTelevision screens are also made up of pixels.\n-Every image we see on a screen, whether it is a picture, a video, or text, is shown using pixels.\n-For example, if we want to display the letter *a* we can divide it into squares.\n-If we zoom in further and further on the letter we can see a grid of pixels similar to these:\n-{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the lower case letter 'a' are shown. These progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\n+{panel end}\n-In a black and white image, each pixel can be either black or white.\n+Every image we see on a screen, whether it is a picture, a video, or text, is shown using pixels, and all a computer needs to store is what colour each of the pixels on the screen should be.\n+In a black and white image, each pixel can be either black or white, so all the computer would need to store is which dots are black and which are white.\n+For example, if we wanted to display the letter *a* we need to divide it into squares.\n+If we zoom in further and further on the letter we can see a grid of pixels similar to these:\n-*explanation of images/pixels being stored using numbers, e.g. binary digits. How these can be converted to the colour of each pixel.*\n+{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the lower case letter 'a' are shown. These progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\n+We can represent this image using binary digits.\n+If a 0 indicates a white square and a 1 indicates a black square then we can represent our letter *a*, on a 5x6 pixel grid, like this:\n-A 0 indicates a white square and a 1 indicates a black square.\n+{image file-path=\"img/topics/a_in_binary_code.png\" alt=\"A string of binary numbers is shown. They are divided in six lots of five numbers.\"}\n+If we take these numbers and draw the image they represent we get the letter a:\n{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"A six by five grid is shown. Some of the squares are white and others are coloured black to create the shape of the letter 'a'. To the right of each row of squares there are five binary digits which describe the image.\"}\n@@ -80,14 +81,13 @@ Now we are going to take binary digits and create images from these.\n- Advise students to colour the squares in lightly at first so it is easy to erase mistakes. They can colour the squares in darker later if they want to.\n+- Try doing the larger images. Have the whole class work on a large one.\n+\n## Applying what we have just learnt\n- Creating your own. Use grid printable, colour in and then read the numbers out to another child (or group).\n-- Whole class one using the bigger images.\n-\n-\n## Lesson reflection\n" } ]
Python
MIT License
uccser/cs-unplugged
Working on lesson 1 content
701,857
18.06.2019 17:08:37
-43,200
082e14a43991e33aa90d9311916a84e07e914038
Added three new 1 page image options to the pixel painter interactive
[ { "change_type": "MODIFY", "old_path": "csunplugged/resources/generators/PixelPainterResourceGenerator.py", "new_path": "csunplugged/resources/generators/PixelPainterResourceGenerator.py", "diff": "@@ -16,6 +16,9 @@ METHOD_VALUES = {\n}\nIMAGE_VALUES = {\n+ \"star\": _(\"Star - 1 page\"),\n+ \"teacup\": _(\"Teacup - 1 page\"),\n+ \"cat\": _(\"Cat - 1 page\"),\n\"fish\": _(\"Fish - 6 pages\"),\n\"kauri-tree\": _(\"Kauri tree - 6 pages\"),\n\"butterfly\": _(\"Butterfly - 6 pages\"),\n@@ -68,6 +71,9 @@ class PixelPainterResourceGenerator(BaseResourceGenerator):\n}\nimage_strings = {\n+ \"star\": _(\"Star\"),\n+ \"teacup\": _(\"Teacup\"),\n+ \"cat\": _(\"Cat\"),\n\"boat\": _(\"Boat\"),\n\"fish\": _(\"Fish\"),\n\"hot-air-balloon\": _(\"Hot air balloon\"),\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/resources/pixel-painter/cat/cat-black-white.png", "new_path": "csunplugged/static/img/resources/pixel-painter/cat/cat-black-white.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/resources/pixel-painter/cat/cat-black-white.png differ\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/resources/pixel-painter/cat/cat-colour.png", "new_path": "csunplugged/static/img/resources/pixel-painter/cat/cat-colour.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/resources/pixel-painter/cat/cat-colour.png differ\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/resources/pixel-painter/cat/cat-greyscale.png", "new_path": "csunplugged/static/img/resources/pixel-painter/cat/cat-greyscale.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/resources/pixel-painter/cat/cat-greyscale.png differ\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/resources/pixel-painter/star/star-black-white.png", "new_path": "csunplugged/static/img/resources/pixel-painter/star/star-black-white.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/resources/pixel-painter/star/star-black-white.png differ\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/resources/pixel-painter/star/star-colour.png", "new_path": "csunplugged/static/img/resources/pixel-painter/star/star-colour.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/resources/pixel-painter/star/star-colour.png differ\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/resources/pixel-painter/star/star-greyscale.png", "new_path": "csunplugged/static/img/resources/pixel-painter/star/star-greyscale.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/resources/pixel-painter/star/star-greyscale.png differ\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/resources/pixel-painter/teacup/teacup-black-white.png", "new_path": "csunplugged/static/img/resources/pixel-painter/teacup/teacup-black-white.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/resources/pixel-painter/teacup/teacup-black-white.png differ\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/resources/pixel-painter/teacup/teacup-colour.png", "new_path": "csunplugged/static/img/resources/pixel-painter/teacup/teacup-colour.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/resources/pixel-painter/teacup/teacup-colour.png differ\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/img/resources/pixel-painter/teacup/teacup-greyscale.png", "new_path": "csunplugged/static/img/resources/pixel-painter/teacup/teacup-greyscale.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/resources/pixel-painter/teacup/teacup-greyscale.png differ\n" } ]
Python
MIT License
uccser/cs-unplugged
Added three new 1 page image options to the pixel painter interactive
701,857
20.06.2019 15:11:15
-43,200
be78bbe33316158f8f091f7aa96693240bdf7be3
Adding to lesson 1 and editing unit plan
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "## Lesson starter\n-{panel type=\"general\"}\n-# Notes on resources\n-For this activity you will need to print out Pixel Painter worksheets:\n+Children will need:\n- - Print enough for one page per child, and spare copies in case of mistakes.\n- - For this activity use the *Black and White (2 possible binary values)* colouring option. Choose the first option in the *Colouring type* list\n- - The first time you do this activity choose either the *Kauri tree* or *Butterfly* option in the *Image* list. Children can move on to the large images in the future.\n+ - A normal writing pencil.\n+ - Erasers.\n-Children will need:\n+This lesson includes two activities, one which students complete individually and one group activity.\n+In each activity you will need enough coloring pages for one per student.\n+These each require different versions of the Pixel Painter worksheets.\n+Use the Black and White colouring type (the first option on the list), and:\n+\n+ - for the first activity choose from the 1 page images (the star, teacup, or the cat). You can use a combination of these images, students do not all need to complete the same one,\n+ - for the second activity choose from the 6, 8, and 9 page images. Print enough for one set of image worksheets per group of students.\n- - A normal writing pencil. They can also use a black pencil or felt tip pen, but easily erasable pencils are preferable.\n- - Erasers.\n+\n+{panel type=\"general\"}\n+\n+# Notes on resources\n+\n+ - Print spare copies of each worksheet in case students make mistakes and need a new one.\n+ - Use the *Black and White (2 possible binary values)* colouring option, **not** the option which says \"in Run Length Encoding\"\n+ - Students can instead use a black pencil or felt tip pen, but easily erasable pencils work much better the first time students do this activity.\n{panel end}\n-Say to the students: Computer screens are divided up into a grid of small squares, each of which can display a colour.\n+Teacher to class: Computer screens are divided up into a grid of small squares, each of which can display a colour.\nWe call these squares picture elements, or pixels.\nWrite the words \"picture elements\" on the board.\nTo show how we get the word pixels, circle the \"pi\" of picture and the \"el\" of elements, and write \"pixel\" underneath.\n-Say to students: Each of these pixels can be a different colour, and when we have a lot of them on a screen they form an image.\n+Teacher to class: Each of these pixels can be a different colour, and when we have a lot of them on a screen they form an image.\nHas anyone heard of pixels before? What about megapixels?\n{panel type=\"general\"}\n@@ -51,9 +60,12 @@ Television screens are also made up of pixels.\n{panel end}\n-Every image we see on a screen, whether it is a picture, a video, or text, is shown using pixels, and all a computer needs to store is what colour each of the pixels on the screen should be.\n+Teacher to class: Every image we see on a screen, whether it is a picture, a video, or text, is shown using pixels, and all a computer needs to store is what colour each of the pixels on the screen should be.\n+\n-In a black and white image, each pixel can be either black or white, so all the computer would need to store is which dots are black and which are white.\n+Show the following images to students on a screen or on the board.\n+\n+Teacher to class: In a black and white image, each pixel can be either black or white, so all the computer would need to store is which dots are black and which are white.\nFor example, if we wanted to display the letter *a* we need to divide it into squares.\nIf we zoom in further and further on the letter we can see a grid of pixels similar to these:\n@@ -69,25 +81,67 @@ If we take these numbers and draw the image they represent we get the letter a:\n{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"A six by five grid is shown. Some of the squares are white and others are coloured black to create the shape of the letter 'a'. To the right of each row of squares there are five binary digits which describe the image.\"}\n+*Anything else to write here?*\n+\n## Lesson activities\n-Put students into groups of 6. If there aren't enough students to have all full groups then this can be done with groups of 2 or 3 instead.\n+Hand out the 1 page image worksheets to students and ask them to look at the grid of squares.\n+What do they notice about the numbers in the squares? They are all 1's or 0's.\n+\n+Teacher to class: The grid on these sheets represents the pixels on a computer screen. Now you're going to be the computer and use the digits in the squares to make an image.\n+\n+\n+On the worksheets, have students colour in each square with a 1 in it, and leave each square with a 0 blank.\n+Advise them to colour them in lightly at first, and then when they are sure they haven't made any mistakes they can colour them in fully.\n+As they work through the worksheet they should see an image emerging.\n+\n-Now we are going to take binary digits and create images from these.\n+Teacher to class: Now that we've made some simple images with our numbers and pixels, we can try making some more detailed ones. How do you think we could make more detailed or higher quality images?\n-- Colouring each image and putting them in order.\n+{panel type=\"general\"}\n+\n+# Teaching observations\n+\n+Possible answers might include adding more colours. This is a good answer and colours are part of more advanced lessons in this unit, but this lesson only focusses on black and white pixels, so bring students back to this and ask them how they can make a black and white image more detailed.\n+\n+{panel end}\n+\n+The answer you are looking for is to use more pixels for the image, which is what students will do in this next activity.\n+\n+Put students into groups and give each group a set of the multipage image worksheets, so that each student has a page to work on.\n+If this isn't possible with the number of students you have just make sure groups are small enough for each students to have at least one page, or preferably for each student to have the same number of pages.\n+For example have groups of 3 each work on one of the 6 page images.\n-- Advise students to colour the squares in lightly at first so it is easy to erase mistakes. They can colour the squares in darker later if they want to.\n+Teacher to class: These sets of grids can all be put together to create one larger image, which has much more pixels than the last ones. You're each going to colour in the pixels on your own sheet, in the same way as before, and then put the whole image together.\n+\n+Once students have coloured in their sheets they can arrange them together to create the whole image.\n+There are diagrams on the worksheet printables which teachers can use to help students put their images together if they get stuck.\n-- Try doing the larger images. Have the whole class work on a large one.\n## Applying what we have just learnt\n-- Creating your own. Use grid printable, colour in and then read the numbers out to another child (or group).\n+- Now that students have tried creating the larger images they could take it a step further and make an image as a whole class.\n+The Pixel Painter Parrots option is made up of 32 pages, and is a great challenge for a class.\n+\n+- Students can also try creating their own pixel art, convert this into a grid of digits, and then have their friends try to re-create their image.\n+- Instead of writing the 1's and 0's into each of the boxes on the grid, have students write out the binary digits that represent their image (in the same way as the 'a' in the lesson starter section) and give this to other students and see if they can re-create the same picture.\n+\n+\n+{panel type=\"general\"}\n+\n+# Notes on resources\n+\n+Students could use grid or graph paper to create their pictures, or a printed grid.\n+There is a printable 8 by 8 grid in the printables section.\n+\n+There are a number of websites students can also use to easily create pixel art.\n+After creating their images they can try converting these to grid paper as well.\n+\n+{panel end}\n## Lesson reflection\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -11,7 +11,7 @@ Students should have completed lesson 1 (for the relevant age group) of the [Bin\nImages are everywhere on computers and digital devices.\nIf you think of all the different devices you use and what you do with them, it is likely that almost all of these will involve a screen of some kind!\nEverything you see on computer screens, whether it is photographs, videos, websites, even text, is an image that a digital device has been programmed to display.\n-Because modern computers store data as digits, computer images are stored inside a computer using just 0's and 1's, and these are used to represent images.\n+Because modern computers store data as digits, computer images are ultimately represented inside a computer using just 0's and 1's.\n{comment Add teaching this in action video here}\n@@ -35,8 +35,8 @@ If you look very very closely at a computer or TV screen (especially older ones)\nThe digits stored in the computer tell each of these pixels what colour they should be and when they should change colour, which means computers can turn a bunch of random looking binary digits into all the beautiful images we see on our screens!\nThere are many different methods we can use to convert images into digital data and back again, and the method we choose depends on what the images are used for.\n-A black and white image, where each pixel can be only either black or white, is much simpler to represent using digits than a full length, colour, high-definition, film is!\n-In this unit students are introduced to simple examples of how they can use digits to create images, how the number of colours an image can include is based on the number of bits used to store it, and how images are compressed so computers can process them faster.\n+A black and white image, where each pixel can be only either black or white, is much simpler to represent using digits than a full length, colour, high-definition, movie is!\n+In this unit students are introduced to simple examples of how they can use digits to create images, how the number of colours an image can include is based on the number of bits used to store it, and how images can be compressed so computers can process them faster.\n## Digital Technologies | Data Representation\n@@ -55,14 +55,14 @@ If it is meant to be text on the other hand, we interpret it as letters.\nThe ability for computers to represent multiple types of information using just two states (represented with binary digits) is one of the things that makes them so powerful.\nJust like learning about the binary number system, exploring image representation introduces students to the Computational Thinking concepts of Abstraction and Decomposition.\n-Students learn to break down images into pixels and then to digits, and how too move back up from digits, to pixels, to images.\n+Students learn to break down images into pixels and then to digits, and how to move back up from digits, to pixels, to images.\n## Digital Technologies | Algorithms\n{comment Could include Algorithms as well because of RLE/encoding Algorithms}\n-When pixels are used to represent images, the process we go through to convert digits into these pixels is an Algorithm.\n+When pixels are used to represent images, the process we go through to convert digits into these pixels is a type of Algorithm.\nThere are many different algorithms computers use to do this, and the one they use depends on things like the file type of the images being displayed, for example if it is a picture like a .png or .jpeg, or a video file like an .mp4 or .avi; or what resolution the image is.\nWe also use Algorithms to compress images to smaller file sizes, which means they use less memory, can be processed more quickly, and are faster to download.\n@@ -80,19 +80,19 @@ The word pixel is an abbreviation of *picture element*. On computer screens (and\n### Display Resolution\nThe resolution of a screen refers to the number or density of pixels on the screen.\n-It is usually defined as either the number of pixels per inch on the screen, or the width x height of the screen measured in pixels (e.g. 1920x1080 pixels).\n+It is usually defined as either the number of pixels per inch on the screen, or the width and height of the screen measured in pixels (e.g. 1920 by 1080 pixels).\n## Real world implications\n-The way images are digitally repersented effects how they are displayed, created, stored, and manipulated.\n+The way images are digitally repersented affects how they are displayed, created, stored, and manipulated.\nThe more bits we use to store the colour of a pixel, the more different colours we can make.\nIf we use one bit to store the colour of a pixel then we only have two options for what that colour can be (remember, with one bit we can represent two different values only, because we can only use 0 or 1).\nIf we use 8 bits (or 1 byte) then we can display 256 different colours instead, and if we use 24 bits (3 bytes) then we can display over 16 million different colours, which is more than the human eye can see!\nHowever, using more bits to represent a colour will increase the size of an image file, which means it will take up more space in memory and take longer for a computer to process.\nFilmakers have to use powerful computers and store large amounts of data when they are editing their videos, otherwise it would take them far too long to do this or they would have to decrease the quality of their films.\n-This is also why old computers can't always run newer games, the older computers simply can't process the game graphics quickly enough to display them.\n+This is also why old computers can't always run newer games; the older computers simply can't process the game graphics quickly enough to display them.\nFor some types of images there are ways we can {glossary-link term=\"compress\"}compress{glossary-link end} them.\nThis means we can decrease the size of the image files without losing, or only losing a small amount of, quality and information.\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding to lesson 1 and editing unit plan
701,857
22.07.2019 11:00:44
-43,200
5b3717457dbad77c5ee8b9abbd01b58aed0dbd34
Small content changes
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "## Key questions\n- How do you think computers display images on a screen?\n-- How do computers represent images when they can only store numbers?\n+- How do computers store images when they store all information as digits?\n## Lesson starter\n@@ -21,7 +21,7 @@ Children will need:\nThis lesson includes two activities, one which students complete individually and one group activity.\nIn each activity you will need enough coloring pages for one per student.\nThese each require different versions of the Pixel Painter worksheets.\n-Use the Black and White colouring type (the first option on the list), and:\n+Use the **Black and White colouring type** (the first option on the list), and:\n- for the first activity choose from the 1 page images (the star, teacup, or the cat). You can use a combination of these images, students do not all need to complete the same one,\n- for the second activity choose from the 6, 8, and 9 page images. Print enough for one set of image worksheets per group of students.\n@@ -52,7 +52,7 @@ Has anyone heard of pixels before? What about megapixels?\n# Teaching observations\nMegapixel means one million pixels.\n-Students may have heard the term \"megapixels\" used before because cameras are often described as being a certain number of megapixels, for example a phone with a 12-megapixel camera.\n+Students may have heard the term \"megapixels\" used before because cameras are often described as being a certain number of megapixels, for example a phone might have a *12-megapixel* camera.\nThis describes the resolution of the photos a camera can take. A 12-mega pixel camera can produce an image with 12 million pixels in it.\nTelevision screens are also made up of pixels.\n@@ -111,7 +111,7 @@ The answer you are looking for is to use more pixels for the image, which is wha\nPut students into groups and give each group a set of the multipage image worksheets, so that each student has a page to work on.\nIf this isn't possible with the number of students you have just make sure groups are small enough for each students to have at least one page, or preferably for each student to have the same number of pages.\n-For example have groups of 3 each work on one of the 6 page images.\n+For example have groups of 3 work on one of the 6 page images, so each student has 2 pages to complete.\nTeacher to class: These sets of grids can all be put together to create one larger image, which has much more pixels than the last ones. You're each going to colour in the pixels on your own sheet, in the same way as before, and then put the whole image together.\n@@ -147,7 +147,7 @@ After creating their images they can try converting these to grid paper as well.\n## Lesson reflection\n-This is just for black and white images, why can't we do more than two colours with this activity?\n+This lesson has just covered black and white images, why can't we do more than two colours with this activity?\n- If we can only use one binary digit for each we can only represent two different colours.\nThis means each pixel can only be one of two different colours.\n@@ -156,6 +156,4 @@ What could we do to represent more colours?\n- If we want each pixel to be able to show more colours other than black and white then we need to use more numbers (or binary digits) to represent the colour of each pixel. This will be explored in future lessons.\n-{comment Come back and split lessons later once all the other content is done}\n-\n-(We will explore this at older ages.)\n+{comment Come back and split lessons later if they need to be different for different age groups, once all the other content is done}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -9,7 +9,7 @@ Students should have completed lesson 1 (for the relevant age group) of the [Bin\n{panel end}\nImages are everywhere on computers and digital devices.\n-If you think of all the different devices you use and what you do with them, it is likely that almost all of these will involve a screen of some kind!\n+If you think of all the different devices you use, and what you do with them, it is likely that almost all of these will involve a screen or display of some kind!\nEverything you see on computer screens, whether it is photographs, videos, websites, even text, is an image that a digital device has been programmed to display.\nBecause modern computers store data as digits, computer images are ultimately represented inside a computer using just 0's and 1's.\n@@ -22,7 +22,7 @@ Because modern computers store data as digits, computer images are ultimately re\n# Terminology note\n-In this unit and its lesson plans the word **image** is used to refer to what is displayed on a computer screen at any time.\n+In this unit and its lesson plans the word **image** is used to refer to what is displayed on a computer screen or display at any time.\nIt includes everything seen on a screen, such as videos, websites, apps, text, rather than just referring to static pictures or photos.\n{panel end}\n@@ -30,21 +30,22 @@ It includes everything seen on a screen, such as videos, websites, apps, text, r\nComputer screens are divided into a grid of tiny squares called {glossary-link term=\"pixel\"}pixels{glossary-link end}.\nThese pixels can each show a different colour, and because they are so small when we look at a screen we don't see the individual pixels, instead we see them blend together into an image.\n-If you look very very closely at a computer or TV screen (especially older ones) then you might be able to see these individual pixels. Be careful not to hurt your eyes though!\n+If you look very, very closely at a computer or TV screen (especially older ones) then you might be able to see these individual pixels.\n+\n+{comment Could add \"Be careful not to hurt your eyes though!\" on the end of this}\nThe digits stored in the computer tell each of these pixels what colour they should be and when they should change colour, which means computers can turn a bunch of random looking binary digits into all the beautiful images we see on our screens!\n-There are many different methods we can use to convert images into digital data and back again, and the method we choose depends on what the images are used for.\n-A black and white image, where each pixel can be only either black or white, is much simpler to represent using digits than a full length, colour, high-definition, movie is!\n+There are many different methods we can use to convert images into digital data and back again. The method we choose depends on what type of images the data needs to be converted into.\n+A black and white image, where each pixel can be only either black or white, is much simpler to represent using digits than a full length, colour, and high-definition movie is!\nIn this unit students are introduced to simple examples of how they can use digits to create images, how the number of colours an image can include is based on the number of bits used to store it, and how images can be compressed so computers can process them faster.\n## Digital Technologies | Data Representation\n-All data on computers is represented with digits, and using these digits to represent other types of data is a core concept of Computer Science.\n+All data on computers is represented with digits, and using these digits to represent other types of data and information is a core concept of Computer Science.\nAt this point you have probably noticed the words **represent** and **representation** are being used a lot, so let's look at exactly what we mean by this.\n-\n{comment This image is currently too big for the page}\n{image file-path=\"img/topics/binary-picture-showing-bits.png\" alt=\"If we look closely at an image on a computer screen we can see it is made up of a grid of tiny dots called pixels. The colour of each of these is stored inside a computer using binary.\"}\n@@ -54,7 +55,7 @@ For example, if a set of digits represents an image then we interpret those digi\nIf it is meant to be text on the other hand, we interpret it as letters.\nThe ability for computers to represent multiple types of information using just two states (represented with binary digits) is one of the things that makes them so powerful.\n-Just like learning about the binary number system, exploring image representation introduces students to the Computational Thinking concepts of Abstraction and Decomposition.\n+Just like learning about the binary number system, exploring image representation exposes students to the Computational Thinking concepts of Abstraction and Decomposition.\nStudents learn to break down images into pixels and then to digits, and how to move back up from digits, to pixels, to images.\n@@ -72,14 +73,14 @@ We also use Algorithms to compress images to smaller file sizes, which means the\n### Pixel\n-The word pixel is an abbreviation of *picture element*. On computer screens (and printers) an image is almost always displayed using a grid of tiny coloured squares, called pixels.\n-\n-{comment Older version, which matches the pixels.md file in the glossary: This term is an abbreviation of picture element, the name given to the tiny squares that make up a grid that is used to represent images on a computer.}\n+Computer screens are divided into a grid of tiny coloured squares, which are called pixels.\n+The colour of each pixel can be set by a computer and they are used to display images on a computer screen (and printed images).\n+The word pixel is an abbreviation of *picture element*.\n### Display Resolution\n-The resolution of a screen refers to the number or density of pixels on the screen.\n+The resolution of a screen refers to the number, or density, of pixels on the screen.\nIt is usually defined as either the number of pixels per inch on the screen, or the width and height of the screen measured in pixels (e.g. 1920 by 1080 pixels).\n@@ -88,10 +89,10 @@ It is usually defined as either the number of pixels per inch on the screen, or\nThe way images are digitally repersented affects how they are displayed, created, stored, and manipulated.\nThe more bits we use to store the colour of a pixel, the more different colours we can make.\nIf we use one bit to store the colour of a pixel then we only have two options for what that colour can be (remember, with one bit we can represent two different values only, because we can only use 0 or 1).\n-If we use 8 bits (or 1 byte) then we can display 256 different colours instead, and if we use 24 bits (3 bytes) then we can display over 16 million different colours, which is more than the human eye can see!\n+If we use 8 bits (1 byte) then we can display 256 different colours instead, and if we use 24 bits (3 bytes) then we can display over 16 million different colours, which is more than the human eye can see!\n-However, using more bits to represent a colour will increase the size of an image file, which means it will take up more space in memory and take longer for a computer to process.\n-Filmakers have to use powerful computers and store large amounts of data when they are editing their videos, otherwise it would take them far too long to do this or they would have to decrease the quality of their films.\n+However, using more bits to represent a colour will increase the size of an image file, which means it will take up more space in memory and take longer for a computer to process and display.\n+Filmakers have to use powerful computers and store large amounts of data when they are editing their videos, otherwise it would take them far too long to do this, or they would have to decrease the image quality of their films.\nThis is also why old computers can't always run newer games; the older computers simply can't process the game graphics quickly enough to display them.\nFor some types of images there are ways we can {glossary-link term=\"compress\"}compress{glossary-link end} them.\n@@ -99,9 +100,6 @@ This means we can decrease the size of the image files without losing, or only l\nImage compression algorithms allow us to store, process, transmit, and create images more quickly.\n-{comment Check conventions around using numerals vs words}\n-\n-\n## Reflection questions\n" } ]
Python
MIT License
uccser/cs-unplugged
Small content changes
701,857
22.07.2019 11:30:35
-43,200
4420c52430d60d9ecfa698951b2bb3b34b875030
Changed the colour values in the black and white and greyscale pixel painter options
[ { "change_type": "MODIFY", "old_path": "csunplugged/resources/generators/PixelPainterResourceGenerator.py", "new_path": "csunplugged/resources/generators/PixelPainterResourceGenerator.py", "diff": "@@ -32,24 +32,24 @@ class PixelPainterResourceGenerator(BaseResourceGenerator):\n\"black-white\": {\n\"name\": _(\"Black and White\"),\n\"labels\": {\n- 255: \"0\",\n- 0: \"1\"\n+ 255: \"1\",\n+ 0: \"0\"\n}\n},\n\"run-length-encoding\": {\n\"name\": _(\"Run length encoding\"),\n\"labels\": {\n- 255: \"0\",\n- 0: \"1\"\n+ 255: \"1\",\n+ 0: \"0\"\n}\n},\n\"greyscale\": {\n\"name\": _(\"Greyscale\"),\n\"labels\": {\n- 255: \"00\",\n- 168: \"01\",\n- 84: \"10\",\n- 0: \"11\"\n+ 255: \"11\",\n+ 168: \"10\",\n+ 84: \"01\",\n+ 0: \"00\"\n}\n},\n\"colour\": {\n" } ]
Python
MIT License
uccser/cs-unplugged
Changed the colour values in the black and white and greyscale pixel painter options
701,857
22.07.2019 13:22:12
-43,200
6f3197dc7a2f9a3c196e58284ece8d5b40f9fb54
Unit plan and lesson 1 for ages 5-7 and 8-10 completed and ready for author review. Lesson content requires issue to be merged, otherwise it is innacurate where the pixel painter instructions are given.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png", "new_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png", "diff": "Binary files a/csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png and b/csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png differ\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "# Colour by numbers\n-{comment Do learning outcomes at some point. They go in the yaml file}\n## Key questions\n## Lesson starter\n-\nChildren will need:\n- - A normal writing pencil.\n+ - A normal writing pencil, or a black pencil.\n- Erasers.\n@@ -33,7 +31,7 @@ Use the **Black and White colouring type** (the first option on the list), and:\n- Print spare copies of each worksheet in case students make mistakes and need a new one.\n- Use the *Black and White (2 possible binary values)* colouring option, **not** the option which says \"in Run Length Encoding\"\n- - Students can instead use a black pencil or felt tip pen, but easily erasable pencils work much better the first time students do this activity.\n+ - Students can instead use a black crayon or felt tip pen, but easily erasable pencils work much better for the first time students do this activity.\n{panel end}\n@@ -55,7 +53,7 @@ Megapixel means one million pixels.\nStudents may have heard the term \"megapixels\" used before because cameras are often described as being a certain number of megapixels, for example a phone might have a *12-megapixel* camera.\nThis describes the resolution of the photos a camera can take. A 12-mega pixel camera can produce an image with 12 million pixels in it.\n-Television screens are also made up of pixels.\n+Television screens and projectors also display images using pixels.\n{panel end}\n@@ -66,22 +64,22 @@ Teacher to class: Every image we see on a screen, whether it is a picture, a vid\nShow the following images to students on a screen or on the board.\nTeacher to class: In a black and white image, each pixel can be either black or white, so all the computer would need to store is which dots are black and which are white.\n-For example, if we wanted to display the letter *a* we need to divide it into squares.\n+For example, if we wanted to display the letter *a* we first need to divide it into squares.\nIf we zoom in further and further on the letter we can see a grid of pixels similar to these:\n{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the lower case letter 'a' are shown. These progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\nWe can represent this image using binary digits.\n-If a 0 indicates a white square and a 1 indicates a black square then we can represent our letter *a*, on a 5x6 pixel grid, like this:\n+If a 1 indicates a white square and a 0 indicates a black square then we can represent our letter *a*, on a 5x6 pixel grid, like this:\n+\n-{image file-path=\"img/topics/a_in_binary_code.png\" alt=\"A string of binary numbers is shown. They are divided in six lots of five numbers.\"}\n+**10001, 11110, 10000, 01110, 01110, 10000**\nIf we take these numbers and draw the image they represent we get the letter a:\n{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"A six by five grid is shown. Some of the squares are white and others are coloured black to create the shape of the letter 'a'. To the right of each row of squares there are five binary digits which describe the image.\"}\n-\n-*Anything else to write here?*\n+We are using 1 to represent white and 0 to represent black, in the same way we used white and black cards to represent 'on' and 'off' in the binary numbers unit.\n## Lesson activities\n@@ -89,32 +87,34 @@ If we take these numbers and draw the image they represent we get the letter a:\nHand out the 1 page image worksheets to students and ask them to look at the grid of squares.\nWhat do they notice about the numbers in the squares? They are all 1's or 0's.\n-Teacher to class: The grid on these sheets represents the pixels on a computer screen. Now you're going to be the computer and use the digits in the squares to make an image.\n+Teacher to class: The grid on these sheets represents the pixels on a computer screen. Now you are going to be the computer and use the digits in the squares to make an image.\n-On the worksheets, have students colour in each square with a 1 in it, and leave each square with a 0 blank.\n-Advise them to colour them in lightly at first, and then when they are sure they haven't made any mistakes they can colour them in fully.\n+On the worksheets, have students colour in each square with a 0 in it black, and leave each square with a 1 blank so that it is white.\n+We are using 1 to represent white and 0 to represent black, because 1 indicates that a pixel is 'on' (and therefore white) and a 0 indicates it is 'off' (and so it is black).\n+By colouring the 0 squares in this activity, students are effectively 'turning off' those pixels.\n+Advise them to colour them in lightly at first, and then when they are sure they have not made any mistakes they can colour them in fully.\nAs they work through the worksheet they should see an image emerging.\n-Teacher to class: Now that we've made some simple images with our numbers and pixels, we can try making some more detailed ones. How do you think we could make more detailed or higher quality images?\n+Teacher to class: Now that we have made some simple images with our numbers and pixels, we can try making some more detailed and complicated ones. How do you think we could make more complicated or higher quality images?\n{panel type=\"general\"}\n# Teaching observations\n-Possible answers might include adding more colours. This is a good answer and colours are part of more advanced lessons in this unit, but this lesson only focusses on black and white pixels, so bring students back to this and ask them how they can make a black and white image more detailed.\n+Possible answers include adding more colours. This is a good answer and colours are part of more advanced lessons in this unit, but this lesson only focusses on black and white pixels, so bring students back to this and ask them how they can make a black and white image more detailed.\n{panel end}\nThe answer you are looking for is to use more pixels for the image, which is what students will do in this next activity.\nPut students into groups and give each group a set of the multipage image worksheets, so that each student has a page to work on.\n-If this isn't possible with the number of students you have just make sure groups are small enough for each students to have at least one page, or preferably for each student to have the same number of pages.\n-For example have groups of 3 work on one of the 6 page images, so each student has 2 pages to complete.\n+If this is not possible with the number of students you have just make sure groups are small enough for each students to have at least one page, or preferably for each student to have the same number of pages.\n+For example have groups of 3 work on a 6 page image, so each student has 2 pages to complete.\n-Teacher to class: These sets of grids can all be put together to create one larger image, which has much more pixels than the last ones. You're each going to colour in the pixels on your own sheet, in the same way as before, and then put the whole image together.\n+Teacher to class: These sets of grids can all be put together to create one larger image, which has much more pixels than the last ones. you are each going to colour in the pixels on your own sheet, in the same way as before, and then put the whole image together.\nOnce students have coloured in their sheets they can arrange them together to create the whole image.\nThere are diagrams on the worksheet printables which teachers can use to help students put their images together if they get stuck.\n@@ -123,13 +123,13 @@ There are diagrams on the worksheet printables which teachers can use to help st\n## Applying what we have just learnt\n+- Instead of writing the 1's and 0's into each of the boxes on the grid, have students write out the binary digits that represent their image (in the same way as the 'a' in the lesson starter section) and give this to other students and see if they can re-create the same picture.\n+\n- Now that students have tried creating the larger images they could take it a step further and make an image as a whole class.\nThe Pixel Painter Parrots option is made up of 32 pages, and is a great challenge for a class.\n- Students can also try creating their own pixel art, convert this into a grid of digits, and then have their friends try to re-create their image.\n-- Instead of writing the 1's and 0's into each of the boxes on the grid, have students write out the binary digits that represent their image (in the same way as the 'a' in the lesson starter section) and give this to other students and see if they can re-create the same picture.\n-\n{panel type=\"general\"}\n@@ -149,11 +149,9 @@ After creating their images they can try converting these to grid paper as well.\nThis lesson has just covered black and white images, why can't we do more than two colours with this activity?\n- - If we can only use one binary digit for each we can only represent two different colours.\n- This means each pixel can only be one of two different colours.\n+ - With one binary digit we can only represent two different values.\n+ This means if we use one digit to represent the colour of one pixel, then each pixel can only be one of two different colours.\nWhat could we do to represent more colours?\n- If we want each pixel to be able to show more colours other than black and white then we need to use more numbers (or binary digits) to represent the colour of each pixel. This will be explored in future lessons.\n-\n-{comment Come back and split lessons later if they need to be different for different age groups, once all the other content is done}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -16,7 +16,6 @@ Because modern computers store data as digits, computer images are ultimately re\n{comment Add teaching this in action video here}\n-{comment Old version of text: All information that modern computers store and process is stored using just two states, represented by binary digits. This means that everything you see in computer images is stored inside a computer using just 0's and 1's, and these are used to *represent* images.}\n{panel type=\"text\"}\n@@ -32,13 +31,11 @@ Computer screens are divided into a grid of tiny squares called {glossary-link t\nThese pixels can each show a different colour, and because they are so small when we look at a screen we don't see the individual pixels, instead we see them blend together into an image.\nIf you look very, very closely at a computer or TV screen (especially older ones) then you might be able to see these individual pixels.\n-{comment Could add \"Be careful not to hurt your eyes though!\" on the end of this}\n-\n-The digits stored in the computer tell each of these pixels what colour they should be and when they should change colour, which means computers can turn a bunch of random looking binary digits into all the beautiful images we see on our screens!\n+The digits stored in the computer tell each of these pixels what colour they should be and when they should change colour, which means computers can turn a bunch of random looking binary digits into all the beautiful images we see on our screens.\nThere are many different methods we can use to convert images into digital data and back again. The method we choose depends on what type of images the data needs to be converted into.\n-A black and white image, where each pixel can be only either black or white, is much simpler to represent using digits than a full length, colour, and high-definition movie is!\n-In this unit students are introduced to simple examples of how they can use digits to create images, how the number of colours an image can include is based on the number of bits used to store it, and how images can be compressed so computers can process them faster.\n+A black and white image, where each pixel can be only either black or white, is much simpler to represent using digits than a full length, colour, and high-definition film is!\n+In this unit students are introduced to simple examples of how they can use digits to create images, how the number of colours an image can include is based on the number of bits used to store it, and how images can be compressed so they take up less memory space and computers can process them faster.\n## Digital Technologies | Data Representation\n@@ -46,8 +43,6 @@ In this unit students are introduced to simple examples of how they can use digi\nAll data on computers is represented with digits, and using these digits to represent other types of data and information is a core concept of Computer Science.\nAt this point you have probably noticed the words **represent** and **representation** are being used a lot, so let's look at exactly what we mean by this.\n-{comment This image is currently too big for the page}\n-\n{image file-path=\"img/topics/binary-picture-showing-bits.png\" alt=\"If we look closely at an image on a computer screen we can see it is made up of a grid of tiny dots called pixels. The colour of each of these is stored inside a computer using binary.\"}\nThe type of information a set of digits **represents** changes the way we interpret it.\n@@ -61,13 +56,10 @@ Students learn to break down images into pixels and then to digits, and how to m\n## Digital Technologies | Algorithms\n-{comment Could include Algorithms as well because of RLE/encoding Algorithms}\n-\nWhen pixels are used to represent images, the process we go through to convert digits into these pixels is a type of Algorithm.\nThere are many different algorithms computers use to do this, and the one they use depends on things like the file type of the images being displayed, for example if it is a picture like a .png or .jpeg, or a video file like an .mp4 or .avi; or what resolution the image is.\nWe also use Algorithms to compress images to smaller file sizes, which means they use less memory, can be processed more quickly, and are faster to download.\n-\n-{comment Through lerning about image representation students practice algorithmic thinking and pattern matching...}\n+Through lerning about image representation students practice algorithmic thinking, pattern matching, and abstract thinking.\n## Vocabulary Explained\n@@ -91,7 +83,7 @@ The more bits we use to store the colour of a pixel, the more different colours\nIf we use one bit to store the colour of a pixel then we only have two options for what that colour can be (remember, with one bit we can represent two different values only, because we can only use 0 or 1).\nIf we use 8 bits (1 byte) then we can display 256 different colours instead, and if we use 24 bits (3 bytes) then we can display over 16 million different colours, which is more than the human eye can see!\n-However, using more bits to represent a colour will increase the size of an image file, which means it will take up more space in memory and take longer for a computer to process and display.\n+However, using more bits to represent a colour will increase the size of an image file. This means it will take up more space in memory, take longer for a computer to process and display. and take longer to be transmitted between computers and over the internet.\nFilmakers have to use powerful computers and store large amounts of data when they are editing their videos, otherwise it would take them far too long to do this, or they would have to decrease the image quality of their films.\nThis is also why old computers can't always run newer games; the older computers simply can't process the game graphics quickly enough to display them.\n@@ -101,7 +93,6 @@ Image compression algorithms allow us to store, process, transmit, and create im\n-\n## Reflection questions\n- What was most surprising about the learning that happened from the teaching of this unit?\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/learning-outcomes.yaml", "new_path": "csunplugged/topics/content/en/learning-outcomes.yaml", "diff": "@@ -329,8 +329,8 @@ sorting-comparing-musical-pitch:\n# IMAGE REPRESENTATION OUTCOMES\n-image-rep-explain-pixels:\n- text: Explain that the images shown by computers are made up of pixels, each of which can display a different colour.\n+image-rep-understand-digits-representing-images:\n+ text: Understand how images can be stored and represented using digits.\n-image-rep-describe-digits-representing-images:\n- text: Describe how images can be stored and represented using digits.\n+image-rep-understand-pixels:\n+ text: Understand that the images shown by computers are made up of pixels, each of which can display a different colour, based on digits.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/structure/image-representation/unit-plan/lessons/lessons.yaml", "new_path": "csunplugged/topics/content/structure/image-representation/unit-plan/lessons/lessons.yaml", "diff": "colour-by-numbers:\nduration: 45\nlearning-outcomes:\n- - image-rep-explain-pixels\n- - image-rep-describe-digits-representing-images\n+ - image-rep-understand-digits-representing-images\n+ - image-rep-understand-pixels\ngenerated-resources:\n- pixel-painter\nclassroom-resources:\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/structure/learning-outcomes.yaml", "new_path": "csunplugged/topics/content/structure/learning-outcomes.yaml", "diff": "@@ -451,10 +451,11 @@ sorting-comparing-musical-pitch:\n# IMAGE REPRESENTATION OUTCOMES\n-image-rep-explain-pixels:\n+image-rep-understand-digits-representing-images:\ncurriculum-areas:\n- - decomposition\n+ - data-representation\n+ - abstraction\n-image-rep-describe-digits-representing-images:\n+image-rep-understand-pixels:\ncurriculum-areas:\n- - abstraction\n+ - data-representation\n" } ]
Python
MIT License
uccser/cs-unplugged
Unit plan and lesson 1 for ages 5-7 and 8-10 completed and ready for author review. Lesson content requires issue #1220 to be merged, otherwise it is innacurate where the pixel painter instructions are given.
701,857
22.07.2019 14:31:00
-43,200
1e1090e09fa5a678bf88b2fdcf8a5cad8cb8ba67
Updated pixel painter tests for new black and white values
[ { "change_type": "MODIFY", "old_path": "csunplugged/tests/resources/generators/test_pixel_painter.py", "new_path": "csunplugged/tests/resources/generators/test_pixel_painter.py", "diff": "@@ -334,14 +334,14 @@ class PixelPainterResourceGeneratorTest(BaseGeneratorTest):\n\"name\",\n\"black-white\"\n)\n- self.assertEqual('0', label)\n+ self.assertEqual('1', label)\nlabel = PixelPainterResourceGenerator.get_pixel_label(\nimage,\n(0, 1),\n\"name\",\n\"black-white\"\n)\n- self.assertEqual('1', label)\n+ self.assertEqual('0', label)\ndef test_get_pixel_label_invalid(self):\nimage = Image.frombytes(\"L\", (1, 1), bytes([127]))\n" } ]
Python
MIT License
uccser/cs-unplugged
Updated pixel painter tests for new black and white values
701,857
23.07.2019 09:07:59
-43,200
3e0c18fbefa662f237db8835072fb58d2a6dba6c
Sentences each moved to a new line in the .md files. No longer used image removed from img/topics
[ { "change_type": "DELETE", "old_path": "csunplugged/static/img/topics/a_in_binary_code.png", "new_path": "csunplugged/static/img/topics/a_in_binary_code.png", "diff": "Binary files a/csunplugged/static/img/topics/a_in_binary_code.png and /dev/null differ\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/glossary/pixel.md", "new_path": "csunplugged/topics/content/en/glossary/pixel.md", "diff": "# Pixel\n-The word pixel is an abbreviation of *picture element*. On computer screens (and printers) an image is almost always displayed using a grid of tiny coloured squares, which are called pixels.\n+The word pixel is an abbreviation of *picture element*.\n+On computer screens (and printers) an image is almost always displayed using a grid of tiny coloured squares, which are called pixels.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "@@ -21,7 +21,8 @@ In each activity you will need enough coloring pages for one per student.\nThese each require different versions of the Pixel Painter worksheets.\nUse the **Black and White colouring type** (the first option on the list), and:\n- - for the first activity choose from the 1 page images (the star, teacup, or the cat). You can use a combination of these images, students do not all need to complete the same one,\n+ - for the first activity choose from the 1 page images (the star, teacup, or the cat).\n+ You can use a combination of these images, students do not all need to complete the same one,\n- for the second activity choose from the 6, 8, and 9 page images. Print enough for one set of image worksheets per group of students.\n@@ -30,7 +31,7 @@ Use the **Black and White colouring type** (the first option on the list), and:\n# Notes on resources\n- Print spare copies of each worksheet in case students make mistakes and need a new one.\n- - Use the *Black and White (2 possible binary values)* colouring option, **not** the option which says \"in Run Length Encoding\"\n+ - Use the *Black and White (2 possible binary values)* colouring option, **not** the option which says \"in Run Length Encoding\".\n- Students can instead use a black crayon or felt tip pen, but easily erasable pencils work much better for the first time students do this activity.\n{panel end}\n@@ -43,7 +44,8 @@ Write the words \"picture elements\" on the board.\nTo show how we get the word pixels, circle the \"pi\" of picture and the \"el\" of elements, and write \"pixel\" underneath.\nTeacher to class: Each of these pixels can be a different colour, and when we have a lot of them on a screen they form an image.\n-Has anyone heard of pixels before? What about megapixels?\n+Has anyone heard of pixels before?\n+What about megapixels?\n{panel type=\"general\"}\n@@ -51,7 +53,8 @@ Has anyone heard of pixels before? What about megapixels?\nMegapixel means one million pixels.\nStudents may have heard the term \"megapixels\" used before because cameras are often described as being a certain number of megapixels, for example a phone might have a *12-megapixel* camera.\n-This describes the resolution of the photos a camera can take. A 12-mega pixel camera can produce an image with 12 million pixels in it.\n+This describes the resolution of the photos a camera can take.\n+A 12-mega pixel camera can produce an image with 12 million pixels in it.\nTelevision screens and projectors also display images using pixels.\n@@ -67,7 +70,8 @@ Teacher to class: In a black and white image, each pixel can be either black or\nFor example, if we wanted to display the letter *a* we first need to divide it into squares.\nIf we zoom in further and further on the letter we can see a grid of pixels similar to these:\n-{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the lower case letter 'a' are shown. These progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\n+{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the lower case letter 'a' are shown.\n+These progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\nWe can represent this image using binary digits.\nIf a 1 indicates a white square and a 0 indicates a black square then we can represent our letter *a*, on a 5x6 pixel grid, like this:\n@@ -77,7 +81,9 @@ If a 1 indicates a white square and a 0 indicates a black square then we can rep\nIf we take these numbers and draw the image they represent we get the letter a:\n-{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"A six by five grid is shown. Some of the squares are white and others are coloured black to create the shape of the letter 'a'. To the right of each row of squares there are five binary digits which describe the image.\"}\n+{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"A six by five grid is shown.\n+Some of the squares are white and others are coloured black to create the shape of the letter 'a'.\n+To the right of each row of squares there are five binary digits which describe the image.\"}\nWe are using 1 to represent white and 0 to represent black, in the same way we used white and black cards to represent 'on' and 'off' in the binary numbers unit.\n@@ -85,9 +91,11 @@ We are using 1 to represent white and 0 to represent black, in the same way we u\n## Lesson activities\nHand out the 1 page image worksheets to students and ask them to look at the grid of squares.\n-What do they notice about the numbers in the squares? They are all 1's or 0's.\n+What do they notice about the numbers in the squares?\n+They are all 1's or 0's.\n-Teacher to class: The grid on these sheets represents the pixels on a computer screen. Now you are going to be the computer and use the digits in the squares to make an image.\n+Teacher to class: The grid on these sheets represents the pixels on a computer screen.\n+Now you are going to be the computer and use the digits in the squares to make an image.\nOn the worksheets, have students colour in each square with a 0 in it black, and leave each square with a 1 blank so that it is white.\n@@ -97,13 +105,15 @@ Advise them to colour them in lightly at first, and then when they are sure they\nAs they work through the worksheet they should see an image emerging.\n-Teacher to class: Now that we have made some simple images with our numbers and pixels, we can try making some more detailed and complicated ones. How do you think we could make more complicated or higher quality images?\n+Teacher to class: Now that we have made some simple images with our numbers and pixels, we can try making some more detailed and complicated ones.\n+How do you think we could make more complicated or higher quality images?\n{panel type=\"general\"}\n# Teaching observations\n-Possible answers include adding more colours. This is a good answer and colours are part of more advanced lessons in this unit, but this lesson only focusses on black and white pixels, so bring students back to this and ask them how they can make a black and white image more detailed.\n+Possible answers include adding more colours.\n+This is a good answer and colours are part of more advanced lessons in this unit, but this lesson only focusses on black and white pixels, so bring students back to this and ask them how they can make a black and white image more detailed.\n{panel end}\n@@ -154,4 +164,5 @@ This lesson has just covered black and white images, why can't we do more than t\nWhat could we do to represent more colours?\n- - If we want each pixel to be able to show more colours other than black and white then we need to use more numbers (or binary digits) to represent the colour of each pixel. This will be explored in future lessons.\n+ - If we want each pixel to be able to show more colours other than black and white then we need to use more numbers (or binary digits) to represent the colour of each pixel.\n+ This will be explored in future lessons.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -33,7 +33,8 @@ If you look very, very closely at a computer or TV screen (especially older ones\nThe digits stored in the computer tell each of these pixels what colour they should be and when they should change colour, which means computers can turn a bunch of random looking binary digits into all the beautiful images we see on our screens.\n-There are many different methods we can use to convert images into digital data and back again. The method we choose depends on what type of images the data needs to be converted into.\n+There are many different methods we can use to convert images into digital data and back again.\n+The method we choose depends on what type of images the data needs to be converted into.\nA black and white image, where each pixel can be only either black or white, is much simpler to represent using digits than a full length, colour, and high-definition film is!\nIn this unit students are introduced to simple examples of how they can use digits to create images, how the number of colours an image can include is based on the number of bits used to store it, and how images can be compressed so they take up less memory space and computers can process them faster.\n@@ -83,7 +84,8 @@ The more bits we use to store the colour of a pixel, the more different colours\nIf we use one bit to store the colour of a pixel then we only have two options for what that colour can be (remember, with one bit we can represent two different values only, because we can only use 0 or 1).\nIf we use 8 bits (1 byte) then we can display 256 different colours instead, and if we use 24 bits (3 bytes) then we can display over 16 million different colours, which is more than the human eye can see!\n-However, using more bits to represent a colour will increase the size of an image file. This means it will take up more space in memory, take longer for a computer to process and display. and take longer to be transmitted between computers and over the internet.\n+However, using more bits to represent a colour will increase the size of an image file.\n+This means it will take up more space in memory, take longer for a computer to process and display, and take longer to be transmitted between computers and over the internet.\nFilmakers have to use powerful computers and store large amounts of data when they are editing their videos, otherwise it would take them far too long to do this, or they would have to decrease the image quality of their films.\nThis is also why old computers can't always run newer games; the older computers simply can't process the game graphics quickly enough to display them.\n" } ]
Python
MIT License
uccser/cs-unplugged
Sentences each moved to a new line in the .md files. No longer used image removed from img/topics
701,857
23.07.2019 09:22:51
-43,200
cb2fec03de5d74d1fef828461756e566c1cdf050
Removed double newlines
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "# Colour by numbers\n-\n## Key questions\n- How do you think computers display images on a screen?\n- How do computers store images when they store all information as digits?\n-\n## Lesson starter\n-\nChildren will need:\n- A normal writing pencil, or a black pencil.\n- Erasers.\n-\nThis lesson includes two activities, one which students complete individually and one group activity.\nIn each activity you will need enough coloring pages for one per student.\nThese each require different versions of the Pixel Painter worksheets.\n@@ -25,18 +21,16 @@ Use the **Black and White colouring type** (the first option on the list), and:\nYou can use a combination of these images, students do not all need to complete the same one,\n- for the second activity choose from the 6, 8, and 9 page images. Print enough for one set of image worksheets per group of students.\n-\n{panel type=\"general\"}\n# Notes on resources\n- Print spare copies of each worksheet in case students make mistakes and need a new one.\n- - Use the *Black and White (2 possible binary values)* colouring option, **not** the option which says \"in Run Length Encoding\".\n+ - Use the **Black and White (2 possible binary values)** colouring option, **not** the option which says \"in Run Length Encoding\".\n- Students can instead use a black crayon or felt tip pen, but easily erasable pencils work much better for the first time students do this activity.\n{panel end}\n-\nTeacher to class: Computer screens are divided up into a grid of small squares, each of which can display a colour.\nWe call these squares picture elements, or pixels.\n@@ -60,10 +54,8 @@ Television screens and projectors also display images using pixels.\n{panel end}\n-\nTeacher to class: Every image we see on a screen, whether it is a picture, a video, or text, is shown using pixels, and all a computer needs to store is what colour each of the pixels on the screen should be.\n-\nShow the following images to students on a screen or on the board.\nTeacher to class: In a black and white image, each pixel can be either black or white, so all the computer would need to store is which dots are black and which are white.\n@@ -76,7 +68,6 @@ These progressively zoom in to show the individual black and white squares which\nWe can represent this image using binary digits.\nIf a 1 indicates a white square and a 0 indicates a black square then we can represent our letter *a*, on a 5x6 pixel grid, like this:\n-\n**10001, 11110, 10000, 01110, 01110, 10000**\nIf we take these numbers and draw the image they represent we get the letter a:\n@@ -87,7 +78,6 @@ To the right of each row of squares there are five binary digits which describe\nWe are using 1 to represent white and 0 to represent black, in the same way we used white and black cards to represent 'on' and 'off' in the binary numbers unit.\n-\n## Lesson activities\nHand out the 1 page image worksheets to students and ask them to look at the grid of squares.\n@@ -97,14 +87,12 @@ They are all 1's or 0's.\nTeacher to class: The grid on these sheets represents the pixels on a computer screen.\nNow you are going to be the computer and use the digits in the squares to make an image.\n-\nOn the worksheets, have students colour in each square with a 0 in it black, and leave each square with a 1 blank so that it is white.\nWe are using 1 to represent white and 0 to represent black, because 1 indicates that a pixel is 'on' (and therefore white) and a 0 indicates it is 'off' (and so it is black).\nBy colouring the 0 squares in this activity, students are effectively 'turning off' those pixels.\nAdvise them to colour them in lightly at first, and then when they are sure they have not made any mistakes they can colour them in fully.\nAs they work through the worksheet they should see an image emerging.\n-\nTeacher to class: Now that we have made some simple images with our numbers and pixels, we can try making some more detailed and complicated ones.\nHow do you think we could make more complicated or higher quality images?\n@@ -123,14 +111,11 @@ Put students into groups and give each group a set of the multipage image worksh\nIf this is not possible with the number of students you have just make sure groups are small enough for each students to have at least one page, or preferably for each student to have the same number of pages.\nFor example have groups of 3 work on a 6 page image, so each student has 2 pages to complete.\n-\nTeacher to class: These sets of grids can all be put together to create one larger image, which has much more pixels than the last ones. you are each going to colour in the pixels on your own sheet, in the same way as before, and then put the whole image together.\nOnce students have coloured in their sheets they can arrange them together to create the whole image.\nThere are diagrams on the worksheet printables which teachers can use to help students put their images together if they get stuck.\n-\n-\n## Applying what we have just learnt\n- Instead of writing the 1's and 0's into each of the boxes on the grid, have students write out the binary digits that represent their image (in the same way as the 'a' in the lesson starter section) and give this to other students and see if they can re-create the same picture.\n@@ -140,7 +125,6 @@ The Pixel Painter Parrots option is made up of 32 pages, and is a great challeng\n- Students can also try creating their own pixel art, convert this into a grid of digits, and then have their friends try to re-create their image.\n-\n{panel type=\"general\"}\n# Notes on resources\n@@ -153,10 +137,8 @@ After creating their images they can try converting these to grid paper as well.\n{panel end}\n-\n## Lesson reflection\n-\nThis lesson has just covered black and white images, why can't we do more than two colours with this activity?\n- With one binary digit we can only represent two different values.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -13,10 +13,8 @@ If you think of all the different devices you use, and what you do with them, it\nEverything you see on computer screens, whether it is photographs, videos, websites, even text, is an image that a digital device has been programmed to display.\nBecause modern computers store data as digits, computer images are ultimately represented inside a computer using just 0's and 1's.\n-\n{comment Add teaching this in action video here}\n-\n{panel type=\"text\"}\n# Terminology note\n@@ -26,7 +24,6 @@ It includes everything seen on a screen, such as videos, websites, apps, text, r\n{panel end}\n-\nComputer screens are divided into a grid of tiny squares called {glossary-link term=\"pixel\"}pixels{glossary-link end}.\nThese pixels can each show a different colour, and because they are so small when we look at a screen we don't see the individual pixels, instead we see them blend together into an image.\nIf you look very, very closely at a computer or TV screen (especially older ones) then you might be able to see these individual pixels.\n@@ -38,7 +35,6 @@ The method we choose depends on what type of images the data needs to be convert\nA black and white image, where each pixel can be only either black or white, is much simpler to represent using digits than a full length, colour, and high-definition film is!\nIn this unit students are introduced to simple examples of how they can use digits to create images, how the number of colours an image can include is based on the number of bits used to store it, and how images can be compressed so they take up less memory space and computers can process them faster.\n-\n## Digital Technologies | Data Representation\nAll data on computers is represented with digits, and using these digits to represent other types of data and information is a core concept of Computer Science.\n@@ -54,7 +50,6 @@ The ability for computers to represent multiple types of information using just\nJust like learning about the binary number system, exploring image representation exposes students to the Computational Thinking concepts of Abstraction and Decomposition.\nStudents learn to break down images into pixels and then to digits, and how to move back up from digits, to pixels, to images.\n-\n## Digital Technologies | Algorithms\nWhen pixels are used to represent images, the process we go through to convert digits into these pixels is a type of Algorithm.\n@@ -70,13 +65,11 @@ Computer screens are divided into a grid of tiny coloured squares, which are cal\nThe colour of each pixel can be set by a computer and they are used to display images on a computer screen (and printed images).\nThe word pixel is an abbreviation of *picture element*.\n-\n### Display Resolution\nThe resolution of a screen refers to the number, or density, of pixels on the screen.\nIt is usually defined as either the number of pixels per inch on the screen, or the width and height of the screen measured in pixels (e.g. 1920 by 1080 pixels).\n-\n## Real world implications\nThe way images are digitally repersented affects how they are displayed, created, stored, and manipulated.\n@@ -93,8 +86,6 @@ For some types of images there are ways we can {glossary-link term=\"compress\"}co\nThis means we can decrease the size of the image files without losing, or only losing a small amount of, quality and information.\nImage compression algorithms allow us to store, process, transmit, and create images more quickly.\n-\n-\n## Reflection questions\n- What was most surprising about the learning that happened from the teaching of this unit?\n" } ]
Python
MIT License
uccser/cs-unplugged
Removed double newlines
701,857
23.07.2019 09:48:50
-43,200
6f480a817232ee66cbbf9218e83a0a51744041b4
Classroom resources moved to sidebar in the 'Colour by numbers' lesson
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/classroom-resources.yaml", "new_path": "csunplugged/topics/content/en/classroom-resources.yaml", "diff": "@@ -36,3 +36,5 @@ chalk:\ndescription: Chalk\ncoloring-pens:\ndescription: Colouring in pencils, crayons or felt tip pens\n+erasers:\n+ description: Erasers\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "## Lesson starter\n-Children will need:\n-\n- - A normal writing pencil, or a black pencil.\n- - Erasers.\n-\nThis lesson includes two activities, one which students complete individually and one group activity.\nIn each activity you will need enough coloring pages for one per student.\nThese each require different versions of the Pixel Painter worksheets.\n@@ -27,7 +22,7 @@ Use the **Black and White colouring type** (the first option on the list), and:\n- Print spare copies of each worksheet in case students make mistakes and need a new one.\n- Use the **Black and White (2 possible binary values)** colouring option, **not** the option which says \"in Run Length Encoding\".\n- - Students can instead use a black crayon or felt tip pen, but easily erasable pencils work much better for the first time students do this activity.\n+ - Students can instead use a black colouring pencil, crayon, or felt tip pen, but easily erasable pencils work much better for the first time students do this activity.\n{panel end}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/structure/classroom-resources.yaml", "new_path": "csunplugged/topics/content/structure/classroom-resources.yaml", "diff": "@@ -18,3 +18,4 @@ classroom-resources:\n- counters\n- chalk\n- coloring-pens\n+ - erasers\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/structure/image-representation/unit-plan/lessons/lessons.yaml", "new_path": "csunplugged/topics/content/structure/image-representation/unit-plan/lessons/lessons.yaml", "diff": "@@ -6,4 +6,5 @@ colour-by-numbers:\ngenerated-resources:\n- pixel-painter\nclassroom-resources:\n- - coloring-pens\n+ - pencils\n+ - erasers\n" } ]
Python
MIT License
uccser/cs-unplugged
Classroom resources moved to sidebar in the 'Colour by numbers' lesson
701,857
23.07.2019 10:52:07
-43,200
d95756a5869667caaead9244aef740f5ef0553c6
Changed the definition of 'compress' to one of 'compression'. Altered wording to clarify the meaning
[ { "change_type": "DELETE", "old_path": "csunplugged/topics/content/en/glossary/compress.md", "new_path": null, "diff": "-#Compress\n-\n-To compress something means to make it smaller.\n-In computing we generally apply this to data compression, where we decrease the the number of bits we use to repesent a piece of information (e.g. decrease the size of a file) using a compression algorithm.\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/glossary/compression.md", "diff": "+# Compression\n+\n+Compression is the process of making something something smaller.\n+Data compression is a core topic of Computer Science, and is the process of decreasing the number of bits we use to represent a piece of information (e.g. decrease the size of a file) using a compression algorithm.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -82,8 +82,8 @@ This means it will take up more space in memory, take longer for a computer to p\nFilmakers have to use powerful computers and store large amounts of data when they are editing their videos, otherwise it would take them far too long to do this, or they would have to decrease the image quality of their films.\nThis is also why old computers can't always run newer games; the older computers simply can't process the game graphics quickly enough to display them.\n-For some types of images there are ways we can {glossary-link term=\"compress\"}compress{glossary-link end} them.\n-This means we can decrease the size of the image files without losing, or only losing a small amount of, quality and information.\n+For some types of images we can use a {glossary-link term=\"compression\"}compression{glossary-link end} algorithm to decrease their file size.\n+Compression algorithms can do this without losing, or only losing a small amount of, the image quality.\nImage compression algorithms allow us to store, process, transmit, and create images more quickly.\n## Reflection questions\n" } ]
Python
MIT License
uccser/cs-unplugged
Changed the definition of 'compress' to one of 'compression'. Altered wording to clarify the meaning
701,857
23.07.2019 20:47:57
-43,200
ad4754c46238222b77bf9a72736bccd5b832fc3c
Grammar and spelling corrections. Removed printers from the definition of pixel
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/glossary/pixel.md", "new_path": "csunplugged/topics/content/en/glossary/pixel.md", "diff": "# Pixel\nThe word pixel is an abbreviation of *picture element*.\n-On computer screens (and printers) an image is almost always displayed using a grid of tiny coloured squares, which are called pixels.\n+On computer screens an image is almost always displayed using a grid of tiny coloured squares, which are called pixels.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "new_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "diff": "# Image Representation\n-Images are everywhere on computers and digital devices, and they are one of the main ways we interact with them.\n+Images are everywhere on computers and other digital devices, and one of the main ways we interact with them.\nDigital devices store everything using digits, so how do they use these digits to create the images we see on our computer screens, our smartphones, and our tablets?\nHow do these devices convert a long list of digits into photos, video game graphics, and web pages?\nThis unit will explore how we can represent pictures and colours using binary digits, how these are displayed using pixels on a screen, and why the way we represent these images changes what we see.\n-We recommend completing lesson 1 (for the relevant age group) of the [Binary Numbers unit]('topics:unit_plan' 'binary-numbers' 'unit-plan') before beginning this unit.\n+We recommend completing Lesson 1 (for the relevant age group) of the [Binary Numbers unit]('topics:unit_plan' 'binary-numbers' 'unit-plan') before beginning this unit.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "## Key questions\n- How do you think computers display images on a screen?\n-- How do computers store images when they store all information as digits?\n+- How do computers store images if they store all information as digits?\n## Lesson starter\n-This lesson includes two activities, one which students complete individually and one group activity.\n-In each activity you will need enough coloring pages for one per student.\n+This lesson includes two activities: one which students complete individually and one group activity.\n+In each activity you will need enough colouring pages for one per student.\nThese each require different versions of the Pixel Painter worksheets.\nUse the **Black and White colouring type** (the first option on the list), and:\n-- for the first activity choose from the 1 page images (the star, teacup, or the cat).\n+- For the first activity choose from the 1 page images (the star, teacup, or cat).\nYou can use a combination of these images, students do not all need to complete the same one,\n-- for the second activity choose from the 6, 8, and 9 page images. Print enough for one set of image worksheets per group of students.\n+- For the second activity choose from the 6, 8, and 9 page images.\n+ Print enough for one set of image worksheets per group of students.\n{panel type=\"general\"}\n@@ -113,12 +114,12 @@ There are diagrams on the worksheet printables which teachers can use to help st\n## Applying what we have just learnt\n-- Instead of writing the 1's and 0's into each of the boxes on the grid, have students write out the binary digits that represent their image (in the same way as the 'a' in the lesson starter section) and give this to other students and see if they can re-create the same picture.\n+- Instead of writing the 1's and 0's into each of the boxes on the grid, have students write out the binary digits that represent their image (in the same way as the 'a' in the lesson starter section), give this to other students, and see if they can recreate the same picture.\n- Now that students have tried creating the larger images they could take it a step further and make an image as a whole class.\nThe Pixel Painter Parrots option is made up of 32 pages, and is a great challenge for a class.\n-- Students can also try creating their own pixel art, convert this into a grid of digits, and then have their friends try to re-create their image.\n+- Students can also try creating their own pixel art, convert this into a grid of digits, and then have their friends try to recreate their image.\n{panel type=\"general\"}\n" } ]
Python
MIT License
uccser/cs-unplugged
Grammar and spelling corrections. Removed printers from the definition of pixel
701,857
24.07.2019 10:46:07
-43,200
9af9a2bf37f172a88e5f65d3e74c284eb3113941
Grammar and spelling changes. Update to compression definition
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/glossary/compression.md", "new_path": "csunplugged/topics/content/en/glossary/compression.md", "diff": "# Compression\n-Compression is the process of making something something smaller.\n-Data compression is a core topic of Computer Science, and is the process of decreasing the number of bits we use to represent a piece of information (e.g. decrease the size of a file) using a compression algorithm.\n+Compression is the process of trying to make something smaller.\n+On computers, data compression is about using a compression algorithm to reduce the size of files, so that they take up less space and can be transmitted faster.\n+This is generally done by trying to find repeated or predictable patterns in a file and replacing them with short codes that convey they same information.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "new_path": "csunplugged/topics/content/en/image-representation/image-representation.md", "diff": "# Image Representation\n-Images are everywhere on computers and other digital devices, and one of the main ways we interact with them.\n-Digital devices store everything using digits, so how do they use these digits to create the images we see on our computer screens, our smartphones, and our tablets?\n+Images are everywhere on computers and other digital devices, and are one of the main ways we interact with them.\n+Digital devices store everything using digits, so how are these digits used to create the images we see on our computer screens, our smartphones, and our tablets?\nHow do these devices convert a long list of digits into photos, video game graphics, and web pages?\nThis unit will explore how we can represent pictures and colours using binary digits, how these are displayed using pixels on a screen, and why the way we represent these images changes what we see.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -37,12 +37,12 @@ In this unit students are introduced to simple examples of how they can use digi\n## Digital Technologies | Data Representation\n-All data on computers is represented with digits, and using these digits to represent other types of data and information is a core concept of Computer Science.\n+All data on computers is represented with digits, and using these digits to represent other types of data and information is a core concept of computer science.\nAt this point you have probably noticed the words **represent** and **representation** are being used a lot, so let's look at exactly what we mean by this.\n{image file-path=\"img/topics/binary-picture-showing-bits.png\" alt=\"If we look closely at an image on a computer screen we can see it is made up of a grid of tiny dots called pixels. The colour of each of these is stored inside a computer using binary.\"}\n-The type of information a set of digits **represents** changes the way we interpret it.\n+The way a set of digits **represents** information changes the way we interpret it.\nFor example, if a set of digits represents an image then we interpret those digits as the colours of different pixels.\nIf it is meant to be text on the other hand, we interpret it as characters.\nThe ability for computers to represent multiple types of information using just binary digits is one of the things that makes them so powerful.\n@@ -52,9 +52,9 @@ Students learn to break down images into pixels and then to digits, and how to m\n## Digital Technologies | Algorithms\n-When pixels are used to represent images, the process we go through to convert digits into these pixels is a type of Algorithm.\n+When pixels are used to represent images, the process we go through to convert digits into these pixels is a type of algorithm.\nThere are many different algorithms computers use to do this, and the one they use depends on things like the file type of the images being displayed, for example if it is a picture like a `.png` or `.jpeg`, or a video file like an `.mp4` or `.avi`, or what resolution the image is.\n-We also use Algorithms to compress images to smaller file sizes, which means they use less memory, can be processed more quickly, and are faster to download.\n+We also use algorithms to compress images to smaller file sizes, which means they use less memory, can be processed more quickly, and are faster to download.\nThrough learning about image representation students practice algorithmic thinking, pattern matching, and abstract thinking.\n## Vocabulary explained\n" } ]
Python
MIT License
uccser/cs-unplugged
Grammar and spelling changes. Update to compression definition
701,857
24.07.2019 11:29:40
-43,200
6a4f99f8c4e6c92da4f4534487003a1f6c33c17d
Replaced the 'a' character used for illustrating pixels in lesson 1 with a 'C' character
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/img/topics/letter-zooming-to-pixels.png", "new_path": "csunplugged/static/img/topics/letter-zooming-to-pixels.png", "diff": "Binary files a/csunplugged/static/img/topics/letter-zooming-to-pixels.png and b/csunplugged/static/img/topics/letter-zooming-to-pixels.png differ\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png", "new_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png", "diff": "Binary files a/csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png and b/csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png differ\n" }, { "change_type": "DELETE", "old_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter.png", "new_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter.png", "diff": "Binary files a/csunplugged/static/img/topics/pixel-visible-grid-with-letter.png and /dev/null differ\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "@@ -42,7 +42,7 @@ What about megapixels?\n# Teaching observations\nMegapixel means one million pixels.\n-Students may have heard the term \"megapixels\" used before because cameras are often described as being a certain number of megapixels, for example a phone might have a *12-megapixel* camera.\n+Students may have heard the term \"megapixels\" before because cameras are often described as being a certain number of megapixels, for example a phone might have a *12-megapixel* camera.\nThis describes the resolution of the photos a camera can take.\nA 12-megapixel camera can produce an image with 12 million pixels in it.\n@@ -55,21 +55,21 @@ Teacher to class: Every image we see on a screen, whether it is a picture, a vid\nShow the following images to students on a screen or on the board.\nTeacher to class: In a black and white image, each pixel can be either black or white, so all the computer would need to store is which dots are black and which are white.\n-For example, if we wanted to display the letter *a* we first need to divide it into squares.\n+For example, if we wanted to display the letter *C*, we first need to divide the letter into squares.\nIf we zoom in further and further on the letter we can see a grid of pixels similar to these:\n-{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the lower case letter 'a' are shown.\n+{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the upper case letter 'C' are shown.\nThese progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\nWe can represent this image using binary digits.\n-If a 1 indicates a white square and a 0 indicates a black square then we can represent our letter *a*, on a 5x6 pixel grid, like this:\n+If a 1 indicates a white square and a 0 indicates a black square then we can represent our letter *C*, on a 5x6 pixel grid, like this:\n-**10001, 11110, 10000, 01110, 01110, 10000**\n+**10001, 01110, 01111, 01111, 01110, 10001**\n-If we take these numbers and draw the image they represent we get the letter a:\n+If we take these numbers and draw the image they represent we get the letter *C*:\n{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"A six by five grid is shown.\n-Some of the squares are white and others are coloured black to create the shape of the letter 'a'.\n+Some of the squares are white and others are coloured black to create the shape of the letter 'C'.\nTo the right of each row of squares there are five binary digits which describe the image.\"}\nWe are using 1 to represent white and 0 to represent black, in the same way we used white and black cards to represent 'on' and 'off' in the binary numbers unit.\n@@ -114,7 +114,7 @@ There are diagrams on the worksheet printables which teachers can use to help st\n## Applying what we have just learnt\n-- Instead of writing the 1's and 0's into each of the boxes on the grid, have students write out the binary digits that represent their image (in the same way as the 'a' in the lesson starter section), give this to other students, and see if they can recreate the same picture.\n+- Instead of writing the 1's and 0's into each of the boxes on the grid, have students write out the binary digits that represent their image (in the same way as the 'C' in the lesson starter section), give this to other students, and see if they can recreate the same picture.\n- Now that students have tried creating the larger images they could take it a step further and make an image as a whole class.\nThe Pixel Painter Parrots option is made up of 32 pages, and is a great challenge for a class.\n" } ]
Python
MIT License
uccser/cs-unplugged
Replaced the 'a' character used for illustrating pixels in lesson 1 with a 'C' character
701,857
24.07.2019 14:07:12
-43,200
49a85752e1c3dda30c2dba6ad291187ca182cd8b
Updated images of pixelated letters. Grammar changes
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/img/topics/letter-zooming-to-pixels.png", "new_path": "csunplugged/static/img/topics/letter-zooming-to-pixels.png", "diff": "Binary files a/csunplugged/static/img/topics/letter-zooming-to-pixels.png and b/csunplugged/static/img/topics/letter-zooming-to-pixels.png differ\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png", "new_path": "csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png", "diff": "Binary files a/csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png and b/csunplugged/static/img/topics/pixel-visible-grid-with-letter-and-numbers.png differ\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "@@ -55,18 +55,18 @@ Teacher to class: Every image we see on a screen, whether it is a picture, a vid\nShow the following images to students on a screen or on the board.\nTeacher to class: In a black and white image, each pixel can be either black or white, so all the computer would need to store is which dots are black and which are white.\n-For example, if we wanted to display the letter *C*, we first need to divide the letter into squares.\n+For example, if we wanted to display the letter **C**, we first need to divide the letter into squares.\nIf we zoom in further and further on the letter we can see a grid of pixels similar to these:\n{image file-path=\"img/topics/letter-zooming-to-pixels.png\" alt=\"Three images of the upper case letter 'C' are shown.\nThese progressively zoom in to show the individual black and white squares which make up the letter on the screen.\"}\n-We can represent this image using binary digits.\n-If a 1 indicates a white square and a 0 indicates a black square then we can represent our letter *C*, on a 5x6 pixel grid, like this:\n+We can represent this image using binary digits (bits).\n+If a 1 indicates a white square and a 0 indicates a black square then we can represent our letter **C**, on a 5x6 pixel grid, like this:\n**10001, 01110, 01111, 01111, 01110, 10001**\n-If we take these numbers and draw the image they represent we get the letter *C*:\n+If we take these numbers and draw the image they represent we get the letter **C**:\n{image file-path=\"img/topics/pixel-visible-grid-with-letter-and-numbers.png\" alt=\"A six by five grid is shown.\nSome of the squares are white and others are coloured black to create the shape of the letter 'C'.\n@@ -142,5 +142,5 @@ This lesson has just covered black and white images, why can't we do more than t\nWhat could we do to represent more colours?\n-- If we want each pixel to be able to show more colours other than black and white then we need to use more numbers (or binary digits) to represent the colour of each pixel.\n+- If we want each pixel to be able to show more colours other than black and white then we need to use more numbers (i.e. more binary digits) to represent the colour of each pixel.\nThis will be explored in future lessons.\n" } ]
Python
MIT License
uccser/cs-unplugged
Updated images of pixelated letters. Grammar changes
701,857
25.07.2019 13:06:14
-43,200
50792b78a6a4918e6c356a2f6991ae6de4b527cb
Incorporated Tims edits
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/lessons/colour-by-numbers.md", "diff": "## Lesson starter\n-This lesson includes two activities: one which students complete individually and one group activity.\n+This lesson includes two activities: one that students complete individually and one group activity.\nIn each activity you will need enough colouring pages for one per student.\nThese each require different versions of the Pixel Painter worksheets.\nUse the **Black and White colouring type** (the first option on the list), and:\n@@ -23,7 +23,7 @@ Use the **Black and White colouring type** (the first option on the list), and:\n- Print spare copies of each worksheet in case students make mistakes and need a new one.\n- Use the **Black and White (2 possible binary values)** colouring option, **not** the option which says \"in Run Length Encoding\".\n-- Students can instead use a black colouring pencil, crayon, or felt tip pen, but easily erasable pencils work much better for the first time students do this activity.\n+- Students can use a black colouring pencil, crayon, or felt tip pen, but easily erasable pencils work much better for the first time students do this activity.\n{panel end}\n@@ -46,7 +46,7 @@ Students may have heard the term \"megapixels\" before because cameras are often d\nThis describes the resolution of the photos a camera can take.\nA 12-megapixel camera can produce an image with 12 million pixels in it.\n-Television screens and projectors also display images using pixels.\n+Television screens and data projectors also display images using pixels.\n{panel end}\n@@ -90,14 +90,18 @@ Advise them to colour them in lightly at first, and then when they are sure they\nAs they work through the worksheet they should see an image emerging.\nTeacher to class: Now that we have made some simple images with our numbers and pixels, we can try making some more detailed and complicated ones.\n-How do you think we could make more complicated or higher quality images?\n+How do you think we could make more detailed images?\n{panel type=\"general\"}\n# Teaching observations\nPossible answers include adding more colours.\n-This is a good answer and colours are part of more advanced lessons in this unit, but this lesson only focusses on black and white pixels, so bring students back to this and ask them how they can make a black and white image more detailed.\n+This is a good answer and colours are part of more advanced lessons in this unit, but this lesson only focusses on black and white pixels, so bring students back to this and ask them how they can make a more detailed black and white image.\n+\n+The may also suggest using smaller pixels for the same image they coloured in.\n+This is a good answer and could be an idea for students to explore with in subsequent classes.\n+For now we are looking at creating other more complicated and detailed images, rather than making the previous ones more detailed though.\n{panel end}\n@@ -105,37 +109,36 @@ The answer you are looking for is to use more pixels for the image, which is wha\nPut students into groups and give each group a set of the multipage image worksheets, so that each student has a page to work on.\nIf this is not possible with the number of students you have just make sure groups are small enough for each students to have at least one page, or preferably for each student to have the same number of pages.\n-For example have groups of 3 work on a 6 page image, so each student has 2 pages to complete.\n+For example, have groups of 3 work on a 6 page image, so each student has 2 pages to complete.\n-Teacher to class: These sets of grids can all be put together to create one larger image, which has much more pixels than the last ones. you are each going to colour in the pixels on your own sheet, in the same way as before, and then put the whole image together.\n+Teacher to class: These sets of grids can all be put together to create one larger image, which contains much more pixels than the previous ones.\n+You are each going to colour in the pixels on your own sheet, in the same way as before, and then put the whole image together.\nOnce students have coloured in their sheets they can arrange them together to create the whole image.\nThere are diagrams on the worksheet printables which teachers can use to help students put their images together if they get stuck.\n## Applying what we have just learnt\n-- Instead of writing the 1's and 0's into each of the boxes on the grid, have students write out the binary digits that represent their image (in the same way as the 'C' in the lesson starter section), give this to other students, and see if they can recreate the same picture.\n+- Students could use a grid or graph paper to create their own images.\n+ Have students write out the binary digits that represent their image (in the same way as the 'C' in the lesson starter section, instead of writing the 1's and 0's into each of the boxes on the grid), give this to other students, and see if they can recreate the same picture.\n+\n+- There are a number of websites avaliable that students can use to easily create pixel art.\n+ They can create their own pixel art, convert this into a grid of digits, and then have their friends try to recreate their image.\n- Now that students have tried creating the larger images they could take it a step further and make an image as a whole class.\nThe Pixel Painter Parrots option is made up of 32 pages, and is a great challenge for a class.\n-- Students can also try creating their own pixel art, convert this into a grid of digits, and then have their friends try to recreate their image.\n-\n{panel type=\"general\"}\n# Notes on resources\n-Students could use grid or graph paper to create their pictures, or a printed grid.\n-There is a printable 8 by 8 grid in the printables section.\n-\n-There are a number of websites students can also use to easily create pixel art.\n-After creating their images they can try converting these to grid paper as well.\n+There is an 8 by 8 [grid]('resources:resource' 'grid') in the printables section which can be used for drawing these images.\n{panel end}\n## Lesson reflection\n-This lesson has just covered black and white images, why can't we do more than two colours with this activity?\n+This lesson has just covered black and white images; why can't we do more than two colours with this activity?\n- With one binary digit we can only represent two different values.\nThis means if we use one digit to represent the colour of one pixel, then each pixel can only be one of two different colours.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "new_path": "csunplugged/topics/content/en/image-representation/unit-plan/unit-plan.md", "diff": "@@ -11,7 +11,7 @@ Students should have completed Lesson 1 (for the relevant age group) of the [Bin\nImages are everywhere on computers and other digital devices.\nIf you think of all the different devices you use, and what you do with them, it is likely that almost all of these will involve a screen or display of some kind!\nEverything you see on computer screens, whether it is photographs, videos, websites, even text, is an image that a digital device has been programmed to display.\n-Because modern computers store data as digits, computer images are ultimately represented inside a computer using just 0's and 1's.\n+Because computers store data as digits, computer images are ultimately represented inside a computer using just 0's and 1's.\n{comment Add teaching this in action video here}\n@@ -33,11 +33,11 @@ The digits stored in the computer tell each of these pixels what colour they sho\nThere are many different methods we can use to convert images into digital data and back again.\nThe method we choose depends on what type of images the data needs to be converted into.\nA black and white image, where each pixel can be only either black or white, is much simpler to represent using digits than a full length, colour, and high-definition film is!\n-In this unit students are introduced to simple examples of how they can use digits to create images, how the number of colours an image can include is based on the number of bits used to store it, and how images can be compressed so they take up less memory space and computers can process them faster.\n+In this unit students are introduced to simple examples of how they can use digits to create images, how the number of colours an image can include is based on the number of bits used to store it, and how images can be compressed so they take up less memory space.\n## Digital Technologies | Data Representation\n-All data on computers is represented with digits, and using these digits to represent other types of data and information is a core concept of computer science.\n+All data on computers is represented with digits, and using these digits to represent other types of data and information is a core concept of Computer Science.\nAt this point you have probably noticed the words **represent** and **representation** are being used a lot, so let's look at exactly what we mean by this.\n{image file-path=\"img/topics/binary-picture-showing-bits.png\" alt=\"If we look closely at an image on a computer screen we can see it is made up of a grid of tiny dots called pixels. The colour of each of these is stored inside a computer using binary.\"}\n@@ -46,6 +46,7 @@ The way a set of digits **represents** information changes the way we interpret\nFor example, if a set of digits represents an image then we interpret those digits as the colours of different pixels.\nIf it is meant to be text on the other hand, we interpret it as characters.\nThe ability for computers to represent multiple types of information using just binary digits is one of the things that makes them so powerful.\n+Computers use extra information, such as file extensions like `.txt` or `.gif` to show how the data should be interpreted and processed.\nJust like learning about the binary number system, exploring image representation exposes students to the Computational Thinking concepts of Abstraction and Decomposition.\nStudents learn to break down images into pixels and then to digits, and how to move back up from digits, to pixels, to images.\n@@ -53,8 +54,9 @@ Students learn to break down images into pixels and then to digits, and how to m\n## Digital Technologies | Algorithms\nWhen pixels are used to represent images, the process we go through to convert digits into these pixels is a type of algorithm.\n+If an image has been compressed to save space, algorithms are needed to uncompress...\nThere are many different algorithms computers use to do this, and the one they use depends on things like the file type of the images being displayed, for example if it is a picture like a `.png` or `.jpeg`, or a video file like an `.mp4` or `.avi`, or what resolution the image is.\n-We also use algorithms to compress images to smaller file sizes, which means they use less memory, can be processed more quickly, and are faster to download.\n+We also use algorithms to compress images to smaller file sizes, which means they use less memory and are faster to download and copy.\nThrough learning about image representation students practice algorithmic thinking, pattern matching, and abstract thinking.\n## Vocabulary explained\n@@ -68,14 +70,15 @@ The word pixel is an abbreviation of *picture element*.\n### Display Resolution\nThe resolution of a screen refers to the number, or density, of pixels on the screen.\n-It is usually defined as either the number of pixels per inch on the screen, or the width and height of the screen measured in pixels (e.g. 1920 by 1080 pixels).\n+It is usually defined as either the number of pixels per inch on the screen, or the width and height of the screen measured in pixels.\n+For example, a common screen resolution is 1920 by 1080 pixels (refered to as 1080p), which means it has 2,073,600 pixels, just over 2 million!\n## Real world implications\nThe way images are digitally represented affects how they are displayed, created, stored, and manipulated.\nThe more bits (binary digits) we use to store the colour of a pixel, the larger the variety of colours we can make.\nIf we use one bit to store the colour of a pixel then we only have two options for what that colour can be (remember, with one bit we can represent two different values only, because we can only use 0 or 1).\n-If we use 8 bits (1 byte) then we can display 256 different colours instead, and if we use 24 bits (3 bytes) then we can display over 16 million different colours, which is more than the human eye can see!\n+If we use 8 bits (1 byte) per pixel we can display 256 different colours instead, and if we use 24 bits (3 bytes) then we can display over 16 million different colours, which is more than the human eye can discern.\nHowever, using more bits to represent a colour will increase the size of an image file.\nThis means it will take up more space in memory, take longer for a computer to process and display, and take longer to be transmitted between computers and over the internet.\n" } ]
Python
MIT License
uccser/cs-unplugged
Incorporated Tims edits
701,857
10.09.2019 10:25:05
-43,200
b44e2446eb9860828e2a9596876aa1e5e64d39dd
Modified text and flowcharts in sections on adding a topic, a unit plan, and a lesson to keep examples consistent
[ { "change_type": "MODIFY", "old_path": "docs/source/_static/img/topics_adding_lesson_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_lesson_flowchart.png", "diff": "Binary files a/docs/source/_static/img/topics_adding_lesson_flowchart.png and b/docs/source/_static/img/topics_adding_lesson_flowchart.png differ\n" }, { "change_type": "MODIFY", "old_path": "docs/source/_static/img/topics_adding_topic_content_files_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_topic_content_files_flowchart.png", "diff": "Binary files a/docs/source/_static/img/topics_adding_topic_content_files_flowchart.png and b/docs/source/_static/img/topics_adding_topic_content_files_flowchart.png differ\n" }, { "change_type": "MODIFY", "old_path": "docs/source/_static/img/topics_adding_topic_structure_files_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_topic_structure_files_flowchart.png", "diff": "Binary files a/docs/source/_static/img/topics_adding_topic_structure_files_flowchart.png and b/docs/source/_static/img/topics_adding_topic_structure_files_flowchart.png differ\n" }, { "change_type": "MODIFY", "old_path": "docs/source/_static/img/topics_adding_unit_plan_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_unit_plan_flowchart.png", "diff": "Binary files a/docs/source/_static/img/topics_adding_unit_plan_flowchart.png and b/docs/source/_static/img/topics_adding_unit_plan_flowchart.png differ\n" }, { "change_type": "MODIFY", "old_path": "docs/source/author/topics.rst", "new_path": "docs/source/author/topics.rst", "diff": "@@ -30,8 +30,9 @@ The following diagram shows the general structure of the topics application.\n- A **lesson** can contain **learning outcomes**, and\n**generated resources**.\n- - A **topic** can also contain **curriculum integrations**, which can also contain\n- **curriculum areas**.\n+ - A **topic** can also contain **curriculum integrations**.\n+\n+ - A **curriculum integration** can also contain **curriculum areas**.\n- A **topic** can also contain **programming challenges**.\n@@ -74,7 +75,7 @@ The ``content`` directory for the topics application contains:\nlocale code. These language directories each contain:\n- A folder for each Topic, containing the content Markdown files.\n- - YAML files containing translatable strings.\n+ - YAML files containing strings that need to be translated in each different language folder.\n- Several auto-generated directories. Please ignore these.\n@@ -110,9 +111,9 @@ Adding Content\n==============================================================================\nThe following flow charts will take you step by step through the process of adding new\n-content to the topics application. Below this section is full details on how to structure\n+content to the topics application. Below this section are full details on how to structure\nand write the configuration files for the topics application.\n-These charts and descriptions will use \"Algorithms\" as an example topic.\n+These charts and descriptions will use \"Binary\" as an example topic.\n.. _adding-a-topic:\n@@ -121,12 +122,17 @@ Adding a Topic\nTo set up a new topic, which you can then add content to, you will first need to:\n-- Create a set of required directories and markdown files within the ``topics/content/en/``\n+- Create a set of required directories and Markdown files within the ``topics/content/en/``\ndirectory (replace ``en/`` if you are creating content for a different language, e.g. ``de/``).\n-- Add several required headings to these files.\n+- Add the required headings to these files.\n- Create a set of required directories and config files within the ``topics/structure/`` directory.\n- Add the minimum required configuration settings to these files.\n+Before you can run ``./csu update`` and view the topic on your local machine, these Markdown\n+and YAML files must contain some required headings and content. We recommend adding some\n+placeholder content to these files and checking that you can view them locally, before moving\n+on to adding content.\n+\nAfter these steps have been completed you can run ``./csu update``, and view\nthe topic at:\n@@ -134,49 +140,56 @@ the topic at:\nlocalhost/en/topics/\n-To create the required directories and markdown files follow this flow chart:\n+To create the required directories and Markdown files follow this flow chart:\n+.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n.. image:: ../_static/img/topics_adding_topic_content_files_flowchart.png\n-Each of these markdown files must include at least one heading and...\n+Add the following content to these Markdown files:\n-To create the required directories and config files follow this flow chart:\n+- An H1 heading (i.e. has a single ``#`` prefix) and some placeholder text to the **topic** description Markdown file.\n-.. image:: ../_static/img/topics_adding_topic_structure_files_flowchart.png\n+ - For example, add ``# Binary`` to the top of the file and the placeholder text ``test`` underneath this.\n-Adding content to these files...\n+- An H1 heading and placeholder text to the **unit-plan** Markdown file.\n-Previous version of Adding a Topic\n-------------------------------------------------------------------------------\n+- An H1 heading and placeholder text to the **lesson** Markdown file.\n+\n+To create the required directories and config files follow this flow chart:\n.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n.. The image is included as raw HTML because it has clickable nodes.\n.. raw:: html\n- <map name=\"topics-map\">\n- <area shape=\"rect\" coords=\"240,308,317,343\" href=\"#topic-configuration-file\">\n- <area shape=\"rect\" coords=\"240,410,317,445\" href=\"#application-structure-configuration-file\">\n- <area shape=\"rect\" coords=\"240,513,317,550\" href=\"#adding-a-unit-plan\">\n- <area shape=\"rect\" coords=\"240,615,317,650\" href=\"../getting_started/helper_commands.html#update\">\n+ <map name=\"topic-structure-files-map\">\n+ <area shape=\"rect\" coords=\"236,230,312,264\" href=\"#topic-configuration-file\">\n+ <area shape=\"rect\" coords=\"236,435,312,468\" href=\"#unit-plan-configuration-file\">\n+ <area shape=\"rect\" coords=\"236,633,312,668\" href=\"#adding-a-lesson\">\n</map>\n- <img src=\"../_static/img/topics_adding_topic_flowchart_old.png\" usemap=\"#topics-map\">\n+ <img src=\"../_static/img/topics_adding_topic_structure_files_flowchart.png\" usemap=\"#topic-structure-files-map\">\n+\n+Add the required fields, and their keys, to these YAML files:\n-The Markdown file containing the description of the topic:\n+- The **topic** config file. The required fields are listed in the :ref:`topic-file` section.\n+\n+- The **unit-plan** config file. The required fields are listed in the :ref:`unit-plan-file` section.\n+\n+- The **lesson** config file. The required fields are listed in the section :ref:`lesson-file` section.\n+\n+Now you can run the ./csu update command.\n+Once this has finished you will be able to view the topic at localhost/en/topics/\n+\n+The description of the topic is written in the **topic** Markdown file.\n+This file:\n- **Is in:** the topic directory, e.g. the description file for\n- Binary Numbers will be in ``topics/content/en/binary-numbers/``.\n+ Binary will be in ``topics/content/en/binary/``.\n- **Is called:** ``<topic-key>.md`` where ``<topic-key>`` is the key\n(:ref:`what-is-a-key`) of the topic and the name of the directory it is in,\n- e.g. ``binary-numbers.md`` or ``kidbots.md``.\n+ e.g. ``binary.md`` or ``kidbots.md``.\n- **Contains:** An H1 heading (i.e. has a single ``#`` prefix) and the content\nof the description.\n-Next several of these files need content added to them before the changes can be viewed.\n-... add these steps...\n-\n-Now you can run the csu update command.\n-Once this has finished you will be able to view the topic at localhost/en/topics/\n-\n.. note ::\nThe heading written in this file will be used exactly as it is given\n@@ -205,10 +218,10 @@ Adding a Unit Plan\n</map>\n<img src=\"../_static/img/topics_adding_unit_plan_flowchart.png\" usemap=\"#unit-plan-map\">\n-The Markdown file containing the content og the unit plan:\n+The Markdown file containing the content of the unit plan:\n-- **Is in:** the unit plan directory, e.g. the unit plan file for Binary Numbers\n- Unit Plan 2 will be in ``topics/content/en/binary-numbers/unit-plan-2/``.\n+- **Is in:** the unit plan directory, e.g. the unit plan file for Binary\n+ Unit Plan 2 will be in ``topics/content/en/binary/unit-plan-2/``.\n- **Is called:** ``<unit-plan-key>.md`` where ``<unit-plan-key>`` is the key\n(:ref:`what-is-a-key`) of the unit plan and the name of the directory it is\nin, e.g. ``unit-plan-2.md``.\n@@ -247,9 +260,9 @@ Adding a Lesson\nThe Markdown file containing the content for the lesson:\n- **Is in:** the lesson subdirectory in the unit plan directory, e.g.\n- ``topics/content/en/binary-numbers/unit-plan/lessons/``.\n+ ``topics/content/en/binary/unit-plan/lessons/``.\n- **Is called:** ``<lesson-key>.md`` where ``<lesson-key>`` is the key\n- (:ref:`what-is-a-key`) of the lesson, e.g. ``introduction-to-bits.md``.\n+ (:ref:`what-is-a-key`) of the lesson, e.g. ``introduction-to-binary.md``.\n- **Contains:** An H1 heading (i.e. has a single ``#`` prefix) and the content\nfor the lesson.\n@@ -261,7 +274,7 @@ The Markdown file containing the content for the lesson:\n(Optional) The translation YAML file containing resource descriptions:\n- **Is in:** the lesson subdirectory in the unit plan directory, e.g.\n- ``topics/content/en/binary-numbers/unit-plan/lessons/``.\n+ ``topics/content/en/binary/unit-plan/lessons/``.\n- **Is called:** ``<lesson-key>-resource-descriptions.md``\n- **Contains:** Descriptions of how printed resources should be used.\nFor example,\n@@ -395,7 +408,7 @@ keys you specified in the programming challenges configuration file.\nA programming challenge is split into several different sections, each of which\nis an its own Markdown file, all of which are in\n-``topics/content/en/binary-numbers/programming-challenges/<challenge-key>/``\n+``topics/content/en/binary/programming-challenges/<challenge-key>/``\nwhere ``<challenge-key>`` refers to the key (:ref:`what-is-a-key`) of the\nchallenge, e.g. ``count-to-16``.\n@@ -468,8 +481,8 @@ Adding a Curriculum Integration\nThe Markdown file containing the content of the curriculum integration:\n- **Is in:** the curriculum integration directrory, e.g. curriculum integrations\n- in Binary Numbers will be in\n- ``topics/content/en/binary-numbers/curriculum-integrations/``.\n+ in Binary will be in\n+ ``topics/content/en/binary/curriculum-integrations/``.\n- **Is called:** ``<integration-key>.md`` where ``<integration-key>`` is the key\n(:ref:`what-is-a-key`) of the curriculum integration, e.g. ``whose-cake-is-it.md``.\n- **Contains:** An H1 heading (i.e. has a single ``#`` prefix) and the content\n@@ -785,6 +798,7 @@ following:\ncodes-for-letters-using-binary-representation:\nnumber: 3\n+.. _lesson-file:\nLesson Configuration File\n------------------------------------------------------------------------------\n" } ]
Python
MIT License
uccser/cs-unplugged
Modified text and flowcharts in sections on adding a topic, a unit plan, and a lesson to keep examples consistent
701,857
10.09.2019 10:41:58
-43,200
f5d5e7c0c2635c3cbfd2ab3dd7499def1e43b8ed
Added a note to curriculum areas and learning outcomes saying that there should only be one config file for each of these in a language directory, and not to add additional ones
[ { "change_type": "MODIFY", "old_path": "docs/source/author/topics.rst", "new_path": "docs/source/author/topics.rst", "diff": "@@ -337,6 +337,10 @@ You will now be able to add learning outcomes to lessons and programming\nchallenges by referencing the keys you specified in the learning outcomes configuration\nfile.\n+There should only be one ``learning-outcomes.yaml`` file per language directory.\n+If one already exists in the language directory then add new learning outcomes to this,\n+rather than creating a new file.\n+\n.. note::\nIf a learning outcome contains curriculum areas, then the curriculum areas\n@@ -385,6 +389,10 @@ integrations by referencing the keys you specified in the curriculum areas\nconfiguration file.\nOnly curriculum areas without any children can be added to items.\n+There should only be one ``curriculum-areas.yaml`` file per language directory.\n+If one already exists in the language directory then add new curriculum areas to this,\n+rather than creating a new file.\n+\n.. _adding-a-programming-challenge:\nAdding a Programming Challenge\n" } ]
Python
MIT License
uccser/cs-unplugged
Added a note to curriculum areas and learning outcomes saying that there should only be one config file for each of these in a language directory, and not to add additional ones
701,857
10.09.2019 11:58:46
-43,200
42755f02cdd39b5891148731eeda7afe4fd86bcc
Updated adding a unit plan flowchart
[ { "change_type": "MODIFY", "old_path": "docs/source/_static/img/topics_adding_unit_plan_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_unit_plan_flowchart.png", "diff": "Binary files a/docs/source/_static/img/topics_adding_unit_plan_flowchart.png and b/docs/source/_static/img/topics_adding_unit_plan_flowchart.png differ\n" }, { "change_type": "MODIFY", "old_path": "docs/source/author/topics.rst", "new_path": "docs/source/author/topics.rst", "diff": "@@ -210,11 +210,11 @@ Adding a Unit Plan\n.. raw:: html\n<map name=\"unit-plan-map\">\n- <area shape=\"rect\" coords=\"240,435,317,468\" href=\"#unit-plan-configuration-file\">\n- <area shape=\"rect\" coords=\"240,547,317,581\" href=\"#unit-plan-configuration-file\">\n- <area shape=\"rect\" coords=\"240,658,317,692\" href=\"#topic-configuration-file\">\n- <area shape=\"rect\" coords=\"240,758,317,792\" href=\"#adding-a-lesson\">\n- <area shape=\"rect\" coords=\"240,864,317,896\" href=\"../getting_started/helper_commands.html#update\">\n+ <area shape=\"rect\" coords=\"233,410,309,445\" href=\"#unit-plan-configuration-file\">\n+ <area shape=\"rect\" coords=\"233,616,309,650\" href=\"#topic-configuration-file\">\n+ <area shape=\"rect\" coords=\"233,823,309,857\" href=\"#unit-plan-configuration-file\">\n+ <area shape=\"rect\" coords=\"233,928,309,962\" href=\"#adding-a-lesson\">\n+ <area shape=\"rect\" coords=\"233,1034,309,1068\" href=\"../getting_started/helper_commands.html#update\">\n</map>\n<img src=\"../_static/img/topics_adding_unit_plan_flowchart.png\" usemap=\"#unit-plan-map\">\n" } ]
Python
MIT License
uccser/cs-unplugged
Updated adding a unit plan flowchart
701,857
10.09.2019 12:52:34
-43,200
bb19fc00a79fdc430dff9d1fc75e8bc2a4fa38ff
Updated adding a lesson flowchart. Split into two seperate flows for either adding the first lesson, or an additional one
[ { "change_type": "MODIFY", "old_path": "docs/source/_static/img/topics_adding_lesson_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_lesson_flowchart.png", "diff": "Binary files a/docs/source/_static/img/topics_adding_lesson_flowchart.png and b/docs/source/_static/img/topics_adding_lesson_flowchart.png differ\n" }, { "change_type": "MODIFY", "old_path": "docs/source/author/topics.rst", "new_path": "docs/source/author/topics.rst", "diff": "@@ -250,10 +250,15 @@ Adding a Lesson\n.. raw:: html\n<map name=\"lesson-map\">\n- <area shape=\"rect\" coords=\"238,318,315,351\" href=\"#lesson-configuration-file\">\n- <area shape=\"rect\" coords=\"237,431,317,465\" href=\"#lesson-configuration-file\">\n- <area shape=\"rect\" coords=\"237,534,317,569\" href=\"#unit-plan-configuration-file\">\n- <area shape=\"rect\" coords=\"237,638,317,671\" href=\"../getting_started/helper_commands.html#update\">\n+ <area shape=\"rect\" coords=\"238,322,315,354\" href=\"#lesson-configuration-file\">\n+ <area shape=\"rect\" coords=\"238,534,315,569\" href=\"#unit-plan-configuration-file\">\n+ <area shape=\"rect\" coords=\"238,824,315,856\" href=\"#lesson-configuration-file\">\n+ <area shape=\"rect\" coords=\"238,919,315,951\" href=\"../getting_started/helper_commands.html#update\">\n+\n+ <area shape=\"rect\" coords=\"595,322,670,354\" href=\"#lesson-configuration-file\">\n+ <area shape=\"rect\" coords=\"595,534,670,569\" href=\"#unit-plan-configuration-file\">\n+ <area shape=\"rect\" coords=\"595,632,670,666\" href=\"#lesson-configuration-file\">\n+ <area shape=\"rect\" coords=\"595,728,670,760\" href=\"../getting_started/helper_commands.html#update\">\n</map>\n<img src=\"../_static/img/topics_adding_lesson_flowchart.png\" usemap=\"#lesson-map\">\n" } ]
Python
MIT License
uccser/cs-unplugged
Updated adding a lesson flowchart. Split into two seperate flows for either adding the first lesson, or an additional one
701,857
10.09.2019 12:55:56
-43,200
a2663771494b3548436fa7fb5366518cc91b48ef
Removed outdated information on the resources YAML file from the adding a lesson section
[ { "change_type": "MODIFY", "old_path": "docs/source/author/topics.rst", "new_path": "docs/source/author/topics.rst", "diff": "@@ -276,23 +276,6 @@ The Markdown file containing the content for the lesson:\nThe heading written in this file will be used exactly as it is given\nthroughout the website as the name of the lesson.\n-(Optional) The translation YAML file containing resource descriptions:\n-\n-- **Is in:** the lesson subdirectory in the unit plan directory, e.g.\n- ``topics/content/en/binary/unit-plan/lessons/``.\n-- **Is called:** ``<lesson-key>-resource-descriptions.md``\n-- **Contains:** Descriptions of how printed resources should be used.\n- For example,\n-\n- .. code-block:: yaml\n-\n- binary-cards:\n- description: One set for class demonstration.\n- binary-cards-small:\n- description: One set of cards per student.\n- binary-to-alphabet:\n- description: Blank sheets for students, plus teacher answer sheet.\n-\n.. note::\nIf a lesson includes programming challenges, Computational Thinking links,\n" } ]
Python
MIT License
uccser/cs-unplugged
Removed outdated information on the resources YAML file from the adding a lesson section
701,857
10.09.2019 13:31:36
-43,200
25113f83447002cf4738ebff1b9d14083717f916
Part way through updating the learning outcomes section
[ { "change_type": "MODIFY", "old_path": "docs/source/_static/img/topics_adding_learning_outcomes_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_learning_outcomes_flowchart.png", "diff": "Binary files a/docs/source/_static/img/topics_adding_learning_outcomes_flowchart.png and b/docs/source/_static/img/topics_adding_learning_outcomes_flowchart.png differ\n" }, { "change_type": "MODIFY", "old_path": "docs/source/author/topics.rst", "new_path": "docs/source/author/topics.rst", "diff": "@@ -287,7 +287,12 @@ The Markdown file containing the content for the lesson:\nAdding Learning Outcomes\n------------------------------------------------------------------------------\n-.. TODO(issue/749): Update diagram with step to add learning outcomes YAML translation file.\n+There are two types of YAML files for Learning Outcomes.\n+One is in ``topics/structure`` and is shared by all language folders.\n+The other is unique to a language and is in ``topics/content/<language>``\n+(e.g. ``content/en``)\n+\n+.. TODO(issue/749): Update diagram with step to add learning outcomes YAML translation file, and fix the coords\n.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n.. The image is included as raw HTML because it has clickable nodes.\n@@ -296,7 +301,7 @@ Adding Learning Outcomes\n<map name=\"learning-outcomes-map\">\n<area shape=\"rect\" coords=\"240,100,317,135\" href=\"#learning-outcomes-configuration-file\">\n<area shape=\"rect\" coords=\"240,210,317,245\" href=\"#application-structure-configuration-file\">\n- <area shape=\"rect\" coords=\"555,200,633,235\" href=\"#learning-outcomes-configuration-file\">\n+ <area shape=\"rect\" coords=\"551,200,633,225\" href=\"#learning-outcomes-configuration-file\">\n<area shape=\"rect\" coords=\"240,330,317,362\" href=\"../getting_started/helper_commands.html#update\">\n</map>\n<img src=\"../_static/img/topics_adding_learning_outcomes_flowchart.png\" usemap=\"#learning-outcomes-map\">\n" } ]
Python
MIT License
uccser/cs-unplugged
Part way through updating the learning outcomes section
701,857
24.09.2019 16:12:48
-43,200
8a963ce076b5a633df25e9a8c9add2a9520fc7a3
Everything in configuration files section updated and checked
[ { "change_type": "MODIFY", "old_path": "docs/source/author/topics.rst", "new_path": "docs/source/author/topics.rst", "diff": "@@ -17,6 +17,7 @@ Topics Overview\nThe following diagram shows the general structure of the topics application.\n+.. Flowchart has been updated\n.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n.. image:: ../_static/img/topics_overview_diagram.png\n:alt: A diagram providing an overview of topics application content\n@@ -646,7 +647,7 @@ The diagram below shows an example of YAML file locations for the\n.. raw:: html\n:file: ../_static/html_snippets/topics_content_directory_tree_only_yaml.html\n-In the following sections, each configuration file is exaplained in more detail.\n+In the following sections, each configuration file is explained in more detail.\n.. note::\n@@ -672,12 +673,14 @@ Application Structure Configuration File\n- **Optional Fields:**\n- - ``learning-outcomes:`` The path to the learning outcomes configuration file.\n+ - ``age-groups:`` The path to the age group configuration file.\n+ - ``classroom-resources:`` The path to the classroom resources configuration file.\n- ``curriculum-areas:`` The path to the curriculum areas configuration file.\n- - ``programming-challenges-structure:`` The path to the programming exercies structure\n- configuration file.\n- ``glossary-folder:`` The folder name that contains the Markdown files for\nglossary definitions.\n+ - ``learning-outcomes:`` The path to the learning outcomes configuration file.\n+ - ``programming-challenges-structure:`` The path to the programming exercises structure\n+ configuration file.\nA complete application structure file may look like the following:\n@@ -687,6 +690,7 @@ A complete application structure file may look like the following:\n- binary-numbers\n- error-detection-correction\n+ age-groups: age-groups.yaml\nlearning-outcomes: learning-outcomes.yaml\ncurriculum-areas: curriculum-areas.yaml\nprogramming-challenges-structure: programming-challenges-structure.yaml\n@@ -810,8 +814,8 @@ Lesson Configuration File\n- **Referenced In:** ``topic/content/structure/<topic-key>/<unit-plan-key>/<unit-plan-key>.yaml``\n-- **Purpose:** This file defines all the lessons (and their respective)\n- attributes for the unit plan.\n+- **Purpose:** This file defines all the lessons (and their respective\n+ attributes) for the specific unit plan.\n- **Required Fields:**\n@@ -873,7 +877,7 @@ Age Group Configuration File\n- **Referenced In:** ``topics/content/structure/structure.yaml``\n-- **Purpose:** Defines the age groups avilable for all lessons.\n+- **Purpose:** Defines the age groups available for all lessons.\n- **Required Fields:**\n@@ -919,7 +923,7 @@ Learning Outcomes Configuration File\n- **Referenced In:** ``topics/content/structure/structure.yaml``\n-- **Purpose:** Defines the learning outcomes avilable for all topics.\n+- **Purpose:** Defines the learning outcomes available for all topics.\n- **Required Fields:**\n@@ -928,7 +932,7 @@ Learning Outcomes Configuration File\n- **Optional Fields:**\n- - ``curriculum-areas:`` A list of curriculum area key (see example file below).\n+ - ``curriculum-areas:`` A list of curriculum area keys (see example file below).\nEach curriculum area listed must not contain child curriculum areas.\nA complete learning outcome structure file may look like the following:\n@@ -1021,7 +1025,7 @@ the following:\ncurriculum areas with no children can be listed.\nThis is because it can be confusing when items belong to the parent\ncurriculum area but not any child in particular.\n- Therefore each item must be linked to a curriculum are with no children.\n+ Therefore each item must be linked to a curriculum area with no children.\nParent curriculum areas (areas with children) are used in search forms to\nselect all child curriculum areas and their related items.\n@@ -1170,7 +1174,7 @@ Curriculum Integrations Configuration File\n- **File Name:** ``curriculum-intergrations.yaml``\n-- **Location:** ``topics/content/structure/<topic-key>/``\n+- **Location:** ``topics/content/structure/<topic-key>/curriculum-integrations/``\n- **Referenced In:** ``topics/content/structure/<topic-key>.yaml``\n@@ -1241,7 +1245,7 @@ Classroom Resources Configuration File\n- **Referenced In:** ``topics/content/structure/<topic-key>/<unit-plan-key>/lessons/lessons.yaml``\n-- **Purpose:** Defines the classroom resources avilable for all topics.\n+- **Purpose:** Defines the classroom resources available for all topics.\n- **Required Fields:**\n@@ -1270,4 +1274,4 @@ A complete classroom resources structure file may look like the following:\n- hula-hoop\n- counters\n- chalk\n- - coloring-pens\n+ - colouring-pens\n" } ]
Python
MIT License
uccser/cs-unplugged
Everything in configuration files section updated and checked
701,857
24.09.2019 17:05:17
-43,200
4e44ffd6122d421a3fe8a90ae011b77d06d0f871
Updated the adding curriculum areas flowchart
[ { "change_type": "MODIFY", "old_path": "docs/source/_static/img/topics_adding_curriculum_areas_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_curriculum_areas_flowchart.png", "diff": "Binary files a/docs/source/_static/img/topics_adding_curriculum_areas_flowchart.png and b/docs/source/_static/img/topics_adding_curriculum_areas_flowchart.png differ\n" }, { "change_type": "MODIFY", "old_path": "docs/source/author/topics.rst", "new_path": "docs/source/author/topics.rst", "diff": "@@ -111,6 +111,11 @@ inside the locale specific directories.\nAdding Content\n==============================================================================\n+.. note ::\n+ If you are adding content for a language other than english then wherever the directory\n+ path ``topics/content/en/`` is used, replace ``en/`` with the relevant folder for that\n+ language, e.g. ``de/``\n+\nThe following flow charts will take you step by step through the process of adding new\ncontent to the topics application. Below this section are full details on how to structure\nand write the configuration files for the topics application.\n@@ -290,10 +295,12 @@ Adding Learning Outcomes\nThere are two types of YAML files for Learning Outcomes.\nOne is in ``topics/structure`` and is shared by all language folders.\n-The other is unique to a language and is in ``topics/content/<language>``\n-(e.g. ``content/en``)\n+The other is the translation YAML file, which is unique to a language and is in\n+``topics/content/<language>`` (e.g. ``content/en``)\n-.. TODO(issue/749): Update diagram with step to add learning outcomes YAML translation file, and fix the coords\n+There should only be one ``learning-outcomes.yaml`` file per language directory.\n+If one already exists in the language directory then add new learning outcomes to this,\n+rather than creating a new file.\n.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n.. The image is included as raw HTML because it has clickable nodes.\n@@ -331,10 +338,6 @@ You will now be able to add learning outcomes to lessons and programming\nchallenges by referencing the keys you specified in the learning outcomes configuration\nfile.\n-There should only be one ``learning-outcomes.yaml`` file per language directory.\n-If one already exists in the language directory then add new learning outcomes to this,\n-rather than creating a new file.\n-\n.. note::\nIf a learning outcome contains curriculum areas, then the curriculum areas\n@@ -345,6 +348,10 @@ rather than creating a new file.\nAdding Curriculum Areas\n------------------------------------------------------------------------------\n+There should only be one ``curriculum-areas.yaml`` file per language directory.\n+If one already exists in the language directory then add new curriculum areas to this,\n+rather than creating a new file.\n+\n.. TODO(issue/749): Update diagram with step to add curriculum areas YAML translation file.\n.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n@@ -383,10 +390,6 @@ integrations by referencing the keys you specified in the curriculum areas\nconfiguration file.\nOnly curriculum areas without any children can be added to items.\n-There should only be one ``curriculum-areas.yaml`` file per language directory.\n-If one already exists in the language directory then add new curriculum areas to this,\n-rather than creating a new file.\n-\n.. _adding-a-programming-challenge:\nAdding a Programming Challenge\n@@ -608,7 +611,7 @@ The translation YAML file containing difficulty descriptions:\ndifficulty-2:\nname: Growing experience\n-Adding a Programming Challenge Languages\n+Adding Programming Challenge Languages\n------------------------------------------------------------------------------\n.. TODO(issue/749): Add diagram for adding a programming challenge language.\n@@ -779,7 +782,7 @@ Unit Plan Configuration File\n- **Optional Fields:**\n- - ``computational-thinking-links``: The Markdown filename containing\n+ - ``computational-thinking-links:`` The Markdown filename containing\nComputational Thinking links.\nA complete unit plan structure file with multiple lessons may look like the\n" } ]
Python
MIT License
uccser/cs-unplugged
Updated the adding curriculum areas flowchart
701,857
25.09.2019 13:54:01
-43,200
75d26d8c3dd1ffb2fd74ee3df8e7cf3675f8a3b5
Added flowcharts for adding age groups, programming challenge difficulties and languages, and classroom resources
[ { "change_type": "ADD", "old_path": "docs/source/_static/img/topics_adding_age_group_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_age_group_flowchart.png", "diff": "Binary files /dev/null and b/docs/source/_static/img/topics_adding_age_group_flowchart.png differ\n" }, { "change_type": "ADD", "old_path": "docs/source/_static/img/topics_adding_classroom_resource_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_classroom_resource_flowchart.png", "diff": "Binary files /dev/null and b/docs/source/_static/img/topics_adding_classroom_resource_flowchart.png differ\n" }, { "change_type": "MODIFY", "old_path": "docs/source/_static/img/topics_adding_curriculum_areas_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_curriculum_areas_flowchart.png", "diff": "Binary files a/docs/source/_static/img/topics_adding_curriculum_areas_flowchart.png and b/docs/source/_static/img/topics_adding_curriculum_areas_flowchart.png differ\n" }, { "change_type": "ADD", "old_path": "docs/source/_static/img/topics_adding_programming_challenge_difficulty_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_programming_challenge_difficulty_flowchart.png", "diff": "Binary files /dev/null and b/docs/source/_static/img/topics_adding_programming_challenge_difficulty_flowchart.png differ\n" }, { "change_type": "ADD", "old_path": "docs/source/_static/img/topics_adding_programming_challenge_language_flowchart.png", "new_path": "docs/source/_static/img/topics_adding_programming_challenge_language_flowchart.png", "diff": "Binary files /dev/null and b/docs/source/_static/img/topics_adding_programming_challenge_language_flowchart.png differ\n" }, { "change_type": "MODIFY", "old_path": "docs/source/author/topics.rst", "new_path": "docs/source/author/topics.rst", "diff": "@@ -355,10 +355,10 @@ rather than creating a new file.\n.. raw:: html\n<map name=\"curriculum-areas-map\">\n- <area shape=\"rect\" coords=\"240,100,317,135\" href=\"#curriculum-areas-configuration-file\">\n- <area shape=\"rect\" coords=\"240,210,317,245\" href=\"#application-structure-configuration-file\">\n- <area shape=\"rect\" coords=\"560,200,642,232\" href=\"#curriculum-areas-configuration-file\">\n- <area shape=\"rect\" coords=\"240,330,317,362\" href=\"../getting_started/helper_commands.html#update\">\n+ <area shape=\"rect\" coords=\"230,236,305,270\" href=\"#curriculum-areas-configuration-file\">\n+ <area shape=\"rect\" coords=\"230,362,305,396\" href=\"#application-structure-configuration-file\">\n+ <area shape=\"rect\" coords=\"230,618,305,650\" href=\"#curriculum-areas-configuration-file\">\n+ <area shape=\"rect\" coords=\"230,722,305,756\" href=\"../getting_started/helper_commands.html#update\">\n</map>\n<img src=\"../_static/img/topics_adding_curriculum_areas_flowchart.png\" usemap=\"#curriculum-areas-map\">\n@@ -391,6 +391,10 @@ Only curriculum areas without any children can be added to items.\nAdding a Programming Challenge\n------------------------------------------------------------------------------\n+There should only be one ``.yaml`` file per language directory.\n+If one already exists in the language directory then add new ... to this,\n+rather than creating a new file.\n+\n.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n.. The image is included as raw HTML because it has clickable nodes.\n.. raw:: html\n@@ -467,6 +471,10 @@ Therefore, the languages you have chosen must be specified in the\nAdding a Curriculum Integration\n------------------------------------------------------------------------------\n+There should only be one ``.yaml`` file per language directory.\n+If one already exists in the language directory then add new ... to this,\n+rather than creating a new file.\n+\n.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n.. The image is included as raw HTML because it has clickable nodes.\n.. raw:: html\n@@ -499,14 +507,18 @@ The Markdown file containing the content of the curriculum integration:\nAdding Glossary Definitions\n------------------------------------------------------------------------------\n+There should only be one ``glossary`` directory per language directory.\n+If one already exists in the language directory then add new definitions to this,\n+rather than creating a new directory.\n+\n.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n.. The image is included as raw HTML because it has clickable nodes.\n.. raw:: html\n<map name=\"glossary-definitions-map\">\n- <area shape=\"rect\" coords=\"240,110,317,145\" href=\"#application-structure-configuration-file\">\n- <area shape=\"rect\" coords=\"240,320,320,350\" href=\"#glossary-definitions-markdown-file\">\n- <area shape=\"rect\" coords=\"240,430,319,462\" href=\"../getting_started/helper_commands.html#update\">\n+ <area shape=\"rect\" coords=\"240,200,317,230\" href=\"#application-structure-configuration-file\">\n+ <area shape=\"rect\" coords=\"240,408,320,442\" href=\"#glossary-definitions-markdown-file\">\n+ <area shape=\"rect\" coords=\"240,518,319,552\" href=\"../getting_started/helper_commands.html#update\">\n</map>\n<img src=\"../_static/img/topics_adding_glossary_definitions_flowchart.png\" usemap=\"#glossary-definitions-map\">\n@@ -539,7 +551,21 @@ contents of that file.\nAdding a Classroom Resource\n------------------------------------------------------------------------------\n-.. TODO(issue/749): Add diagram for adding a classroom resource.\n+There should only be one ``classroom-resources.yaml`` file per language directory.\n+If one already exists in the language directory then add new resources to this,\n+rather than creating a new file.\n+\n+.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n+.. The image is included as raw HTML because it has clickable nodes.\n+.. raw:: html\n+\n+ <map name=\"classroom-resources-map\">\n+ <area shape=\"rect\" coords=\"230,236,305,270\" href=\"#classroom-resources-configuration-file\">\n+ <area shape=\"rect\" coords=\"230,362,305,396\" href=\"#application-structure-configuration-file\">\n+ <area shape=\"rect\" coords=\"230,618,305,650\" href=\"#classroom-resources-configuration-file\">\n+ <area shape=\"rect\" coords=\"230,722,305,756\" href=\"../getting_started/helper_commands.html#update\">\n+ </map>\n+ <img src=\"../_static/img/topics_adding_classroom_resource_flowchart.png\" usemap=\"#classroom-resources-map\">\nThe translation YAML file containing classroom resource descriptions:\n@@ -566,7 +592,21 @@ The translation YAML file containing classroom resource descriptions:\nAdding an Age Group\n------------------------------------------------------------------------------\n-.. TODO(issue/749): Add diagram for adding an age group.\n+There should only be one ``age-groups.yaml`` file per language directory.\n+If one already exists in the language directory then add new age groups to this,\n+rather than creating a new file.\n+\n+.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n+.. The image is included as raw HTML because it has clickable nodes.\n+.. raw:: html\n+\n+ <map name=\"age-groups-map\">\n+ <area shape=\"rect\" coords=\"230,236,305,270\" href=\"#age-group-configuration-file\">\n+ <area shape=\"rect\" coords=\"230,362,305,396\" href=\"#application-structure-configuration-file\">\n+ <area shape=\"rect\" coords=\"230,618,305,650\" href=\"#age-group-configuration-file\">\n+ <area shape=\"rect\" coords=\"230,722,305,756\" href=\"../getting_started/helper_commands.html#update\">\n+ </map>\n+ <img src=\"../_static/img/topics_adding_age_group_flowchart.png\" usemap=\"#age-groups-map\">\nThe translation YAML file containing age group descriptions:\n@@ -586,7 +626,21 @@ The translation YAML file containing age group descriptions:\nAdding a Programming Challenge Difficulty\n------------------------------------------------------------------------------\n-.. TODO(issue/749): Add diagram for adding a programming challenge difficulty.\n+There should only be one ``programming-challenges-structure-difficulties.yaml`` file per language directory.\n+If one already exists in the language directory then add new difficulties to this,\n+rather than creating a new file.\n+\n+.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n+.. The image is included as raw HTML because it has clickable nodes.\n+.. raw:: html\n+\n+ <map name=\"programming-challenge-difficulty-map\">\n+ <area shape=\"rect\" coords=\"238,258,312,292\" href=\"#application-structure-configuration-file\">\n+ <area shape=\"rect\" coords=\"238,563,312,597\" href=\"#programming-challenges-structure-file\">\n+ <area shape=\"rect\" coords=\"238,680,312,712\" href=\"../getting_started/helper_commands.html#update\">\n+ </map>\n+ <img src=\"../_static/img/topics_adding_programming_challenge_difficulty_flowchart.png\" usemap=\"#programming-challenge-difficulty-map\">\n+\nThe translation YAML file containing difficulty descriptions:\n@@ -610,7 +664,20 @@ The translation YAML file containing difficulty descriptions:\nAdding Programming Challenge Languages\n------------------------------------------------------------------------------\n-.. TODO(issue/749): Add diagram for adding a programming challenge language.\n+There should only be one ``programming-challenges-structure-languages.yaml`` file per language directory.\n+If one already exists in the language directory then add new languages to this,\n+rather than creating a new file.\n+\n+.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n+.. The image is included as raw HTML because it has clickable nodes.\n+.. raw:: html\n+\n+ <map name=\"programming-challenge-language-map\">\n+ <area shape=\"rect\" coords=\"238,258,312,292\" href=\"#application-structure-configuration-file\">\n+ <area shape=\"rect\" coords=\"238,563,312,597\" href=\"#programming-challenges-structure-file\">\n+ <area shape=\"rect\" coords=\"238,680,312,712\" href=\"../getting_started/helper_commands.html#update\">\n+ </map>\n+ <img src=\"../_static/img/topics_adding_programming_challenge_language_flowchart.png\" usemap=\"#programming-challenge-language-map\">\nThe translation YAML file containing programming language descriptions:\n" } ]
Python
MIT License
uccser/cs-unplugged
Added flowcharts for adding age groups, programming challenge difficulties and languages, and classroom resources
701,857
27.09.2019 15:34:37
-43,200
8648ce2419c884c6bb8e1ed9f7867c16763e2183
Added button leading to classic unplugged activities to the topics index. Used an old version of the logo as an icon at the moment, but there are other options in there as well
[ { "change_type": "ADD", "old_path": "csunplugged/static/img/classic-cs-unplugged-logo.png", "new_path": "csunplugged/static/img/classic-cs-unplugged-logo.png", "diff": "Binary files /dev/null and b/csunplugged/static/img/classic-cs-unplugged-logo.png differ\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/topics/index.html", "new_path": "csunplugged/templates/topics/index.html", "diff": "</a>\n</div>\n{% endfor %}\n+ <div class=\"col-12 col-md-8 col-lg-6 mb-4\">\n+ <a class=\"link-item no-text-decoration d-block h-100\" href=\"https://classic.csunplugged.org/activities/\">\n+ <div class=\"row align-items-center h-100\">\n+ <div class=\"col-12 text-center text-md-{{LANGUAGE_START}}\">\n+ <h2>{% trans \"More activities available at Classic CS Unplugged\" %}</h2>\n+ </div>\n+ <div class=\"col-12 col-md-5 text-center text-md-{{LANGUAGE_START}}\">\n+ <!-- <ul class=\"list-unstyled list-unstyled-i18n text-muted mb-0\">\n+ <li> One </li>\n+ <li>Two</li>\n+ <li>Three</li>\n+ </ul> -->\n+ </div>\n+ <div class=\"d-none col-md-7 d-md-flex justify-content-end align-items-end\">\n+ <img class=\"img-fluid\" src=\"{% static 'img/classic-cs-unplugged-logo.png' %}\">\n+ <!-- <img class=\"img-fluid\" src=\"{% static 'img/logo.png' %}\"> -->\n+ <!-- <img class=\"img-fluid\" src=\"{% static 'img/classic-unplugged-computer-illustration.png' %}\"> -->\n+ </div>\n+ </div>\n+ </a>\n+ </div>\n</div>\n{% else %}\n<p>{% trans \"No topics are available.\" %}</p>\n" } ]
Python
MIT License
uccser/cs-unplugged
Added button leading to classic unplugged activities to the topics index. Used an old version of the logo as an icon at the moment, but there are other options in there as well
701,857
28.09.2019 14:43:52
-43,200
ce2288779aee66df81205deea3da325a02713719
Added more activities, and translations available buttons on the topics page. Have left in options for other icons we could use for the buttons
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/topics/index.html", "new_path": "csunplugged/templates/topics/index.html", "diff": "{% block content %}\n{% if topics %}\n<p>{% trans \"Open a topic to see all related unit plans, lessons, curriculum integrations, and programming challenges.\" %}</p>\n-\n<div class=\"row justify-content-between\">\n{% for topic in topics %}\n<div class=\"col-12 col-md-8 col-lg-6 mb-4\">\n</div>\n{% endfor %}\n<div class=\"col-12 col-md-8 col-lg-6 mb-4\">\n+ {% if LANGUAGE_CODE == \"en\" %}\n<a class=\"link-item no-text-decoration d-block h-100\" href=\"https://classic.csunplugged.org/activities/\">\n<div class=\"row align-items-center h-100\">\n<div class=\"col-12 text-center text-md-{{LANGUAGE_START}}\">\n- <h2>{% trans \"More activities available at Classic CS Unplugged\" %}</h2>\n+ <h2>More activities available at Classic CS Unplugged</h2>\n+ </div>\n+ <div class=\"col-12 col-md-7 text-center text-md-{{LANGUAGE_START}}\">\n+ </div>\n+ <div class=\"d-none col-md-5 d-md-flex justify-content-end align-items-end\">\n+ <img class=\"img-fluid\" src=\"{% static 'img/classic-cs-unplugged-logo.png' %}\">\n+ <!-- <img class=\"img-fluid\" src=\"{% static 'img/logo.png' %}\"> -->\n+ <!-- <img class=\"img-fluid\" src=\"{% static 'img/general/computer-searching.png' %}\"> -->\n+ </div>\n+ </div>\n+ </a>\n+ {% else %}\n+ <a class=\"link-item no-text-decoration d-block h-100\" href=\"https://classic.csunplugged.org/books/\">\n+ <div class=\"row align-items-center h-100\">\n+ <div class=\"col-12 text-center text-md-{{LANGUAGE_START}}\">\n+ <h2>{% trans \"Translations for some activities are available at Classic CS Unplugged\" %}</h2>\n</div>\n<div class=\"col-12 col-md-5 text-center text-md-{{LANGUAGE_START}}\">\n- <!-- <ul class=\"list-unstyled list-unstyled-i18n text-muted mb-0\">\n- <li> One </li>\n- <li>Two</li>\n- <li>Three</li>\n- </ul> -->\n</div>\n<div class=\"d-none col-md-7 d-md-flex justify-content-end align-items-end\">\n<img class=\"img-fluid\" src=\"{% static 'img/classic-cs-unplugged-logo.png' %}\">\n- <!-- <img class=\"img-fluid\" src=\"{% static 'img/logo.png' %}\"> -->\n- <!-- <img class=\"img-fluid\" src=\"{% static 'img/classic-unplugged-computer-illustration.png' %}\"> -->\n</div>\n</div>\n</a>\n+ {% endif %}\n</div>\n</div>\n{% else %}\n<p>{% trans \"No topics are available.\" %}</p>\n+ <div class=\"col-12 col-md-8 col-lg-6 mb-4\">\n+ <a class=\"link-item no-text-decoration d-block h-100\" href=\"https://classic.csunplugged.org/activities/\">\n+ <div class=\"row align-items-center h-100\">\n+ <div class=\"col-12 text-center text-md-{{LANGUAGE_START}}\">\n+ <h2>{% trans \"There are activities available at Classic CS Unplugged\" %}</h2>\n+ </div>\n+ <div class=\"col-12 col-md-5 text-center text-md-{{LANGUAGE_START}}\">\n+ </div>\n+ <div class=\"d-none col-md-7 d-md-flex justify-content-end align-items-end\">\n+ <img class=\"img-fluid\" src=\"{% static 'img/classic-cs-unplugged-logo.png' %}\">\n+ </div>\n+ </div>\n+ </a>\n+ </div>\n{% endif %}\n{% endblock content %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Added more activities, and translations available buttons on the topics page. Have left in options for other icons we could use for the buttons
701,857
01.10.2019 12:50:27
-46,800
aa8cb40e2f51fbad3eb202f9188aab7c87455032
Set the icon to the old cs-unplugged logo and cleaned up some code
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/topics/index.html", "new_path": "csunplugged/templates/topics/index.html", "diff": "<div class=\"col-12 col-md-8 col-lg-6 mb-4\">\n{% if LANGUAGE_CODE == \"en\" %}\n<a class=\"link-item no-text-decoration d-block h-100\" href=\"https://classic.csunplugged.org/activities/\">\n- <div class=\"row align-items-center h-100\">\n- <div class=\"col-12 text-center text-md-{{LANGUAGE_START}}\">\n- <h2>More activities available at Classic CS Unplugged</h2>\n- </div>\n- <div class=\"col-12 col-md-7 text-center text-md-{{LANGUAGE_START}}\">\n- </div>\n- <div class=\"d-none col-md-5 d-md-flex justify-content-end align-items-end\">\n- <img class=\"img-fluid\" src=\"{% static 'img/classic-cs-unplugged-logo.png' %}\">\n- <!-- <img class=\"img-fluid\" src=\"{% static 'img/logo.png' %}\"> -->\n- <!-- <img class=\"img-fluid\" src=\"{% static 'img/general/computer-searching.png' %}\"> -->\n- </div>\n- </div>\n- </a>\n{% else %}\n<a class=\"link-item no-text-decoration d-block h-100\" href=\"https://classic.csunplugged.org/books/\">\n+ {% endif %}\n<div class=\"row align-items-center h-100\">\n<div class=\"col-12 text-center text-md-{{LANGUAGE_START}}\">\n- <h2>{% trans \"Translations for some activities are available at Classic CS Unplugged\" %}</h2>\n+ {% if LANGUAGE_CODE == \"en\" %}\n+ <h2>{% trans \"More activities at the Classic CS Unplugged website\" %}</h2>\n+ {% else %}\n+ <h2>{% trans \"Translations for some activities available at the Classic CS Unplugged website\" %}</h2>\n+ {% endif %}\n</div>\n- <div class=\"col-12 col-md-5 text-center text-md-{{LANGUAGE_START}}\">\n+ <div class=\"col-12 col-md-7 text-center text-md-{{LANGUAGE_START}}\">\n</div>\n- <div class=\"d-none col-md-7 d-md-flex justify-content-end align-items-end\">\n+ <div class=\"d-none col-md-5 d-md-flex justify-content-end align-items-end\">\n<img class=\"img-fluid\" src=\"{% static 'img/classic-cs-unplugged-logo.png' %}\">\n</div>\n</div>\n</a>\n- {% endif %}\n</div>\n</div>\n{% else %}\n<p>{% trans \"No topics are available.\" %}</p>\n<div class=\"col-12 col-md-8 col-lg-6 mb-4\">\n+ {% if LANGUAGE_CODE == \"en\" %}\n<a class=\"link-item no-text-decoration d-block h-100\" href=\"https://classic.csunplugged.org/activities/\">\n+ {% else %}\n+ <a class=\"link-item no-text-decoration d-block h-100\" href=\"https://classic.csunplugged.org/books/\">\n+ {% endif %}\n<div class=\"row align-items-center h-100\">\n<div class=\"col-12 text-center text-md-{{LANGUAGE_START}}\">\n- <h2>{% trans \"There are activities available at Classic CS Unplugged\" %}</h2>\n+ {% if LANGUAGE_CODE == \"en\" %}\n+ <h2>{% trans \"Activities available at the Classic CS Unplugged website\" %}</h2>\n+ {% else %}\n+ <h2>{% trans \"Translations for some activities available at the Classic CS Unplugged website\" %}</h2>\n+ {% endif %}\n</div>\n- <div class=\"col-12 col-md-5 text-center text-md-{{LANGUAGE_START}}\">\n+ <div class=\"col-12 col-md-7 text-center text-md-{{LANGUAGE_START}}\">\n</div>\n- <div class=\"d-none col-md-7 d-md-flex justify-content-end align-items-end\">\n+ <div class=\"d-none col-md-5 d-md-flex justify-content-end align-items-end\">\n<img class=\"img-fluid\" src=\"{% static 'img/classic-cs-unplugged-logo.png' %}\">\n</div>\n</div>\n" } ]
Python
MIT License
uccser/cs-unplugged
Set the icon to the old cs-unplugged logo and cleaned up some code
701,857
03.10.2019 11:11:33
-46,800
2725553be9e522753bcaad39bf06b92c3829fad1
Warning about flowcharts removed and old comments removed
[ { "change_type": "MODIFY", "old_path": "docs/source/author/topics.rst", "new_path": "docs/source/author/topics.rst", "diff": "Topic Content\n##############################################################################\n-.. warning::\n- Most flowcharts in this guide need to be updated to reflect changes to the content directory structure.\n- This is tracked by `isssue/749 <https://github.com/uccser/cs-unplugged/issues/749>`__.\n-\nThe topics application (see :ref:`what-is-an-application`) is the main focus of\nthe CS Unplugged website, as it contains the majority of educational material\nfor the project.\n@@ -17,7 +13,6 @@ Topics Overview\nThe following diagram shows the general structure of the topics application.\n-.. Flowchart has been updated\n.. The following image can copied for be edits here: https://goo.gl/Vjv6XV\n.. image:: ../_static/img/topics_overview_diagram.png\n:alt: A diagram providing an overview of topics application content\n" } ]
Python
MIT License
uccser/cs-unplugged
Warning about flowcharts removed and old comments removed
701,848
27.03.2020 17:07:03
-46,800
9670fa972777b90d25b22d18665e14d012db635b
Adding new plugging it in django app with index page based on topics.
[ { "change_type": "MODIFY", "old_path": "csunplugged/config/settings/base.py", "new_path": "csunplugged/config/settings/base.py", "diff": "@@ -54,6 +54,7 @@ THIRD_PARTY_APPS = [\nLOCAL_APPS = [\n\"general.apps.GeneralConfig\",\n\"topics.apps.TopicsConfig\",\n+ \"pluggingitin.apps.PluggingitinConfig\",\n\"resources.apps.ResourcesConfig\",\n\"search.apps.SearchConfig\",\n\"classic.apps.ClassicConfig\",\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/config/urls.py", "new_path": "csunplugged/config/urls.py", "diff": "@@ -11,6 +11,7 @@ from django.conf.urls.i18n import i18n_patterns\nurlpatterns = i18n_patterns(\nurl(r\"\", include(\"general.urls\", namespace=\"general\")),\nurl(r\"^topics/\", include(\"topics.urls\", namespace=\"topics\")),\n+ url(r\"^pluggingitin/\", include(\"pluggingitin.urls\", namespace=\"pluggingitin\")),\nurl(r\"^resources/\", include(\"resources.urls\", namespace=\"resources\")),\nurl(r\"^at-home/\", include(\"at_home.urls\", namespace=\"at_home\")),\n)\n" }, { "change_type": "ADD", "old_path": "csunplugged/pluggingitin/__init__.py", "new_path": "csunplugged/pluggingitin/__init__.py", "diff": "" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/pluggingitin/admin.py", "diff": "+from django.contrib import admin\n+\n+# Register your models here.\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/pluggingitin/apps.py", "diff": "+from django.apps import AppConfig\n+\n+\n+class PluggingitinConfig(AppConfig):\n+ name = 'pluggingitin'\n" }, { "change_type": "ADD", "old_path": "csunplugged/pluggingitin/migrations/__init__.py", "new_path": "csunplugged/pluggingitin/migrations/__init__.py", "diff": "" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/pluggingitin/models.py", "diff": "+from django.db import models\n+\n+\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/pluggingitin/tests.py", "diff": "+from django.test import TestCase\n+\n+# Create your tests here.\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/pluggingitin/urls.py", "diff": "+from django.conf.urls import url\n+\n+from . import views\n+\n+app_name = \"pluggingitin\"\n+\n+urlpatterns = [\n+ url(\n+ r\"^$\",\n+ views.IndexView.as_view(),\n+ name=\"index\"\n+ ),\n+]\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/pluggingitin/views.py", "diff": "+from django.http import HttpResponse\n+\n+from topics.utils.add_lesson_ages_to_objects import add_lesson_ages_to_objects\n+from django.views import generic\n+from utils.translated_first import translated_first\n+from topics.models import (\n+ Topic\n+)\n+\n+class IndexView(generic.ListView):\n+ \"\"\"View for the topics application homepage.\"\"\"\n+\n+ template_name = \"pluggingitin/index.html\"\n+ context_object_name = \"topics\"\n+\n+ def get_queryset(self):\n+ \"\"\"Get queryset of all topics.\n+\n+ Returns:\n+ Queryset of Topic objects ordered by name.\n+ \"\"\"\n+ topics = Topic.objects.order_by(\"name\").prefetch_related(\n+ \"unit_plans\",\n+ \"lessons\",\n+ \"curriculum_integrations\",\n+ \"programming_challenges\",\n+ )\n+ return translated_first(topics)\n+\n+ def get_context_data(self, **kwargs):\n+ \"\"\"Provide the context data for the index view.\n+\n+ Returns:\n+ Dictionary of context data.\n+ \"\"\"\n+ # Call the base implementation first to get a context\n+ context = super(IndexView, self).get_context_data(**kwargs)\n+ add_lesson_ages_to_objects(self.object_list)\n+ return context\n+\n+def index(request):\n+ return HttpResponse(\"You are at the plugging it in home page!\")\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/templates/pluggingitin/index.html", "diff": "+{% extends \"base.html\" %}\n+\n+{% load i18n %}\n+{% load static %}\n+{% load django_bootstrap_breadcrumbs %}\n+\n+{% block title %}\n+ {% trans \"Plugging It In\" %}\n+{% endblock title %}\n+\n+{% block breadcrumbs %}\n+ {% breadcrumb \"Plugging it in\" \"pluggingitin:index\" %}\n+{% endblock breadcrumbs %}\n+\n+{% block page_heading %}\n+ <h1>{% trans \"Plugging It In\" %}</h1>\n+{% endblock page_heading %}\n+\n+{% block content %}\n+ {% if topics %}\n+ <p>{% trans \"Open a topic to see all related unit plans, lessons, curriculum integrations, and programming challenges.\" %}</p>\n+ <div class=\"row justify-content-between\">\n+ {% for topic in topics %}\n+ <div class=\"col-12 col-md-8 col-lg-6 mb-4\">\n+ <a class=\"link-item no-text-decoration d-block h-100{% if not topic.translation_available %} unavailable{% endif %}\" href=\"{% url 'topics:topic' topic.slug %}\">\n+ <div class=\"row align-items-center h-100\">\n+ <div class=\"col-12 text-center text-md-{{LANGUAGE_START}}\">\n+ <h2>{{ topic.name }}</h2>\n+ {% if not topic.translation_available %}\n+ {% include \"generic/not-available-badge.html\" %}\n+ {% endif %}\n+ </div>\n+ <div class=\"col-12 col-md-7 text-center text-md-{{LANGUAGE_START}}\">\n+ <ul class=\"list-unstyled list-unstyled-i18n text-muted mb-0\">\n+ {% if topic.lessons.exists %}\n+ <li>\n+ <strong>\n+ {% blocktrans trimmed with min_age=topic.min_age max_age=topic.max_age%}\n+ Ages {{ min_age }} to {{ max_age }}\n+ {% endblocktrans %}\n+ </strong>\n+ </li>\n+ <li>\n+ {{ topic.lessons.count }} {% trans \"lessons\" %}\n+ </li>\n+ {% endif %}\n+ {% if topic.curriculum_integrations.exists %}\n+ <li>{{ topic.curriculum_integrations.count }} {% trans \"curriculum integrations\" %}</li>\n+ {% endif %}\n+ {% if topic.programming_challenges.exists %}\n+ <li>{{ topic.programming_challenges.count }} {% trans \"programming challenges\" %}</li>\n+ {% endif %}\n+ </ul>\n+ </div>\n+ <div class=\"d-none col-md-5 d-md-flex justify-content-end align-items-end\">\n+ {% if topic.icon %}\n+ <img class=\"img-fluid\" src=\"{% static topic.icon %}\">\n+ {% endif %}\n+ </div>\n+ </div>\n+ </a>\n+ </div>\n+ {% endfor %}\n+ {% include \"generic/classic-unplugged-button.html\" %}\n+ </div>\n+ {% else %}\n+ <p>{% trans \"No topics are available.\" %}</p>\n+ {% include \"generic/classic-unplugged-button.html\" %}\n+ {% endif %}\n+{% endblock content %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding new plugging it in django app with index page based on topics.
701,848
27.03.2020 17:20:19
-46,800
0bb4fb01bc600ec2d8c42bc6be52ef6daabf15e6
Updating pii (plugging it in) index template to only show topics which have programming exercises.
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/index.html", "new_path": "csunplugged/templates/pluggingitin/index.html", "diff": "{% block content %}\n{% if topics %}\n- <p>{% trans \"Open a topic to see all related unit plans, lessons, curriculum integrations, and programming challenges.\" %}</p>\n+ <p>{% trans \"[PLUGGING IT IN BLURB.....] Lorem ipsum dolor sit amet, nec metus leo pulvinar urna. Vestibulum ut, wisi neque rutrum. Euismod volutpat integer libero justo, sit erat dapibus tortor duis arcu elit, class nisl massa dictum eleifend adipiscing, a nec ridiculus risus egestas augue id. Ligula non nulla at curabitur feugiat, vestibulum sit at vestibulum nam arcu.\" %}</p>\n<div class=\"row justify-content-between\">\n{% for topic in topics %}\n+ {% if topic.programming_challenges.exists %}\n<div class=\"col-12 col-md-8 col-lg-6 mb-4\">\n<a class=\"link-item no-text-decoration d-block h-100{% if not topic.translation_available %} unavailable{% endif %}\" href=\"{% url 'topics:topic' topic.slug %}\">\n<div class=\"row align-items-center h-100\">\n</div>\n<div class=\"col-12 col-md-7 text-center text-md-{{LANGUAGE_START}}\">\n<ul class=\"list-unstyled list-unstyled-i18n text-muted mb-0\">\n- {% if topic.lessons.exists %}\n- <li>\n- <strong>\n- {% blocktrans trimmed with min_age=topic.min_age max_age=topic.max_age%}\n- Ages {{ min_age }} to {{ max_age }}\n- {% endblocktrans %}\n- </strong>\n- </li>\n- <li>\n- {{ topic.lessons.count }} {% trans \"lessons\" %}\n- </li>\n- {% endif %}\n- {% if topic.curriculum_integrations.exists %}\n- <li>{{ topic.curriculum_integrations.count }} {% trans \"curriculum integrations\" %}</li>\n- {% endif %}\n- {% if topic.programming_challenges.exists %}\n<li>{{ topic.programming_challenges.count }} {% trans \"programming challenges\" %}</li>\n- {% endif %}\n</ul>\n</div>\n<div class=\"d-none col-md-5 d-md-flex justify-content-end align-items-end\">\n</div>\n</a>\n</div>\n+ {% endif %}\n{% endfor %}\n- {% include \"generic/classic-unplugged-button.html\" %}\n</div>\n{% else %}\n<p>{% trans \"No topics are available.\" %}</p>\n" } ]
Python
MIT License
uccser/cs-unplugged
Updating pii (plugging it in) index template to only show topics which have programming exercises.
701,848
27.03.2020 18:24:26
-46,800
9d3f4afb871f5fcac9e6229bcb4fa16a021e2750
Adding programming topic page with listed programming challenges for that topic.
[ { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/urls.py", "new_path": "csunplugged/pluggingitin/urls.py", "diff": "@@ -10,4 +10,9 @@ urlpatterns = [\nviews.IndexView.as_view(),\nname=\"index\"\n),\n+ url(\n+ r\"^(?P<topic_slug>[-\\w]+)/$\",\n+ views.TopicView.as_view(),\n+ name=\"topic\"\n+ ),\n]\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/views.py", "new_path": "csunplugged/pluggingitin/views.py", "diff": "@@ -4,14 +4,15 @@ from topics.utils.add_lesson_ages_to_objects import add_lesson_ages_to_objects\nfrom django.views import generic\nfrom utils.translated_first import translated_first\nfrom topics.models import (\n- Topic\n+ Topic,\n+ ProgrammingChallenge\n)\nclass IndexView(generic.ListView):\n\"\"\"View for the topics application homepage.\"\"\"\ntemplate_name = \"pluggingitin/index.html\"\n- context_object_name = \"topics\"\n+ context_object_name = \"programming_topics\"\ndef get_queryset(self):\n\"\"\"Get queryset of all topics.\n@@ -19,13 +20,10 @@ class IndexView(generic.ListView):\nReturns:\nQueryset of Topic objects ordered by name.\n\"\"\"\n- topics = Topic.objects.order_by(\"name\").prefetch_related(\n- \"unit_plans\",\n- \"lessons\",\n- \"curriculum_integrations\",\n+ programming_topics = Topic.objects.order_by(\"name\").prefetch_related(\n\"programming_challenges\",\n)\n- return translated_first(topics)\n+ return translated_first(programming_topics)\ndef get_context_data(self, **kwargs):\n\"\"\"Provide the context data for the index view.\n@@ -38,5 +36,24 @@ class IndexView(generic.ListView):\nadd_lesson_ages_to_objects(self.object_list)\nreturn context\n-def index(request):\n- return HttpResponse(\"You are at the plugging it in home page!\")\n+\n+class TopicView(generic.DetailView):\n+ \"\"\"View for a specific topic.\"\"\"\n+\n+ model = Topic\n+ template_name = \"pluggingitin/topic.html\"\n+ slug_url_kwarg = \"topic_slug\"\n+\n+ def get_context_data(self, **kwargs):\n+ \"\"\"Provide the context data for the topic view.\n+\n+ Returns:\n+ Dictionary of context data.\n+ \"\"\"\n+ # Call the base implementation first to get a context\n+ context = super(TopicView, self).get_context_data(**kwargs)\n+\n+ # Add in a QuerySet of all the connected programming exercises for this topic\n+ context[\"programming_challenges\"] = ProgrammingChallenge.objects.filter(topic=self.object)\n+ return context\n+\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/index.html", "new_path": "csunplugged/templates/pluggingitin/index.html", "diff": "{% endblock page_heading %}\n{% block content %}\n- {% if topics %}\n+ {% if programming_topics %}\n<p>{% trans \"[PLUGGING IT IN BLURB.....] Lorem ipsum dolor sit amet, nec metus leo pulvinar urna. Vestibulum ut, wisi neque rutrum. Euismod volutpat integer libero justo, sit erat dapibus tortor duis arcu elit, class nisl massa dictum eleifend adipiscing, a nec ridiculus risus egestas augue id. Ligula non nulla at curabitur feugiat, vestibulum sit at vestibulum nam arcu.\" %}</p>\n<div class=\"row justify-content-between\">\n- {% for topic in topics %}\n+ {% for topic in programming_topics %}\n{% if topic.programming_challenges.exists %}\n<div class=\"col-12 col-md-8 col-lg-6 mb-4\">\n- <a class=\"link-item no-text-decoration d-block h-100{% if not topic.translation_available %} unavailable{% endif %}\" href=\"{% url 'topics:topic' topic.slug %}\">\n+ <a class=\"link-item no-text-decoration d-block h-100{% if not topic.translation_available %} unavailable{% endif %}\" href=\"{% url 'pluggingitin:topic' topic.slug %}\">\n<div class=\"row align-items-center h-100\">\n<div class=\"col-12 text-center text-md-{{LANGUAGE_START}}\">\n<h2>{{ topic.name }}</h2>\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/templates/pluggingitin/programming-challenges-table.html", "diff": "+{% load static %}\n+\n+{% load i18n %}\n+\n+<table class=\"table table-responsive table-center-vertical\">\n+ <thead class=\"thead-default\">\n+ <tr>\n+ <th class=\"text-center\">{% trans \"Number\" %}</th>\n+ <th>{% trans \"Name\" %}</th>\n+ <th class=\"text-center\">{% trans \"Challenge Level\" %}</th>\n+ <th class=\"text-center\">{% trans \"Languages\" %}</th>\n+ </tr>\n+ </thead>\n+ <tbody>\n+ {% for programming_challenge in programming_challenges %}\n+ <tr class=\"align-middle{% if not programming_challenge.translation_available %} table-active{% endif %}\">\n+ <td class=\"text-center\">\n+ {{ programming_challenge.challenge_set_number }}.{{ programming_challenge.challenge_number }}\n+ </td>\n+ <td>\n+ {% if not programming_challenge.translation_available %}\n+ {% include \"generic/not-available-badge.html\" %}\n+ <br>\n+ {% endif %}\n+ <a href=\"{% url 'topics:programming_challenge' topic.slug programming_challenge.slug %}\">\n+ <strong>\n+ {{ programming_challenge.name }}\n+ </strong>\n+ </a>\n+ </td>\n+ <td class=\"text-center\">\n+ {% include \"topics/programming-difficulty-badge.html\" %}\n+ </td>\n+ <td class=\"text-center\">\n+ {% for implementation in programming_challenge.ordered_implementations %}\n+ <img src=\"{% get_static_prefix %}{{ implementation.language.icon }}\" class=\"inline-image-small\" />\n+ {% endfor %}\n+ </td>\n+ </tr>\n+ {% endfor %}\n+ </tbody>\n+</table>\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/templates/pluggingitin/topic.html", "diff": "+{% extends \"base.html\" %}\n+\n+{% load i18n %}\n+{% load static %}\n+{% load render_html_field %}\n+{% load django_bootstrap_breadcrumbs %}\n+\n+{% block title %}\n+ {{ topic.name }} Programming Exercises\n+{% endblock title %}\n+\n+{% block breadcrumbs %}\n+ {% breadcrumb \"Plugging It In\" \"pluggingitin:index\" %}\n+ {% breadcrumb topic.name \"topics:topic\" topic.slug %}\n+{% endblock breadcrumbs %}\n+\n+{% block page_heading %}\n+ <h1 id=\"{{ topic.slug }}\">{{ topic.name }} Programming Exercises</h1>\n+ {% if not topic.translation_available %}\n+ {% url \"topics:index\" as url %}\n+ {% trans \"Return to list of topics\" as url_label %}\n+ {% with model=topic %}\n+ {% include 'topics/not-available-warning.html' %}\n+ {% endwith %}\n+ {% endif %}\n+\n+ {% if topic.translation_available %}\n+ {% render_html_field topic.content %}\n+ {% endif %}\n+{% endblock page_heading %}\n+\n+{% block content %}\n+ {% if programming_challenges %}\n+ {% include \"pluggingitin/programming-challenges-table.html\" %}\n+ {% else %}\n+ <p>{% blocktrans trimmed %}No programming challenges for {{ topic }}.{% endblocktrans %}</p>\n+ {% endif %}\n+{% endblock content %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding programming topic page with listed programming challenges for that topic.
701,848
27.03.2020 19:17:04
-46,800
89c5b4edbfbfd677889419307322de31f4be7327
Added pii programming challenge page with 3 column fullscreen layout
[ { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/urls.py", "new_path": "csunplugged/pluggingitin/urls.py", "diff": "@@ -15,4 +15,9 @@ urlpatterns = [\nviews.TopicView.as_view(),\nname=\"topic\"\n),\n+ url(\n+ r\"^(?P<topic_slug>[-\\w]+)/(?P<programming_challenge_slug>[-\\w]+)/$\", # noqa: E501\n+ views.ProgrammingChallengeView.as_view(),\n+ name=\"programming_challenge\"\n+ ),\n]\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/views.py", "new_path": "csunplugged/pluggingitin/views.py", "diff": "from django.http import HttpResponse\nfrom topics.utils.add_lesson_ages_to_objects import add_lesson_ages_to_objects\n+from django.shortcuts import get_object_or_404\nfrom django.views import generic\nfrom utils.translated_first import translated_first\nfrom topics.models import (\nTopic,\n- ProgrammingChallenge\n+ ProgrammingChallenge,\n+ ProgrammingChallengeNumber\n)\nclass IndexView(generic.ListView):\n@@ -57,3 +59,37 @@ class TopicView(generic.DetailView):\ncontext[\"programming_challenges\"] = ProgrammingChallenge.objects.filter(topic=self.object)\nreturn context\n+\n+class ProgrammingChallengeView(generic.DetailView):\n+ \"\"\"View for a specific programming challenge.\"\"\"\n+\n+ model = ProgrammingChallenge\n+ template_name = \"pluggingitin/programming-challenge.html\"\n+ context_object_name = \"programming_challenge\"\n+\n+ def get_object(self, **kwargs):\n+ \"\"\"Retrieve object for the programming challenge view.\n+\n+ Returns:\n+ ProgrammingChallenge object, or raises 404 error if not found.\n+ \"\"\"\n+ return get_object_or_404(\n+ self.model.objects.select_related(),\n+ topic__slug=self.kwargs.get(\"topic_slug\", None),\n+ slug=self.kwargs.get(\"programming_challenge_slug\", None)\n+ )\n+\n+ def get_context_data(self, **kwargs):\n+ \"\"\"Provide the context data for the programming challenge view.\n+\n+ Returns:\n+ Dictionary of context data.\n+ \"\"\"\n+ # Call the base implementation first to get a context\n+ context = super(ProgrammingChallengeView, self).get_context_data(**kwargs)\n+\n+ context[\"topic\"] = self.object.topic\n+ # Add all the connected learning outcomes\n+ context[\"learning_outcomes\"] = self.object.learning_outcomes(manager=\"translated_objects\").order_by(\"text\")\n+ context[\"implementations\"] = self.object.ordered_implementations()\n+ return context\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "diff": "+{% extends \"base.html\" %}\n+\n+{% load i18n %}\n+{% load static %}\n+{% load render_html_field %}\n+{% comment %} {% load django_bootstrap_breadcrumbs %} {% endcomment %}\n+\n+{% block title %}\n+ {{ programming_challenge.name }}\n+{% endblock title %}\n+\n+{% block body_container %}\n+\n+ <div class=\"row\">\n+{% if programming_challenge.translation_available %}\n+ <div class=\"col-12 col-md-4\">\n+ <h1>\n+ {{ programming_challenge.name }}\n+ </h1>\n+ {% if not programming_challenge.translation_available %}\n+ {% with model=programming_challenge parent=topic %}\n+ {% include 'topics/not-available-warning.html' %}\n+ {% endwith %}\n+ {% else %}\n+ <p class=\"w-100 text-white rounded p-2 mt-3 difficulty-level-{{ programming_challenge.difficulty.level }}\">\n+ <strong>{% trans \"Challenge Level:\" %}</strong> {{ programming_challenge.difficulty.name }}\n+ </p>\n+ {% endif %}\n+\n+ {% if learning_outcomes %}\n+ <details class=\"panel-learning-outcomes\">\n+ <summary>\n+ <strong>{% trans \"Learning outcomes\" %}</strong>\n+ <img class=\"inline-image\" src=\"{% static 'img/general/outcomes.png' %}\">\n+ </summary>\n+ <div class=\"boxed-text-content\">\n+ <p>{% trans \"Students will be able to:\" %}</p>\n+ <ul>\n+ {% for learning_outcome in learning_outcomes %}\n+ <li>\n+ {{ learning_outcome.text }}<br>\n+ {% for area in learning_outcome.curriculum_areas.all %}\n+ {% include \"topics/curriculum-area-badge.html\" %}\n+ {% endfor %}\n+ </li>\n+ {% endfor %}\n+ </ul>\n+ </div>\n+ </details>\n+ {% endif %}\n+\n+ {% render_html_field programming_challenge.content %}\n+ </div>\n+ <div class=\"col-12 col-md-4\">\n+ <h2>Code Editor</h2>\n+ </div>\n+ <div class=\"col-12 col-md-4\">\n+ <h2>Results</h2>\n+ </div>\n+ {% endif %}\n+ </div>\n+\n+{% endblock body_container %}\n+\n+{% block end_content %}\n+ {% if programming_challenge.translation_available %}\n+ {% if programming_challenge.extra_challenge %}\n+ <h2>{% trans \"Extra Challenge\" %}</h2>\n+ {% render_html_field programming_challenge.extra_challenge %}\n+ {% endif %}\n+ {% endif %}\n+{% endblock end_content %}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/programming-challenges-table.html", "new_path": "csunplugged/templates/pluggingitin/programming-challenges-table.html", "diff": "{% include \"generic/not-available-badge.html\" %}\n<br>\n{% endif %}\n- <a href=\"{% url 'topics:programming_challenge' topic.slug programming_challenge.slug %}\">\n+ <a href=\"{% url 'pluggingitin:programming_challenge' topic.slug programming_challenge.slug %}\">\n<strong>\n{{ programming_challenge.name }}\n</strong>\n" } ]
Python
MIT License
uccser/cs-unplugged
Added pii programming challenge page with 3 column fullscreen layout
701,848
28.03.2020 12:01:10
-46,800
27852c06daf2ec2907fb8f7fe1bba652b37e2c0c
Adding codemirror editor and connecting with local jobe server.
[ { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "+// Set up code mirror\n+let myTextarea = document.getElementById(\"codemirror_editor\");\n+let myCodeMirror = CodeMirror.fromTextArea(myTextarea, {\n+ lineNumbers: true,\n+ mode: \"python\"\n+});\n+\n+// Send code to jobe and get a result\n+function send_code_to_jobe() {\n+ let code = myCodeMirror.getValue()\n+\n+ const data = {\n+ \"run_spec\": {\n+ \"language_id\": \"python3\",\n+ \"sourcefilename\": \"test.py\",\n+ \"sourcecode\": code\n+ }\n+ };\n+\n+ let jobeResult = document.getElementById(\"jobe_result\")\n+ let jobeOutputText = document.getElementById(\"jobe_output\")\n+\n+ JOBE_SERVER = \"http://localhost:4000/jobe/index.php/restapi/runs/\";\n+\n+ fetch(JOBE_SERVER, {\n+ method: \"POST\",\n+ headers: {\n+ \"Content-type\": \"application/json; charset=utf-8\",\n+ Accept: \"application/json\"\n+ },\n+ body: JSON.stringify(data)\n+ })\n+ .then(response => response.json())\n+ .then(data => {\n+ console.log(\"Success:\", data);\n+ if (data.stdout) {\n+ console.log('here')\n+ jobeResult.innerHTML = \"SUCCESS!\"\n+ jobeOutputText.innerHTML = data.stdout\n+ } else if (data.cmpinfo) {\n+ jobeResult.innerHTML = \"COMPILE ERROR!\"\n+ jobeOutputText.innerHTML = data.cmpinfo\n+ } else {\n+ jobeResult.innerHTML = \"ERROR!\"\n+ jobeOutputText.innerHTML = data.stderr\n+ }\n+\n+ })\n+ .catch(error => {\n+ console.error(\"Error:\", error);\n+ jobeResult.innerHTML = \"ERROR!\"\n+ jobeOutputText.innerHTML = data.stderr\n+ });\n+}\n+\n+let submitButton = document.getElementById('editor_run_button');\n+submitButton.addEventListener(\"click\", send_code_to_jobe)\n+\n" }, { "change_type": "ADD", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "new_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "diff": "{% load i18n %}\n{% load static %}\n{% load render_html_field %}\n-{% comment %} {% load django_bootstrap_breadcrumbs %} {% endcomment %}\n{% block title %}\n{{ programming_challenge.name }}\n</div>\n<div class=\"col-12 col-md-4\">\n<h2>Code Editor</h2>\n+ <textarea id=\"codemirror_editor\"></textarea>\n+ <button id=\"editor_run_button\" >Submit</button>\n</div>\n<div class=\"col-12 col-md-4\">\n<h2>Results</h2>\n+ <strong><p id=\"jobe_result\"></p></strong>\n+ <p id=\"jobe_output\"></p>\n</div>\n{% endif %}\n</div>\n{% endif %}\n{% endif %}\n{% endblock end_content %}\n+\n+{% block scripts %}\n+ <link rel=\"stylesheet\" href=\"{% static '../node_modules/codemirror/lib/codemirror.css' %}\" >\n+ <link rel=\"stylesheet\" href=\"{% static 'css/programming-editor.css' %}\" >\n+\n+ <script src=\"{% static '../node_modules/codemirror/lib/codemirror.js' %}\" ></script>\n+ <script src=\"{% static '../node_modules/codemirror/mode/python/python.js' %}\" ></script>\n+ <script src=\"{% static 'js/jobe-editor.js' %}\"></script>\n+{% endblock scripts %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding codemirror editor and connecting with local jobe server.
701,848
30.03.2020 12:40:57
-46,800
1511cb6e2f753a0dbe55331885d2989d4870e509
Adding some style adjustments to the code editor page
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "+html,\n+body,\n+.programming__challenge-screen {\n+ height: 100%;\n+ width: 100%;\n+}\n+\n+#sponsor-logos {\n+ display: none;\n+}\n+\n+#page-footer {\n+ display: none;\n+}\n+\n+.programming__challenge-screen {\n+ margin: 0px;\n+}\n+\n+.programming__info-area {\n+ overflow-y: scroll;\n+ padding: 20px !important;\n+}\n+\n+.programming__results {\n+ padding: 20px !important;\n+}\n+\n+.programming__editor {\n+ height: 100%;\n+ padding: 0px;\n+\n+ .CodeMirror {\n+ margin: 0px;\n+ height: 95%;\n+ }\n+\n+ .programming__submit {\n+ height: 5%;\n+ background-color: #d6c1e1ff;\n+\n+ #editor_run_button {\n+ border: none;\n+ background-color: #06a284ff;\n+ color: white;\n+ height: 100%;\n+ width: 20%;\n+ transition: ease-in;\n+ }\n+\n+ #editor_run_button:hover {\n+ cursor: pointer;\n+ background-color: #05856dff;\n+ }\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "new_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "diff": "{% block body_container %}\n- <div class=\"row\">\n+<div class=\"row programming__challenge-screen\">\n{% if programming_challenge.translation_available %}\n- <div class=\"col-12 col-md-4\">\n+ <div class=\"col-12 col-md-4 programming__info-area\">\n<h1>\n{{ programming_challenge.name }}\n</h1>\n{% render_html_field programming_challenge.content %}\n</div>\n- <div class=\"col-12 col-md-4\">\n- <h2>Code Editor</h2>\n+ <div class=\"col-12 col-md-4 programming__editor\">\n<textarea id=\"codemirror_editor\"></textarea>\n- <button id=\"editor_run_button\" >Submit</button>\n+ <div class=\"programming__submit d-flex justify-content-start\">\n+ <button id=\"editor_run_button\" >RUN</button>\n</div>\n- <div class=\"col-12 col-md-4\">\n+ </div>\n+ <div class=\"col-12 col-md-4 programming__results\">\n<h2>Results</h2>\n- <strong><p id=\"jobe_result\"></p></strong>\n- <p id=\"jobe_output\"></p>\n+ <p id=\"jobe_results\"></p>\n</div>\n{% endif %}\n</div>\n<script src=\"{% static '../node_modules/codemirror/lib/codemirror.js' %}\" ></script>\n<script src=\"{% static '../node_modules/codemirror/mode/python/python.js' %}\" ></script>\n+ <script src=\"{% static 'js/test-code.js' %}\"></script>\n<script src=\"{% static 'js/jobe-editor.js' %}\"></script>\n{% endblock scripts %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding some style adjustments to the code editor page
701,848
30.03.2020 12:43:03
-46,800
fcb0df0907e16094b4280c306bf13bf69c3ed7dc
Adding static "Hello World" test case example. Displaying results in json.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "+// Temporary testing variables\n+TEST_SOLUTION = \"print('Hello World')\"\n+TEST_INPUT = \"\"\n+TEST_OUTPUT = \"Hello World\"\n+\n// Set up code mirror\nlet myTextarea = document.getElementById(\"codemirror_editor\");\nlet myCodeMirror = CodeMirror.fromTextArea(myTextarea, {\nlineNumbers: true,\n- mode: \"python\"\n+ mode: \"python\",\n+ viewportMargin: Infinity\n});\n// Send code to jobe and get a result\nfunction send_code_to_jobe() {\nlet code = myCodeMirror.getValue()\n- const data = {\n- \"run_spec\": {\n- \"language_id\": \"python3\",\n- \"sourcefilename\": \"test.py\",\n- \"sourcecode\": code\n- }\n- };\n-\n- let jobeResult = document.getElementById(\"jobe_result\")\n- let jobeOutputText = document.getElementById(\"jobe_output\")\n-\n- JOBE_SERVER = \"http://localhost:4000/jobe/index.php/restapi/runs/\";\n+ run_all_testcases(code, [TEST_INPUT], [TEST_OUTPUT]).then(result => {\n+ console.log('Result...')\n+ console.log(result);\n- fetch(JOBE_SERVER, {\n- method: \"POST\",\n- headers: {\n- \"Content-type\": \"application/json; charset=utf-8\",\n- Accept: \"application/json\"\n- },\n- body: JSON.stringify(data)\n+ let jobeResult = document.getElementById(\"jobe_results\");\n+ jobeResult.innerHTML = JSON.stringify(result);\n})\n- .then(response => response.json())\n- .then(data => {\n- console.log(\"Success:\", data);\n- if (data.stdout) {\n- console.log('here')\n- jobeResult.innerHTML = \"SUCCESS!\"\n- jobeOutputText.innerHTML = data.stdout\n- } else if (data.cmpinfo) {\n- jobeResult.innerHTML = \"COMPILE ERROR!\"\n- jobeOutputText.innerHTML = data.cmpinfo\n- } else {\n- jobeResult.innerHTML = \"ERROR!\"\n- jobeOutputText.innerHTML = data.stderr\n- }\n-\n- })\n- .catch(error => {\n- console.error(\"Error:\", error);\n- jobeResult.innerHTML = \"ERROR!\"\n- jobeOutputText.innerHTML = data.stderr\n- });\n}\nlet submitButton = document.getElementById('editor_run_button');\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/static/js/test-code.js", "diff": "+const JOBE_SERVER = \"http://localhost:4000/jobe/index.php/restapi/runs/\";\n+\n+async function run_code(program, givenInput) {\n+ let data = {\n+ run_spec: {\n+ language_id: \"python3\",\n+ sourcefilename: \"test.py\",\n+ sourcecode: program\n+ }\n+ };\n+\n+ let response = await fetch(JOBE_SERVER, {\n+ method: \"POST\",\n+ headers: {\n+ \"Content-type\": \"application/json; charset=utf-8\",\n+ Accept: \"application/json\"\n+ },\n+ body: JSON.stringify(data)\n+ });\n+\n+ let result = await response.json();\n+ return result;\n+}\n+\n+async function run_testcase(userProgram, givenInput, expectedOutput) {\n+ let userResult = await run_code(userProgram, givenInput);\n+ console.log(\"jobe result\");\n+ console.log(userResult);\n+\n+ testcaseResult = {\n+ status: \"Passed\",\n+ input: givenInput,\n+ userOutput: \"\",\n+ expectedOutput: expectedOutput\n+ };\n+\n+ if (userResult.outcome == 15) {\n+ // Outcome 15: Run Successfully\n+ let userOutput = userResult.stdout.replace(/(\\r\\n|\\n|\\r)/gm, \"\");\n+ if (userOutput === expectedOutput) {\n+ testcaseResult.userOutput = userOutput\n+ } else {\n+ testcaseResult.status = \"Failed\";\n+ testcaseResult.userOutput = userResult.stdout;\n+ }\n+ } else if (userResult.outcome == 11) {\n+ // Outcome 11: Compiler Error\n+ testcaseResult.status = \"Compiler Error\";\n+ testcaseResult.userOutput = userResult.cmpinfo;\n+ } else {\n+ // Any other error\n+ testcaseResult.status = \"Error\";\n+ testcaseResult.userOutput = userResult.stderr;\n+ }\n+\n+ return testcaseResult;\n+}\n+\n+async function run_all_testcases(userProgram, testInputs, testOutputs) {\n+ allTestCaseResults = [];\n+\n+ for (let i = 0; i < testInputs.length; i++) {\n+ await run_testcase(userProgram, testInputs[i], testOutputs[i]).then(\n+ testcaseResult => {\n+ allTestCaseResults.push(testcaseResult);\n+ }\n+ );\n+ }\n+\n+ return allTestCaseResults;\n+}\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding static "Hello World" test case example. Displaying results in json.
701,848
30.03.2020 13:50:56
-46,800
4d6dea9fccc0088faed3b23bfd44f075e18e7999
Add in static test cases to view and added table display for results.
[ { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/views.py", "new_path": "csunplugged/pluggingitin/views.py", "diff": "from django.http import HttpResponse\n+import json\nfrom topics.utils.add_lesson_ages_to_objects import add_lesson_ages_to_objects\nfrom django.shortcuts import get_object_or_404\nfrom django.views import generic\n@@ -92,4 +93,6 @@ class ProgrammingChallengeView(generic.DetailView):\n# Add all the connected learning outcomes\ncontext[\"learning_outcomes\"] = self.object.learning_outcomes(manager=\"translated_objects\").order_by(\"text\")\ncontext[\"implementations\"] = self.object.ordered_implementations()\n+ context[\"test_cases\"] = [{\"id\": \"1\", \"test_input\": \"\", \"expected_output\": \"Hello World\"}]\n+\nreturn context\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "-// Temporary testing variables\n-TEST_SOLUTION = \"print('Hello World')\"\n-TEST_INPUT = \"\"\n-TEST_OUTPUT = \"Hello World\"\n-\n// Set up code mirror\nlet myTextarea = document.getElementById(\"codemirror_editor\");\nlet myCodeMirror = CodeMirror.fromTextArea(myTextarea, {\n+ mode: {\n+ name: \"python\",\n+ version: 3,\n+ singleLineStringErrors: false\n+ },\nlineNumbers: true,\n- mode: \"python\",\n- viewportMargin: Infinity\n+ textWrapping: false,\n+ styleActiveLine: true,\n+ autofocus: true,\n+ indentUnit: 4,\n+ viewportMargin: Infinity,\n+ // Replace tabs with 4 spaces. Taken from https://stackoverflow.com/questions/15183494/codemirror-tabs-to-spaces\n+ extraKeys: {\n+ Tab: function(cm) {\n+ cm.replaceSelection(\" \", \"end\");\n+ }\n+ }\n});\n// Send code to jobe and get a result\n-function send_code_to_jobe() {\n- let code = myCodeMirror.getValue()\n-\n- run_all_testcases(code, [TEST_INPUT], [TEST_OUTPUT]).then(result => {\n- console.log('Result...')\n- console.log(result);\n+function sendCodeToJobe() {\n+ let code = myCodeMirror.getValue();\n- let jobeResult = document.getElementById(\"jobe_results\");\n- jobeResult.innerHTML = JSON.stringify(result);\n- })\n+ run_all_testcases(code, test_cases).then(result => {\n+ updateResultsTable(result);\n+ });\n}\n-let submitButton = document.getElementById('editor_run_button');\n-submitButton.addEventListener(\"click\", send_code_to_jobe)\n+function updateResultsTable(results) {\n+ for (result of results) {\n+ // Update status cell\n+ let status_element = $(\"#test-case-\" + result.id + \"-status\");\n+ status_element.text(result.status);\n+\n+ // Update output cell\n+ var output_element = $(\"#test-case-\" + result.id + \"-output\");\n+ output_element.text(result.userOutput);\n+ }\n+}\n+let submitButton = document.getElementById(\"editor_run_button\");\n+submitButton.addEventListener(\"click\", sendCodeToJobe);\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/js/test-code.js", "new_path": "csunplugged/static/js/test-code.js", "diff": "@@ -38,7 +38,7 @@ async function run_testcase(userProgram, givenInput, expectedOutput) {\n// Outcome 15: Run Successfully\nlet userOutput = userResult.stdout.replace(/(\\r\\n|\\n|\\r)/gm, \"\");\nif (userOutput === expectedOutput) {\n- testcaseResult.userOutput = userOutput\n+ testcaseResult.userOutput = userOutput;\n} else {\ntestcaseResult.status = \"Failed\";\ntestcaseResult.userOutput = userResult.stdout;\n@@ -56,15 +56,18 @@ async function run_testcase(userProgram, givenInput, expectedOutput) {\nreturn testcaseResult;\n}\n-async function run_all_testcases(userProgram, testInputs, testOutputs) {\n+async function run_all_testcases(userProgram, testCases) {\nallTestCaseResults = [];\n- for (let i = 0; i < testInputs.length; i++) {\n- await run_testcase(userProgram, testInputs[i], testOutputs[i]).then(\n- testcaseResult => {\n+ for (const testCase of testCases) {\n+ await run_testcase(\n+ userProgram,\n+ testCase.test_input,\n+ testCase.expected_output\n+ ).then(testcaseResult => {\n+ testcaseResult.id = testCase.id;\nallTestCaseResults.push(testcaseResult);\n- }\n- );\n+ });\n}\nreturn allTestCaseResults;\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "new_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "diff": "<div class=\"col-12 col-md-4 programming__results\">\n<h2>Results</h2>\n<p id=\"jobe_results\"></p>\n+ {% include \"pluggingitin/results-table.html\" %}\n</div>\n{% endif %}\n</div>\n<link rel=\"stylesheet\" href=\"{% static '../node_modules/codemirror/lib/codemirror.css' %}\" >\n<link rel=\"stylesheet\" href=\"{% static 'css/programming-editor.css' %}\" >\n+ <script type=\"text/javascript\">\n+ let test_cases = {{ test_cases|safe }};\n+ </script>\n+\n<script src=\"{% static '../node_modules/codemirror/lib/codemirror.js' %}\" ></script>\n<script src=\"{% static '../node_modules/codemirror/mode/python/python.js' %}\" ></script>\n<script src=\"{% static 'js/test-code.js' %}\"></script>\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/templates/pluggingitin/results-table.html", "diff": "+<div class=\"table-responsive\">\n+ <table id=\"test-case-table\" class=\"table table-sm table-bordered\">\n+ <thead class=\"thead-light\">\n+ <tr>\n+ <th scope=\"col\">Input</th>\n+ <th scope=\"col\">Expected output</th>\n+ <th scope=\"col\">Received output</th>\n+ <th scope=\"col\">Status</th>\n+ </tr>\n+ </thead>\n+ <tbody>\n+ {% for test_case in test_cases %}\n+ <tr id=\"test-case-{{ test_case.id }}-row\">\n+ <td>\n+ <pre class=\"mb-0 test-case-input\"\n+ id=\"test-case-{{ test_case.id }}-input\">{{ test_case.test_input }}</pre>\n+ </td>\n+ <td>\n+ <pre class=\"mb-0\"\n+ id=\"test-case-{{ test_case.id }}-expected-output\">{{ test_case.expected_output }}</pre>\n+ </td>\n+ <td>\n+ <pre class=\"mb-0 test-case-output\" id=\"test-case-{{ test_case.id }}-output\"></pre>\n+ </td>\n+ <td id=\"test-case-{{ test_case.id }}-status\">\n+ <span class=\"text-muted\">\n+ Not yet run\n+ </span>\n+ </td>\n+ </tr>\n+ {% endfor %}\n+ </tbody>\n+ </table>\n+</div>\n\\ No newline at end of file\n" } ]
Python
MIT License
uccser/cs-unplugged
Add in static test cases to view and added table display for results.
701,848
31.03.2020 10:26:05
-46,800
18cbdaa29aff232177c125e535834f252c25ef9d
Adding in input test case suport
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/test-code.js", "new_path": "csunplugged/static/js/test-code.js", "diff": "@@ -5,7 +5,8 @@ async function run_code(program, givenInput) {\nrun_spec: {\nlanguage_id: \"python3\",\nsourcefilename: \"test.py\",\n- sourcecode: program\n+ sourcecode: program,\n+ input: givenInput\n}\n};\n@@ -24,8 +25,6 @@ async function run_code(program, givenInput) {\nasync function run_testcase(userProgram, givenInput, expectedOutput) {\nlet userResult = await run_code(userProgram, givenInput);\n- console.log(\"jobe result\");\n- console.log(userResult);\ntestcaseResult = {\nstatus: \"Passed\",\n@@ -37,7 +36,7 @@ async function run_testcase(userProgram, givenInput, expectedOutput) {\nif (userResult.outcome == 15) {\n// Outcome 15: Run Successfully\nlet userOutput = userResult.stdout.replace(/(\\r\\n|\\n|\\r)/gm, \"\");\n- if (userOutput === expectedOutput) {\n+ if (userOutput === expectedOutput || (givenInput && userOutput.includes(expectedOutput))) {\ntestcaseResult.userOutput = userOutput;\n} else {\ntestcaseResult.status = \"Failed\";\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding in input test case suport
701,848
31.03.2020 10:26:26
-46,800
97d8e20c9d201ad77ae617a7324efa5bd35b3d32
Adding in multiple static test case examples for input
[ { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/views.py", "new_path": "csunplugged/pluggingitin/views.py", "diff": "@@ -11,6 +11,7 @@ from topics.models import (\nProgrammingChallengeNumber\n)\n+\nclass IndexView(generic.ListView):\n\"\"\"View for the topics application homepage.\"\"\"\n@@ -93,6 +94,6 @@ class ProgrammingChallengeView(generic.DetailView):\n# Add all the connected learning outcomes\ncontext[\"learning_outcomes\"] = self.object.learning_outcomes(manager=\"translated_objects\").order_by(\"text\")\ncontext[\"implementations\"] = self.object.ordered_implementations()\n- context[\"test_cases\"] = [{\"id\": \"1\", \"test_input\": \"\", \"expected_output\": \"Hello World\"}]\n-\n+ context[\"test_cases\"] = [{\"id\": \"1\", \"test_input\": \"World\", \"expected_output\": \"Hello World\"}, {\n+ \"id\": \"2\", \"test_input\": \"\\n\", \"expected_output\": \"Hello \"}, {\"id\": \"3\", \"test_input\": \"Test\", \"expected_output\": \"Hello Test\"}]\nreturn context\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding in multiple static test case examples for input
701,848
31.03.2020 10:48:09
-46,800
7e3451847218ec2d0da2228f3d8aa2d0a0e63851
Updating table colors to represent status.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "@@ -38,6 +38,22 @@ function updateResultsTable(results) {\n// Update output cell\nvar output_element = $(\"#test-case-\" + result.id + \"-output\");\noutput_element.text(result.userOutput);\n+\n+ // Update row colors\n+ var row_element = $(\"#test-case-\" + result.id + \"-row\");\n+ if (result.status == \"Passed\") {\n+ row_element.addClass(\"table-success\");\n+ row_element.removeClass(\"table-danger\");\n+ row_element.removeClass(\"table-warning\");\n+ } else if (result.status == \"Compiler Error\") {\n+ row_element.addClass(\"table-warning\");\n+ row_element.removeClass(\"table-danger\");\n+ row_element.removeClass(\"table-success\");\n+ } else {\n+ row_element.addClass(\"table-danger\");\n+ row_element.removeClass(\"table-success\");\n+ row_element.removeClass(\"table-warning\");\n+ }\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@@ -24,7 +24,7 @@ body,\n}\n.programming__results {\n- padding: 20px !important;\n+ padding: 0px !important;\n}\n.programming__editor {\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "new_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "diff": "</div>\n</div>\n<div class=\"col-12 col-md-4 programming__results\">\n- <h2>Results</h2>\n- <p id=\"jobe_results\"></p>\n{% include \"pluggingitin/results-table.html\" %}\n</div>\n{% endif %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Updating table colors to represent status.
701,848
31.03.2020 11:18:57
-46,800
e465ac23f3af0a438017b721c629d8c44a4374ed
Adding test case support for python functions.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/test-code.js", "new_path": "csunplugged/static/js/test-code.js", "diff": "const JOBE_SERVER = \"http://localhost:4000/jobe/index.php/restapi/runs/\";\n-async function run_code(program, givenInput) {\n+async function run_code(program, givenInput, questionType) {\nlet data = {\nrun_spec: {\nlanguage_id: \"python3\",\nsourcefilename: \"test.py\",\nsourcecode: program,\n- input: givenInput\n+ input: givenInput ? questionType == \"INPUT\" : \"\"\n}\n};\n@@ -23,8 +23,12 @@ async function run_code(program, givenInput) {\nreturn result;\n}\n-async function run_testcase(userProgram, givenInput, expectedOutput) {\n- let userResult = await run_code(userProgram, givenInput);\n+async function run_testcase(userProgram, givenInput, expectedOutput, questionType) {\n+ if (questionType === \"FUNCTION\") {\n+ userProgram = userProgram.concat(\"\\n\" + givenInput)\n+ }\n+\n+ let userResult = await run_code(userProgram, givenInput, questionType);\ntestcaseResult = {\nstatus: \"Passed\",\n@@ -62,7 +66,8 @@ async function run_all_testcases(userProgram, testCases) {\nawait run_testcase(\nuserProgram,\ntestCase.test_input,\n- testCase.expected_output\n+ testCase.expected_output,\n+ testCase.questionType\n).then(testcaseResult => {\ntestcaseResult.id = testCase.id;\nallTestCaseResults.push(testcaseResult);\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding test case support for python functions.
701,848
31.03.2020 11:19:37
-46,800
ba55124bf7935ab34622c9237cb4b36647fb1682
Adding sample test case examples for functions.
[ { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/views.py", "new_path": "csunplugged/pluggingitin/views.py", "diff": "@@ -94,6 +94,9 @@ class ProgrammingChallengeView(generic.DetailView):\n# Add all the connected learning outcomes\ncontext[\"learning_outcomes\"] = self.object.learning_outcomes(manager=\"translated_objects\").order_by(\"text\")\ncontext[\"implementations\"] = self.object.ordered_implementations()\n- context[\"test_cases\"] = [{\"id\": \"1\", \"test_input\": \"World\", \"expected_output\": \"Hello World\"}, {\n- \"id\": \"2\", \"test_input\": \"\\n\", \"expected_output\": \"Hello \"}, {\"id\": \"3\", \"test_input\": \"Test\", \"expected_output\": \"Hello Test\"}]\n+ # context[\"test_cases\"] = [{\"id\": \"1\", \"test_input\": \"World\", \"expected_output\": \"Hello World\", \"questionType\": \"INPUT\"}, {\n+ # \"id\": \"2\", \"test_input\": \"\\n\", \"expected_output\": \"Hello \", \"questionType\": \"INPUT\"}, {\"id\": \"3\", \"test_input\": \"Test\", \"expected_output\": \"Hello Test\", \"questionType\": \"INPUT\"}]\n+\n+ context[\"test_cases\"] = [{\"id\": \"1\", \"test_input\": \"hello('World')\", \"expected_output\": \"Hello World\", \"questionType\": \"FUNCTION\"}, {\n+ \"id\": \"2\", \"test_input\": \"hello('')\", \"expected_output\": \"Hello \", \"questionType\": \"FUNCTION\"}, {\"id\": \"3\", \"test_input\": \"hello('Test')\", \"expected_output\": \"Hello Test\", \"questionType\": \"FUNCTION\"}]\nreturn context\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding sample test case examples for functions.
701,848
31.03.2020 16:45:01
-46,800
3fea00f747551f926afba5d66d7bdf034e927df9
Adding a Test Case model with corresponding migration
[ { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/pluggingitin/migrations/0001_initial.py", "diff": "+# -*- coding: utf-8 -*-\n+# Generated by Django 1.11.15 on 2020-03-31 00:55\n+from __future__ import unicode_literals\n+\n+import django.contrib.postgres.fields\n+from django.db import migrations, models\n+import django.db.models.deletion\n+\n+\n+class Migration(migrations.Migration):\n+\n+ initial = True\n+\n+ dependencies = [\n+ ('topics', '0093_auto_20190208_0157'),\n+ ]\n+\n+ operations = [\n+ migrations.CreateModel(\n+ name='TestCase',\n+ fields=[\n+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n+ ('languages', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=10), default=[], size=None)),\n+ ('number', models.PositiveSmallIntegerField(default=1)),\n+ ('test_input', models.TextField(blank=True)),\n+ ('expected_output', models.TextField(blank=True)),\n+ ('question_type', models.CharField(max_length=20)),\n+ ('challenge', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='test_cases', to='topics.ProgrammingChallenge')),\n+ ],\n+ options={\n+ 'verbose_name': 'Test Case',\n+ },\n+ ),\n+ ]\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/models.py", "new_path": "csunplugged/pluggingitin/models.py", "diff": "from django.db import models\n+from utils.TranslatableModel import TranslatableModel\n+from topics.models import ProgrammingChallenge\n+class TestCase(TranslatableModel):\n+ \"\"\"A test case for prgramming challenge question.\"\"\"\n+\n+ number = models.PositiveSmallIntegerField(default=1)\n+ test_input = models.TextField(blank=True)\n+ expected_output = models.TextField(blank=True)\n+ question_type = models.CharField(max_length=20)\n+ challenge = models.ForeignKey(\n+ ProgrammingChallenge,\n+ on_delete=models.CASCADE,\n+ related_name=\"test_cases\"\n+ )\n+\n+ class Meta:\n+ \"\"\"Meta information for class.\"\"\"\n+ verbose_name = 'Test Case'\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/models.py", "new_path": "csunplugged/topics/models.py", "diff": "@@ -237,6 +237,15 @@ class ProgrammingChallenge(TranslatableModel):\n\"\"\"\nreturn self.implementations.all().order_by(\"language__number\").select_related()\n+ def oredered_test_cases(self):\n+ \"\"\"Return a QuerySet of test cases.\n+\n+ Returns:\n+ QuerySet.\n+ \"\"\"\n+ return self.test_cases.all().select_related()\n+\n+\ndef __str__(self):\n\"\"\"Text representation of ProgrammingChallenge object.\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding a Test Case model with corresponding migration
701,848
31.03.2020 16:47:36
-46,800
a26871a0630ba436fb417d1e4572e3b3e0093bd7
Adding in loader for test-cases from files
[ { "change_type": "MODIFY", "old_path": "csunplugged/topics/management/commands/_ProgrammingChallengesLoader.py", "new_path": "csunplugged/topics/management/commands/_ProgrammingChallengesLoader.py", "diff": "@@ -6,6 +6,9 @@ from utils.errors.KeyNotFoundError import KeyNotFoundError\nfrom utils.errors.MissingRequiredFieldError import MissingRequiredFieldError\nfrom utils.TranslatableModelLoader import TranslatableModelLoader\n+from pluggingitin.models import (\n+ TestCase\n+)\nfrom topics.models import (\nLearningOutcome,\n@@ -168,6 +171,40 @@ class ProgrammingChallengesLoader(TranslatableModelLoader):\nLOG_TEMPLATE = \"Added language implementation: {}\"\nself.log(LOG_TEMPLATE.format(implementation.language), 2)\n+ test_cases = challenge_structure.get(\"test-cases\", None)\n+ if (test_cases is not None):\n+ for (testcase_id, testcase_type) in test_cases.items():\n+ test_case_translations = self.get_blank_translation_dictionary()\n+\n+ testcase_filename_template = os.path.join(\n+ challenge_slug,\n+ 'test-cases',\n+ \"test-case-{}-{{}}.txt\".format(testcase_id)\n+ )\n+\n+ testcase_input = open(self.get_localised_file(\n+ \"en\", testcase_filename_template.format(testcase_type)), encoding='UTF-8').read()\n+\n+ testcase_output = open(self.get_localised_file(\n+ \"en\", testcase_filename_template.format(\"output\")), encoding='UTF-8').read()\n+\n+ test_case=TestCase(\n+ number = testcase_id,\n+ test_input = testcase_input,\n+ expected_output = testcase_output,\n+ question_type = testcase_type,\n+ challenge = programming_challenge\n+ )\n+\n+ required_fields=['test_input', 'expected_output', 'question_type']\n+\n+ self.populate_translations(test_case, test_case_translations)\n+ self.mark_translation_availability(test_case, required_fields = required_fields)\n+ test_case.save()\n+\n+ LOG_TEMPLATE=\"Added Programming Challenge Test Case: {}\"\n+ self.log(LOG_TEMPLATE.format(testcase_id), 2)\n+\nif \"learning-outcomes\" in challenge_structure:\nlearning_outcomes=challenge_structure[\"learning-outcomes\"]\nif learning_outcomes is not None:\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding in loader for test-cases from files
701,848
31.03.2020 16:48:17
-46,800
35523d2dd1251570adf96cdc04e3d146010d941c
Adding in input and function type example test cases
[ { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/binary-numbers/programming-challenges/binary-cards-as-dots/test-cases/test-case-1-function.txt", "diff": "+hello(\"Test\")\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/binary-numbers/programming-challenges/binary-cards-as-dots/test-cases/test-case-1-output.txt", "diff": "+Hello Test\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/binary-numbers/programming-challenges/binary-cards-as-dots/test-cases/test-case-2-function.txt", "diff": "+hello(\"World\")\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/binary-numbers/programming-challenges/binary-cards-as-dots/test-cases/test-case-2-output.txt", "diff": "+Hello World\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/binary-numbers/programming-challenges/binary-numbers-using-variables-as-operator/test-cases/test-case-1-input.txt", "diff": "+\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/topics/content/en/binary-numbers/programming-challenges/binary-numbers-using-variables-as-operator/test-cases/test-case-1-output.txt", "diff": "+1\n+2\n+4\n+8\n+16\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/content/structure/binary-numbers/programming-challenges/programming-challenges.yaml", "new_path": "csunplugged/topics/content/structure/binary-numbers/programming-challenges/programming-challenges.yaml", "diff": "@@ -33,6 +33,8 @@ binary-numbers-using-variables-as-operator:\n- programming-explain-sequencing\n- programming-outline-variable-updates\nextra-challenge: extra-challenge.md\n+ test-cases:\n+ 1: input\nbinary-numbers-using-variable-operator-repeat:\nchallenge-set-number: 1\n@@ -304,3 +306,6 @@ binary-cards-as-dots:\n- programming-describe-variables\n- programming-identify-if-statement\n- programming-identify-loop\n+ test-cases:\n+ 1: function\n+ 2: function\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding in input and function type example test cases
701,848
31.03.2020 16:49:11
-46,800
26768d931b83c892599832d59d81ed684b13cedd
Updating frontend to connect with new model Test Case data
[ { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/views.py", "new_path": "csunplugged/pluggingitin/views.py", "diff": "@@ -94,9 +94,6 @@ class ProgrammingChallengeView(generic.DetailView):\n# Add all the connected learning outcomes\ncontext[\"learning_outcomes\"] = self.object.learning_outcomes(manager=\"translated_objects\").order_by(\"text\")\ncontext[\"implementations\"] = self.object.ordered_implementations()\n- # context[\"test_cases\"] = [{\"id\": \"1\", \"test_input\": \"World\", \"expected_output\": \"Hello World\", \"questionType\": \"INPUT\"}, {\n- # \"id\": \"2\", \"test_input\": \"\\n\", \"expected_output\": \"Hello \", \"questionType\": \"INPUT\"}, {\"id\": \"3\", \"test_input\": \"Test\", \"expected_output\": \"Hello Test\", \"questionType\": \"INPUT\"}]\n-\n- context[\"test_cases\"] = [{\"id\": \"1\", \"test_input\": \"hello('World')\", \"expected_output\": \"Hello World\", \"questionType\": \"FUNCTION\"}, {\n- \"id\": \"2\", \"test_input\": \"hello('')\", \"expected_output\": \"Hello \", \"questionType\": \"FUNCTION\"}, {\"id\": \"3\", \"test_input\": \"hello('Test')\", \"expected_output\": \"Hello Test\", \"questionType\": \"FUNCTION\"}]\n+ context[\"test_cases_json\"] = json.dumps(list(self.object.oredered_test_cases().values()))\n+ context[\"test_cases\"] = self.object.oredered_test_cases().values()\nreturn context\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/js/test-code.js", "new_path": "csunplugged/static/js/test-code.js", "diff": "@@ -6,7 +6,7 @@ async function run_code(program, givenInput, questionType) {\nlanguage_id: \"python3\",\nsourcefilename: \"test.py\",\nsourcecode: program,\n- input: givenInput ? questionType == \"INPUT\" : \"\"\n+ input: givenInput ? questionType == \"input\" : \"\"\n}\n};\n@@ -24,7 +24,7 @@ async function run_code(program, givenInput, questionType) {\n}\nasync function run_testcase(userProgram, givenInput, expectedOutput, questionType) {\n- if (questionType === \"FUNCTION\") {\n+ if (questionType === \"function\") {\nuserProgram = userProgram.concat(\"\\n\" + givenInput)\n}\n@@ -39,7 +39,7 @@ async function run_testcase(userProgram, givenInput, expectedOutput, questionTyp\nif (userResult.outcome == 15) {\n// Outcome 15: Run Successfully\n- let userOutput = userResult.stdout.replace(/(\\r\\n|\\n|\\r)/gm, \"\");\n+ let userOutput = userResult.stdout.replace(/\\n$/, \"\")\nif (userOutput === expectedOutput || (givenInput && userOutput.includes(expectedOutput))) {\ntestcaseResult.userOutput = userOutput;\n} else {\n@@ -67,7 +67,7 @@ async function run_all_testcases(userProgram, testCases) {\nuserProgram,\ntestCase.test_input,\ntestCase.expected_output,\n- testCase.questionType\n+ testCase.question_type\n).then(testcaseResult => {\ntestcaseResult.id = testCase.id;\nallTestCaseResults.push(testcaseResult);\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "new_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "diff": "<button id=\"editor_run_button\" >RUN</button>\n</div>\n</div>\n+\n<div class=\"col-12 col-md-4 programming__results\">\n{% include \"pluggingitin/results-table.html\" %}\n</div>\n<link rel=\"stylesheet\" href=\"{% static 'css/programming-editor.css' %}\" >\n<script type=\"text/javascript\">\n- let test_cases = {{ test_cases|safe }};\n+ let test_cases = {{ test_cases_json|safe }};\n</script>\n<script src=\"{% static '../node_modules/codemirror/lib/codemirror.js' %}\" ></script>\n" } ]
Python
MIT License
uccser/cs-unplugged
Updating frontend to connect with new model Test Case data
701,848
01.04.2020 14:40:51
-46,800
4aefd0b78c1ecf1f8c342f55d8e097f54d2e83a6
Adding base-students template and updating pluggingitin templates to use this
[ { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/templates/base-students.html", "diff": "+{% extends \"core.html\" %}\n+\n+{% load i18n %}\n+{% load static %}\n+{% load render_html_field %}\n+{% load translate_url %}\n+{% load django_bootstrap_breadcrumbs %}\n+\n+{% get_language_info for LANGUAGE_CODE as current_language %}\n+\n+{% block navbar %}\n+ <nav class=\"navbar fixed-top navbar-expand-md navbar-dark py-1 d-print-none{% block navbar_class_overrides %}{% endblock navbar_class_overrides %}\">\n+ <div class=\"container px-0\">\n+ <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarNav\"\n+ aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n+ <span class=\"navbar-toggler-icon\"></span>\n+ </button>\n+ <a class=\"navbar-brand mr-0\" href=\"{% url 'general:home' %}\">\n+ <img src=\"{% static 'img/cs-unplugged-logo-white.svg' %}\" id=\"navbar-brand-logo\" class=\"d-inline-block align-top\"\n+ alt=\"CS Unplugged logo\">\n+ </a>\n+ <div class=\"dropdown ml-md-3 order-md-last\">\n+ <button type=\"button\" id=\"navbarLanguageSelector\" data-toggle=\"dropdown\" aria-haspopup=\"true\"\n+ aria-expanded=\"false\">\n+ <!-- SVG from https://thenounproject.com/term/translation/987/ (Public Domain) -->\n+ <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\"\n+ viewBox=\"0 0 100 75.446\" xml:space=\"preserve\" class=\"icon icon-language\">\n+ <title>{% trans \"Language\" %}</title>\n+ <g>\n+ <path\n+ d=\"M19.198,44.002v-8.201h-8.575c-3.319,0-6.021-2.874-6.021-6.406V10.903c0-3.533,2.701-6.408,6.021-6.408h38.345 c3.319,0,6.019,2.875,6.019,6.408v18.492c0,3.532-2.7,6.406-6.019,6.406v4.496c5.797,0,10.514-4.891,10.514-10.902V10.903 C59.482,4.892,54.766,0,48.968,0H10.623C4.824,0,0.107,4.892,0.107,10.903v18.492c0,6.011,4.717,10.902,10.516,10.902h4.08v7.968 c0,1.223,0.789,2.332,1.963,2.764c0.334,0.123,0.677,0.184,1.014,0.184c0.821,0,1.609-0.354,2.165-1.01l8.369-9.905h8.353v-4.496 H26.128L19.198,44.002z\">\n+ </path>\n+ <path\n+ d=\"M89.377,24.233h-25.96v4.496h25.96c3.319,0,6.021,2.875,6.021,6.408v18.489c0,3.533-2.701,6.408-6.021,6.408h-8.574v8.205 l-6.931-8.203H51.031c-3.318,0-6.019-2.875-6.019-6.408V35.137c0-3.533,2.701-6.408,6.019-6.408v-4.496 c-5.797,0-10.515,4.892-10.515,10.903v18.491c0,6.014,4.717,10.904,10.515,10.904h20.754l8.372,9.91 c0.555,0.652,1.342,1.004,2.161,1.004c0.337,0,0.68-0.059,1.014-0.182c1.176-0.432,1.967-1.543,1.967-2.768V64.53h4.078 c5.799,0,10.516-4.891,10.516-10.904V35.137C99.893,29.125,95.176,24.233,89.377,24.233z\">\n+ </path>\n+ <path\n+ d=\"M26.532,7.437l-7.952,20.951h4.665l1.644-4.665h7.834l1.584,4.665h4.782L31.255,7.437H26.532z M26.093,20.29l2.729-7.688 h0.058l2.641,7.688H26.093z\">\n+ </path>\n+ <path\n+ d=\"M60.12,49.114c0,2.297,1.468,3.787,3.862,3.787c2.876-0.061,5.721-1.887,6.647-2.711c0.926-0.826,3.42-3.693,4.521-5.963 c1.393,0.658,2.053,1.76,2.053,2.98c0,2.639-2.542,4.17-6.599,4.635l1.968,2.725c6.354-0.832,8.516-3.5,8.516-7.408 c0-3.301-2.077-5.305-4.74-6.183c0.049-0.242,0.138-0.495,0.188-0.74l-3.611-0.643c-0.024,0.365-0.097,0.432-0.168,0.798 c-1.297-0.074-2.738,0.121-3.202,0.219c0-0.66,0.024-2.421,0.049-3.055c3.006-0.122,5.962-0.365,8.699-0.781l-0.318-3.566 c-2.81,0.562-5.523,0.856-8.186,1.003c0.072-0.71,0.172-2.717,0.172-2.717l-3.813-0.291c-0.05,0.978-0.072,2.127-0.121,3.128 c-1.688,0.024-3.689,0.024-4.742,0l0.171,3.446h0.414c1.003,0,2.641-0.051,4.109-0.099c0,0.952,0.023,3.005,0.048,3.934 C62.589,43.051,60.12,45.717,60.12,49.114z M71.606,43.59c-0.514,1.025-1.124,1.957-1.808,2.736 c-0.1-0.807-0.148-1.637-0.196-2.516C69.87,43.762,70.945,43.59,71.606,43.59z M66.229,45.008c0.123,1.369,0.27,2.688,0.489,3.885 c-0.634,0.318-1.244,0.514-1.809,0.539c-1.223,0.049-1.223-0.732-1.223-1.076C63.687,47.059,64.689,45.864,66.229,45.008z\">\n+ </path>\n+ </g>\n+ </svg>\n+ </button>\n+ <div id=\"navbarLanguageDropdown\" class=\"dropdown-menu dropdown-menu-{{ LANGUAGE_END }}\"\n+ aria-labelledby=\"navbarLanguageSelector\">\n+ {% for language in LANGUAGES %}\n+ {% get_language_info for language.0 as lang %}\n+ <a class=\"dropdown-item{% if LANGUAGE_CODE == lang.code %} active{% endif %}\"\n+ href=\"{% translate_url language.0 %}\">{{ lang.name_local|capfirst }}</a>\n+ {% endfor %}\n+ </div>\n+ </div>\n+ <div class=\"collapse navbar-collapse\" id=\"navbarNav\">\n+ <div class=\"navbar-nav navbar-nav-i18n mr-auto\">\n+ <a class=\"nav-item nav-link\" href=\"{% url 'topics:index' %}\">{% trans \"Topics\" %}</a>\n+ <a class=\"nav-item nav-link\" href=\"{% url 'resources:index' %}\">{% trans \"Printables\" %}</a>\n+ <a class=\"nav-item nav-link\" href=\"{% url 'general:about' %}\">{% trans \"About\" %}</a>\n+ </div>\n+ {% if LANGUAGE_CODE == \"en\" %}\n+ <!-- Search is only currently available in English, see https://github.com/uccser/cs-unplugged/issues/989 -->\n+ <form method=\"get\" action=\"{% url 'search:index' %}\">\n+ <div class=\"input-group\" id=\"search-navbar\">\n+ <input type=\"text\" class=\"form-control form-control-sm border-0\" placeholder=\"Search\"\n+ aria-label=\"Search\" name=\"q\">\n+ <div class=\"input-group-append\">\n+ <button class=\"btn btn-outline-light btn-sm\" type=\"submit\">\n+ <!-- SVG from Icomoon-Free -->\n+ <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\"\n+ viewBox=\"0 0 32 32\" class=\"icon icon-search\">\n+ <title>{% trans \"Search\" %}</title>\n+ <path\n+ d=\"M31.008 27.231l-7.58-6.447c-0.784-0.705-1.622-1.029-2.299-0.998 1.789-2.096 2.87-4.815 2.87-7.787 0-6.627-5.373-12-12-12s-12 5.373-12 12 5.373 12 12 12c2.972 0 5.691-1.081 7.787-2.87-0.031 0.677 0.293 1.515 0.998 2.299l6.447 7.58c1.104 1.226 2.907 1.33 4.007 0.23s0.997-2.903-0.23-4.007zM12 20c-4.418 0-8-3.582-8-8s3.582-8 8-8 8 3.582 8 8-3.582 8-8 8z\">\n+ </path>\n+ </svg>\n+ </button>\n+ </div>\n+ </div>\n+ </form>\n+ {% endif %}\n+ </div>\n+ </div>\n+ </nav>\n+{% endblock navbar %}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/index.html", "new_path": "csunplugged/templates/pluggingitin/index.html", "diff": "-{% extends \"base.html\" %}\n+{% extends \"base-students.html\" %}\n{% load i18n %}\n{% load static %}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "new_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "diff": "-{% extends \"base.html\" %}\n+{% extends \"base-students.html\" %}\n{% load i18n %}\n{% load static %}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/topic.html", "new_path": "csunplugged/templates/pluggingitin/topic.html", "diff": "-{% extends \"base.html\" %}\n+{% extends \"base-students.html\" %}\n{% load i18n %}\n{% load static %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding base-students template and updating pluggingitin templates to use this
701,848
01.04.2020 14:49:46
-46,800
6ef838ab24039d56954522b54eb6e20fbae9c056
Updating static file imports
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "+const code_tester = require('./test-code.js');\n+var CodeMirror = require('codemirror');\n+require('codemirror/mode/python/python.js');\n+\n// Set up code mirror\nlet myTextarea = document.getElementById(\"codemirror_editor\");\nlet myCodeMirror = CodeMirror.fromTextArea(myTextarea, {\n@@ -24,7 +28,7 @@ let myCodeMirror = CodeMirror.fromTextArea(myTextarea, {\nfunction sendCodeToJobe() {\nlet code = myCodeMirror.getValue();\n- run_all_testcases(code, test_cases).then(result => {\n+ code_tester.run_all_testcases(code, test_cases).then(result => {\nupdateResultsTable(result);\n});\n}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/js/test-code.js", "new_path": "csunplugged/static/js/test-code.js", "diff": "@@ -76,3 +76,5 @@ async function run_all_testcases(userProgram, testCases) {\nreturn allTestCaseResults;\n}\n+\n+exports.run_all_testcases = run_all_testcases;\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "new_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "diff": "let test_cases = {{ test_cases_json|safe }};\n</script>\n- <script src=\"{% static '../node_modules/codemirror/lib/codemirror.js' %}\" ></script>\n- <script src=\"{% static '../node_modules/codemirror/mode/python/python.js' %}\" ></script>\n- <script src=\"{% static 'js/test-code.js' %}\"></script>\n<script src=\"{% static 'js/jobe-editor.js' %}\"></script>\n{% endblock scripts %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Updating static file imports
701,848
01.04.2020 15:28:36
-46,800
391ce1647094c466152da567eea301081ed8e97a
Disable submit button and add spinner during request to jobe
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "@@ -28,8 +28,13 @@ let myCodeMirror = CodeMirror.fromTextArea(myTextarea, {\nfunction sendCodeToJobe() {\nlet code = myCodeMirror.getValue();\n+ $(\"#editor_run_button\").prop('disabled', true);\n+ $(\".code_running_spinner\").css(\"display\", \"inline-block\");\n+\ncode_tester.run_all_testcases(code, test_cases).then(result => {\nupdateResultsTable(result);\n+ $(\"#editor_run_button\").prop('disabled', false);\n+ $(\".code_running_spinner\").css(\"display\", \"none\");\n});\n}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@@ -40,6 +40,12 @@ body,\nheight: 5%;\nbackground-color: #d6c1e1ff;\n+ .code_running_spinner {\n+ display: none;\n+ color: white;\n+ margin-right: 10px;\n+ }\n+\n#editor_run_button {\nborder: none;\nbackground-color: #06a284ff;\n@@ -53,5 +59,10 @@ body,\ncursor: pointer;\nbackground-color: #05856dff;\n}\n+\n+ #editor_run_button:disabled {\n+ background-color: #05856dff;\n+ cursor: normal;\n+ }\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "new_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "diff": "</div>\n<div class=\"col-12 col-md-4 programming__editor\">\n<textarea id=\"codemirror_editor\"></textarea>\n- <div class=\"programming__submit d-flex justify-content-start\">\n- <button id=\"editor_run_button\" >RUN</button>\n+ <div class=\"programming__submit d-flex justify-content-between align-items-center\">\n+ <button id=\"editor_run_button\" >CHECK</button>\n+ <div class=\"code_running_spinner spinner-grow\" role=\"status\">\n+ <span class=\"sr-only\">Loading...</span>\n+</div>\n</div>\n</div>\n" } ]
Python
MIT License
uccser/cs-unplugged
Disable submit button and add spinner during request to jobe
701,848
02.04.2020 21:58:01
-46,800
e94c9521293baeeb5c582c289a3a01a6df61025d
Add Jobe URLS to settings
[ { "change_type": "MODIFY", "old_path": "csunplugged/config/settings/local.py", "new_path": "csunplugged/config/settings/local.py", "diff": "@@ -88,3 +88,7 @@ TEST_RUNNER = \"django.test.runner.DiscoverRunner\"\n# Your local stuff: Below this line define 3rd party library settings\n# ----------------------------------------------------------------------------\nINSTALLED_APPS += [\"dev.apps.DevConfig\"] # noqa: F405\n+\n+# Jobe Server\n+JOBE_SERVER_URL = \"http://jobeinabox\"\n+JOBE_PROXY_URL = \"http://localhost/en/pluggingitin/jobe_proxy\"\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/config/settings/production.py", "new_path": "csunplugged/config/settings/production.py", "diff": "@@ -62,3 +62,7 @@ SECURE_SSL_REDIRECT = env.bool(\"DJANGO_SECURE_SSL_REDIRECT\", default=True) # no\nCSRF_COOKIE_SECURE = True\nCSRF_COOKIE_HTTPONLY = True\nX_FRAME_OPTIONS = \"DENY\"\n+\n+# Jobe Server\n+JOBE_SERVER_URL = \"http://jobe2.cosc.canterbury.ac.nz\"\n+JOBE_PROXY_URL = \"\"\n" } ]
Python
MIT License
uccser/cs-unplugged
Add Jobe URLS to settings
701,848
02.04.2020 21:58:30
-46,800
38748df556c633d287adb946ea1de2cb7bdd9f90
Adding proxy for Jobe server
[ { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/urls.py", "new_path": "csunplugged/pluggingitin/urls.py", "diff": "@@ -16,8 +16,13 @@ urlpatterns = [\nname=\"topic\"\n),\nurl(\n- r\"^(?P<topic_slug>[-\\w]+)/(?P<programming_challenge_slug>[-\\w]+)/$\", # noqa: E501\n+ r\"^(?P<topic_slug>[-\\w]+)/(?P<programming_challenge_slug>[-\\w]+)/$\",\nviews.ProgrammingChallengeView.as_view(),\nname=\"programming_challenge\"\n),\n+ url(\n+ r\"^jobe_proxy$\",\n+ views.JobeProxyView.as_view(),\n+ name=\"jobe_proxy\"\n+ ),\n]\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/views.py", "new_path": "csunplugged/pluggingitin/views.py", "diff": "from django.http import HttpResponse\nimport json\n+import requests\n+import os\n+\nfrom topics.utils.add_lesson_ages_to_objects import add_lesson_ages_to_objects\nfrom django.shortcuts import get_object_or_404\nfrom django.views import generic\n+from django.views import View\n+from django.conf import settings\nfrom utils.translated_first import translated_first\nfrom topics.models import (\nTopic,\n@@ -11,6 +16,7 @@ from topics.models import (\nProgrammingChallengeNumber\n)\n+import http.client\nclass IndexView(generic.ListView):\n\"\"\"View for the topics application homepage.\"\"\"\n@@ -96,4 +102,29 @@ class ProgrammingChallengeView(generic.DetailView):\ncontext[\"implementations\"] = self.object.ordered_implementations()\ncontext[\"test_cases_json\"] = json.dumps(list(self.object.oredered_test_cases().values()))\ncontext[\"test_cases\"] = self.object.oredered_test_cases().values()\n+ context[\"jobe_proxy_url\"] = settings.JOBE_PROXY_URL\n+\nreturn context\n+\n+\n+class JobeProxyView(View):\n+ \"\"\"Proxy for Jobe Server\n+ \"\"\"\n+\n+ def post(self, request, *args, **kwargs):\n+\n+ # Extracting data from the request body\n+ body_unicode = request.body.decode('utf-8')\n+ body = json.dumps(json.loads(body_unicode))\n+\n+ headers = {\"Content-type\": \"application/json; charset=utf-8\",\n+ \"Accept\": \"application/json\"}\n+\n+ # Set API key for production\n+ if hasattr(settings, 'JOBE_API_KEY'):\n+ headers[\"X-API-KEY\"] = settings.JOBE_API_KEY\n+\n+ response = requests.post(settings.JOBE_SERVER_URL + \"/jobe/index.php/restapi/runs/\", data=body, headers=headers)\n+ return HttpResponse(response.text)\n+\n+\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/js/test-code.js", "new_path": "csunplugged/static/js/test-code.js", "diff": "-const JOBE_SERVER = \"http://localhost:4000/jobe/index.php/restapi/runs/\";\n+const JOBE_SERVER = jobe_proxy_url;\nasync function run_code(program, givenInput, questionType) {\nlet data = {\n@@ -14,7 +14,8 @@ async function run_code(program, givenInput, questionType) {\nmethod: \"POST\",\nheaders: {\n\"Content-type\": \"application/json; charset=utf-8\",\n- Accept: \"application/json\"\n+ Accept: \"application/json\",\n+ \"X-CSRFToken\": csrf_token\n},\nbody: JSON.stringify(data)\n});\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "new_path": "csunplugged/templates/pluggingitin/programming-challenge.html", "diff": "<script type=\"text/javascript\">\nlet test_cases = {{ test_cases_json|safe }};\n+ let csrf_token = '{{ csrf_token }}';\n+ let jobe_proxy_url = '{{ jobe_proxy_url }}'\n</script>\n<script src=\"{% static 'js/jobe-editor.js' %}\"></script>\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding proxy for Jobe server
701,848
02.04.2020 22:09:50
-46,800
fd958eaabff20856c0d53d1328a2e3843e74dfe7
Connecting plugging it in to home page
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/website.scss", "new_path": "csunplugged/static/scss/website.scss", "diff": "@@ -484,10 +484,9 @@ ol, ul {\n}\n&-student-1 {\nborder-top-color: $student-colour;\n- cursor: not-allowed;\n- // &:hover {\n- // background-color: mix($student-colour, $white, 10%);\n- // }\n+ &:hover {\n+ background-color: mix($student-colour, $white, 10%);\n+ }\n}\n&-orange {\nborder-top-color: $orange;\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/base-students.html", "new_path": "csunplugged/templates/base-students.html", "diff": "{% get_language_info for LANGUAGE_CODE as current_language %}\n{% block navbar %}\n- <nav class=\"navbar fixed-top navbar-expand-md navbar-dark py-1 d-print-none{% block navbar_class_overrides %}{% endblock navbar_class_overrides %}\">\n+ <nav class=\"navbar navbar-student fixed-top navbar-expand-md navbar-dark py-1 d-print-none{% block navbar_class_overrides %}{% endblock navbar_class_overrides %}\">\n<div class=\"container px-0\">\n<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarNav\"\naria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/general/index.html", "new_path": "csunplugged/templates/general/index.html", "diff": "</div>\n<div class=\"col-12 col-md-4 mb-4\">\n<h2 class=\"student-colour\">For students</h2>\n- <a class=\"link-item link-item-top link-item-top-student-1 no-text-decoration d-block mb-3 unavailable\" href=\"#\">\n+ <a class=\"link-item link-item-top link-item-top-student-1 no-text-decoration d-block mb-3\" href=\"{% url 'pluggingitin:index' %}\">\n<h3 class=\"mb-0\">\n{% trans \"Plugging it in\" %}\n</h3>\n- <span class=\"badge badge-secondary\">Coming soon</span>\n+ <span class=\"badge badge-secondary\">In Progress</span>\n</a>\n</div>\n</div>\n" } ]
Python
MIT License
uccser/cs-unplugged
Connecting plugging it in to home page
701,848
03.04.2020 20:56:16
-46,800
13af83fae03ca68a36ee692af83bb701da33b502
Fix bug with input checking on frontend
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/test-code.js", "new_path": "csunplugged/static/js/test-code.js", "diff": "@@ -6,7 +6,7 @@ async function run_code(program, givenInput, questionType) {\nlanguage_id: \"python3\",\nsourcefilename: \"test.py\",\nsourcecode: program,\n- input: givenInput ? questionType == \"input\" : \"\"\n+ input: questionType == \"input\" ? givenInput : \"\"\n}\n};\n" } ]
Python
MIT License
uccser/cs-unplugged
Fix bug with input checking on frontend
701,848
04.04.2020 08:57:41
-46,800
50e8170c20e68186e65511523bef46c20684c8d1
Fixing up pep 8 formatting errors.
[ { "change_type": "DELETE", "old_path": "csunplugged/pluggingitin/admin.py", "new_path": null, "diff": "-from django.contrib import admin\n-\n-# Register your models here.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/models.py", "new_path": "csunplugged/pluggingitin/models.py", "diff": "@@ -2,6 +2,7 @@ from django.db import models\nfrom utils.TranslatableModel import TranslatableModel\nfrom topics.models import ProgrammingChallenge\n+\nclass TestCase(TranslatableModel):\n\"\"\"A test case for prgramming challenge question.\"\"\"\n@@ -18,4 +19,3 @@ class TestCase(TranslatableModel):\nclass Meta:\n\"\"\"Meta information for class.\"\"\"\nverbose_name = 'Test Case'\n-\n" }, { "change_type": "DELETE", "old_path": "csunplugged/pluggingitin/tests.py", "new_path": null, "diff": "-from django.test import TestCase\n-\n-# Create your tests here.\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/views.py", "new_path": "csunplugged/pluggingitin/views.py", "diff": "@@ -2,7 +2,6 @@ from django.http import HttpResponse\nimport json\nimport requests\n-import os\nfrom topics.utils.add_lesson_ages_to_objects import add_lesson_ages_to_objects\nfrom django.shortcuts import get_object_or_404\n@@ -13,10 +12,8 @@ from utils.translated_first import translated_first\nfrom topics.models import (\nTopic,\nProgrammingChallenge,\n- ProgrammingChallengeNumber\n)\n-import http.client\nclass IndexView(generic.ListView):\n\"\"\"View for the topics application homepage.\"\"\"\n@@ -124,7 +121,6 @@ class JobeProxyView(View):\nif hasattr(settings, 'JOBE_API_KEY'):\nheaders[\"X-API-KEY\"] = settings.JOBE_API_KEY\n- response = requests.post(settings.JOBE_SERVER_URL + \"/jobe/index.php/restapi/runs/\", data=body, headers=headers)\n+ response = requests.post(settings.JOBE_SERVER_URL + \"/jobe/index.php/restapi/runs/\",\n+ data=body, headers=headers)\nreturn HttpResponse(response.text)\n-\n-\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/models.py", "new_path": "csunplugged/topics/models.py", "diff": "@@ -245,7 +245,6 @@ class ProgrammingChallenge(TranslatableModel):\n\"\"\"\nreturn self.test_cases.all().select_related()\n-\ndef __str__(self):\n\"\"\"Text representation of ProgrammingChallenge object.\n" } ]
Python
MIT License
uccser/cs-unplugged
Fixing up pep 8 formatting errors.
701,848
04.04.2020 09:10:55
-46,800
84b6e32b04d42c65ae0f20cd9add2fd1dc46ac92
Adding in and fixing up doc strings where needed.
[ { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/__init__.py", "new_path": "csunplugged/pluggingitin/__init__.py", "diff": "+\"\"\"Module for the pluggingitin application.\"\"\"\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/apps.py", "new_path": "csunplugged/pluggingitin/apps.py", "diff": "+\"\"\"Application configuration for the pluggingitin application.\"\"\"\n+\nfrom django.apps import AppConfig\nclass PluggingitinConfig(AppConfig):\n+ \"\"\"Configuration object for the pluggingitin application.\"\"\"\n+\nname = 'pluggingitin'\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/models.py", "new_path": "csunplugged/pluggingitin/models.py", "diff": "+\"\"\"Models for the pluggingitin application.\"\"\"\n+\nfrom django.db import models\nfrom utils.TranslatableModel import TranslatableModel\nfrom topics.models import ProgrammingChallenge\nclass TestCase(TranslatableModel):\n- \"\"\"A test case for prgramming challenge question.\"\"\"\n+ \"\"\"Model for a test case linked to a programming challenge question.\"\"\"\nnumber = models.PositiveSmallIntegerField(default=1)\ntest_input = models.TextField(blank=True)\n@@ -18,4 +20,5 @@ class TestCase(TranslatableModel):\nclass Meta:\n\"\"\"Meta information for class.\"\"\"\n+\nverbose_name = 'Test Case'\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/urls.py", "new_path": "csunplugged/pluggingitin/urls.py", "diff": "+\"\"\"URL routing for the pluggingitin application.\"\"\"\n+\nfrom django.conf.urls import url\nfrom . import views\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/pluggingitin/views.py", "new_path": "csunplugged/pluggingitin/views.py", "diff": "+\"\"\"Views for the pluggingitin application.\"\"\"\n+\nfrom django.http import HttpResponse\nimport json\n@@ -105,11 +107,14 @@ class ProgrammingChallengeView(generic.DetailView):\nclass JobeProxyView(View):\n- \"\"\"Proxy for Jobe Server\n- \"\"\"\n+ \"\"\"Proxy for Jobe Server.\"\"\"\ndef post(self, request, *args, **kwargs):\n+ \"\"\"Forward on request to Jobe from the frontend and adds API key if this is needed.\n+ Returns:\n+ The response from the Jobe server.\n+ \"\"\"\n# Extracting data from the request body\nbody_unicode = request.body.decode('utf-8')\nbody = json.dumps(json.loads(body_unicode))\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding in and fixing up doc strings where needed.
701,848
04.04.2020 09:45:06
-46,800
f5f36ea2192acd4f01b7325c399527c1c195df15
Adding documentation to the javascript files for the code editor screen.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "-const code_tester = require('./test-code.js');\n-var CodeMirror = require('codemirror');\n-require('codemirror/mode/python/python.js');\n+// Scripts used to manage the UI functionality for the programming challenge editor screen.\n-// Set up code mirror\n+const code_tester = require(\"./test-code.js\");\n+var CodeMirror = require(\"codemirror\");\n+require(\"codemirror/mode/python/python.js\");\n+\n+// Set up code mirror editor\nlet myTextarea = document.getElementById(\"codemirror_editor\");\nlet myCodeMirror = CodeMirror.fromTextArea(myTextarea, {\nmode: {\n@@ -24,20 +26,27 @@ let myCodeMirror = CodeMirror.fromTextArea(myTextarea, {\n}\n});\n-// Send code to jobe and get a result\n+/**\n+ * Retrieves code from the code mirror editor, runs all the test cases then updates the results table.\n+ * Disables the \"CHECK\" button and shows a loading spinner while request is being processed.\n+ */\nfunction sendCodeToJobe() {\nlet code = myCodeMirror.getValue();\n- $(\"#editor_run_button\").prop('disabled', true);\n+ $(\"#editor_run_button\").prop(\"disabled\", true);\n$(\".code_running_spinner\").css(\"display\", \"inline-block\");\ncode_tester.run_all_testcases(code, test_cases).then(result => {\nupdateResultsTable(result);\n- $(\"#editor_run_button\").prop('disabled', false);\n+ $(\"#editor_run_button\").prop(\"disabled\", false);\n$(\".code_running_spinner\").css(\"display\", \"none\");\n});\n}\n+/**\n+ * Updates the results table given some test case results.\n+ * @param {Array} results An array of test case results.\n+ */\nfunction updateResultsTable(results) {\nfor (result of results) {\n// Update status cell\n@@ -66,5 +75,6 @@ function updateResultsTable(results) {\n}\n}\n+// Setting up event listener for the check button to run the code.\nlet submitButton = document.getElementById(\"editor_run_button\");\nsubmitButton.addEventListener(\"click\", sendCodeToJobe);\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/js/test-code.js", "new_path": "csunplugged/static/js/test-code.js", "diff": "+// Scripts used to manage code running and testing for the programming challenge editor screen.\n+\nconst JOBE_SERVER = jobe_proxy_url;\n+/**\n+ * Creates a request to the jobe proxy for the given program and input (if an 'input' question type). Recieves a response from jobe detailing if the code output\n+ * or if there was any errors.\n+ * @param {String} program The user code from the code mirror editor\n+ * @param {String} givenInput The given input for the test case being run.\n+ * @param {String} questionType The question type, used to determine whether the request should contain an 'input' field or not.\n+ * @return {Object} The response from the Jobe server.\n+ */\nasync function run_code(program, givenInput, questionType) {\n+ // Creates the run spec for Jobe\nlet data = {\nrun_spec: {\nlanguage_id: \"python3\",\n@@ -10,6 +21,7 @@ async function run_code(program, givenInput, questionType) {\n}\n};\n+ // Sends request to the Jobe proxy and recieves a result.\nlet response = await fetch(JOBE_SERVER, {\nmethod: \"POST\",\nheaders: {\n@@ -24,13 +36,31 @@ async function run_code(program, givenInput, questionType) {\nreturn result;\n}\n-async function run_testcase(userProgram, givenInput, expectedOutput, questionType) {\n+//\n+/**\n+ * Runs the code from the user program with some given input or function call.\n+ * Tests the output against some given expected output and returns a testCaseResult object.\n+ * @param {String} userProgram The user program from the code mirror editor.\n+ * @param {String} givenInput The given input or function call.\n+ * @param {String} expectedOutput The expected output for the given input.\n+ * @param {String} questionType Whether the question is either an 'input' type or a 'function' type. This changes how the code is run.\n+ * @return {Object} A test case result detailing if the code passed or if there was an error, the given input, user code output and expected output.\n+ */\n+async function run_testcase(\n+ userProgram,\n+ givenInput,\n+ expectedOutput,\n+ questionType\n+) {\n+ // Appends a function call to the end of the user call to test function type questions.\nif (questionType === \"function\") {\n- userProgram = userProgram.concat(\"\\n\" + givenInput)\n+ userProgram = userProgram.concat(\"\\n\" + givenInput);\n}\n+ // Send code to Jobe to get the code output.\nlet userResult = await run_code(userProgram, givenInput, questionType);\n+ // Test case result template\ntestcaseResult = {\nstatus: \"Passed\",\ninput: givenInput,\n@@ -40,8 +70,11 @@ async function run_testcase(userProgram, givenInput, expectedOutput, questionTyp\nif (userResult.outcome == 15) {\n// Outcome 15: Run Successfully\n- let userOutput = userResult.stdout.replace(/\\n$/, \"\")\n- if (userOutput === expectedOutput || (givenInput && userOutput.includes(expectedOutput))) {\n+ let userOutput = userResult.stdout.replace(/\\n$/, \"\");\n+ if (\n+ userOutput === expectedOutput ||\n+ (givenInput && userOutput.includes(expectedOutput))\n+ ) {\ntestcaseResult.userOutput = userOutput;\n} else {\ntestcaseResult.status = \"Failed\";\n@@ -60,6 +93,12 @@ async function run_testcase(userProgram, givenInput, expectedOutput, questionTyp\nreturn testcaseResult;\n}\n+/**\n+ * Runs all the test cases for the current challenge against the users program.\n+ * @param {String} userProgram The users code from the code mirror editor.\n+ * @param {Array} testCases A list of test case objects.\n+ * @return {Array} A list of all the test case results.\n+ */\nasync function run_all_testcases(userProgram, testCases) {\nallTestCaseResults = [];\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding documentation to the javascript files for the code editor screen.
701,848
06.04.2020 11:10:33
-43,200
f0b4b1300160c3435e53268836c61410dd331058
Remove unessarary content from students base template
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/base-students.html", "new_path": "csunplugged/templates/base-students.html", "diff": "</div>\n<div class=\"collapse navbar-collapse\" id=\"navbarNav\">\n<div class=\"navbar-nav navbar-nav-i18n mr-auto\">\n- <a class=\"nav-item nav-link\" href=\"{% url 'topics:index' %}\">{% trans \"Topics\" %}</a>\n- <a class=\"nav-item nav-link\" href=\"{% url 'resources:index' %}\">{% trans \"Printables\" %}</a>\n- <a class=\"nav-item nav-link\" href=\"{% url 'general:about' %}\">{% trans \"About\" %}</a>\n- </div>\n- {% if LANGUAGE_CODE == \"en\" %}\n- <!-- Search is only currently available in English, see https://github.com/uccser/cs-unplugged/issues/989 -->\n- <form method=\"get\" action=\"{% url 'search:index' %}\">\n- <div class=\"input-group\" id=\"search-navbar\">\n- <input type=\"text\" class=\"form-control form-control-sm border-0\" placeholder=\"Search\"\n- aria-label=\"Search\" name=\"q\">\n- <div class=\"input-group-append\">\n- <button class=\"btn btn-outline-light btn-sm\" type=\"submit\">\n- <!-- SVG from Icomoon-Free -->\n- <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\"\n- viewBox=\"0 0 32 32\" class=\"icon icon-search\">\n- <title>{% trans \"Search\" %}</title>\n- <path\n- d=\"M31.008 27.231l-7.58-6.447c-0.784-0.705-1.622-1.029-2.299-0.998 1.789-2.096 2.87-4.815 2.87-7.787 0-6.627-5.373-12-12-12s-12 5.373-12 12 5.373 12 12 12c2.972 0 5.691-1.081 7.787-2.87-0.031 0.677 0.293 1.515 0.998 2.299l6.447 7.58c1.104 1.226 2.907 1.33 4.007 0.23s0.997-2.903-0.23-4.007zM12 20c-4.418 0-8-3.582-8-8s3.582-8 8-8 8 3.582 8 8-3.582 8-8 8z\">\n- </path>\n- </svg>\n- </button>\n- </div>\n+ <a class=\"nav-item nav-link\" href=\"{% url 'general:home' %}\">\n+ <small>\n+ {% trans \"Back to CS Unplugged\" %}\n+ </small>\n+ </a>\n</div>\n- </form>\n- {% endif %}\n</div>\n</div>\n</nav>\n" } ]
Python
MIT License
uccser/cs-unplugged
Remove unessarary content from students base template
701,848
06.04.2020 11:21:47
-43,200
8f99a20bbaa091a94e912aa2780cbb8c25eb7e56
Renaming programming challenge test case query method
[ { "change_type": "MODIFY", "old_path": "csunplugged/plugging_it_in/views.py", "new_path": "csunplugged/plugging_it_in/views.py", "diff": "@@ -99,8 +99,8 @@ class ProgrammingChallengeView(generic.DetailView):\n# Add all the connected learning outcomes\ncontext[\"learning_outcomes\"] = self.object.learning_outcomes(manager=\"translated_objects\").order_by(\"text\")\ncontext[\"implementations\"] = self.object.ordered_implementations()\n- context[\"test_cases_json\"] = json.dumps(list(self.object.oredered_test_cases().values()))\n- context[\"test_cases\"] = self.object.oredered_test_cases().values()\n+ context[\"test_cases_json\"] = json.dumps(list(self.object.related_test_cases().values()))\n+ context[\"test_cases\"] = self.object.related_test_cases().values()\ncontext[\"jobe_proxy_url\"] = settings.JOBE_PROXY_URL\nreturn context\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/models.py", "new_path": "csunplugged/topics/models.py", "diff": "@@ -237,7 +237,7 @@ class ProgrammingChallenge(TranslatableModel):\n\"\"\"\nreturn self.implementations.all().order_by(\"language__number\").select_related()\n- def oredered_test_cases(self):\n+ def related_test_cases(self):\n\"\"\"Return a QuerySet of test cases.\nReturns:\n" } ]
Python
MIT License
uccser/cs-unplugged
Renaming programming challenge test case query method
701,848
06.04.2020 11:22:16
-43,200
c198daedcf216cd596f1165939c6d5eba481b8de
Fixing up codemirror import
[ { "change_type": "MODIFY", "old_path": "csunplugged/package.json", "new_path": "csunplugged/package.json", "diff": "\"details-element-polyfill\": \"2.4.0\",\n\"popper.js\": \"1.15.0\",\n\"jquery\": \"3.4.1\",\n- \"codemirror\": \"^5.52.2\"\n+ \"codemirror\": \"5.52.2\"\n},\n\"devDependencies\": {\n\"autoprefixer\": \"9.5.1\",\n" } ]
Python
MIT License
uccser/cs-unplugged
Fixing up codemirror import
701,848
06.04.2020 12:32:55
-43,200
626b40088167ad2eb580bd7f9b3b8dc3adf9c99a
Adding in temporary demo progamming exercises to index
[ { "change_type": "MODIFY", "old_path": "csunplugged/plugging_it_in/views.py", "new_path": "csunplugged/plugging_it_in/views.py", "diff": "@@ -43,6 +43,10 @@ class IndexView(generic.ListView):\n# Call the base implementation first to get a context\ncontext = super(IndexView, self).get_context_data(**kwargs)\nadd_lesson_ages_to_objects(self.object_list)\n+\n+ # Add in a QuerySet of all the demo programming exercises (Temporary)\n+ demo_challenge_ids = {1, 4, 8, 13, 15, 20}\n+ context[\"demo_programming_challenges\"] = ProgrammingChallenge.objects.filter(id__in=demo_challenge_ids)\nreturn context\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/index.html", "new_path": "csunplugged/templates/plugging_it_in/index.html", "diff": "{% block content %}\n{% if programming_topics %}\n<p>{% trans \"[PLUGGING IT IN BLURB.....] Lorem ipsum dolor sit amet, nec metus leo pulvinar urna. Vestibulum ut, wisi neque rutrum. Euismod volutpat integer libero justo, sit erat dapibus tortor duis arcu elit, class nisl massa dictum eleifend adipiscing, a nec ridiculus risus egestas augue id. Ligula non nulla at curabitur feugiat, vestibulum sit at vestibulum nam arcu.\" %}</p>\n+\n+ <h2 class=\"mt-4\">Demo Programming Challenges</h2>\n+ {% if demo_programming_challenges %}\n+ {% include \"plugging_it_in/programming-challenges-table-demo-temp.html\" %}\n+ {% else %}\n+ <p>{% blocktrans trimmed %}No demo programming challenges.{% endblocktrans %}</p>\n+ {% endif %}\n+\n+ <h2 class=\"mt-5\">Topics</h2>\n<div class=\"row justify-content-between\">\n{% for topic in programming_topics %}\n{% if topic.programming_challenges.exists %}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/templates/plugging_it_in/programming-challenges-table-demo-temp.html", "diff": "+{% load static %}\n+\n+{% load i18n %}\n+\n+<table class=\"table table-responsive table-center-vertical mt-3\">\n+ <thead class=\"thead-default\">\n+ <tr>\n+ <th class=\"text-center\">{% trans \"Number\" %}</th>\n+ <th>{% trans \"Name\" %}</th>\n+ <th class=\"text-center\">{% trans \"Challenge Level\" %}</th>\n+ </tr>\n+ </thead>\n+ <tbody>\n+ {% for programming_challenge in demo_programming_challenges %}\n+ <tr class=\"align-middle{% if not programming_challenge.translation_available %} table-active{% endif %}\">\n+ <td class=\"text-center\">\n+ {{ programming_challenge.id }}\n+ </td>\n+ <td>\n+ {% if not programming_challenge.translation_available %}\n+ {% include \"generic/not-available-badge.html\" %}\n+ <br>\n+ {% endif %}\n+ <a href=\"{% url 'plugging_it_in:programming_challenge' programming_challenge.topic.slug programming_challenge.slug %}\">\n+ <strong>\n+ {{ programming_challenge.name }}\n+ </strong>\n+ </a>\n+ </td>\n+ <td class=\"text-center\">\n+ {% include \"topics/programming-difficulty-badge.html\" %}\n+ </td>\n+ </tr>\n+ {% endfor %}\n+ </tbody>\n+</table>\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding in temporary demo progamming exercises to index
701,848
06.04.2020 13:48:14
-43,200
bf268f8115fe1c5085f0cd27899db1c7f9e3e684
Replacing user input prompt to be empty and checking exact outputs.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "@@ -31,7 +31,9 @@ let myCodeMirror = CodeMirror.fromTextArea(myTextarea, {\n* Disables the \"CHECK\" button and shows a loading spinner while request is being processed.\n*/\nfunction sendCodeToJobe() {\n- let code = myCodeMirror.getValue();\n+ // Replaces all user input parameters to be blank so it matches the expected output\n+ // Takes into consideration cases input(\"thing)\"), input('thing)'), input(thing) and int(input(thing))\n+ let code = myCodeMirror.getValue().replace(/(input\\(\"[^\"]+\"\\)|input\\('[^']+'\\)|input\\([^)]+\\))/mg, 'input()');\n$(\"#editor_run_button\").prop(\"disabled\", true);\n$(\".code_running_spinner\").css(\"display\", \"inline-block\");\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/js/test-code.js", "new_path": "csunplugged/static/js/test-code.js", "diff": "@@ -72,9 +72,8 @@ async function run_testcase(\n// Outcome 15: Run Successfully\nlet userOutput = userResult.stdout.replace(/\\n$/, \"\");\nif (\n- userOutput === expectedOutput ||\n- (givenInput && userOutput.includes(expectedOutput))\n- ) {\n+ userOutput === expectedOutput)\n+ {\ntestcaseResult.userOutput = userOutput;\n} else {\ntestcaseResult.status = \"Failed\";\n" } ]
Python
MIT License
uccser/cs-unplugged
Replacing user input prompt to be empty and checking exact outputs.
701,848
06.04.2020 14:10:34
-43,200
6c95c2e9faa0a6b5504f9c3e2373c1e1945bc17a
Remove learning outcomes from editor screen
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "<strong>{% trans \"Challenge Level:\" %}</strong> {{ programming_challenge.difficulty.name }}\n</p>\n{% endif %}\n-\n- {% if learning_outcomes %}\n- <details class=\"panel-learning-outcomes\">\n- <summary>\n- <strong>{% trans \"Learning outcomes\" %}</strong>\n- <img class=\"inline-image\" src=\"{% static 'img/general/outcomes.png' %}\">\n- </summary>\n- <div class=\"boxed-text-content\">\n- <p>{% trans \"Students will be able to:\" %}</p>\n- <ul>\n- {% for learning_outcome in learning_outcomes %}\n- <li>\n- {{ learning_outcome.text }}<br>\n- {% for area in learning_outcome.curriculum_areas.all %}\n- {% include \"topics/curriculum-area-badge.html\" %}\n- {% endfor %}\n- </li>\n- {% endfor %}\n- </ul>\n- </div>\n- </details>\n- {% endif %}\n-\n{% render_html_field programming_challenge.content %}\n</div>\n<div class=\"col-12 col-md-4 programming__editor\">\n" } ]
Python
MIT License
uccser/cs-unplugged
Remove learning outcomes from editor screen
701,848
27.06.2020 17:35:11
-43,200
6cb07fbcbeb741cd8c09856882ccb75655330f79
Add lessons page and navigation to plugging it in.
[ { "change_type": "MODIFY", "old_path": "csunplugged/plugging_it_in/urls.py", "new_path": "csunplugged/plugging_it_in/urls.py", "diff": "@@ -18,7 +18,12 @@ urlpatterns = [\nname=\"topic\"\n),\nurl(\n- r\"^(?P<topic_slug>[-\\w]+)/(?P<programming_challenge_slug>[-\\w]+)/$\",\n+ r\"^(?P<topic_slug>[-\\w]+)/(?P<lesson_slug>[-\\w]+)/$\",\n+ views.LessonView.as_view(),\n+ name=\"lesson\"\n+ ),\n+ url(\n+ r\"^(?P<topic_slug>[-\\w]+)/(?P<lesson_slug>[-\\w]+)/(?P<programming_challenge_slug>[-\\w]+)/$\",\nviews.ProgrammingChallengeView.as_view(),\nname=\"programming_challenge\"\n),\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/plugging_it_in/views.py", "new_path": "csunplugged/plugging_it_in/views.py", "diff": "@@ -5,16 +5,19 @@ from django.http import HttpResponse\nimport json\nimport requests\n-from topics.utils.add_lesson_ages_to_objects import add_lesson_ages_to_objects\nfrom django.shortcuts import get_object_or_404\nfrom django.views import generic\nfrom django.views import View\nfrom django.urls import reverse\nfrom django.conf import settings\n+from topics.utils.add_lesson_ages_to_objects import add_lesson_ages_to_objects\nfrom utils.translated_first import translated_first\n+from utils.group_lessons_by_age import group_lessons_by_age\nfrom topics.models import (\nTopic,\nProgrammingChallenge,\n+ UnitPlan,\n+ Lesson\n)\n@@ -50,28 +53,63 @@ class IndexView(generic.ListView):\ncontext[\"demo_programming_challenges\"] = ProgrammingChallenge.objects.filter(id__in=demo_challenge_ids)\nreturn context\n-\nclass TopicView(generic.DetailView):\n- \"\"\"View for a specific topic.\"\"\"\n+ \"\"\"View of lessons with programming exercises for a particular topic.\"\"\"\n- model = Topic\n+ model = UnitPlan\ntemplate_name = \"plugging_it_in/topic.html\"\nslug_url_kwarg = \"topic_slug\"\n+ context_object_name = \"topic\"\n+\n+ def get_object(self, **kwargs):\n+ \"\"\"Retrieve object for the unit plan view.\n+\n+ Returns:\n+ UnitPlan object, or raises 404 error if not found.\n+ \"\"\"\n+ return get_object_or_404(\n+ self.model.objects.select_related(),\n+ topic__slug=self.kwargs.get(\"topic_slug\", None)\n+ )\ndef get_context_data(self, **kwargs):\n- \"\"\"Provide the context data for the topic view.\n+ \"\"\"Provide the context data for the lessons view.\nReturns:\nDictionary of context data.\n\"\"\"\n# Call the base implementation first to get a context\ncontext = super(TopicView, self).get_context_data(**kwargs)\n+ # Loading object under consistent context names for breadcrumbs\n+ context[\"topic\"] = self.object.topic\n+ # Add all the connected lessons\n+ context[\"grouped_lessons\"] = group_lessons_by_age(self.object.lessons.all(), only_programming_exercises=True)\n+ return context\n+\n+class LessonView(generic.DetailView):\n+ \"\"\"View for a specific lesson.\"\"\"\n+\n+ model = Lesson\n+ template_name = \"plugging_it_in/lesson.html\"\n+ slug_url_kwarg = \"lesson_slug\"\n+\n+ def get_context_data(self, **kwargs):\n+ \"\"\"Provide the context data for the topic view.\n+\n+ Returns:\n+ Dictionary of context data.\n+ \"\"\"\n+ # Call the base implementation first to get a context\n+ context = super(LessonView, self).get_context_data(**kwargs)\n+\n+ context[\"topic\"] = self.object.topic\n+\n+ context[\"lesson\"] = self.object\n# Add in a QuerySet of all the connected programming exercises for this topic\n- context[\"programming_challenges\"] = ProgrammingChallenge.objects.filter(topic=self.object)\n+ context[\"programming_challenges\"] = self.object.retrieve_related_programming_challenges()\nreturn context\n-\nclass ProgrammingChallengeView(generic.DetailView):\n\"\"\"View for a specific programming challenge.\"\"\"\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/templates/plugging_it_in/lesson.html", "diff": "+{% extends \"base-students.html\" %}\n+\n+{% load i18n %}\n+{% load static %}\n+{% load render_html_field %}\n+{% load django_bootstrap_breadcrumbs %}\n+\n+{% block title %}\n+ {{ topic.name }} Programming Exercises\n+{% endblock title %}\n+\n+{% block breadcrumbs %}\n+ {% breadcrumb \"Plugging It In\" \"plugging_it_in:index\" %}\n+ {% breadcrumb topic.name \"plugging_it_in:topic\" topic.slug %}\n+ {% breadcrumb lesson.name \"plugging_it_in:lesson\" lesson.slug %}\n+{% endblock breadcrumbs %}\n+\n+{% block page_heading %}\n+ <h1 id=\"{{ lesson.slug }}\">{{ lesson.name }} programming exercises</h1>\n+\n+{% endblock page_heading %}\n+\n+{% block content %}\n+ {% if programming_challenges %}\n+ {% include \"plugging_it_in/programming-challenges-table.html\" %}\n+ {% else %}\n+ <p>{% blocktrans trimmed %}No programming challenges for {{ topic }}.{% endblocktrans %}</p>\n+ {% endif %}\n+{% endblock content %}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/templates/plugging_it_in/lessons-table.html", "diff": "+{% load i18n %}\n+\n+{% get_current_language as LANGUAGE_CODE %}\n+\n+{% for age_group, lessons in grouped_lessons.items %}\n+ <table class=\"table table-responsive table-center-vertical\">\n+ <thead class=\"thead-default\">\n+ <tr>\n+ <th colspan=\"2\">\n+ {% blocktrans with lower=age_group.ages.lower upper=age_group.ages.upper trimmed %}\n+ Ages {{ lower }} to {{ upper }}\n+ {% endblocktrans %}\n+ </th>\n+ <th class=\"text-center\">{% trans \"Programming languages\" %}</th>\n+ </tr>\n+ </thead>\n+ <tbody>\n+ {% if age_group.description %}\n+ <tr class=\"align-middle\">\n+ <td colspan=\"3\" class=\"small\">\n+ {{ age_group.description }}\n+ </td>\n+ </tr>\n+ {% endif %}\n+ {% for lesson in lessons %}\n+ <tr class=\"align-middle{% if not lesson.translation_available %} table-active unavailable{% endif %}\">\n+ <td class=\"text-center\" style=\"width:10%\">\n+ {{ lesson.number }}\n+ </td>\n+ <td style=\"width:60%\">\n+ <a href=\"{% url 'plugging_it_in:lesson' topic.slug lesson.slug %}\">\n+ <strong>{{ lesson.name }}</strong>\n+ {% if not lesson.translation_available %}\n+ <br>\n+ {% include \"generic/not-available-badge.html\" %}\n+ {% endif %}\n+ </a>\n+ </td>\n+ <td class=\"text-center\" style=\"width:20%\">\n+ {% comment %} TODO {% endcomment %}\n+ {% comment %} {% for implementation in programming_challenge.ordered_implementations %}\n+ <img src=\"{% get_static_prefix %}{{ implementation.language.icon }}\" class=\"inline-image-small\" />\n+ {% endfor %} {% endcomment %}\n+ </td>\n+ </tr>\n+ {% endfor %}\n+ </tbody>\n+ </table>\n+{% endfor %}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenges-table.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenges-table.html", "diff": "{% include \"generic/not-available-badge.html\" %}\n<br>\n{% endif %}\n- <a href=\"{% url 'plugging_it_in:programming_challenge' topic.slug programming_challenge.slug %}\">\n+ <a href=\"{% url 'plugging_it_in:programming_challenge' topic.slug lesson.slug programming_challenge.slug %}\">\n<strong>\n{{ programming_challenge.name }}\n</strong>\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/topic.html", "new_path": "csunplugged/templates/plugging_it_in/topic.html", "diff": "{% load django_bootstrap_breadcrumbs %}\n{% block title %}\n- {{ topic.name }} Programming Exercises\n+ {{ topic.name }} lessons\n{% endblock title %}\n{% block breadcrumbs %}\n{% endblock breadcrumbs %}\n{% block page_heading %}\n- <h1 id=\"{{ topic.slug }}\">{{ topic.name }} Programming Exercises</h1>\n+ <h1 id=\"{{ topic.slug }}\">{{ topic.name }} lessons</h1>\n{% if not topic.translation_available %}\n{% url \"topics:index\" as url %}\n{% trans \"Return to list of topics\" as url_label %}\n{% endblock page_heading %}\n{% block content %}\n- {% if programming_challenges %}\n- {% include \"plugging_it_in/programming-challenges-table.html\" %}\n+ {% if grouped_lessons %}\n+ {% include \"plugging_it_in/lessons-table.html\" %}\n{% else %}\n- <p>{% blocktrans trimmed %}No programming challenges for {{ topic }}.{% endblocktrans %}</p>\n+ <p>{% blocktrans trimmed %}No lessons for {{ topic }}.{% endblocktrans %}</p>\n{% endif %}\n{% endblock content %}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/utils/group_lessons_by_age.py", "new_path": "csunplugged/utils/group_lessons_by_age.py", "diff": "@@ -7,7 +7,7 @@ from topics.models import (\n)\n-def group_lessons_by_age(lessons):\n+def group_lessons_by_age(lessons, only_programming_exercises=False):\n\"\"\"Return ordered groups of lessons.\nLessons are grouped by the lesson minimum age and maximum ages,\n@@ -25,6 +25,7 @@ def group_lessons_by_age(lessons):\ngrouped_lessons = OrderedDict()\nfor age_group in AgeGroup.objects.distinct():\nfor lesson in age_group.lessons.filter(id__in=lessons).order_by(\"lessonnumber\"):\n+ if not only_programming_exercises or (only_programming_exercises and lesson.has_programming_challenges()):\nlesson.number = LessonNumber.objects.get(lesson=lesson, age_group=age_group).number\nif age_group in grouped_lessons.keys():\ngrouped_lessons[age_group].append(lesson)\n" } ]
Python
MIT License
uccser/cs-unplugged
Add lessons page and navigation to plugging it in.
701,848
27.06.2020 17:42:11
-43,200
6dd35ecfb12a4c81a71015e5933535061735853f
Add "Start coding here" prompt in the code editor
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "{% render_html_field programming_challenge.content %}\n</div>\n<div class=\"col-12 col-md-4 programming__editor\">\n- <textarea id=\"codemirror_editor\"></textarea>\n+ <textarea id=\"codemirror_editor\"># Start Coding Here.</textarea>\n<div class=\"programming__submit d-flex justify-content-between align-items-center\">\n<button id=\"editor_run_button\" >CHECK</button>\n<div class=\"code_running_spinner spinner-grow\" role=\"status\">\n" } ]
Python
MIT License
uccser/cs-unplugged
Add "Start coding here" prompt in the code editor
701,848
27.06.2020 17:46:25
-43,200
5cd6ad6ecf02442a4e322bc107ef8a614473c581
Add learning outcomes to editor screen
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "<strong>{% trans \"Challenge Level:\" %}</strong> {{ programming_challenge.difficulty.name }}\n</p>\n{% endif %}\n+\n+ {% if learning_outcomes %}\n+ <details class=\"panel-learning-outcomes\">\n+ <summary>\n+ <strong>{% trans \"Learning outcomes\" %}</strong>\n+ <img class=\"inline-image\" src=\"{% static 'img/general/outcomes.png' %}\">\n+ </summary>\n+ <div class=\"boxed-text-content\">\n+ <p>{% trans \"Students will be able to:\" %}</p>\n+ <ul>\n+ {% for learning_outcome in learning_outcomes %}\n+ <li>\n+ {{ learning_outcome.text }}<br>\n+ {% for area in learning_outcome.curriculum_areas.all %}\n+ {% include \"topics/curriculum-area-badge.html\" %}\n+ {% endfor %}\n+ </li>\n+ {% endfor %}\n+ </ul>\n+ </div>\n+ </details>\n+ {% endif %}\n+\n{% render_html_field programming_challenge.content %}\n</div>\n<div class=\"col-12 col-md-4 programming__editor\">\n" } ]
Python
MIT License
uccser/cs-unplugged
Add learning outcomes to editor screen
701,848
27.06.2020 18:19:18
-43,200
4c3f99f1049a35ba9a1530a0ebdab791ce57c956
Add breadcrumbs to editor screen.
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "{% load i18n %}\n{% load static %}\n{% load render_html_field %}\n+{% load django_bootstrap_breadcrumbs %}\n{% block title %}\n{{ programming_challenge.name }}\n{% endblock title %}\n+{% block breadcrumbs %}\n+ {% breadcrumb \"Plugging It In\" \"plugging_it_in:index\" %}\n+ {% breadcrumb topic.name \"plugging_it_in:topic\" topic.slug %}\n+ {% comment %} Bit of an issue with relating back to a single lesson since there could be multiple. {% endcomment %}\n+ {% breadcrumb programming_challenge.name \"plugging_it_in:programming_challenge\" programming_challenge.slug %}\n+{% endblock breadcrumbs %}\n+\n{% block body_container %}\n<div class=\"row programming__challenge-screen\">\n{% if programming_challenge.translation_available %}\n<div class=\"col-12 col-md-4 programming__info-area\">\n+ {% render_breadcrumbs %}\n<h1>\n{{ programming_challenge.name }}\n</h1>\n" } ]
Python
MIT License
uccser/cs-unplugged
Add breadcrumbs to editor screen.
701,848
27.06.2020 18:20:05
-43,200
eae8ac191c918655c0dc584bc1619781654a0419
Add links back to related unplugged lessons from editor screen.
[ { "change_type": "MODIFY", "old_path": "csunplugged/plugging_it_in/views.py", "new_path": "csunplugged/plugging_it_in/views.py", "diff": "@@ -16,6 +16,7 @@ from utils.group_lessons_by_age import group_lessons_by_age\nfrom topics.models import (\nTopic,\nProgrammingChallenge,\n+ ProgrammingChallengeNumber,\nUnitPlan,\nLesson\n)\n@@ -139,7 +140,17 @@ class ProgrammingChallengeView(generic.DetailView):\ncontext = super(ProgrammingChallengeView, self).get_context_data(**kwargs)\ncontext[\"topic\"] = self.object.topic\n- # Add all the connected learning outcomes\n+\n+ # Getting the related lessons - there may be multiple\n+ context[\"lessons\"] = self.object.lessons.all()\n+ for lesson in context[\"lessons\"]:\n+ challenge_numbers = ProgrammingChallengeNumber.objects.get(\n+ lesson=lesson,\n+ programming_challenge=self.object\n+ )\n+ lesson.challenge_set_number = challenge_numbers.challenge_set_number\n+ lesson.challenge_number = challenge_numbers.challenge_number\n+\ncontext[\"learning_outcomes\"] = self.object.learning_outcomes(manager=\"translated_objects\").order_by(\"text\")\ncontext[\"implementations\"] = self.object.ordered_implementations()\ncontext[\"test_cases_json\"] = json.dumps(list(self.object.related_test_cases().values()))\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "</p>\n{% endif %}\n+ {% if lessons %}\n+ <div class=\"alert alert-info\" role=\"alert\">\n+ <p>{% trans \"This programming challenge is linked to the following lessons:\" %}</p>\n+\n+ <ul class=\"mb-0\">\n+ {% for lesson in lessons %}\n+ <li>\n+ <a href=\"{% url 'topics:lesson' topic.slug lesson.unit_plan.slug lesson.slug %}\">\n+ {% blocktrans with set_num=lesson.challenge_set_number chal_num=lesson.challenge_number name=lesson.name trimmed %}\n+ {{ name }}\n+ {% endblocktrans %}\n+ ({% for age_group in lesson.age_group.all %}{% blocktrans with lower=age_group.ages.lower upper=age_group.ages.upper trimmed %}{{ lower }} to {{ upper }}{% endblocktrans %}{% if not forloop.last %}, {% endif %}{% endfor %})\n+ </a>\n+ {% if not lesson.translation_available %}\n+ {% include 'generic/not-available-badge.html' %}\n+ {% endif %}\n+ </li>\n+ {% endfor %}\n+ </ul>\n+ </div>\n+ {% endif %}\n+\n{% if learning_outcomes %}\n<details class=\"panel-learning-outcomes\">\n<summary>\n" } ]
Python
MIT License
uccser/cs-unplugged
Add links back to related unplugged lessons from editor screen.
701,848
27.06.2020 20:28:05
-43,200
3f616daefe2304a3652d95748ba984570d62ae0d
Add button to download the editor code.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "@@ -77,6 +77,35 @@ function updateResultsTable(results) {\n}\n}\n+/**\n+ * Downloads text to a file.\n+ * @param {String} filename The filename of the file to be downloaded.\n+ * @param {string} text The text content of the file to be downloaded.\n+ */\n+function download(filename, text) {\n+ var element = document.createElement('a');\n+ element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));\n+ element.setAttribute('download', filename);\n+\n+ element.style.display = 'none';\n+ document.body.appendChild(element);\n+\n+ element.click();\n+\n+ document.body.removeChild(element);\n+}\n+\n+/**\n+ * Downloads the editor code to a file called code.py.\n+ */\n+function downloadCode() {\n+ download(\"code.py\", myCodeMirror.getValue());\n+}\n+\n// Setting up event listener for the check button to run the code.\nlet submitButton = document.getElementById(\"editor_run_button\");\nsubmitButton.addEventListener(\"click\", sendCodeToJobe);\n+\n+// Setting up event listener for the download button.\n+let downloadButton = document.getElementById(\"download_button\");\n+downloadButton.addEventListener(\"click\", downloadCode);\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@@ -34,30 +34,38 @@ body,\npadding: 0px;\n.CodeMirror {\n+ height: 92%;\nmargin: 0px;\n- height: 95%;\n}\n.programming__submit {\n- height: 5%;\n- background-color: #d6c1e1ff;\n+ height: 8%;\n+ background-color: white;\n.code_running_spinner {\ndisplay: none;\n- color: white;\n+ color: #06a284ff;\nmargin-right: 0.625rem;\n}\n- #editor_run_button {\n+ .programming__submit_options {\n+\n+ height: 100%;\n+ padding-left: 30px;\n+ align-items: center;\n+\n+ .editor_button {\nborder: none;\nbackground-color: #06a284ff;\ncolor: white;\n- height: 100%;\n- width: 20%;\n+ height: 60%;\n+ padding: 0px 20px;\n+ margin: 0px 10px;\n+ border-radius: 10px;\ntransition: ease-in;\n}\n- #editor_run_button:hover {\n+ .editor_button:hover {\ncursor: pointer;\nbackground-color: #05856dff;\n}\n@@ -68,3 +76,4 @@ body,\n}\n}\n}\n+}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "<div class=\"col-12 col-md-4 programming__editor\">\n<textarea id=\"codemirror_editor\"># Start Coding Here.</textarea>\n<div class=\"programming__submit d-flex justify-content-between align-items-center\">\n- <button id=\"editor_run_button\" >CHECK</button>\n+ <div class=\"programming__submit_options d-flex justify-content-start\">\n+ <button class=\"editor_button\" id=\"editor_run_button\" >CHECK</button>\n+ <button class=\"editor_button\" id=\"download_button\" >DOWNLOAD</button>\n+ </div>\n<div class=\"code_running_spinner spinner-grow\" role=\"status\">\n<span class=\"sr-only\">Loading...</span>\n</div>\n" } ]
Python
MIT License
uccser/cs-unplugged
Add button to download the editor code.
701,848
28.06.2020 09:40:00
-43,200
29ba15eb066819eb882aa216e300a8d852a25e84
Adding in breadcrumb relating to a single lesson from the editor.
[ { "change_type": "MODIFY", "old_path": "csunplugged/plugging_it_in/views.py", "new_path": "csunplugged/plugging_it_in/views.py", "diff": "@@ -140,6 +140,10 @@ class ProgrammingChallengeView(generic.DetailView):\ncontext = super(ProgrammingChallengeView, self).get_context_data(**kwargs)\ncontext[\"topic\"] = self.object.topic\n+ lessons = self.object.lessons.all()\n+ for lesson in lessons:\n+ if lesson.slug == self.kwargs.get(\"lesson_slug\", None):\n+ context[\"lesson\"] = lesson\n# Getting the related lessons - there may be multiple\ncontext[\"lessons\"] = self.object.lessons.all()\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/lesson.html", "new_path": "csunplugged/templates/plugging_it_in/lesson.html", "diff": "{% block breadcrumbs %}\n{% breadcrumb \"Plugging It In\" \"plugging_it_in:index\" %}\n{% breadcrumb topic.name \"plugging_it_in:topic\" topic.slug %}\n- {% breadcrumb lesson.name \"plugging_it_in:lesson\" lesson.slug %}\n+ {% breadcrumb lesson.name \"plugging_it_in:lesson\" topic.slug lesson.slug %}\n{% endblock breadcrumbs %}\n{% block page_heading %}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "{% block breadcrumbs %}\n{% breadcrumb \"Plugging It In\" \"plugging_it_in:index\" %}\n{% breadcrumb topic.name \"plugging_it_in:topic\" topic.slug %}\n- {% comment %} Bit of an issue with relating back to a single lesson since there could be multiple. {% endcomment %}\n- {% breadcrumb programming_challenge.name \"plugging_it_in:programming_challenge\" programming_challenge.slug %}\n+ {% breadcrumb lesson.name \"plugging_it_in:lesson\" topic.slug lesson.slug %}\n+ {% breadcrumb programming_challenge.name \"plugging_it_in:programming_challenge\" topic.slug lesson.slug programming_challenge.slug %}\n{% endblock breadcrumbs %}\n{% block body_container %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Adding in breadcrumb relating to a single lesson from the editor.
701,848
28.06.2020 18:18:06
-43,200
3861cff29f7df9c3475c91f12891b21f4e99f939
Add bottom lesson navigation bar.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@import \"node_modules/codemirror/lib/codemirror\";\nhtml,\n-body,\n-.programming__challenge-screen {\n+body {\nheight: 100%;\nwidth: 100%;\n}\n+.programming__challenge-screen {\n+ height: 93%;\n+ width: 100%;\n+}\n+\n+.programming__options {\n+ height: 7%;\n+ background-color: #28368f;\n+ color: white;\n+ margin-left: 0px;\n+\n+ .progression-options {\n+ .btn {\n+ border-radius: 20px;\n+ }\n+\n+ .prev {\n+ border: 2px solid white;\n+ }\n+\n+ .prev:hover {\n+ color: #28368f;\n+ background-color: white;\n+ }\n+\n+ .next {\n+ color: #28368f;\n+ background-color: #ffea00;\n+ }\n+ }\n+\n+ .lesson-link {\n+ font-size: 20px;\n+ }\n+\n+ .lesson-link:hover {\n+ cursor: pointer;\n+ }\n+\n+ .btn {\n+ margin-right: 20px;\n+ color: white;\n+ }\n+\n+ .lesson-nav {\n+ .btn:hover {\n+ color: white;\n+ }\n+ }\n+\n+ p {\n+ color: white;\n+ margin-bottom: 0px !important;\n+ }\n+}\n+\n#sponsor-logos {\ndisplay: none;\n}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/core.html", "new_path": "csunplugged/templates/core.html", "diff": "<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"{% static 'img/apple-touch-icon.png' %}\">\n<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"{% static 'img/favicon-32x32.png' %}\">\n<link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"{% static 'img/favicon-16x16.png' %}\">\n+ <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css\">\n<link rel=\"manifest\" href=\"{% static 'img/manifest.json' %}\">\n<link rel=\"mask-icon\" href=\"{% static 'img/safari-pinned-tab.svg' %}\" color=\"#ce2326\">\n<link rel=\"shortcut icon\" href=\"{% static 'img/favicon.ico' %}\">\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/index.html", "new_path": "csunplugged/templates/plugging_it_in/index.html", "diff": "{% if programming_topics %}\n<p>{% trans \"[PLUGGING IT IN BLURB.....] Lorem ipsum dolor sit amet, nec metus leo pulvinar urna. Vestibulum ut, wisi neque rutrum. Euismod volutpat integer libero justo, sit erat dapibus tortor duis arcu elit, class nisl massa dictum eleifend adipiscing, a nec ridiculus risus egestas augue id. Ligula non nulla at curabitur feugiat, vestibulum sit at vestibulum nam arcu.\" %}</p>\n- <h2 class=\"mt-4\">Demo Programming Challenges</h2>\n+ {% comment %} DEMO PROGRAMMING CHALENGES {% endcomment %}\n+ {% comment %} <h2 class=\"mt-4\">Demo Programming Challenges</h2>\n{% if demo_programming_challenges %}\n{% include \"plugging_it_in/programming-challenges-table-demo-temp.html\" %}\n{% else %}\n<p>{% blocktrans trimmed %}No demo programming challenges.{% endblocktrans %}</p>\n- {% endif %}\n+ {% endif %} {% endcomment %}\n<h2 class=\"mt-5\">Topics</h2>\n<div class=\"row justify-content-between\">\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "<div class=\"row programming__challenge-screen\">\n{% if programming_challenge.translation_available %}\n<div class=\"col-12 col-md-4 programming__info-area\">\n- {% render_breadcrumbs %}\n- <h1>\n- {{ programming_challenge.name }}\n- </h1>\n+\n{% if not programming_challenge.translation_available %}\n{% with model=programming_challenge parent=topic %}\n{% include 'topics/not-available-warning.html' %}\n{% endif %}\n</div>\n+<div class=\"col-12 row programming__options d-flex justify-content-between align-items-center\">\n+ <div class=\"col-4 lesson-nav d-flex justify-content-start align-items-center\">\n+ <button class=\"btn\"><i class=\"fa fa-bars\"></i></button>\n+ <p>{{programming_challenge.name}}</p>\n+ </div>\n+\n+ <div class=\"col-4 progression-options d-flex justify-content-around align-items-center\">\n+ <button class=\"btn prev\">Previous Challenge</button>\n+ <p>7/12</p>\n+ <button class=\"btn next\">Next Challenge</button>\n+ </div>\n+\n+ <a class=\"col-4 d-flex justify-content-end lesson-link\" href=\"{% url \"plugging_it_in:lesson\" topic.slug lesson.slug %}\">\n+ <p >{{lesson.name}}</p>\n+ </a>\n+</div>\n+\n{% endblock body_container %}\n{% block end_content %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Add bottom lesson navigation bar.
701,848
28.06.2020 18:19:35
-43,200
390c7f3eca9e730786654e787c00f98568a22e57
UI style update.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@@ -4,6 +4,7 @@ html,\nbody {\nheight: 100%;\nwidth: 100%;\n+ background-color: #e9f1fc;\n}\n.programming__challenge-screen {\n@@ -24,6 +25,7 @@ body {\n.prev {\nborder: 2px solid white;\n+ color: white;\n}\n.prev:hover {\n@@ -45,12 +47,13 @@ body {\ncursor: pointer;\n}\n+ .lesson-nav {\n.btn {\n- margin-right: 20px;\ncolor: white;\n+ margin-right: 20px;\n+ font-size: 20px;\n}\n- .lesson-nav {\n.btn:hover {\ncolor: white;\n}\n@@ -75,58 +78,80 @@ body {\n}\n.programming__info-area {\n- overflow-y: scroll;\n+ width: 100%;\nheight: 100%;\n+ padding: 20px 10px;\n+ padding-left: 20px;\n+\n+ .programming__info-area-content {\n+ background-color: white;\n+ overflow-y: scroll;\npadding: 1.25rem !important;\n+ height: 100%;\n+ width: 100%;\n+ border: 1px solid grey;\n+ border-radius: 15px;\n+ }\n+\n}\n.programming__results {\n- padding: 0px !important;\n+ padding: 20px 10px !important;\n+ padding-right: 20px !important;\n+\n+ .results-table {\n+ border: 1px solid grey;\n+ border-radius: 15px;\n+ background-color: white;\n+\n+ .table {\n+ margin-bottom: 0px;\n+ }\n+ }\n}\n.programming__editor {\nheight: 100%;\n- padding: 0px;\n+ padding: 20px 10px;\n.CodeMirror {\n- height: 92%;\n+ height: 93%;\nmargin: 0px;\n+ border: 1px solid grey;\n+ border-radius: 15px;\n}\n.programming__submit {\n- height: 8%;\n- background-color: white;\n+ height: 7%;\n.code_running_spinner {\ndisplay: none;\n- color: #06a284ff;\n+ color: #5a9fffff;\nmargin-right: 0.625rem;\n}\n.programming__submit_options {\n-\nheight: 100%;\n- padding-left: 30px;\n- align-items: center;\n+ align-items: flex-end;\n.editor_button {\nborder: none;\n- background-color: #06a284ff;\n+ background-color: #5a9fffff;\ncolor: white;\n- height: 60%;\n+ height: 80%;\npadding: 0px 20px;\nmargin: 0px 10px;\n- border-radius: 10px;\n+ border-radius: 20px;\ntransition: ease-in;\n}\n.editor_button:hover {\ncursor: pointer;\n- background-color: #05856dff;\n+ background-color: #1b7bffff;\n}\n#editor_run_button:disabled {\n- background-color: #05856dff;\n+ background-color: #a4caffff;\ncursor: normal;\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "{% if programming_challenge.translation_available %}\n<div class=\"col-12 col-md-4 programming__info-area\">\n+ <div class=\"programming__info-area-content\">\n{% if not programming_challenge.translation_available %}\n{% with model=programming_challenge parent=topic %}\n{% include 'topics/not-available-warning.html' %}\n{% render_html_field programming_challenge.content %}\n</div>\n+ </div>\n<div class=\"col-12 col-md-4 programming__editor\">\n<textarea id=\"codemirror_editor\"># Start Coding Here.</textarea>\n<div class=\"programming__submit d-flex justify-content-between align-items-center\">\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/results-table.html", "new_path": "csunplugged/templates/plugging_it_in/results-table.html", "diff": "-<div class=\"table-responsive\">\n+<div class=\"results-table table-responsive\">\n<table id=\"test-case-table\" class=\"table table-sm table-bordered\">\n<thead class=\"thead-light\">\n<tr>\n" } ]
Python
MIT License
uccser/cs-unplugged
UI style update.
701,848
29.06.2020 19:12:37
-43,200
fb2e43af3732c9627e3f53ef4fb35a9d1498905c
Add basic sidebar functionality.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "@@ -102,6 +102,19 @@ function downloadCode() {\ndownload(\"code.py\", myCodeMirror.getValue());\n}\n+// Side Navigation\n+function openNav() {\n+ document.getElementById(\"my_sidenav\").style.width = \"500px\";\n+ document.getElementById(\"sidebar_overlay\").style.zIndex = \"1031\";\n+ document.getElementById(\"sidebar_overlay\").style.opacity = \"0.6\";\n+}\n+\n+function closeNav() {\n+ document.getElementById(\"my_sidenav\").style.width = \"0\";\n+ document.getElementById(\"sidebar_overlay\").style.zIndex = \"0\";\n+ document.getElementById(\"sidebar_overlay\").style.opacity = \"0\";\n+}\n+\n// Setting up event listener for the check button to run the code.\nlet submitButton = document.getElementById(\"editor_run_button\");\nsubmitButton.addEventListener(\"click\", sendCodeToJobe);\n@@ -109,3 +122,12 @@ submitButton.addEventListener(\"click\", sendCodeToJobe);\n// Setting up event listener for the download button.\nlet downloadButton = document.getElementById(\"download_button\");\ndownloadButton.addEventListener(\"click\", downloadCode);\n+\n+// Setting up event listener for the download button.\n+let lessonsNavToggle = document.getElementById(\"lessons_nav_toggle\");\n+lessonsNavToggle.addEventListener(\"click\", openNav);\n+\n+// Setting up event listener for the download button.\n+let closeLessonsNav = document.getElementById(\"close_nav_button\");\n+closeLessonsNav.addEventListener(\"click\", closeNav);\n+\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@@ -157,3 +157,57 @@ body {\n}\n}\n}\n+\n+// Side Drawer\n+.sidenav {\n+ height: 100%;\n+ width: 0;\n+ position: fixed;\n+ z-index: 1032;\n+ top: 0;\n+ left: 0;\n+ background-color: white;\n+ overflow-x: hidden;\n+ transition: 0.5s;\n+ padding-top: 60px;\n+}\n+\n+#sidebar_overlay {\n+ height: 100%;\n+ width: 100%;\n+ position: fixed;\n+ z-index: 0;\n+ top: 0;\n+ left: 0;\n+ background-color: #111;\n+ opacity: 0;\n+ overflow-x: hidden;\n+ transition: opacity 0.5s;\n+ padding-top: 60px;\n+}\n+\n+.sidenav a {\n+ padding: 8px 8px 8px 32px;\n+ text-decoration: none;\n+ font-size: 25px;\n+ color: #818181;\n+ display: block;\n+ transition: 0.3s;\n+}\n+\n+.sidenav a:hover {\n+ color: #f1f1f1;\n+}\n+\n+.sidenav .closebtn {\n+ position: absolute;\n+ top: 0;\n+ right: 25px;\n+ font-size: 36px;\n+ margin-left: 50px;\n+}\n+\n+@media screen and (max-height: 450px) {\n+ .sidenav {padding-top: 15px;}\n+ .sidenav a {font-size: 18px;}\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "{% block body_container %}\n<div class=\"row programming__challenge-screen\">\n+\n+\n+<div id=\"my_sidenav\" class=\"sidenav\">\n+ <a href=\"javascript:void(0)\" class=\"closebtn\" id=\"close_nav_button\">&times;</a>\n+</div>\n+\n+<div id=\"sidebar_overlay\">\n+</div>\n+\n{% if programming_challenge.translation_available %}\n<div class=\"col-12 col-md-4 programming__info-area\">\n<div class=\"col-12 row programming__options d-flex justify-content-between align-items-center\">\n<div class=\"col-4 lesson-nav d-flex justify-content-start align-items-center\">\n- <button class=\"btn\"><i class=\"fa fa-bars\"></i></button>\n+ <button id=\"lessons_nav_toggle\" class=\"btn\"><i class=\"fa fa-bars\"></i></button>\n<p>{{programming_challenge.name}}</p>\n</div>\n" } ]
Python
MIT License
uccser/cs-unplugged
Add basic sidebar functionality.
701,848
29.06.2020 20:18:06
-43,200
4b4a2a51a88bed7b50255bfba58a257ee6ebe1c3
Add demo content and styling to the lesson challenges sidebar.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "@@ -123,11 +123,14 @@ submitButton.addEventListener(\"click\", sendCodeToJobe);\nlet downloadButton = document.getElementById(\"download_button\");\ndownloadButton.addEventListener(\"click\", downloadCode);\n-// Setting up event listener for the download button.\n+// Setting up event listener for opening the navigation bar.\nlet lessonsNavToggle = document.getElementById(\"lessons_nav_toggle\");\nlessonsNavToggle.addEventListener(\"click\", openNav);\n-// Setting up event listener for the download button.\n-let closeLessonsNav = document.getElementById(\"close_nav_button\");\n+// Setting up event listener for closing the navigation drawer.\n+let closeLessonsNav = document.getElementById(\"sidebar_overlay\");\ncloseLessonsNav.addEventListener(\"click\", closeNav);\n+let closeLessonsNavButton = document.getElementById(\"close_nav_button\");\n+closeLessonsNavButton.addEventListener(\"click\", closeNav);\n+\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@import \"node_modules/codemirror/lib/codemirror\";\n+$student-colour: #3044b3;\n+$student-colour-light: #5a9fffff;;\n+\nhtml,\nbody {\nheight: 100%;\n@@ -169,34 +172,56 @@ body {\nbackground-color: white;\noverflow-x: hidden;\ntransition: 0.5s;\n- padding-top: 60px;\n+ -webkit-box-shadow: 10px 0px 8px -3px rgba(0,1,17,0.27);\n+ -moz-box-shadow: 10px 0px 8px -3px rgba(0,1,17,0.27);\n+ box-shadow: 10px 0px 8px -3px rgba(0,1,17,0.27);\n+\n+ .sidebar-headings {\n+ padding: 20px 0px;\n+ background-color: rgb(248, 249, 250);\n}\n-#sidebar_overlay {\n- height: 100%;\n- width: 100%;\n- position: fixed;\n- z-index: 0;\n- top: 0;\n- left: 0;\n- background-color: #111;\n- opacity: 0;\n- overflow-x: hidden;\n- transition: opacity 0.5s;\n- padding-top: 60px;\n+ h5 {\n+ margin-bottom: 0px;\n+ }\n+\n+ h2, h5, p {\n+ padding-left: 20px;\n}\n-.sidenav a {\n- padding: 8px 8px 8px 32px;\n+ a:hover {\ntext-decoration: none;\n- font-size: 25px;\n- color: #818181;\n+ }\n+\n+ hr {\n+ height: 3px;\n+ margin-top: 0px;\n+ background: $student-colour-light;\n+ }\n+\n+ .challenges-heading {\n+ color: $student-colour;\n+ font-weight: bold;\n+ }\n+\n+ .challenges-list {\n+ padding: 0px;\n+ }\n+\n+}\n+\n+.sidenav li {\n+ padding: 8px 8px 8px 20px;\n+ text-decoration: none;\n+ font-size: 16px;\n+ color: rgb(33, 37, 41);\ndisplay: block;\ntransition: 0.3s;\n}\n-.sidenav a:hover {\n- color: #f1f1f1;\n+.sidenav li:hover {\n+ background-color: #e9f1fc;\n+ cursor: pointer;\n}\n.sidenav .closebtn {\n@@ -211,3 +236,16 @@ body {\n.sidenav {padding-top: 15px;}\n.sidenav a {font-size: 18px;}\n}\n+\n+#sidebar_overlay {\n+ height: 100%;\n+ width: 100%;\n+ position: fixed;\n+ z-index: 0;\n+ top: 0;\n+ left: 0;\n+ background-color: #111;\n+ opacity: 0;\n+ overflow-x: hidden;\n+ transition: opacity 0.5s;\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "<div id=\"my_sidenav\" class=\"sidenav\">\n<a href=\"javascript:void(0)\" class=\"closebtn\" id=\"close_nav_button\">&times;</a>\n+\n+ <div class='sidebar-headings'>\n+ <h2 class='lesson-heading'>{{lesson.name}}</h2>\n+ <h5 class='topic-subheading'>{{topic.name}}</h5>\n+ </div>\n+\n+ <hr>\n+\n+ <p class='challenges-heading'>Challenges</p>\n+ <ol class='challenges-list'>\n+ <li>1.1 Some cool challenge</li>\n+ <li>1.2 Another cool challenge</li>\n+ <li>2.3 Yet another cool challenge</li>\n+ </ol>\n</div>\n<div id=\"sidebar_overlay\">\n" } ]
Python
MIT License
uccser/cs-unplugged
Add demo content and styling to the lesson challenges sidebar.
701,848
29.06.2020 20:37:43
-43,200
61c20840d93cbe33944d6d0997340e40466ef3ce
Add challenge links in the sidebar.
[ { "change_type": "MODIFY", "old_path": "csunplugged/plugging_it_in/views.py", "new_path": "csunplugged/plugging_it_in/views.py", "diff": "@@ -144,6 +144,7 @@ class ProgrammingChallengeView(generic.DetailView):\nfor lesson in lessons:\nif lesson.slug == self.kwargs.get(\"lesson_slug\", None):\ncontext[\"lesson\"] = lesson\n+ context[\"programming_challenges\"] = lesson.retrieve_related_programming_challenges()\n# Getting the related lessons - there may be multiple\ncontext[\"lessons\"] = self.object.lessons.all()\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "@@ -104,7 +104,7 @@ function downloadCode() {\n// Side Navigation\nfunction openNav() {\n- document.getElementById(\"my_sidenav\").style.width = \"500px\";\n+ document.getElementById(\"my_sidenav\").style.width = \"800px\";\ndocument.getElementById(\"sidebar_overlay\").style.zIndex = \"1031\";\ndocument.getElementById(\"sidebar_overlay\").style.opacity = \"0.6\";\n}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@@ -211,7 +211,7 @@ body {\n}\n.sidenav li {\n- padding: 8px 8px 8px 20px;\n+ padding: 12px 8px 12px 20px;\ntext-decoration: none;\nfont-size: 16px;\ncolor: rgb(33, 37, 41);\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "<p class='challenges-heading'>Challenges</p>\n<ol class='challenges-list'>\n- <li>1.1 Some cool challenge</li>\n- <li>1.2 Another cool challenge</li>\n- <li>2.3 Yet another cool challenge</li>\n+ {% for programming_challenge in programming_challenges %}\n+ <a href=\"{% url 'plugging_it_in:programming_challenge' topic.slug lesson.slug programming_challenge.slug %}\">\n+ <li>{{ programming_challenge.challenge_set_number }}.{{ programming_challenge.challenge_number }} {{ programming_challenge.name }}</li>\n+ </a>\n+ {% endfor %}\n</ol>\n</div>\n" } ]
Python
MIT License
uccser/cs-unplugged
Add challenge links in the sidebar.
701,848
30.06.2020 22:19:47
-43,200
9d82e55cff7aceda404b48ebd5b14a00436c372b
Add challenge navigation using next and previous buttons.
[ { "change_type": "MODIFY", "old_path": "csunplugged/plugging_it_in/views.py", "new_path": "csunplugged/plugging_it_in/views.py", "diff": "@@ -145,6 +145,7 @@ class ProgrammingChallengeView(generic.DetailView):\nif lesson.slug == self.kwargs.get(\"lesson_slug\", None):\ncontext[\"lesson\"] = lesson\ncontext[\"programming_challenges\"] = lesson.retrieve_related_programming_challenges()\n+ context[\"programming_exercises_json\"] = json.dumps(list(lesson.retrieve_related_programming_challenges().values()))\n# Getting the related lessons - there may be multiple\ncontext[\"lessons\"] = self.object.lessons.all()\n" }, { "change_type": "ADD", "old_path": null, "new_path": "csunplugged/static/js/editor-options-menu.js", "diff": "+// Scripts used to manage the UI functionality for the programming challenge editor options bar.\n+\n+/**\n+ * Opens the challenge navigation drawer.\n+ */\n+function openNav() {\n+ document.getElementById(\"my_sidenav\").style.width = \"800px\";\n+ document.getElementById(\"sidebar_overlay\").style.zIndex = \"1031\";\n+ document.getElementById(\"sidebar_overlay\").style.opacity = \"0.6\";\n+}\n+\n+/**\n+ * Closes the challenge naviation drawer.\n+ */\n+function closeNav() {\n+ document.getElementById(\"my_sidenav\").style.width = \"0\";\n+ document.getElementById(\"sidebar_overlay\").style.zIndex = \"0\";\n+ document.getElementById(\"sidebar_overlay\").style.opacity = \"0\";\n+}\n+\n+// Setting up event listener for opening the navigation bar.\n+let lessonsNavToggle = document.getElementById(\"lessons_nav_toggle\");\n+lessonsNavToggle.addEventListener(\"click\", openNav);\n+\n+// Setting up event listener for closing the navigation drawer.\n+let closeLessonsNav = document.getElementById(\"sidebar_overlay\");\n+closeLessonsNav.addEventListener(\"click\", closeNav);\n+\n+let closeLessonsNavButton = document.getElementById(\"close_nav_button\");\n+closeLessonsNavButton.addEventListener(\"click\", closeNav);\n+\n+/**\n+ * Sets the link to the next challenge if it is not the last challenge.\n+ * @param {Number} index The index of the current challenge\n+ */\n+function setNextChallenge(index) {\n+ if (index !== programming_exercises.length-1) {\n+ const nextLesson = programming_exercises[index+1];\n+ const nextLessonUrl = lesson_url + nextLesson.slug;\n+ $(\"#next_challenge_button\").attr(\"href\", nextLessonUrl);\n+ }\n+}\n+\n+/**\n+ * Sets the link to the previous challenge if it is not the first challenge.\n+ * @param {Number} index The index of the current challenge\n+ */\n+function setPreviousChallenge(index) {\n+ if (index !== 0) {\n+ const prevLesson = programming_exercises[index-1];\n+ const prevLessonUrl = lesson_url + prevLesson.slug;\n+ $(\"#prev_challenge_button\").attr(\"href\", prevLessonUrl);\n+ }\n+}\n+\n+/**\n+ * Sets up the links to the next and previous exercises.\n+ * Also sets the text to show lesson progression.\n+ */\n+function setupLessonNav() {\n+ const isCurrentChallengeIndex = (element) => element.slug == current_challenge_slug;\n+ currentChallengeIndex = programming_exercises.findIndex(isCurrentChallengeIndex);\n+\n+ document.getElementById(\"challenge_progression_text\").innerHTML = currentChallengeIndex+1 + \"/\" + programming_exercises.length;\n+ setPreviousChallenge(currentChallengeIndex)\n+ setNextChallenge(currentChallengeIndex)\n+}\n+\n+// Apply the navigation setup\n+setupLessonNav()\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "@@ -102,19 +102,6 @@ function downloadCode() {\ndownload(\"code.py\", myCodeMirror.getValue());\n}\n-// Side Navigation\n-function openNav() {\n- document.getElementById(\"my_sidenav\").style.width = \"800px\";\n- document.getElementById(\"sidebar_overlay\").style.zIndex = \"1031\";\n- document.getElementById(\"sidebar_overlay\").style.opacity = \"0.6\";\n-}\n-\n-function closeNav() {\n- document.getElementById(\"my_sidenav\").style.width = \"0\";\n- document.getElementById(\"sidebar_overlay\").style.zIndex = \"0\";\n- document.getElementById(\"sidebar_overlay\").style.opacity = \"0\";\n-}\n-\n// Setting up event listener for the check button to run the code.\nlet submitButton = document.getElementById(\"editor_run_button\");\nsubmitButton.addEventListener(\"click\", sendCodeToJobe);\n@@ -122,15 +109,3 @@ submitButton.addEventListener(\"click\", sendCodeToJobe);\n// Setting up event listener for the download button.\nlet downloadButton = document.getElementById(\"download_button\");\ndownloadButton.addEventListener(\"click\", downloadCode);\n\\ No newline at end of file\n-\n-// Setting up event listener for opening the navigation bar.\n-let lessonsNavToggle = document.getElementById(\"lessons_nav_toggle\");\n-lessonsNavToggle.addEventListener(\"click\", openNav);\n-\n-// Setting up event listener for closing the navigation drawer.\n-let closeLessonsNav = document.getElementById(\"sidebar_overlay\");\n-closeLessonsNav.addEventListener(\"click\", closeNav);\n-\n-let closeLessonsNavButton = document.getElementById(\"close_nav_button\");\n-closeLessonsNavButton.addEventListener(\"click\", closeNav);\n-\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "</div>\n<div class=\"col-4 progression-options d-flex justify-content-around align-items-center\">\n+ <a id='prev_challenge_button'>\n<button class=\"btn prev\">Previous Challenge</button>\n- <p>7/12</p>\n+ </a>\n+ <p id=\"challenge_progression_text\"></p>\n+ <a id='next_challenge_button'>\n<button class=\"btn next\">Next Challenge</button>\n+ </a>\n</div>\n<a class=\"col-4 d-flex justify-content-end lesson-link\" href=\"{% url \"plugging_it_in:lesson\" topic.slug lesson.slug %}\">\n<link rel=\"stylesheet\" href=\"{% static 'css/programming-editor.css' %}\" >\n<script type=\"text/javascript\">\n+ let current_challenge_slug = '{{ programming_challenge.slug }}';\nlet test_cases = {{ test_cases_json|safe }};\n+ let programming_exercises = {{ programming_exercises_json|safe }};\n+ let lesson_url = \"{% url 'plugging_it_in:lesson' topic.slug lesson.slug %}\";\nlet csrf_token = '{{ csrf_token }}';\nlet jobe_proxy_url = '{{ jobe_proxy_url }}';\n</script>\n<script src=\"{% static 'js/jobe-editor.js' %}\"></script>\n+ <script src=\"{% static 'js/editor-options-menu.js' %}\"></script>\n{% endblock scripts %}\n" } ]
Python
MIT License
uccser/cs-unplugged
Add challenge navigation using next and previous buttons.
701,848
30.06.2020 22:27:20
-43,200
5e55e970344869e6095ffd220892e5289fd20169
Update download filename to the challenge slug.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/jobe-editor.js", "new_path": "csunplugged/static/js/jobe-editor.js", "diff": "@@ -99,7 +99,7 @@ function download(filename, text) {\n* Downloads the editor code to a file called code.py.\n*/\nfunction downloadCode() {\n- download(\"code.py\", myCodeMirror.getValue());\n+ download(current_challenge_slug + \".py\", myCodeMirror.getValue());\n}\n// Setting up event listener for the check button to run the code.\n" } ]
Python
MIT License
uccser/cs-unplugged
Update download filename to the challenge slug.
701,848
01.07.2020 08:45:28
-43,200
91e6578365abe4bc4ec2361b0dde4a34f41ce8bd
Add more specific error messages.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/test-code.js", "new_path": "csunplugged/static/js/test-code.js", "diff": "@@ -81,7 +81,11 @@ async function run_testcase(\n}\n} else if (userResult.outcome == 11) {\n// Outcome 11: Compiler Error\n- testcaseResult.status = \"Compiler Error\";\n+ testcaseResult.status = \"Syntax Error\";\n+ testcaseResult.userOutput = userResult.cmpinfo;\n+ } else if (userResult.outcome == 13) {\n+ // Outcome 13: Time limit exceeeded\n+ testcaseResult.status = \"Time limit exceeded\";\ntestcaseResult.userOutput = userResult.cmpinfo;\n} else {\n// Any other error\n" } ]
Python
MIT License
uccser/cs-unplugged
Add more specific error messages.
701,848
04.07.2020 08:25:33
-43,200
53e8821badf28e894178d5d74b416bcffd16cfb7
Add highlight to selected challenge in the side drawer.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@@ -208,6 +208,13 @@ body {\npadding: 0px;\n}\n+ .current-exercise {\n+ background-color: #e9f1fc;\n+ }\n+\n+ .current-exercise:hover {\n+ background-color: #e9f1fc;\n+ }\n}\n.sidenav li {\n@@ -220,7 +227,7 @@ body {\n}\n.sidenav li:hover {\n- background-color: #e9f1fc;\n+ background-color: #f4f7fcff;\ncursor: pointer;\n}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "<p class='challenges-heading'>Challenges</p>\n<ol class='challenges-list'>\n- {% for programming_challenge in programming_challenges %}\n- <a href=\"{% url 'plugging_it_in:programming_challenge' topic.slug lesson.slug programming_challenge.slug %}\">\n- <li>{{ programming_challenge.challenge_set_number }}.{{ programming_challenge.challenge_number }} {{ programming_challenge.name }}</li>\n+ {% for programming_challenge_item in programming_challenges %}\n+ <a href=\"{% url 'plugging_it_in:programming_challenge' topic.slug lesson.slug programming_challenge_item.slug %}\">\n+ <li class=\"{% if programming_challenge.slug == programming_challenge_item.slug %}current-exercise{% endif %}\">{{ programming_challenge_item.challenge_set_number }}.{{ programming_challenge_item.challenge_number }} {{ programming_challenge_item.name }}</li>\n</a>\n{% endfor %}\n</ol>\n" } ]
Python
MIT License
uccser/cs-unplugged
Add highlight to selected challenge in the side drawer.
701,848
04.07.2020 09:34:37
-43,200
44c30688385af66f4b7e5aed9c6d59867b1b811a
Remove test examples block from info area and replacing it with a reference to the test table.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/js/editor-options-menu.js", "new_path": "csunplugged/static/js/editor-options-menu.js", "diff": "@@ -68,3 +68,7 @@ function setupLessonNav() {\n// Apply the navigation setup\nsetupLessonNav()\n+\n+// Add testing examples info to the requirements block (temporary)\n+const static_requirement_info = \"Your program should display the outputs in the table (shown on the right) for the given inputs provided.\";\n+$(\"#requirement + p\").append(`</br></br> <p>${static_requirement_info}</p>`);\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@@ -96,6 +96,11 @@ body {\nborder-radius: 15px;\n}\n+ // Removing the testing examples section from content (temporary).\n+ #testing-examples, #testing-examples + p, #testing-examples + p + table {\n+ display: none;\n+ }\n+\n}\n.programming__results {\n" } ]
Python
MIT License
uccser/cs-unplugged
Remove test examples block from info area and replacing it with a reference to the test table.
701,848
04.07.2020 11:40:45
-43,200
c55921f4246a010c05f637b0aef916cf49e835ec
Update editor information area Add challenge tite Add challenge hints and link to solution Add static programming hints area (no content)
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "new_path": "csunplugged/templates/plugging_it_in/programming-challenge.html", "diff": "<div class=\"col-12 col-md-4 programming__info-area\">\n<div class=\"programming__info-area-content\">\n+ {% block page_heading %}\n+ <h1>\n+ {{ programming_challenge.name }}\n+ </h1>\n{% if not programming_challenge.translation_available %}\n{% with model=programming_challenge parent=topic %}\n{% include 'topics/not-available-warning.html' %}\n<strong>{% trans \"Challenge Level:\" %}</strong> {{ programming_challenge.difficulty.name }}\n</p>\n{% endif %}\n+ {% endblock page_heading %}\n{% if lessons %}\n<div class=\"alert alert-info\" role=\"alert\">\n- <p>{% trans \"This programming challenge is linked to the following lessons:\" %}</p>\n+ <p>{% trans \"This programming challenge is linked to the following unplugged lessons:\" %}</p>\n<ul class=\"mb-0\">\n{% for lesson in lessons %}\n</div>\n{% endif %}\n+\n+ {% render_html_field programming_challenge.content %}\n+\n+ {% comment %} Learning Outcomes {% endcomment %}\n{% if learning_outcomes %}\n<details class=\"panel-learning-outcomes\">\n<summary>\n</details>\n{% endif %}\n- {% render_html_field programming_challenge.content %}\n+ {% comment %} Challenge Hints {% endcomment %}\n+ {% for implementation in implementations %}\n+ {% if implementation.language.name == \"Python\" and implementation.hints %}\n+ <details>\n+ <summary>\n+ <strong>\n+ {% trans \"Hints\" %}\n+ </strong>\n+ </summary>\n+\n+ <div class=\"boxed-text-content\">\n+ {% render_html_field implementation.hints %}\n+ <p class=\"text-center\">\n+ {% comment %} Link to old solution - in topics section {% endcomment %}\n+ <a href=\"{% url 'topics:programming_challenge_solution' topic.slug programming_challenge.slug implementation.language.slug %}\">\n+ {% blocktrans trimmed %}\n+ Show {{ implementation.language.name }} solution\n+ {% endblocktrans %}\n+ </a>\n+ </p>\n+ </div>\n+ </details>\n+ {% endif %}\n+ {% endfor %}\n+\n+ {% comment %} Programming syntax reminders {% endcomment %}\n+ <details>\n+ <summary>\n+ <strong>{% trans \"Programming Reminders\" %}</strong>\n+ </summary>\n+ <div class=\"boxed-text-content\">\n+ <p>[Some static content here]</p>\n+ </div>\n+ </details>\n+\n</div>\n</div>\n<div class=\"col-12 col-md-4 programming__editor\">\n" } ]
Python
MIT License
uccser/cs-unplugged
Update editor information area - Add challenge tite - Add challenge hints and link to solution - Add static programming hints area (no content)
701,848
04.07.2020 16:06:16
-43,200
addf7b9375d9c7d8cc1e4eb5eb8a121ee62fa867
Update editor info scrollbar to only show if needed.
[ { "change_type": "MODIFY", "old_path": "csunplugged/static/scss/programming-editor.scss", "new_path": "csunplugged/static/scss/programming-editor.scss", "diff": "@@ -88,7 +88,7 @@ body {\n.programming__info-area-content {\nbackground-color: white;\n- overflow-y: scroll;\n+ overflow-y: auto;\npadding: 1.25rem !important;\nheight: 100%;\nwidth: 100%;\n" } ]
Python
MIT License
uccser/cs-unplugged
Update editor info scrollbar to only show if needed.
701,848
20.07.2020 11:09:15
-43,200
c2ec75cb4a1308c08f2dfb8924cd9533c4dfe37b
Fix style checker errors.
[ { "change_type": "MODIFY", "old_path": "csunplugged/plugging_it_in/views.py", "new_path": "csunplugged/plugging_it_in/views.py", "diff": "@@ -54,6 +54,7 @@ class IndexView(generic.ListView):\ncontext[\"demo_programming_challenges\"] = ProgrammingChallenge.objects.filter(id__in=demo_challenge_ids)\nreturn context\n+\nclass TopicView(generic.DetailView):\n\"\"\"View of lessons with programming exercises for a particular topic.\"\"\"\n@@ -87,6 +88,7 @@ class TopicView(generic.DetailView):\ncontext[\"grouped_lessons\"] = group_lessons_by_age(self.object.lessons.all(), only_programming_exercises=True)\nreturn context\n+\nclass LessonView(generic.DetailView):\n\"\"\"View for a specific lesson.\"\"\"\n@@ -111,6 +113,7 @@ class LessonView(generic.DetailView):\ncontext[\"programming_challenges\"] = self.object.retrieve_related_programming_challenges()\nreturn context\n+\nclass ProgrammingChallengeView(generic.DetailView):\n\"\"\"View for a specific programming challenge.\"\"\"\n@@ -145,7 +148,8 @@ class ProgrammingChallengeView(generic.DetailView):\nif lesson.slug == self.kwargs.get(\"lesson_slug\", None):\ncontext[\"lesson\"] = lesson\ncontext[\"programming_challenges\"] = lesson.retrieve_related_programming_challenges()\n- context[\"programming_exercises_json\"] = json.dumps(list(lesson.retrieve_related_programming_challenges().values()))\n+ context[\"programming_exercises_json\"] = json.dumps(\n+ list(lesson.retrieve_related_programming_challenges().values()))\n# Getting the related lessons - there may be multiple\ncontext[\"lessons\"] = self.object.lessons.all()\n" } ]
Python
MIT License
uccser/cs-unplugged
Fix style checker errors.
701,848
21.07.2020 10:45:38
-43,200
5d8e208fce201c7ec4bc608b185f47f51d2c23cb
Show icons for available programming languages in a lesson.
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/lessons-table.html", "new_path": "csunplugged/templates/plugging_it_in/lessons-table.html", "diff": "+{% load static %}\n+\n{% load i18n %}\n{% get_current_language as LANGUAGE_CODE %}\n</a>\n</td>\n<td class=\"text-center\" style=\"width:20%\">\n- {% comment %} TODO {% endcomment %}\n- {% comment %} {% for implementation in programming_challenge.ordered_implementations %}\n- <img src=\"{% get_static_prefix %}{{ implementation.language.icon }}\" class=\"inline-image-small\" />\n- {% endfor %} {% endcomment %}\n+ {% for language_icon in lesson.challenge_language_icons %}\n+ <img src=\"{% get_static_prefix %}{{ language_icon.implementations__language__icon }}\" class=\"inline-image-small\" />\n+ {% endfor %}\n</td>\n</tr>\n{% endfor %}\n" }, { "change_type": "MODIFY", "old_path": "csunplugged/topics/models.py", "new_path": "csunplugged/topics/models.py", "diff": "@@ -408,6 +408,14 @@ class Lesson(TranslatableModel):\nprogramming_challenge.challenge_number = challenge_numbers.challenge_number\nreturn programming_challenges\n+ def challenge_language_icons(self):\n+ \"\"\"Retrieve the lesson's programming challenge language icons.\n+\n+ Returns:\n+ QuerySet of language icons for this lesson.\n+ \"\"\"\n+ return self.programming_challenges.all().values('implementations__language__icon').distinct()\n+\ndef get_absolute_url(self):\n\"\"\"Return the canonical URL for a lesson.\n" } ]
Python
MIT License
uccser/cs-unplugged
Show icons for available programming languages in a lesson.
701,848
22.07.2020 08:50:55
-43,200
ecdb131a924576ca588ac58660cb08255e59f39a
Removing the demo programming challenges.
[ { "change_type": "MODIFY", "old_path": "csunplugged/templates/plugging_it_in/index.html", "new_path": "csunplugged/templates/plugging_it_in/index.html", "diff": "{% if programming_topics %}\n<p>{% trans \"[PLUGGING IT IN BLURB.....] Lorem ipsum dolor sit amet, nec metus leo pulvinar urna. Vestibulum ut, wisi neque rutrum. Euismod volutpat integer libero justo, sit erat dapibus tortor duis arcu elit, class nisl massa dictum eleifend adipiscing, a nec ridiculus risus egestas augue id. Ligula non nulla at curabitur feugiat, vestibulum sit at vestibulum nam arcu.\" %}</p>\n- {% comment %} DEMO PROGRAMMING CHALENGES {% endcomment %}\n- {% comment %} <h2 class=\"mt-4\">Demo Programming Challenges</h2>\n- {% if demo_programming_challenges %}\n- {% include \"plugging_it_in/programming-challenges-table-demo-temp.html\" %}\n- {% else %}\n- <p>{% blocktrans trimmed %}No demo programming challenges.{% endblocktrans %}</p>\n- {% endif %} {% endcomment %}\n-\n<h2 class=\"mt-5\">Topics</h2>\n<div class=\"row justify-content-between\">\n{% for topic in programming_topics %}\n" }, { "change_type": "DELETE", "old_path": "csunplugged/templates/plugging_it_in/programming-challenges-table-demo-temp.html", "new_path": null, "diff": "-{% load static %}\n-\n-{% load i18n %}\n-\n-<table class=\"table table-responsive table-center-vertical mt-3\">\n- <thead class=\"thead-default\">\n- <tr>\n- <th class=\"text-center\">{% trans \"Number\" %}</th>\n- <th>{% trans \"Name\" %}</th>\n- <th class=\"text-center\">{% trans \"Challenge Level\" %}</th>\n- </tr>\n- </thead>\n- <tbody>\n- {% for programming_challenge in demo_programming_challenges %}\n- <tr class=\"align-middle{% if not programming_challenge.translation_available %} table-active{% endif %}\">\n- <td class=\"text-center\">\n- {{ programming_challenge.id }}\n- </td>\n- <td>\n- {% if not programming_challenge.translation_available %}\n- {% include \"generic/not-available-badge.html\" %}\n- <br>\n- {% endif %}\n- <a href=\"{% url 'plugging_it_in:programming_challenge' programming_challenge.topic.slug programming_challenge.slug %}\">\n- <strong>\n- {{ programming_challenge.name }}\n- </strong>\n- </a>\n- </td>\n- <td class=\"text-center\">\n- {% include \"topics/programming-difficulty-badge.html\" %}\n- </td>\n- </tr>\n- {% endfor %}\n- </tbody>\n-</table>\n" } ]
Python
MIT License
uccser/cs-unplugged
Removing the demo programming challenges.