<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Introduction_to_the_Shor_quantum_factoring_algorithm" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">Introduction to the Shor quantum factoring algorithm</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5a">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5a" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Introduction to the Shor quantum factoring algorithm</h3>
<div
id="video_U2L5a"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5a/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5a/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:66pSl3z-kbM", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5a/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5a/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L5a"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@Quantum_factoring_in_practice">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@Quantum_factoring_in_practice" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p>
Shor's quantum factoring algorithm was first demonstrated in an experiment at IBM in 2001, by Lieven M. K. Vandersypen, Matthias Steffen, Gregory Breyta, Costantino S. Yannoni, Mark H. Sherwood, and Isaac Chuang; see <a href="https://www.nature.com/articles/414883a" target="_blank">Experimental realization of Shor's quantum factoring algorithm using nuclear magnetic resonance</a> (Nature, 2001). </p><p><img src="/assets/courseware/v1/fefdfd66d8ac1c196b6a81da7a94d3ed/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_IMAGE-quantum-factoring-7-qubits-nmrqc.png" width="500"/></p><p>
Fifteen years later, the same algorithm was demonstrated, without simplification, using trapped ions, by Thomas Monz, Daniel Nigg, Esteban A. Martinez, Matthias F. Brandl, Philipp Schindler, Richard Rines, Shannon X. Wang, Isaac Chuang, and Rainer Blatt, as described in <a href="http://science.sciencemag.org/content/351/6277/1068" target="_blank">Realization of a scalable Shor algorithm</a> (Science, 2016). </p>
</div>
</div>
<div class="vert vert-2" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box1">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box1" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@CQ_The_quantum_order_finding_algorithm__Simons_algorithm__and_factoring" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">CQ: The quantum order finding algorithm, Simon's algorithm, and factoring</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_orderfinding">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="problem" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_orderfinding" data-runtime-class="LmsRuntime" data-has-score="True">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_u2_5_cq_orderfinding" class="problems-wrapper" role="group"
aria-labelledby="u2_5_cq_orderfinding-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_orderfinding" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_orderfinding/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="u2_5_cq_orderfinding-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_orderfinding-problem-progress" tabindex="-1">
The quantum order finding algorithm, Simon&#39;s algorithm, and factoring
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_orderfinding-problem-progress"></div>
<div class="problem">
<div>
<p>
This is a concept question, provided to double-check your understanding of the previous video clip. </p>
<p>
Which of the following statements are true about the quantum order finding algorithm (also known as the <a href="https://en.wikipedia.org/wiki/Quantum_phase_estimation_algorithm" target="_blank">quantum phase estimation algorithm</a>), <a href="https://en.wikipedia.org/wiki/Simon%27s_problem" target="_blank">Simon's algorithm</a>, and <a href="https://en.wikipedia.org/wiki/Shor%27s_algorithm" target="_blank">Shor's quantum factoring algorithm</a>? Check all that apply: </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div class="choicegroup capa_inputtype" id="inputtype_u2_5_cq_orderfinding_2_1">
<fieldset aria-describedby="status_u2_5_cq_orderfinding_2_1">
<div class="field">
<input type="checkbox" name="input_u2_5_cq_orderfinding_2_1[]" id="input_u2_5_cq_orderfinding_2_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="u2_5_cq_orderfinding_2_1-choice_0-label" for="input_u2_5_cq_orderfinding_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_orderfinding_2_1">
<text>Shor's algorithm factors [mathjaxinline]N[/mathjaxinline] by using the quantum order finding algorithm to find the period of a certain function of [mathjaxinline]N[/mathjaxinline]</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_orderfinding_2_1[]" id="input_u2_5_cq_orderfinding_2_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="u2_5_cq_orderfinding_2_1-choice_1-label" for="input_u2_5_cq_orderfinding_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_orderfinding_2_1">
<text>Simon's algorithm finds periods of functions for which [mathjaxinline]f(x)=f(x\oplus c)[/mathjaxinline] as well as functions [mathjaxinline]f(x)=f(x + c)[/mathjaxinline]</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_orderfinding_2_1[]" id="input_u2_5_cq_orderfinding_2_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="u2_5_cq_orderfinding_2_1-choice_2-label" for="input_u2_5_cq_orderfinding_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_orderfinding_2_1">
<text>The quantum order finding algorithm finds periods of functions for which [mathjaxinline]f(x)=f(x + c)[/mathjaxinline]</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_orderfinding_2_1[]" id="input_u2_5_cq_orderfinding_2_1_choice_3" class="field-input input-checkbox" value="choice_3"/><label id="u2_5_cq_orderfinding_2_1-choice_3-label" for="input_u2_5_cq_orderfinding_2_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_orderfinding_2_1">
<text>Quantum factoring can use Simon's algorithm instead of the order finding algorithm</text>
</label>
</div>
<span id="answer_u2_5_cq_orderfinding_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_u2_5_cq_orderfinding_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
</p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="The quantum order finding algorithm, Simon&#39;s algorithm, and factoring" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_u2_5_cq_orderfinding" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_u2_5_cq_orderfinding">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_5_cq_orderfinding-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_5_cq_orderfinding-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_5_cq_orderfinding-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box1x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box1x" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Why_is_factoring_important_" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">Why is factoring important?</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5b">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5b" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Why is factoring important?</h3>
<div
id="video_U2L5b"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5b/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5b/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:VgfZiWMy8-k", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5b/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5b/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L5b"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box2">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box2" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Detailed_steps_of_the_quantum_order_finding_algorithm" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">Detailed steps of the quantum order finding algorithm</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5c">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5c" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Detailed steps of the quantum order finding algorithm</h3>
<div
id="video_U2L5c"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5c/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5c/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:iZ355z3AfTg", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5c/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5c/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L5c"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Order_finding_algorithm_measurement_result_as_a_geometric_sum" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">Order finding algorithm measurement result as a geometric sum</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5d">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5d" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Order finding algorithm measurement result as a geometric sum</h3>
<div
id="video_U2L5d"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5d/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5d/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:canCHvkXozE", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5d/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5d/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L5d"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box4">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box4" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Runtime_and_probability_distribution_of_measurement_results_for_quantum_order_finding" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">Runtime and probability distribution of measurement results for quantum order finding</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5e">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5e" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Runtime and probability distribution of measurement results for quantum order finding</h3>
<div
id="video_U2L5e"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5e/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5e/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:zYNpq800-30", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5e/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5e/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L5e"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box5">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box5" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Reduction_of_factoring_to_order_finding" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">Reduction of factoring to order finding</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5f">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5f" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Reduction of factoring to order finding</h3>
<div
id="video_U2L5f"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5f/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5f/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:4fhT72gVcOk", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5f/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5f/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L5f"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box6">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box6" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@CQ_Setting_and_structure_of_Shors_quantum_factoring_algorithm" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">CQ: Setting and structure of Shor's quantum factoring algorithm</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_factoring">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="problem" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_factoring" data-runtime-class="LmsRuntime" data-has-score="True">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_u2_5_cq_factoring" class="problems-wrapper" role="group"
aria-labelledby="u2_5_cq_factoring-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_factoring" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_factoring/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="u2_5_cq_factoring-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_factoring-problem-progress" tabindex="-1">
Setting and structure of Shor&#39;s quantum factoring algorithm
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_factoring-problem-progress"></div>
<div class="problem">
<div>
<p>
This is a concept question, provided to double-check your understanding of the previous video clip. </p>
<p>
Which of the following statements are true about <a href="https://en.wikipedia.org/wiki/Shor%27s_algorithm" target="_blank">Shor's quantum factoring algorithm</a>, which applies <a href="https://en.wikipedia.org/wiki/Quantum_phase_estimation_algorithm" target="_blank">quantum phase estimation</a> to find the unknown periood [mathjaxinline]r[/mathjaxinline] of a function </p>
<table id="a0000000002" class="eqnarray" cellspacing="0" cellpadding="7" width="100%" style="table-layout:auto">
<tr id="a0000000003">
<td style="width:40%; border:none">&#160;</td>
<td style="vertical-align:middle; text-align:right; border:none">
[mathjaxinline]\displaystyle f(x) = a^ x\ {\rm mod}\ N \, .[/mathjaxinline]
</td>
<td style="width:40%; border:none">&#160;</td>
<td class="eqnnum" style="width:20%; border:none;text-align:right">(1.1)</td>
</tr>
</table>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div class="choicegroup capa_inputtype" id="inputtype_u2_5_cq_factoring_2_1">
<fieldset aria-describedby="status_u2_5_cq_factoring_2_1">
<div class="field">
<input type="checkbox" name="input_u2_5_cq_factoring_2_1[]" id="input_u2_5_cq_factoring_2_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="u2_5_cq_factoring_2_1-choice_0-label" for="input_u2_5_cq_factoring_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_factoring_2_1">
<text>In this algorithm, [mathjaxinline]N[/mathjaxinline] is the number being factored, and can be assumed to be the product of two odd co-prime numbers</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_factoring_2_1[]" id="input_u2_5_cq_factoring_2_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="u2_5_cq_factoring_2_1-choice_1-label" for="input_u2_5_cq_factoring_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_factoring_2_1">
<text>In this algorithm, [mathjaxinline]a[/mathjaxinline] is the number being factored, and is assumed to be the product of two prime numbers</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_factoring_2_1[]" id="input_u2_5_cq_factoring_2_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="u2_5_cq_factoring_2_1-choice_2-label" for="input_u2_5_cq_factoring_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_factoring_2_1">
<text>The number [mathjaxinline]a[/mathjaxinline] is chosen randomly</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_factoring_2_1[]" id="input_u2_5_cq_factoring_2_1_choice_3" class="field-input input-checkbox" value="choice_3"/><label id="u2_5_cq_factoring_2_1-choice_3-label" for="input_u2_5_cq_factoring_2_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_factoring_2_1">
<text>The quantum factoring algorithm always succeeds</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_factoring_2_1[]" id="input_u2_5_cq_factoring_2_1_choice_4" class="field-input input-checkbox" value="choice_4"/><label id="u2_5_cq_factoring_2_1-choice_4-label" for="input_u2_5_cq_factoring_2_1_choice_4" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_factoring_2_1">
<text>The algorithm requires classical post-processing</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_factoring_2_1[]" id="input_u2_5_cq_factoring_2_1_choice_5" class="field-input input-checkbox" value="choice_5"/><label id="u2_5_cq_factoring_2_1-choice_5-label" for="input_u2_5_cq_factoring_2_1_choice_5" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_factoring_2_1">
<text>The algorithm requires no classical post-processing</text>
</label>
</div>
<span id="answer_u2_5_cq_factoring_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_u2_5_cq_factoring_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
</p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Setting and structure of Shor&#39;s quantum factoring algorithm" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_u2_5_cq_factoring" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_u2_5_cq_factoring">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_5_cq_factoring-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_5_cq_factoring-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_5_cq_factoring-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box2x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box2x" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Efficient_modular_exponentiation_by_repeated_squaring" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">Efficient modular exponentiation by repeated squaring</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5g">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5g" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Efficient modular exponentiation by repeated squaring</h3>
<div
id="video_U2L5g"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5g/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5g/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:U7cI4ykKEJk", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5g/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5g/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L5g"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box7">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box7" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@CQ_The_modular_exponentiation_circuit" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">CQ: The modular exponentiation circuit</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_modexp">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="problem" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_modexp" data-runtime-class="LmsRuntime" data-has-score="True">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_u2_5_cq_modexp" class="problems-wrapper" role="group"
aria-labelledby="u2_5_cq_modexp-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_modexp" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_modexp/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="u2_5_cq_modexp-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_modexp-problem-progress" tabindex="-1">
The modular exponentiation circuit
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_5_cq_modexp-problem-progress"></div>
<div class="problem">
<div>
<p>
This is a concept question, provided to double-check your understanding of the previous video clip. </p>
<p>
In lecture, Prof. Shor describes how the function [mathjaxinline]f(x) = a^ x\ {\rm mod} N[/mathjaxinline] can be efficiently realized by a circuit construction. Which of the following statements about that construction, are valid? Check all that apply: </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div class="choicegroup capa_inputtype" id="inputtype_u2_5_cq_modexp_2_1">
<fieldset aria-describedby="status_u2_5_cq_modexp_2_1">
<div class="field">
<input type="checkbox" name="input_u2_5_cq_modexp_2_1[]" id="input_u2_5_cq_modexp_2_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="u2_5_cq_modexp_2_1-choice_0-label" for="input_u2_5_cq_modexp_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_modexp_2_1">
<text>Modular multiplication can be done reversibly</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_modexp_2_1[]" id="input_u2_5_cq_modexp_2_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="u2_5_cq_modexp_2_1-choice_1-label" for="input_u2_5_cq_modexp_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_modexp_2_1">
<text>The integer multiplication operation [mathjaxinline]m(x,y) = xy[/mathjaxinline] is a reversible operation, when [mathjaxinline]x[/mathjaxinline] is also kept (and [mathjaxinline]x[/mathjaxinline] and [mathjaxinline]y[/mathjaxinline] are nonzero)</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_modexp_2_1[]" id="input_u2_5_cq_modexp_2_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="u2_5_cq_modexp_2_1-choice_2-label" for="input_u2_5_cq_modexp_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_modexp_2_1">
<text>The integer division operation [mathjaxinline]d(x,y) = x/y[/mathjaxinline] is a reversible operation, when [mathjaxinline]x[/mathjaxinline] is also kept</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_modexp_2_1[]" id="input_u2_5_cq_modexp_2_1_choice_3" class="field-input input-checkbox" value="choice_3"/><label id="u2_5_cq_modexp_2_1-choice_3-label" for="input_u2_5_cq_modexp_2_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_modexp_2_1">
<text>The modular exponentiation function [mathjaxinline]f(x)[/mathjaxinline] requires [mathjaxinline]O(N)[/mathjaxinline] elementary operations</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_5_cq_modexp_2_1[]" id="input_u2_5_cq_modexp_2_1_choice_4" class="field-input input-checkbox" value="choice_4"/><label id="u2_5_cq_modexp_2_1-choice_4-label" for="input_u2_5_cq_modexp_2_1_choice_4" class="response-label field-label label-inline" aria-describedby="status_u2_5_cq_modexp_2_1">
<text>The modular exponentiation function [mathjaxinline]f(x)[/mathjaxinline] can done using [mathjaxinline]O({\rm poly}(\log (N)))[/mathjaxinline] elementary operations</text>
</label>
</div>
<span id="answer_u2_5_cq_modexp_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_u2_5_cq_modexp_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
</p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="The modular exponentiation circuit" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_u2_5_cq_modexp" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_u2_5_cq_modexp">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_5_cq_modexp-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_5_cq_modexp-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_5_cq_modexp-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3x" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@The_contnued_fractions_algorithm" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">The contnued fractions algorithm</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5h">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5h" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">The contnued fractions algorithm</h3>
<div
id="video_U2L5h"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5h/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5h/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:mnUxOLwsvlo", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5h/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5h/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L5h"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box8">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box8" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Convergence_of_the_continued_fractions_algorithm_within_a_fininte_interval" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">Convergence of the continued fractions algorithm within a fininte interval</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5j">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5j" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Convergence of the continued fractions algorithm within a fininte interval</h3>
<div
id="video_U2L5j"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5j/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5j/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:VL_F3KeDZIA", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5j/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L5j/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L5j"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box9">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box9" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@The_quantum_phase_estimation_algorithm" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">The quantum phase estimation algorithm</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6h">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6h" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">The quantum phase estimation algorithm</h3>
<div
id="video_U2L6h"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6h/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6h/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:sBKVf60-SKA", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6h/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6h/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L6h"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box8x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box8x" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Factoring_using_the_quantum_phase_estimation_algorithm" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">Factoring using the quantum phase estimation algorithm</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6j">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="video" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6j" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Factoring using the quantum phase estimation algorithm</h3>
<div
id="video_U2L6j"
class="video closed"
data-metadata='{"publishCompletionUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6j/handler/publish_completion", "duration": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "prioritizeHls": false, "generalSpeed": 1.0, "sources": [], "captionDataDir": null, "autoAdvance": false, "poster": null, "autohideHtml5": false, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6j/handler/transcript/translation/__lang__", "recordedYoutubeIsAvailable": true, "completionEnabled": false, "end": 0.0, "ytMetadataEndpoint": "", "completionPercentage": 0.95, "savedVideoPosition": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "saveStateEnabled": false, "start": 0.0, "streams": "1.00:ZL41hPcv2LE", "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6j/handler/transcript/available_translations", "autoplay": false, "showCaptions": "true", "transcriptLanguages": {"en": "English"}, "saveStateUrl": "/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@video+block@U2L6j/handler/xmodule_handler/save_user_state", "ytApiUrl": "https://www.youtube.com/iframe_api"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="U2L6j"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box9x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box9x" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="VerticalStudentView" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@CQ_Factoring_using_phase_estimation" data-runtime-class="LmsRuntime" data-has-score="False">
<h2 class="hd hd-2 unit-title">CQ: Factoring using phase estimation</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_6_cq_factoring_pest">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="problem" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_6_cq_factoring_pest" data-runtime-class="LmsRuntime" data-has-score="True">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_u2_6_cq_factoring_pest" class="problems-wrapper" role="group"
aria-labelledby="u2_6_cq_factoring_pest-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_6_cq_factoring_pest" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_6_cq_factoring_pest/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="u2_6_cq_factoring_pest-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_6_cq_factoring_pest-problem-progress" tabindex="-1">
Factoring using phase estimation
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@u2_6_cq_factoring_pest-problem-progress"></div>
<div class="problem">
<div>
<p>
This is a concept question, provided to double-check your understanding of the previous video clip. </p>
<p>
Which are the following statements are correct, regarding the use of the quantum phase estimation algorithm, for factoring the number [mathjaxinline]N[/mathjaxinline]? Check all that apply: </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div class="choicegroup capa_inputtype" id="inputtype_u2_6_cq_factoring_pest_2_1">
<fieldset aria-describedby="status_u2_6_cq_factoring_pest_2_1">
<div class="field">
<input type="checkbox" name="input_u2_6_cq_factoring_pest_2_1[]" id="input_u2_6_cq_factoring_pest_2_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="u2_6_cq_factoring_pest_2_1-choice_0-label" for="input_u2_6_cq_factoring_pest_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_u2_6_cq_factoring_pest_2_1">
<text>The continued fractions algorithm is no longer needed using this approach</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_6_cq_factoring_pest_2_1[]" id="input_u2_6_cq_factoring_pest_2_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="u2_6_cq_factoring_pest_2_1-choice_1-label" for="input_u2_6_cq_factoring_pest_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_u2_6_cq_factoring_pest_2_1">
<text>Phase estimation is used to find the eigenvalues of [mathjaxinline]U[/mathjaxinline], where [mathjaxinline]U|x\rangle = |xy~ {\rm mod}N\rangle[/mathjaxinline]</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_6_cq_factoring_pest_2_1[]" id="input_u2_6_cq_factoring_pest_2_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="u2_6_cq_factoring_pest_2_1-choice_2-label" for="input_u2_6_cq_factoring_pest_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_u2_6_cq_factoring_pest_2_1">
<text>Phase estimation is used to find the eigenvalues of [mathjaxinline]U[/mathjaxinline], where [mathjaxinline]U|x\rangle = |x~ {\rm mod}N\rangle[/mathjaxinline]</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_6_cq_factoring_pest_2_1[]" id="input_u2_6_cq_factoring_pest_2_1_choice_3" class="field-input input-checkbox" value="choice_3"/><label id="u2_6_cq_factoring_pest_2_1-choice_3-label" for="input_u2_6_cq_factoring_pest_2_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_u2_6_cq_factoring_pest_2_1">
<text>Phase estimation is used to find the eigenvalues of [mathjaxinline]U[/mathjaxinline], where [mathjaxinline]U|x,y\rangle = |x\oplus y~ {\rm mod}N\rangle[/mathjaxinline]</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_6_cq_factoring_pest_2_1[]" id="input_u2_6_cq_factoring_pest_2_1_choice_4" class="field-input input-checkbox" value="choice_4"/><label id="u2_6_cq_factoring_pest_2_1-choice_4-label" for="input_u2_6_cq_factoring_pest_2_1_choice_4" class="response-label field-label label-inline" aria-describedby="status_u2_6_cq_factoring_pest_2_1">
<text>Phase estimation does not need the quantum Fourier transform</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_u2_6_cq_factoring_pest_2_1[]" id="input_u2_6_cq_factoring_pest_2_1_choice_5" class="field-input input-checkbox" value="choice_5"/><label id="u2_6_cq_factoring_pest_2_1-choice_5-label" for="input_u2_6_cq_factoring_pest_2_1_choice_5" class="response-label field-label label-inline" aria-describedby="status_u2_6_cq_factoring_pest_2_1">
<text>The qubits measured at the output are an integer [mathjaxinline]r[/mathjaxinline] such that [mathjaxinline]U^ r = I[/mathjaxinline]</text>
</label>
</div>
<span id="answer_u2_6_cq_factoring_pest_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_u2_6_cq_factoring_pest_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
</p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Factoring using phase estimation" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_u2_6_cq_factoring_pest" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_u2_6_cq_factoring_pest">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_6_cq_factoring_pest-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_6_cq_factoring_pest-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="u2_6_cq_factoring_pest-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3xx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-graded="True" data-init="XBlockToXModuleShim" data-request-token="d53d8b341ed111f095f216ffcd2b1d4d" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3xx" data-runtime-class="LmsRuntime" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
© All Rights Reserved