discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Compare sources to detect plagiarism

MH
Miro Hrončok
Wed, Dec 2, 2015 1:05 PM

Hi,
I have several dozens implementations of the same module (some of them
work as expected, some of them do not). Those were provided by
students as part of they assignment. Now I'd like to check if someone
didn't just copy-pasted his friends code and changed the variable
names etc.

I was thinking if comparing CSG tree would do the trick. Would
comparing two CSG trees with diff work? Or do I need to load the tree
to some dictionary-like structure and compare those?

Also, is there a command line way to export CSG tree?

Thanks for your tips.

Miro Hrončok

Telefon: +420777974800

Hi, I have several dozens implementations of the same module (some of them work as expected, some of them do not). Those were provided by students as part of they assignment. Now I'd like to check if someone didn't just copy-pasted his friends code and changed the variable names etc. I was thinking if comparing CSG tree would do the trick. Would comparing two CSG trees with diff work? Or do I need to load the tree to some dictionary-like structure and compare those? Also, is there a command line way to export CSG tree? Thanks for your tips. Miro Hrončok Telefon: +420777974800
FS
Felipe Sanches
Wed, Dec 2, 2015 1:26 PM

If I would do it, I would maybe write my own parser for the language and
them compare the AST (abstract syntactic tree) of each sample code.

On the other hand, you could encourage your students to share code and
improve upon the work of each other :-)

On Wed, Dec 2, 2015 at 11:05 AM, Miro Hrončok miro@hroncok.cz wrote:

Hi,
I have several dozens implementations of the same module (some of them
work as expected, some of them do not). Those were provided by
students as part of they assignment. Now I'd like to check if someone
didn't just copy-pasted his friends code and changed the variable
names etc.

I was thinking if comparing CSG tree would do the trick. Would
comparing two CSG trees with diff work? Or do I need to load the tree
to some dictionary-like structure and compare those?

Also, is there a command line way to export CSG tree?

Thanks for your tips.

Miro Hrončok

Telefon: +420777974800


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

If I would do it, I would maybe write my own parser for the language and them compare the AST (abstract syntactic tree) of each sample code. On the other hand, you could encourage your students to share code and improve upon the work of each other :-) On Wed, Dec 2, 2015 at 11:05 AM, Miro Hrončok <miro@hroncok.cz> wrote: > Hi, > I have several dozens implementations of the same module (some of them > work as expected, some of them do not). Those were provided by > students as part of they assignment. Now I'd like to check if someone > didn't just copy-pasted his friends code and changed the variable > names etc. > > I was thinking if comparing CSG tree would do the trick. Would > comparing two CSG trees with diff work? Or do I need to load the tree > to some dictionary-like structure and compare those? > > Also, is there a command line way to export CSG tree? > > Thanks for your tips. > > Miro Hrončok > > Telefon: +420777974800 > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
MH
Miro Hrončok
Wed, Dec 2, 2015 1:38 PM

If I would do it, I would maybe write my own parser for the language and
them compare the AST (abstract syntactic tree) of each sample code.

That's something I don't (yet) want to do, if there are other options.

On the other hand, you could encourage your students to share code and
improve upon the work of each other :-)

That's what would be great, but unfortunately very hard to evaluate :(

> If I would do it, I would maybe write my own parser for the language and > them compare the AST (abstract syntactic tree) of each sample code. That's something I don't (yet) want to do, if there are other options. > On the other hand, you could encourage your students to share code and > improve upon the work of each other :-) That's what would be great, but unfortunately very hard to evaluate :(
FS
Felipe Sanches
Wed, Dec 2, 2015 1:41 PM

You can make the students use GitHub and then evaluate based on how
intensely they collaborate on the platform as opposed to simply evaluating
the final piece of code.

On Wed, Dec 2, 2015 at 11:38 AM, Miro Hrončok miro@hroncok.cz wrote:

If I would do it, I would maybe write my own parser for the language and
them compare the AST (abstract syntactic tree) of each sample code.

That's something I don't (yet) want to do, if there are other options.

On the other hand, you could encourage your students to share code and
improve upon the work of each other :-)

That's what would be great, but unfortunately very hard to evaluate :(


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

You can make the students use GitHub and then evaluate based on how intensely they collaborate on the platform as opposed to simply evaluating the final piece of code. On Wed, Dec 2, 2015 at 11:38 AM, Miro Hrončok <miro@hroncok.cz> wrote: > > If I would do it, I would maybe write my own parser for the language and > > them compare the AST (abstract syntactic tree) of each sample code. > That's something I don't (yet) want to do, if there are other options. > > > On the other hand, you could encourage your students to share code and > > improve upon the work of each other :-) > That's what would be great, but unfortunately very hard to evaluate :( > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
FS
Felipe Sanches
Wed, Dec 2, 2015 1:42 PM

In other words... you can see the ongoing process of creating the solution,
instead of simply evaluating the correctness of the final script.

On Wed, Dec 2, 2015 at 11:41 AM, Felipe Sanches juca@members.fsf.org
wrote:

You can make the students use GitHub and then evaluate based on how
intensely they collaborate on the platform as opposed to simply evaluating
the final piece of code.

On Wed, Dec 2, 2015 at 11:38 AM, Miro Hrončok miro@hroncok.cz wrote:

If I would do it, I would maybe write my own parser for the language and
them compare the AST (abstract syntactic tree) of each sample code.

That's something I don't (yet) want to do, if there are other options.

On the other hand, you could encourage your students to share code and
improve upon the work of each other :-)

That's what would be great, but unfortunately very hard to evaluate :(


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

In other words... you can see the ongoing process of creating the solution, instead of simply evaluating the correctness of the final script. On Wed, Dec 2, 2015 at 11:41 AM, Felipe Sanches <juca@members.fsf.org> wrote: > You can make the students use GitHub and then evaluate based on how > intensely they collaborate on the platform as opposed to simply evaluating > the final piece of code. > > On Wed, Dec 2, 2015 at 11:38 AM, Miro Hrončok <miro@hroncok.cz> wrote: > >> > If I would do it, I would maybe write my own parser for the language and >> > them compare the AST (abstract syntactic tree) of each sample code. >> That's something I don't (yet) want to do, if there are other options. >> >> > On the other hand, you could encourage your students to share code and >> > improve upon the work of each other :-) >> That's what would be great, but unfortunately very hard to evaluate :( >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > >
TP
Torsten Paul
Wed, Dec 2, 2015 1:59 PM

Von: "Miro Hrončok" miro@hroncok.cz

If I would do it, I would maybe write my own parser for the language and
them compare the AST (abstract syntactic tree) of each sample code.

That's something I don't (yet) want to do, if there are other options.

CSG output is basically a dump of the internal AST.

Exporting on command line is possible by specifying csg as file type.

openscad -o output.csg input.scad

ciao,
Torsten.

Von: "Miro Hrončok" <miro@hroncok.cz> > > If I would do it, I would maybe write my own parser for the language and > > them compare the AST (abstract syntactic tree) of each sample code. > That's something I don't (yet) want to do, if there are other options. > CSG output is basically a dump of the internal AST. Exporting on command line is possible by specifying csg as file type. openscad -o output.csg input.scad ciao, Torsten.
P
Parkinbot
Wed, Dec 2, 2015 2:02 PM

An approach like this is highly dependend on the problem.

  • How many students do you have?
  • How many different solutions will the problem have, if it is solved in a
    straight way? How probable is it to find the same solution (i.e. just naming
    differences allowed).
  • How many different solutions are syntactically equivalent (e.g. ordering
    of union-elements)
  • How many different solutions are semantically equivalent (is problem
    completely characterized?)

Up to 100 students: I'd recommend to just look at the codes for 10 minutes
(6 secs each). With this you could exctract suspicious solutions for closer
inspection, which would cost you another 20 minutes or so.
Writing a "usable" software will cost you month! And how would you validate
it?

--
View this message in context: http://forum.openscad.org/Compare-sources-to-detect-plagiarism-tp14890p14896.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

An approach like this is highly dependend on the problem. - How many students do you have? - How many different solutions will the problem have, if it is solved in a straight way? How probable is it to find the same solution (i.e. just naming differences allowed). - How many different solutions are syntactically equivalent (e.g. ordering of union-elements) - How many different solutions are semantically equivalent (is problem completely characterized?) Up to 100 students: I'd recommend to just look at the codes for 10 minutes (6 secs each). With this you could exctract suspicious solutions for closer inspection, which would cost you another 20 minutes or so. Writing a "usable" software will cost you month! And how would you validate it? -- View this message in context: http://forum.openscad.org/Compare-sources-to-detect-plagiarism-tp14890p14896.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TV
Tim V. Shaporev
Wed, Dec 2, 2015 2:05 PM

When a teacher I used to say something like
"It is just unrealistic to write everything yourself, so it is really
good if you can use others' code, but to demonstrate that you understood
what you did please change this code at my eyes the following way..."

:-)

Just my $0.02
Tim

On 02.12.2015 16:38, Miro Hrončok wrote:

If I would do it, I would maybe write my own parser for the language and
them compare the AST (abstract syntactic tree) of each sample code.

That's something I don't (yet) want to do, if there are other options.

On the other hand, you could encourage your students to share code and
improve upon the work of each other :-)

That's what would be great, but unfortunately very hard to evaluate :(


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

When a teacher I used to say something like "It is just unrealistic to write everything yourself, so it is really good if you can use others' code, but to demonstrate that you understood what you did please change this code at my eyes the following way..." :-) Just my $0.02 Tim On 02.12.2015 16:38, Miro Hrončok wrote: >> If I would do it, I would maybe write my own parser for the language and >> them compare the AST (abstract syntactic tree) of each sample code. > That's something I don't (yet) want to do, if there are other options. > >> On the other hand, you could encourage your students to share code and >> improve upon the work of each other :-) > That's what would be great, but unfortunately very hard to evaluate :( > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
MH
Miro Hrončok
Wed, Dec 2, 2015 2:25 PM

2015-12-02 14:59 GMT+01:00 Torsten Paul Torsten.Paul@gmx.de:

Von: "Miro Hrončok" miro@hroncok.cz

If I would do it, I would maybe write my own parser for the language and
them compare the AST (abstract syntactic tree) of each sample code.

That's something I don't (yet) want to do, if there are other options.

CSG output is basically a dump of the internal AST.

Exporting on command line is possible by specifying csg as file type.

openscad -o output.csg input.scad

Great, thanks.

2015-12-02 14:59 GMT+01:00 Torsten Paul <Torsten.Paul@gmx.de>: > Von: "Miro Hrončok" <miro@hroncok.cz> >> > If I would do it, I would maybe write my own parser for the language and >> > them compare the AST (abstract syntactic tree) of each sample code. >> That's something I don't (yet) want to do, if there are other options. >> > CSG output is basically a dump of the internal AST. > > Exporting on command line is possible by specifying csg as file type. > > openscad -o output.csg input.scad Great, thanks.
MH
Miro Hrončok
Wed, Dec 2, 2015 2:29 PM

2015-12-02 15:02 GMT+01:00 Parkinbot rudolf@parkinbot.com:

An approach like this is highly dependend on the problem.

  • How many students do you have?
  • How many different solutions will the problem have, if it is solved in a
    straight way? How probable is it to find the same solution (i.e. just naming
    differences allowed).

Actually, more than a few.

  • How many different solutions are syntactically equivalent (e.g. ordering
    of union-elements)

That's what I'm not sure.

  • How many different solutions are semantically equivalent (is problem
    completely characterized?)

It is.

Up to 100 students: I'd recommend to just look at the codes for 10 minutes
(6 secs each). With this you could exctract suspicious solutions for closer
inspection, which would cost you another 20 minutes or so.

I've tried that, but I simply cannot hold that much information in my
head. It's slightly less than 100.

Writing a "usable" software will cost you month!

That's why I just try to use what's already available.

And how would you validate
it?

I would inspect the code manually, after I find similarities in the
CSG tree. Than I would get the students to explain to me why they did
this and that, and to change the module to act differently, etc.

Thanks for all the feedback.

2015-12-02 15:02 GMT+01:00 Parkinbot <rudolf@parkinbot.com>: > An approach like this is highly dependend on the problem. > > - How many students do you have? > - How many different solutions will the problem have, if it is solved in a > straight way? How probable is it to find the same solution (i.e. just naming > differences allowed). Actually, more than a few. > - How many different solutions are syntactically equivalent (e.g. ordering > of union-elements) That's what I'm not sure. > - How many different solutions are semantically equivalent (is problem > completely characterized?) It is. > Up to 100 students: I'd recommend to just look at the codes for 10 minutes > (6 secs each). With this you could exctract suspicious solutions for closer > inspection, which would cost you another 20 minutes or so. I've tried that, but I simply cannot hold that much information in my head. It's slightly less than 100. > Writing a "usable" software will cost you month! That's why I just try to use what's already available. > And how would you validate > it? I would inspect the code manually, after I find similarities in the CSG tree. Than I would get the students to explain to me why they did this and that, and to change the module to act differently, etc. Thanks for all the feedback.