Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
5385a024
Commit
5385a024
authored
Dec 12, 2011
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sequence is now namespaced
parent
0a075b5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
23 deletions
+50
-23
problem.js
+27
-0
seq_module.html
+2
-2
seq_module.js
+21
-21
No files found.
problem.js
0 → 100644
View file @
5385a024
$
(
function
()
{
$
(
'#check_${ id }'
).
click
(
function
()
{
var
submit_data
=
{};
$
.
each
(
$
(
"[id^=input_${ id }_]"
),
function
(
index
,
value
){
submit_data
[
value
.
id
]
=
value
.
value
;
});
if
(
$
(
'#check_${ id }'
).
attr
(
'value'
)
==
'Check'
)
{
$
.
getJSON
(
'/modx/problem/${ id }/problem_check'
,
submit_data
,
function
(
json
)
{
for
(
p
in
json
)
{
if
(
json
[
p
]
==
'correct'
)
$
(
"#status_"
+
p
).
attr
(
"class"
,
"ui-icon ui-icon-check"
);
if
(
json
[
p
]
==
'incorrect'
)
$
(
"#status_"
+
p
).
attr
(
"class"
,
"ui-icon ui-icon-close"
);
$
(
'#check_${ id }'
).
attr
(
"value"
,
"Reset"
);
}
});
}
else
/* if 'Reset' */
{
// Possible cleanup: Move from getJSON to just load
$
.
getJSON
(
'/modx/problem/${ id }/problem_reset'
,
{
'id'
:
'${ id }'
},
function
(
json
)
{
$
(
'#main_${ id }'
).
html
(
json
);
});
}
});
});
seq_module.html
View file @
5385a024
...
...
@@ -5,9 +5,9 @@
% endfor
<td></td></tr>
<tr><td
align=
center
valign=
center
><div
id=
"
prev"
><span
class=
"ui-icon ui-icon-circle-triangle-w"
onclick=
"pause();
"
></span></div></td>
<tr><td
align=
center
valign=
center
><div
id=
"
${ id }prev"
><span
class=
"ui-icon ui-icon-circle-triangle-w
"
></span></div></td>
<td
colspan=
10
><div
id=
"content"
></div></td>
<td
align=
center
valign=
center
><div
id=
"
next"
><span
class=
"ui-icon ui-icon-circle-triangle-e"
onclick=
"pause();
"
>
</span></div></td>
<td
align=
center
valign=
center
><div
id=
"
${ id }next"
><span
class=
"ui-icon ui-icon-circle-triangle-e
"
>
</span></div></td>
</tr>
<tr></tr>
</table>
...
...
seq_module.js
View file @
5385a024
// CRITICAL TODO: Namespace
var
files
=
[
""
,
var
$
{
id
}
files
=
[
""
,
%
for
t
in
items
:
$
{
t
[
1
][
'content'
]}
,
%
endfor
""
];
var
functions
=
[
""
,
var
$
{
id
}
functions
=
[
""
,
%
for
t
in
items
:
function
(){
$
{
t
[
1
][
'js'
]}
},
%
endfor
""
];
var
loc
;
var
$
{
id
}
loc
;
function
goto
(
i
)
{
$
(
'#content'
).
html
(
files
[
i
]);
functions
[
i
]()
loc
=
i
;
function
$
{
id
}
goto
(
i
)
{
$
(
'#content'
).
html
(
$
{
id
}
files
[
i
]);
$
{
id
}
functions
[
i
]()
$
{
id
}
loc
=
i
;
}
function
setup_click
(
i
)
{
$
(
'#tt_'
+
i
).
click
(
function
(
eo
)
{
goto
(
i
);});
function
$
{
id
}
setup_click
(
i
)
{
$
(
'#tt_'
+
i
).
click
(
function
(
eo
)
{
$
{
id
}
goto
(
i
);});
}
function
next
()
{
loc
=
loc
+
1
;
if
(
loc
>
$
{
len
(
items
)
}
)
loc
=
$
{
len
(
items
)
};
goto
(
loc
);
function
$
{
id
}
next
()
{
$
{
id
}
loc
=
$
{
id
}
loc
+
1
;
if
(
$
{
id
}
loc
>
$
{
len
(
items
)
}
)
$
{
id
}
loc
=
$
{
len
(
items
)
};
$
{
id
}
goto
(
$
{
id
}
loc
);
}
function
prev
()
{
loc
=
loc
-
1
;
if
(
loc
<
1
)
loc
=
1
;
goto
(
loc
);
function
$
{
id
}
prev
()
{
$
{
id
}
loc
=
$
{
id
}
loc
-
1
;
if
(
$
{
id
}
loc
<
1
)
$
{
id
}
loc
=
1
;
$
{
id
}
goto
(
$
{
id
}
loc
);
}
$
(
function
()
{
var
i
;
for
(
i
=
1
;
i
<
11
;
i
++
)
{
setup_click
(
i
);
$
{
id
}
setup_click
(
i
);
}
$
(
'#
next'
).
click
(
function
(
eo
)
{
next
();});
$
(
'#
prev'
).
click
(
function
(
eo
)
{
prev
();});
goto
(
1
);
$
(
'#
${ id }next'
).
click
(
function
(
eo
)
{
$
{
id
}
next
();});
$
(
'#
${ id }prev'
).
click
(
function
(
eo
)
{
$
{
id
}
prev
();});
$
{
id
}
goto
(
1
);
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment