Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matching Questions and the start of Order Questions #16

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6ac6397
implement dragdrop in models, services and views (only in new and show)
KKrenz Nov 16, 2014
d27c553
Take care of naming conventions
KKrenz Nov 18, 2014
6118315
match result table and first steps in participate
KKrenz Jan 4, 2015
0a395e9
Basic match questions functions run
KKrenz Jan 12, 2015
16f20aa
Fix show corrects bug and make result table look better
KKrenz Jan 15, 2015
6954446
word-wrap; fix downloadButton
KKrenz Feb 24, 2015
96b6d55
Commit-Nachricht
KKrenz Mar 1, 2015
a825f7c
finally fix fill_up_answer_pairs
KKrenz Mar 5, 2015
0b520ce
Lösche überflüssigen answer_pair controller
KKrenz Mar 5, 2015
7915c36
Fix result-table style, csv + moodle xml parser
KKrenz Mar 12, 2015
a7cab02
GIFT Parser Import done
KKrenz Mar 25, 2015
b2d5e19
Duplicate Button + Start working on Order Questions
KKrenz Apr 10, 2015
4d3b182
Kleine Korrektur Ilias Parser, Erste Versuche für Teilnahme an Reihen…
KKrenz Apr 15, 2015
5fbba1e
Finish participate partial for order_questions
KKrenz Apr 15, 2015
dbc2234
Balken in result table für order- und match-questions wachsen nun von…
KKrenz Apr 21, 2015
165bb91
Fertigstellung von Ergebnisdarstellung von order_surveys; alle parser…
KKrenz Apr 25, 2015
b47197c
Erstellung von Kategorie-Fragen
KKrenz May 6, 2015
c1305d2
vote-response-fehler gefixt; bei 'korrekte-markieren'-button für orde…
KKrenz Jun 10, 2015
2096aff
finish participate@categorySurveys; fix show-results4category
KKrenz Jun 17, 2015
5dac6e1
Fix repeat functions
KKrenz Jun 17, 2015
1f1f227
Ermögliche Im- und Export von Tags individueller Fragen
KKrenz Dec 16, 2015
bcf4232
Update Import/Export-Info
KKrenz Jan 15, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Empty file modified Gemfile
100644 → 100755
Empty file.
Empty file modified Gemfile.lock
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Binary file added app/.DS_Store
Binary file not shown.
Binary file added app/assets/.DS_Store
Binary file not shown.
Binary file added app/assets/javascripts/.DS_Store
Binary file not shown.
Empty file modified app/assets/javascripts/collaborators.coffee
100644 → 100755
Empty file.
125 changes: 125 additions & 0 deletions app/assets/javascripts/table.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
function tableDraw()
{this.span();

var props = "";
var i = 0;
var dummyRows = this.content.length;
var dummyCols = this.content[0].length;

var dummyCode = '<table';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.

for (prop in this)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating global 'for' variable. Should be 'for (var prop ...'.
The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.

{if (i >= this.propsLengthPublic) {break;}
dummyCode = dummyCode+' '+prop+'="'+this[prop]+'"';i++;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.

}
dummyCode = dummyCode+'>\n';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.


for (var i=1;i<=dummyRows;i++)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'i' is already defined.

{dummyCode = dummyCode+'<tr>\n';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.

for (var k=1;k<=dummyCols;k++)
{if (this.content[(i-1)][(k-1)][2] == "false")
{dummyCode = dummyCode+' <td '+this.content[(i-1)][(k-1)][0]+'>'+this.content[(i-1)][(k-1)][1]+'</td>\n';}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.
Mixed double and single quotes.

}
dummyCode = dummyCode+'</tr>\n';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.

}

dummyCode = dummyCode+'</table>\n';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.

return dummyCode;
}

function tableSpan()
{var dummyRows = this.content.length;
var dummyCols = this.content[0].length;

for (var i=1;i<=dummyRows;i++)
{var rowspan = 0;var colspan = 0;
var fromHere = 0;var tillThere = 0;
var myString = "";
for (var k=1;k<=dummyCols;k++)
{rowspan = 0;colspan = 0;
if (this.content[(i-1)][(k-1)][2] == "false")
{myString = (this.content[(i-1)][(k-1)][0]) + "";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

if (myString.indexOf("colspan") >= 0)
{fromHere = (myString.indexOf("colspan"))+9;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

tillThere = (myString.indexOf('"',fromHere))-1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.
Mixed double and single quotes.

if ((fromHere-tillThere) == 0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use '===' to compare with '0'.

{colspan = myString.charAt(fromHere);}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

else
{colspan = myString.substring(fromHere,tillThere);}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

colspan = parseInt(colspan);
}
if (myString.indexOf("rowspan") >= 0)
{fromHere = (myString.indexOf("rowspan"))+9;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

tillThere = (myString.indexOf('"',fromHere))-1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.
Mixed double and single quotes.

if ((fromHere-tillThere) == 0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use '===' to compare with '0'.

{rowspan = myString.charAt(fromHere);}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

else
{rowspan = myString.substring(fromHere,tillThere);}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

rowspan = parseInt(rowspan);
}
if ((colspan >= 2) && (rowspan <= 1))
{for (var m=2;m<=colspan;m++)
{this.content[(i-1)][((k-1)+(m-1))][2] = "true";}
}
if ((rowspan >= 2) && (colspan <= 1))
{for (var m=2;m<=rowspan;m++)
{this.content[((i-1)+(m-1))][(k-1)][2] = "true";}
}
if ((rowspan >= 2) && (colspan >= 2))
{for (var m=1;m<=rowspan;m++)
{for (var p=1;p<=colspan;p++)
{this.content[((i-1)+(m-1))][((k-1)+(p-1))][2] = "true";}
}
this.content[(i-1)][(k-1)][2] = "false";
} } } } }

function tableContent(dummyCols,dummyRows)
{var dummyContent = "[";
for (var i=1;i<=dummyRows;i++)
{dummyContent = dummyContent+"["
for (var k=1;k<=dummyCols;k++)
{dummyContent = dummyContent+"[['align="+'"left"'+" valign="+'"top"'+"'],[' '],['false']],";}
dummyContent = dummyContent.substring(0,((dummyContent.length)-1));
dummyContent = dummyContent+"],"
}
dummyContent = dummyContent.substring(0,((dummyContent.length)-1));
dummyContent = dummyContent+"]";
return eval(dummyContent);
}

function tableContentArraysToArguments()
{var dummyRows = this.content.length;
var dummyCols = this.content[0].length;
for (var i=1;i<=dummyRows;i++)
{for (var k=1;k<=dummyCols;k++)
{this.content[(i-1)][(k-1)].props = this.content[(i-1)][(k-1)][0];
this.content[(i-1)][(k-1)].value = this.content[(i-1)][(k-1)][1];
this.content[(i-1)][(k-1)].spans = this.content[(i-1)][(k-1)][2];
} } }

function tableContentArgumentsToArrays()
{var dummyRows = this.content.length;
var dummyCols = this.content[0].length;
for (var i=1;i<=dummyRows;i++)
{for (var k=1;k<=dummyCols;k++)
{this.content[(i-1)][(k-1)][0] = this.content[(i-1)][(k-1)].props;
this.content[(i-1)][(k-1)][1] = this.content[(i-1)][(k-1)].value;
this.content[(i-1)][(k-1)][2] = this.content[(i-1)][(k-1)].spans;
} } }

function table()
{var propsDefaultLength = 2;
this.cols = 1;
this.rows = 1;
for (var i=1;i<=table.arguments.length;i++)
{if (table.arguments[(i-1)].indexOf("cols") >= 0) {propsDefaultLength--;}
if (table.arguments[(i-1)].indexOf("rows") >= 0) {propsDefaultLength--;}
eval("this."+table.arguments[(i-1)]);
}
this.propsLengthPublic = (table.arguments.length + propsDefaultLength);
this.propsLengthPrivat = 7;
this.content = tableContent(this.cols,this.rows);
this.span = tableSpan;
this.draw = tableDraw;
this.contentArraysToArguments = tableContentArraysToArguments;
this.contentArgumentsToArrays = tableContentArgumentsToArrays;
}
Binary file added app/assets/stylesheets/.DS_Store
Binary file not shown.
Empty file modified app/assets/stylesheets/events.css.less
100644 → 100755
Empty file.
9 changes: 8 additions & 1 deletion app/assets/stylesheets/layout.css.less
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ time {
margin: 1em 0;
}

.bulletless_plus_margin {
list-style: none;
li {
margin: 5px;
}
}

.lead {
i {
position: relative;
Expand Down Expand Up @@ -86,4 +93,4 @@ time {

.island {
padding: 1em;
}
}
15 changes: 15 additions & 0 deletions app/assets/stylesheets/questions.css.less
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,18 @@ input[type="checkbox"].questions-table__checkbox {
.import-info, #compatibility {
display: none;
}

.move_handler {
cursor: move;
}

.ghost {
opacity: .5;
background: #FECA40;
}

.create_order_option_list {
list-style-type: none;
margin: 0;
padding: 0;
}
157 changes: 150 additions & 7 deletions app/assets/stylesheets/surveys.css.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,35 @@
font-style: italic;
font-size: 80%;
}

#survey-options-list li {
margin-bottom:10px;
}

.move_handler {
cursor: move;
}

.categoryDiv {
border: 1px solid white;
width: 100%;
height: 36px;
}

.ghost {
opacity: .5;
background: #FECA40;
}

#overmsg {
display:none;
background-color: #FCC;
border: solid 1px #C66;
-moz-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 5px 5px 2px #C66;
-webkit-box-shadow: 5px 5px 2px #C66;
box-shadow: 5px 5px 2px #C66;
border: solid 1px #C66;
-moz-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 5px 5px 2px #C66;
-webkit-box-shadow: 5px 5px 2px #C66;
box-shadow: 5px 5px 2px #C66;
margin-bottom:10px;
}
#not_running {
Expand All @@ -33,6 +50,15 @@
padding-bottom: 0.5em;
font-weight: bold;
}

#survey-table {
width: 100%;

td {
width: 50%;
}
}

.pointer {
cursor: pointer;
}
Expand All @@ -56,7 +82,66 @@
}
}

.selectable {
list-style-type: none;
margin: 0;
padding: 0;

li {
border: 1px solid LightGray;
padding: 0.4em;
margin-top: 6px;
margin-bottom: 6px;
text-align: center;
border-radius: 5px;
word-wrap: break-word;
}
}

.leftOptions {
margin-right: 2px;
}

.rightOptions {
margin-left: 2px;
}

.select-result {
padding: 0em;
margin: 0px;
}

.select-result div {
border: 1px solid LightGray;
margin-bottom: 5px;
padding: 0em;
width:100%;
text-align:center;
border-radius: 5px;
}

.selected_left {
width:45%;
word-break: break-all;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 10px;
}

.selected_right {
width:45%;
word-break: break-all;
padding-top: 5px;
padding-bottom: 5px;
padding-right: 5px;
}

.remove-btn {
-moz-box-shadow: inset 0 0 2px #000000;
-webkit-box-shadow: inset 0 0 2px #000000;
box-shadow: inset 0 0 2px #000000;
margin:0.4em;
}


/* ========================================
Expand Down Expand Up @@ -96,7 +181,9 @@
display: inline;
}


.selected {
background: #FECA40;
}



Expand Down Expand Up @@ -185,3 +272,59 @@
}
}
}


/* ========================================
RESULT TABLE
======================================== */

.result-table {
table-layout:fixed;

div {
margin: 0px !important;
padding: 0px !important;
}

th {
text-align: center;
vertical-align: middle;
word-wrap: break-word;
}
}

.result-table-td {
text-align: center;
word-wrap: break-word;
margin: 0px !important;
padding: 0px !important;

div {
position: relative;
height: 100%;
width:100%;
text-align:center;

div {
position: absolute;
left: 0px;
bottom: 0px;
z-index:-1;
background-color: #DAEDF7;
width: 100%;
}

p {
height:any;
width:any;
position:relative;
top:50%;
margin-top:-HalfYourHeigth;
line-height: 0%;
}
}
}

.greenBorder {
border: 3px solid green !important;
}
Binary file added app/controllers/.DS_Store
Binary file not shown.
Empty file modified app/controllers/application_controller.rb
100644 → 100755
Empty file.
Empty file modified app/controllers/events_controller.rb
100644 → 100755
Empty file.
Empty file modified app/controllers/question_comments_controller.rb
100644 → 100755
Empty file.
Loading